Exemple #1
0
 public CmdletExtensionAgentsGlobalConfig(ITopologyConfigurationSession session)
 {
     CmdletExtensionAgent[] array = session.FindCmdletExtensionAgents(false, false);
     this.prioritiesInUse     = new CmdletExtensionAgent[256];
     this.agentIdentities     = new List <string>(array.Length);
     this.configurationIssues = new List <LocalizedString>();
     foreach (CmdletExtensionAgent cmdletExtensionAgent in array)
     {
         if (this.prioritiesInUse[(int)cmdletExtensionAgent.Priority] != null)
         {
             this.configurationIssues.Add(Strings.ClashingPriorities(cmdletExtensionAgent.Priority.ToString(), cmdletExtensionAgent.Name, this.prioritiesInUse[(int)cmdletExtensionAgent.Priority].Name));
         }
         else
         {
             this.prioritiesInUse[(int)cmdletExtensionAgent.Priority] = cmdletExtensionAgent;
         }
         string factoryIdentity = CmdletExtensionAgentsGlobalConfig.GetFactoryIdentity(cmdletExtensionAgent.Assembly, cmdletExtensionAgent.ClassFactory);
         if (this.agentIdentities.Contains(factoryIdentity))
         {
             this.configurationIssues.Add(Strings.ClashingIdentities(cmdletExtensionAgent.Assembly, cmdletExtensionAgent.ClassFactory));
         }
         else
         {
             this.agentIdentities.Add(factoryIdentity);
         }
         if (this.nextAvailablePriority < (int)(cmdletExtensionAgent.Priority + 1))
         {
             this.nextAvailablePriority = (int)(cmdletExtensionAgent.Priority + 1);
         }
     }
 }
Exemple #2
0
 public bool IsFactoryIdentityInUse(string assembly, string classFactory)
 {
     return(this.agentIdentities.Contains(CmdletExtensionAgentsGlobalConfig.GetFactoryIdentity(assembly, classFactory)));
 }