Thursday, 19 September 2013

Find and return a class based on a string

Find and return a class based on a string

I have multiple classes of the parent class "command_functions"
example
class Empty_Command : command_functions
each of the command classes override a value
public override string command_display_name { get { return "Empty"; } }
is there anyway to search types of command_functions looking for where
command_display_name is set to a matching string and return that.
so I could use it like so
command_functions find = FindCommand("Empty");
if(find != null)
{
new find();
}

No comments:

Post a Comment