Here is an example of what I am looking to do.
public class A
{
public virtual void DoSomething(string a)
{
// perform something
}
}
public
There is a way. It requires some code though. You create a master class fex. 'MachineParams'. Then create subclasses like 'MachineParamsGeneral', 'MachineParamsDetail'.
Your function can now be like:
public override void Setup(MachineParams p)
{
// since you know what subclass this is inside, you can simple cast
MachineParamsGeneral g = (MachineParamsGeneral)p;
float paramExample = p.paramExample;
}
You need to consider if this solution is "handy" enough for your scale.
A second solution:
public override void Setup(params object[] p ..)
{
// you need to know the arrangement of values inside the object array
float x = (float)p[0]; // not strictly speaking type-safe
}