C
Chris Blanco
I am building a Dynamic assembly loader which will scan and monitor a
directory, when a new assembly gets placed in that directory it will examine
the directory to see if there is a class that is derived from a certain base
class, if so it will create a n instance of that class and add it to a
command map. The problem I am having is determining if the System.Type that
is currently being examined is of a certain base type. The problem is that
the types are NEVER equal, even when they are the same types. Here is a
clip of what I am trying to do:
<code>
public void AddAllFromType(Type t)
{
object instance=null;
//check to see if type is command
if(t.BaseType != typeof(DynamicLoader.Command) )
{
//we aren't the right type so we don't care.
return;
}
...
</code>
The if statement above is ALWAYS true even if t.Basetype evaluates to
"DynamicLoader.Command"
Please Help!!!!
Chris Blanco
NEC AMERICA
Software Engineer
directory, when a new assembly gets placed in that directory it will examine
the directory to see if there is a class that is derived from a certain base
class, if so it will create a n instance of that class and add it to a
command map. The problem I am having is determining if the System.Type that
is currently being examined is of a certain base type. The problem is that
the types are NEVER equal, even when they are the same types. Here is a
clip of what I am trying to do:
<code>
public void AddAllFromType(Type t)
{
object instance=null;
//check to see if type is command
if(t.BaseType != typeof(DynamicLoader.Command) )
{
//we aren't the right type so we don't care.
return;
}
...
</code>
The if statement above is ALWAYS true even if t.Basetype evaluates to
"DynamicLoader.Command"
Please Help!!!!
Chris Blanco
NEC AMERICA
Software Engineer