I have a hash table that can contain any number of objects. All these objects implement some similar methods / properties and some of them.
For example, all objects in a hash table may have a PrintText method that takes a single parameter of a type string. All objects, however, are created from different classes.
Is it possible for me to pull a specific object from a hash table by its key, without knowing its type before execution, and get access to all my methods and properties (and not just general ones)?
I would usually do something like
MyClass TheObject = MyHashTable [Key];
But a pullable object can be obtained from any class, so I cannot do this in this case.
source share