I have a structure with a bunch of properties. All properties have a corresponding method called someMethod(). I am trying to call the method for each property that is in the struct. I need to be able to do this without anything except the struct. Is this even possible?
public class someStruct()
{
public int prop1{get, set}
public int prop2{get, set}
public int prop3{get, set}
}
This obviously isn't my code, but gets the point across. Assume each prop has an add(). I could normally do:
someStruct example = new someStruct();
example.prop1.add();
example.prop2.add();
example.prop3.add();
But I need to have a method where I can pass in example and it will call add() for each property. End goal is to have a method called callAdds:
callAdds(example);