public static BuildInfoPublisherBase 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(BuildInfoPublisherBase) && typeof(BuildInfoPublisherBase).IsAssignableFrom(PotentialConfigType)) { Handler = Activator.CreateInstance(PotentialConfigType) as BuildInfoPublisherBase; break; } } } if (Handler == null) { throw new AutomationException("Attempt to use BuildInfoPublisherBase.Get() and it doesn't appear that there are any modules that implement this class."); } } return(Handler); }
public static BuildInfoPublisherBase 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(BuildInfoPublisherBase) && typeof(BuildInfoPublisherBase).IsAssignableFrom(PotentialConfigType)) { Handler = Activator.CreateInstance(PotentialConfigType) as BuildInfoPublisherBase; break; } } } if (Handler == null) { throw new AutomationException("Attempt to use BuildInfoPublisherBase.Get() and it doesn't appear that there are any modules that implement this class."); } } return Handler; }