Beispiel #1
0
        private CmdletTaskFactory()
        {
            foreach (object obj in Enum.GetValues(typeof(TaskModuleKey)))
            {
                TaskModuleKey key = (TaskModuleKey)obj;
                TaskModuleFactory.DisableModule(key);
            }
            TaskModuleFactory.EnableModule(TaskModuleKey.RunspaceServerSettingsInit);
            TaskModuleFactory.EnableModule(TaskModuleKey.RunspaceServerSettingsFinalize);
            string configStringValue = AppConfigLoader.GetConfigStringValue("PSDirectInvokeEnabledModules", string.Empty);

            string[] array = configStringValue.Split(new char[]
            {
                ','
            }, StringSplitOptions.RemoveEmptyEntries);
            foreach (string value in array)
            {
                TaskModuleKey key2;
                if (Enum.TryParse <TaskModuleKey>(value, true, out key2))
                {
                    TaskModuleFactory.EnableModule(key2);
                }
            }
        }
 protected void UnregisterModule(TaskModuleKey key)
 {
     this.taskModules[(int)key] = null;
 }
 public static void EnableModule(TaskModuleKey key)
 {
     TaskModuleFactory.disabledTaskModules[(int)key] = false;
 }
 protected void RegisterModule(TaskModuleKey key, Type module)
 {
     this.taskModules[(int)key] = module;
 }
 public static void DisableModule(TaskModuleKey key)
 {
     TaskModuleFactory.disabledTaskModules[(int)key] = true;
 }