If I have:
void MyMethod(Object obj) { ... }
How can I cast obj to what its actual type is?
obj
Implement an interface to call your function in your method interface IMyInterface { void MyinterfaceMethod(); } IMyInterface MyObj = obj as IMyInterface; if ( MyObj != null) { MyMethod(IMyInterface MyObj ); }