当前位置: 首页>>代码示例>>C#>>正文


C# Design.ConfigurationNode类代码示例

本文整理汇总了C#中Microsoft.Practices.EnterpriseLibrary.Configuration.Design.ConfigurationNode的典型用法代码示例。如果您正苦于以下问题:C# ConfigurationNode类的具体用法?C# ConfigurationNode怎么用?C# ConfigurationNode使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


ConfigurationNode类属于Microsoft.Practices.EnterpriseLibrary.Configuration.Design命名空间,在下文中一共展示了ConfigurationNode类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: CreateCommands

 private void CreateCommands(ConfigurationNode node)
 {
     Type t = node.GetType();
     PropertyInfo[] properties = t.GetProperties(BindingFlags.Public | BindingFlags.Instance);
     CreateCommandsOnNode(node, properties);
     CreateCommandsOnChildNodeProperties(node);
 }
开发者ID:bnantz,项目名称:NCS-V2-0,代码行数:7,代码来源:StorageCreationNodeCommand.cs

示例2: ExecuteCore

        /// <summary>
        /// Closes the application configuration.
        /// </summary>
        /// <param name="node">
        /// The node to execute the command upon.
        /// </param>
        protected override void ExecuteCore(ConfigurationNode node)
        {
            try
            {
                UIService.BeginUpdate();

                if (UIService.IsDirty(node.Hierarchy))
                {
                    DialogResult result = UIService.ShowMessage(Resources.SaveApplicationRequest, Resources.SaveApplicationCaption, MessageBoxButtons.YesNo);
                    if (DialogResult.Yes == result)
                    {
                        if (!TryAndSaveApplication(node))
                        {
                            return;
                        }
                    }
                }
                if (ErrorLogService.ConfigurationErrorCount > 0)
                {
                    UIService.DisplayErrorLog(ErrorLogService);
                    DialogResult result = UIService.ShowMessage(Resources.SaveApplicationErrorRequestMessage, Resources.SaveApplicationCaption, MessageBoxButtons.YesNo);
                    if (result == DialogResult.No) return;
                }
                ConfigurationUIHierarchyService.RemoveHierarchy(node.Hierarchy.Id);
            }
            finally
            {
                UIService.EndUpdate();
            }
        }
开发者ID:bnantz,项目名称:NCS-V2-0,代码行数:36,代码来源:CloseConfigurationApplicationCommand.cs

示例3: CreateCommandsOnChildNodeProperties

 private void CreateCommandsOnChildNodeProperties(ConfigurationNode node)
 {
     foreach (ConfigurationNode childNode in node.Nodes)
     {
         CreateCommands(childNode);
     }
 }
开发者ID:bnantz,项目名称:NCS-V2-0,代码行数:7,代码来源:StorageCreationNodeCommand.cs

示例4: ExecuteCore

        protected override void ExecuteCore(ConfigurationNode node)
        {
            TypeSelectorUI selector = new TypeSelectorUI(
                typeof(RijndaelManaged),
                typeof(SymmetricAlgorithm),
                TypeSelectorIncludeFlags.Default
                );
            DialogResult typeResult = selector.ShowDialog();
            if (typeResult == DialogResult.OK)
            {
                KeySettings keySettings = new KeySettings(new SymmetricAlgorithmKeyCreator(selector.SelectedType.AssemblyQualifiedName));
                KeyManagerEditorUI keyManager = new KeyManagerEditorUI(keySettings);
                DialogResult keyResult = keyManager.ShowDialog();

                if (keyResult == DialogResult.OK)
                {
                    INodeNameCreationService service = GetService(typeof(INodeNameCreationService)) as INodeNameCreationService;
                    Debug.Assert(service != null, "Could not find the INodeNameCreationService");
                    base.ExecuteCore(node);
                    SymmetricAlgorithmProviderNode providerNode = (SymmetricAlgorithmProviderNode)ChildNode;
                    providerNode.AlgorithmType = selector.SelectedType.AssemblyQualifiedName;
                    providerNode.Name = service.GetUniqueDisplayName(providerNode.Parent, selector.SelectedType.Name);
                    providerNode.Key = keyManager.KeySettings;
                }
            }
        }
开发者ID:bnantz,项目名称:NCS-V1-1,代码行数:26,代码来源:AddSymmetricAlgorithmProviderNodeCommand.cs

示例5: ExecuteCore

 /// <summary>
 /// Creates the commands and adds them to the <see cref="IStorageService"/>.
 /// </summary>
 /// <param name="node">The node to execute the command upon.</param>
 protected override void ExecuteCore(ConfigurationNode node)
 {
     // clear out the service first since we are going to refill it
     IStorageService storageService = ServiceHelper.GetCurrentStorageService(ServiceProvider);
     storageService.Clear();
     CreateCommands(node);
 }
