// Token: 0x060011B4 RID: 4532 RVA: 0x000363A8 File Offset: 0x000345A8 internal static IProvisioningAgent GetClassFactoryInstance(string assemblyName, string classFactoryName, out Exception ex) { string assemblyFile = Path.Combine(CmdletExtensionAgentsGlobalConfig.CmdletExtensionAgentsFolder, assemblyName); IProvisioningAgent provisioningAgent = null; ex = null; try { Assembly assembly = Assembly.LoadFrom(assemblyFile); Type type = assembly.GetType(classFactoryName); if (type == null) { ex = new ArgumentException(Strings.CouldntFindClassFactoryInAssembly(classFactoryName, assembly.FullName)); return(provisioningAgent); } object obj = assembly.CreateInstance(type.FullName); provisioningAgent = (obj as IProvisioningAgent); if (provisioningAgent == null) { ex = new ArgumentException(Strings.ClassFactoryDoesNotImplementIProvisioningAgent(classFactoryName, assembly.FullName)); return(provisioningAgent); } } catch (TargetInvocationException ex2) { ex = ex2.InnerException; } catch (ReflectionTypeLoadException ex3) { ex = ex3; } catch (MissingMethodException ex4) { ex = ex4; } catch (FileNotFoundException ex5) { ex = ex5; } catch (FileLoadException ex6) { ex = ex6; } catch (BadImageFormatException ex7) { ex = ex7; } catch (ArgumentException ex8) { ex = ex8; } return(provisioningAgent); }
// Token: 0x060011B3 RID: 4531 RVA: 0x000360F8 File Offset: 0x000342F8 private void BuildHandlerLookupTable(CmdletExtensionAgent[] enabledAgents, out Exception ex) { ex = null; CmdletExtensionAgent cmdletExtensionAgent = null; try { for (int i = 0; i < enabledAgents.Length; i++) { if (cmdletExtensionAgent != null && cmdletExtensionAgent.Priority == enabledAgents[i].Priority) { throw new ArgumentException(Strings.ClashingPriorities(cmdletExtensionAgent.Priority.ToString(), enabledAgents[i].Name, cmdletExtensionAgent.Name)); } cmdletExtensionAgent = enabledAgents[i]; IProvisioningAgent classFactoryInstance = ProvisioningBroker.GetClassFactoryInstance(enabledAgents[i].Assembly, enabledAgents[i].ClassFactory, out ex); if (ex != null) { break; } this.agentNameLookupTable.Add(classFactoryInstance, enabledAgents[i].Name); IEnumerable <string> supportedCmdlets = classFactoryInstance.GetSupportedCmdlets(); foreach (string key in supportedCmdlets) { List <ProvisioningBroker.ClassFactoryBucket> list; if (!this.lookupTable.TryGetValue(key, out list)) { list = new List <ProvisioningBroker.ClassFactoryBucket>(); this.lookupTable.Add(key, list); } list.Add(new ProvisioningBroker.ClassFactoryBucket(classFactoryInstance, enabledAgents[i].Name, enabledAgents[i].Priority)); } } } catch (ConfigurationErrorsException ex2) { ex = ex2; } catch (ProvisioningException ex3) { ex = ex3; } catch (FileNotFoundException ex4) { ex = ex4; } catch (FileLoadException ex5) { ex = ex5; } catch (BadImageFormatException ex6) { ex = ex6; } catch (SecurityException ex7) { ex = ex7; } catch (UnauthorizedAccessException ex8) { ex = ex8; } catch (ArgumentException ex9) { ex = ex9; } catch (IOException ex10) { ex = ex10; } catch (MissingMethodException ex11) { ex = ex11; } catch (AmbiguousMatchException ex12) { ex = ex12; } catch (ReflectionTypeLoadException ex13) { ex = ex13; } }
// Token: 0x060011B5 RID: 4533 RVA: 0x000364D0 File Offset: 0x000346D0 public ClassFactoryBucket(IProvisioningAgent classFactory, string agentName, byte priority) { this.ClassFactory = classFactory; this.Priority = priority; this.AgentName = agentName; }