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);
		}
Exemplo n.º 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);
        }
Exemplo n.º 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);
        }
Exemplo n.º 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;
		}
Exemplo n.º 6
0
 private void OnElementNodeRemoved(object sender, ConfigurationNodeChangedEventArgs args)
 {
     configurationSourceElementNode = null;
 }