Hi David,

you could use

foreach( Assembly a in AppDomain.CurrentDomain.GetAssemblies())
foreach( Type t in a.GetTypes())
{
  if ( t.GetInterface( typeof(IYourInterface).Name) != null)
  {
    IYourInterface obj =
(IYourInterface)AppDomain.CurrentDomain.CreateInstanceAndUnwrap(
a.FullName, t.Name);
    ... use obj
  }
}

but I do not understand the why the interface should return the name
of the class,
you already know the name of the class via its type...

HTH
// Ryan

===================================
This list is hosted by DevelopMentorĀ®  http://www.develop.com

View archives and manage your subscription(s) at http://discuss.develop.com

Reply via email to