private void CreateConfigurationSourceElement(ConfigurationSourceSectionNode node, ConfigurationSourceElement configurationSourceElement)
		{
			ConfigurationNode sourceNode = NodeCreationService.CreateNodeByDataType(configurationSourceElement.GetType(), new object[] { configurationSourceElement });
			if (null == sourceNode)
			{
				LogNodeMapError(node, configurationSourceElement.GetType());
				return;
			}
			if (configurationSourceSection.SelectedSource == configurationSourceElement.Name) defaultNode = (ConfigurationSourceElementNode)sourceNode;
			node.AddNode(sourceNode);
		}
Пример #2
0
        public ConfigurationSourceSection Build()
        {
            ConfigurationSourceSection section = new ConfigurationSourceSection();

            section.SelectedSource = configurationSourceSectionNode.SelectedSource.Name;
            for (int index = 0; index < configurationSourceSectionNode.Nodes.Count; ++index)
            {
                ConfigurationSourceElementNode sourceNode = (ConfigurationSourceElementNode)configurationSourceSectionNode.Nodes[index];
                section.Sources.Add(sourceNode.ConfigurationSourceElement);
            }
            return(section);
        }
Пример #3
0
        private void CreateConfigurationSourceElement(ConfigurationSourceSectionNode node, ConfigurationSourceElement configurationSourceElement)
        {
            ConfigurationNode sourceNode = NodeCreationService.CreateNodeByDataType(configurationSourceElement.GetType(), new object[] { configurationSourceElement });

            if (null == sourceNode)
            {
                LogNodeMapError(node, configurationSourceElement.GetType());
                return;
            }
            if (configurationSourceSection.SelectedSource == configurationSourceElement.Name)
            {
                defaultNode = (ConfigurationSourceElementNode)sourceNode;
            }
            node.AddNode(sourceNode);
        }
Пример #4
0
        public ConfigurationSourceSection Build()
        {
            ConfigurationSourceSection section = new ConfigurationSourceSection();

            if (!configurationSourceSectionNode.RequirePermission)              // don't set if false
            {
                section.SectionInformation.RequirePermission = configurationSourceSectionNode.RequirePermission;
            }
            section.SelectedSource = configurationSourceSectionNode.SelectedSource.Name;
            for (int index = 0; index < configurationSourceSectionNode.Nodes.Count; ++index)
            {
                ConfigurationSourceElementNode sourceNode = (ConfigurationSourceElementNode)configurationSourceSectionNode.Nodes[index];
                section.Sources.Add(sourceNode.ConfigurationSourceElement);
            }
            return(section);
        }
		private void OnElementNodeRemoved(object sender, ConfigurationNodeChangedEventArgs args)
		{
			configurationSourceElementNode = null;
		}
Пример #6
0
 private void OnElementNodeRemoved(object sender, ConfigurationNodeChangedEventArgs args)
 {
     configurationSourceElementNode = null;
 }