private void CreateLogFilterNode(LogFilterData logFilterData)
 {
     LogFilterNode logFilterNode = NodeCreationService.CreateNodeByDataType(logFilterData.GetType(), new object[] { logFilterData }) as LogFilterNode;
     if (null == logFilterNode)
     {
         LogNodeMapError(node, logFilterData.GetType());
         return;
     }
     node.AddNode(logFilterNode);
 }
 public void Setup()
 {
     filterData = new LogEnabledFilterData("filter", true);
 }
        public void LogFilterWithDisabledPolicyIsNotRemovedIfGroupPoliciesAreDisabled()
        {
            MockConfigurationElementManageabilityProvider registeredProvider
                = new MockConfigurationElementManageabilityProvider();
            Dictionary<Type, ConfigurationElementManageabilityProvider> subProviders
                = new Dictionary<Type, ConfigurationElementManageabilityProvider>();
            subProviders.Add(typeof(LogFilterData), registeredProvider);
            provider = new LoggingSettingsManageabilityProvider(subProviders);

            LogFilterData logFilter1Data = new LogFilterData("logFilter1", typeof(Object));
            section.LogFilters.Add(logFilter1Data);
            LogFilterData logFilter2Data = new LogFilterData("logFilter2", typeof(Object));
            section.LogFilters.Add(logFilter2Data);

            MockRegistryKey machineLogFiltersKey = new MockRegistryKey(false);
            machineKey.AddSubKey(LoggingSettingsManageabilityProvider.LogFiltersKeyName, machineLogFiltersKey);
            MockRegistryKey machineLogFilter2Key = new MockRegistryKey(false);
            machineLogFiltersKey.AddSubKey("logFilter2", machineLogFilter2Key);
            machineLogFilter2Key.AddBooleanValue(AdmContentBuilder.AvailableValueName, false);

            provider.OverrideWithGroupPolicies(section, false, machineKey, userKey);

            Assert.AreEqual(2, section.LogFilters.Count);
            Assert.IsNotNull(section.LogFilters.Get("logFilter1"));
            Assert.IsNotNull(section.LogFilters.Get("logFilter2"));

            Assert.IsTrue(MockRegistryKey.CheckAllClosed(machineLogFiltersKey, machineLogFilter2Key));
        }
예제 #4
0
 protected LogFilterSetting(LogFilterData sourceElement, string name)
     : base(sourceElement, name)
 {
 }