當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。