开发者ID:bnantz,项目名称:NCS-V2-0,代码行数:11,代码来源:StorageCreationNodeCommand.cs

示例6: ExecuteCore

        /// <summary>
        /// <para>Creates an instance of the child node class and adds it as a child of the parent node. The node will be a <see cref="SymmetricAlgorithmProviderNode"/>.</para>
        /// </summary>
        /// <param name="node">
        /// <para>The parent node to add the newly created <see cref="AddChildNodeCommand.ChildNode"/>.</para>
        /// </param>
        protected override void ExecuteCore(ConfigurationNode node)
        {
            TypeSelectorUI selector = new TypeSelectorUI(
                typeof(RijndaelManaged),
                typeof(SymmetricAlgorithm),
                TypeSelectorIncludes.None
                );

            DialogResult typeResult = selector.ShowDialog();
            if (typeResult == DialogResult.OK)
            {
                Type algorithmType = selector.SelectedType;
                CryptographicKeyWizard keyManager = new CryptographicKeyWizard(new SymmetricAlgorithmKeyCreator(algorithmType));
                DialogResult keyResult = keyManager.ShowDialog();

                if (keyResult == DialogResult.OK)
                {
                    INodeNameCreationService service = ServiceHelper.GetNameCreationService(ServiceProvider);
                    Debug.Assert(service != null, "Could not find the INodeNameCreationService");
                    base.ExecuteCore(node);
                    SymmetricAlgorithmProviderNode providerNode = (SymmetricAlgorithmProviderNode)ChildNode;
                    providerNode.AlgorithmType = selector.SelectedType;
                    providerNode.Name = service.GetUniqueName(selector.SelectedType.Name, providerNode, providerNode.Parent);
                    providerNode.Key = keyManager.KeySettings;
                }
            }
        }
开发者ID:bnantz,项目名称:NCS-V2-0,代码行数:33,代码来源:AddSymmetricAlgorithmProviderNodeCommand.cs

示例7: ExecuteCore

        /// <summary>
        /// 
        /// </summary>
        /// <param name="node"></param>
        protected override void ExecuteCore(ConfigurationNode node)
        {
            base.ExecuteCore(node);

            RuleNode ruleNode = ChildNode as RuleNode;
            if (ruleNode == null) return;
        }
开发者ID:rentianhua,项目名称:AgileMVC,代码行数:11,代码来源:AddRuleNodeCommand.cs

示例8: ExecuteCore

        protected override void ExecuteCore(ConfigurationNode node)
        {
            ConfigurationSectionCollectionNode configurationSectionCollectionNode = node.Hierarchy.FindNodeByType(typeof(ConfigurationSectionCollectionNode)) as ConfigurationSectionCollectionNode;
            if (configurationSectionCollectionNode == null) return;

            IXmlIncludeTypeService service = GetService(typeof(IXmlIncludeTypeService)) as IXmlIncludeTypeService;
            Type[] types = null;
            XmlSerializerTransformerNode transformerNode = null;
            foreach (ConfigurationNode configurationNode in configurationSectionCollectionNode.Nodes)
            {
                transformerNode = node.Hierarchy.FindNodeByType(configurationNode, typeof(XmlSerializerTransformerNode)) as XmlSerializerTransformerNode;
                if (transformerNode == null) continue;
                types = service.GetXmlIncludeTypes(configurationNode.Name);
                if (types == null) continue;
                foreach (Type t in types)
                {
                    INodeCreationService nodeCreationService = (INodeCreationService)GetService(typeof(INodeCreationService));
                    if (!nodeCreationService.DoesNodeTypeMatchDataType(nodeType, t)) continue;
                    if (node.Hierarchy.FindNodeByName(transformerNode, t.Name) == null)
                    {
                        transformerNode.Nodes.Add(new XmlIncludeTypeNode(new XmlIncludeTypeData(t.Name, t.AssemblyQualifiedName)));
                    }
                }
            }
        }
开发者ID:bnantz,项目名称:NCS-V1-1,代码行数:25,代码来源:AddXmlIncludeTypesCommand.cs

示例9: ExecuteCore

 /// <summary>
 /// Executes the moving the node before it's sibling.
 /// </summary>
 /// <param name="node">
 /// The node to execute the command upon.
 /// </param>
 protected override void ExecuteCore(ConfigurationNode node)
 {
     if (node.PreviousSibling != null)
     {
         node.Parent.MoveBefore(node, node.PreviousSibling);
     }
 }
开发者ID:bnantz,项目名称:NCS-V2-0,代码行数:13,代码来源:MoveNodeBeforeCommand.cs

