public void BuildContextTest()
 {
     HierarchyService.SelectedHierarchy.Open();
     ExceptionHandlingConfigurationDesignManager b = new ExceptionHandlingConfigurationDesignManager();
     ConfigurationDictionary dictionary = new ConfigurationDictionary();
     b.BuildContext(Host, dictionary);
     Assert.AreEqual(1, dictionary.Count);
     Assert.IsTrue(dictionary.Contains("exceptionHandlingConfiguration"));
 }
 public void BuildContextTest()
 {
     ClientLoggingConfigurationDesignManager b = new ClientLoggingConfigurationDesignManager();
     GeneratedHierarchy.Open();
     ConfigurationDictionary dictionary = new ConfigurationDictionary();
     b.BuildContext(Host, dictionary);
     Assert.AreEqual(1, dictionary.Count);
     Assert.IsTrue(dictionary.Contains(LoggingSettings.SectionName));
 }
 public void BuildContextTest()
 {
     CachingConfigurationDesignManager b = new CachingConfigurationDesignManager();
     b.Register(Host);
     b.Open(Host);
     ConfigurationDictionary dictionary = new ConfigurationDictionary();
     b.BuildContext(Host, dictionary);
     Assert.AreEqual(1, dictionary.Count);
     Assert.IsTrue(dictionary.Contains("cachingConfiguration"));
 }
 public void BuildContextTest()
 {
     SecuritySettingsNode node = new SecuritySettingsNode(new SecuritySettings());
     GeneratedApplicationNode.Nodes.Add(node);
     SecurityConfigurationDesignManager b = new SecurityConfigurationDesignManager();
     ConfigurationDictionary dictionary = new ConfigurationDictionary();
     b.BuildContext(Host, dictionary);
     Assert.AreEqual(1, dictionary.Count);
     Assert.IsTrue(dictionary.Contains(SecuritySettings.SectionName));
 }
 public void BuildContextTest()
 {
     ApplicationData data = ApplicationData.FromCurrentAppDomain();
     ApplicationConfigurationNode applicationNode = new ApplicationConfigurationNode(data);
     CreateHierarchyAndAddToHierarchyService(applicationNode, CreateDefaultConfiguration());
     DataConfigurationDesignManager b = new DataConfigurationDesignManager();
     b.Register(Host);
     b.Open(Host);
     ConfigurationDictionary dictionary = new ConfigurationDictionary();
     b.BuildContext(Host, dictionary);
     Assert.AreEqual(1, dictionary.Count);
     Assert.IsTrue(dictionary.Contains("dataConfiguration"));
 }
        public void BuildContext()
        {
            ApplicationData data = ApplicationData.FromCurrentAppDomain();
            ApplicationConfigurationNode applicationNode = new ApplicationConfigurationNode(data.Name, data);
            ConfigurationDesignManager manager = new ConfigurationDesignManager();
            manager.Register(applicationNode, null);
            foreach (ConfigurationNodeCommand command in applicationNode.NewCommand.SubCommands)
            {
                command.Execute();
            }

            ConfigurationDictionary dictionary = new ConfigurationDictionary();
            manager.BuildContext(applicationNode, dictionary);
            Assert.AreEqual(1, dictionary.Count);
            Assert.IsTrue(dictionary.Contains(CryptographySettings.SectionName));
        }
Ejemplo n.º 7
0
 private void CloneConfigurationSettingsFromContextDictionary(ConfigurationDictionary dictionary)
 {
     // we need to make sure to check if the meta config is in the dictionary and clone it
     // so we get our own copy of the data
     if (dictionary.Contains(ConfigurationSettings.SectionName))
     {
         ConfigurationSettings settings = dictionary[ConfigurationSettings.SectionName] as ConfigurationSettings;
         configurationSettings.KeyAlgorithmPairStorageProviderData = (KeyAlgorithmPairStorageProviderData)((null != settings.KeyAlgorithmPairStorageProviderData) ? settings.KeyAlgorithmPairStorageProviderData.Clone() : null);
         foreach (ConfigurationSectionData data in settings.ConfigurationSections)
         {
             ConfigurationSectionData cloneData = new ConfigurationSectionData(data.Name, data.Encrypt,
                                                                               (null != data.StorageProvider) ? (StorageProviderData)data.StorageProvider.Clone() : null,
                                                                               (null != data.Transformer) ? (TransformerData)data.Transformer.Clone() : null);
             configurationSettings.ConfigurationSections.Add(cloneData);
         }
         sections.Remove(ConfigurationSettings.SectionName);
     }
 }
Ejemplo n.º 8
0
 private void CloneConfigurationSettingsFromContextDictionary(ConfigurationDictionary dictionary)
 {
     // we need to make sure to check if the meta config is in the dictionary and clone it
     // so we get our own copy of the data
     if (dictionary.Contains(ConfigurationSettings.SectionName))
     {
         ConfigurationSettings settings = dictionary[ConfigurationSettings.SectionName] as ConfigurationSettings;
         configurationSettings.KeyAlgorithmPairStorageProviderData = (KeyAlgorithmPairStorageProviderData)((null != settings.KeyAlgorithmPairStorageProviderData) ? settings.KeyAlgorithmPairStorageProviderData.Clone() : null);
         foreach (ConfigurationSectionData data in settings.ConfigurationSections)
         {
             ConfigurationSectionData cloneData = new ConfigurationSectionData(data.Name, data.Encrypt,
                 (null != data.StorageProvider) ? (StorageProviderData)data.StorageProvider.Clone() : null,
                 (null != data.Transformer) ? (TransformerData)data.Transformer.Clone() : null);
             configurationSettings.ConfigurationSections.Add(cloneData);
         }
         sections.Remove(ConfigurationSettings.SectionName);
     }
 }