Example #1
0
 public static McpAccountServiceBase Get()
 {
     if (Handler == null)
     {
         Assembly[] LoadedAssemblies = AppDomain.CurrentDomain.GetAssemblies();
         foreach (var Dll in LoadedAssemblies)
         {
             Type[] AllTypes = Dll.GetTypes();
             foreach (var PotentialConfigType in AllTypes)
             {
                 if (PotentialConfigType != typeof(McpAccountServiceBase) && typeof(McpAccountServiceBase).IsAssignableFrom(PotentialConfigType))
                 {
                     Handler = Activator.CreateInstance(PotentialConfigType) as McpAccountServiceBase;
                     break;
                 }
             }
         }
         if (Handler == null)
         {
             throw new AutomationException("Attempt to use McpAccountServiceBase.Get() and it doesn't appear that there are any modules that implement this class.");
         }
     }
     return(Handler);
 }
Example #2
0
 public static McpAccountServiceBase Get()
 {
     if (Handler == null)
     {
         Assembly[] LoadedAssemblies = AppDomain.CurrentDomain.GetAssemblies();
         foreach (var Dll in LoadedAssemblies)
         {
             Type[] AllTypes = Dll.GetTypes();
             foreach (var PotentialConfigType in AllTypes)
             {
                 if (PotentialConfigType != typeof(McpAccountServiceBase) && typeof(McpAccountServiceBase).IsAssignableFrom(PotentialConfigType))
                 {
                     Handler = Activator.CreateInstance(PotentialConfigType) as McpAccountServiceBase;
                     break;
                 }
             }
         }
         if (Handler == null)
         {
             throw new AutomationException("Attempt to use McpAccountServiceBase.Get() and it doesn't appear that there are any modules that implement this class.");
         }
     }
     return Handler;
 }