示例10: ExecuteCore

 protected override void ExecuteCore(ConfigurationNode node)
 {
     TypeSelectorUI selector = new TypeSelectorUI(
         typeof(Exception),
         typeof(Exception),
         TypeSelectorIncludeFlags.BaseType |
             TypeSelectorIncludeFlags.AbstractTypes);
     DialogResult result = selector.ShowDialog();
     if (result == DialogResult.OK)
     {
         base.ExecuteCore(node);
         ExceptionTypeNode typeNode = (ExceptionTypeNode) ChildNode;
         typeNode.TypeName = selector.SelectedType.AssemblyQualifiedName;
         typeNode.PostHandlingAction = PostHandlingAction.NotifyRethrow;
         try
         {
             typeNode.Name = selector.SelectedType.Name;
         }
         catch (InvalidOperationException)
         {
             typeNode.Remove();
             UIService.ShowError(SR.DuplicateExceptionTypeErrorMessage(selector.SelectedType.Name));
         }
     }
 }
开发者ID:bnantz,项目名称:NCS-V1-1,代码行数:25,代码来源:AddExceptionTypeNodeCommand.cs

示例11: ExecuteCore

 /// <summary>
 /// Executes the moving the node after it's sibling.
 /// </summary>
 /// <param name="node">
 /// The node to execute the command upon.
 /// </param>
 protected override void ExecuteCore(ConfigurationNode node)
 {
     if (node.NextSibling != null)
     {
         node.Parent.MoveAfter(node, node.NextSibling);
     }
 }
开发者ID:bnantz,项目名称:NCS-V2-0,代码行数:13,代码来源:MoveNodeAfterCommand.cs

示例12: ExecuteCore

        /// <summary>
        /// Adds the <see cref="LoggingSettingsNode"/> and adds the default nodes.
        /// </summary>
        /// <param name="node">The <see cref="LoggingSettingsNode"/> added.</param>
        protected override void ExecuteCore(ConfigurationNode node)
        {
            base.ExecuteCore(node);
            ApplicationBlockSettingsNode blockSettingsNode = ChildNode as ApplicationBlockSettingsNode;
            if (blockSettingsNode == null) return;

            // TODO: Initialize your initial configuration settings for the MyNewApplicationBlock7 Design Time.
        }
开发者ID:rentianhua,项目名称:AgileMVC,代码行数:12,代码来源:AddApplicationBlockSettingsNodeCommand.cs

示例13: ConfigurationNodeChangedEventArgs

 /// <summary>
 /// <para>Initializes a new instance of the <see cref="ConfigurationNodeChangedEventArgs"/> class with an action, the node it was performed upon, and the parent node.</para>
 /// </summary>
 /// <param name="action">
 /// <para>One of the <see cref="ConfigurationNodeChangedAction"/> values.</para>
 /// </param>
 /// <param name="node">
 /// <para>The <see cref="ConfigurationNode"/> that the action occured upon.</para>
 /// </param>
 /// <param name="parent"><para>The parent node of the <paramref name="node"/>.</para></param>
 public ConfigurationNodeChangedEventArgs(ConfigurationNodeChangedAction action,
                                          ConfigurationNode node,
                                          ConfigurationNode parent)
 {
     this.action = action;
     this.node = node;
     this.parent = parent;
 }
开发者ID:bnantz,项目名称:NCS-V1-1,代码行数:18,代码来源:ConfigurationNodeChangedEventArgs.cs

示例14: ExecuteCore

 /// <summary>
 /// Saves the application configuration.
 /// </summary>
 /// <param name="node">
 /// The node to execute the command upon.
 /// </param>
 protected override void ExecuteCore(ConfigurationNode node)
 {            
     if (!DoValidationCommand())
     {
         return;
     }
     DoApplicationSave();
 }
开发者ID:ChiangHanLung,项目名称:PIC_VDS,代码行数:14,代码来源:SaveConfigurationApplicationNodeCommand.cs

示例15: ExecuteCore

		/// <summary>
		/// After the <see cref="SecuritySettingsNode"/> is added, adds the default nodes.
		/// </summary>
		/// <param name="node">The <see cref="SecuritySettingsNode"/>.S</param>
        protected override void ExecuteCore(ConfigurationNode node)
        {
            base.ExecuteCore(node);
            SecuritySettingsNode securitySettingsNode = (SecuritySettingsNode)ChildNode;

            securitySettingsNode.AddNode(new AuthorizationProviderCollectionNode());
            securitySettingsNode.AddNode(new SecurityCacheProviderCollectionNode());
        }
开发者ID:ChiangHanLung,项目名称:PIC_VDS,代码行数:12,代码来源:AddSecuritySettingsNodeCommand.cs


注:本文中的Microsoft.Practices.EnterpriseLibrary.Configuration.Design.ConfigurationNode类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。