• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

C# Design.ConfigurationNode类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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


示例16: LogError

		/// <summary>
		/// Log an error to the <see cref="IErrorLogService"/>.
		/// </summary>
		/// <param name="serviceProvider">
		/// The a mechanism for retrieving a service object; that is, an object that provides custom support to other objects.
		/// </param>
		/// <param name="node">The configuration node associated with the error.</param>
		/// <param name="e">The <see cref="Exception"/> to log.</param>
		public static void LogError(IServiceProvider serviceProvider, ConfigurationNode node, Exception e)
		{
			Exception exception = e;
			while (exception != null)
			{
				LogError(serviceProvider, new ConfigurationError(node, exception.Message));
				exception = exception.InnerException;
			}
		}
开发者ID:ChiangHanLung,项目名称:PIC_VDS,代码行数:17,代码来源:ServiceHelper.cs


示例17: 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="RuleSetNode"/>.</para>
        /// </summary>
        /// <param name="node">
        /// <para>The parent node to add the newly created <see cref="RuleSetNode"/>.</para>
        /// </param>
        protected override void ExecuteCore(ConfigurationNode node)
        {
            base.ExecuteCore(node);

            RuleSetNode ruleNode = ChildNode as RuleSetNode;
            if (ruleNode == null) return;

            ruleNode.AddNode(new SelfNode());
        }
开发者ID:rentianhua,项目名称:AgileMVC,代码行数:15,代码来源:AddRuleSetNodeCommand.cs


示例18: ConfigurationMenuItem

 public ConfigurationMenuItem(ConfigurationNode node, ConfigurationUICommand command)
 {
     Debug.Assert(node != null);
     this.command = command;
     Shortcut = command.Shortcut;
     Text = command.Text;
     this.node = node;
     this.Enabled = (command.GetCommandState(node) == CommandState.Enabled);
 }
开发者ID:bnantz,项目名称:NCS-V2-0,代码行数:9,代码来源:ConfigurationMenuItem.cs


示例19: ExecuteCore

 /// <summary>
 /// Shows an dialog that allows the user to export an cryptographic key.
 /// </summary>
 /// <param name="node">
 /// The <see cref="ConfigurationNode"/> of which an cryptographic key should be exported.
 /// </param>
 protected override void ExecuteCore(ConfigurationNode node)
 {
     ICryptographicKeyConfigurationNode cryptographicNode = node as ICryptographicKeyConfigurationNode;
     if (cryptographicNode != null)
     {
         ExportKeyUI exportKeyDialog = new ExportKeyUI(cryptographicNode.KeySettings.ProtectedKey);
         exportKeyDialog.ShowDialog();
     }
 }
开发者ID:ChiangHanLung,项目名称:PIC_VDS,代码行数:15,代码来源:ExportKeyCommand.cs


示例20: MoveNodeAfterCommand

        /// <summary>
        /// <para>Initialize a new instance of the <see cref="MoveNodeAfterCommand"/> class with an <see cref="IServiceProvider"/>, the node to move, and the sibling node to move it after.</para>
        /// </summary>
        /// <param name="serviceProvider">
        /// <para>The a mechanism for retrieving a service object; that is, an object that provides custom support to other objects.</para>
        /// </param>
        /// <param name="clearErrorLog">
        /// <para>Determines if all the messages in the <see cref="IConfigurationErrorLogService"/> should be cleared when the command has executed.</para>
        /// </param>
        /// <param name="nodeToMove">
        /// <para>The node to move.</para>
        /// </param>
        /// <param name="siblingNode">
        /// <para>The sibling node to move <paramref name="nodeToMove"/> after.</para>
        /// </param>
        public MoveNodeAfterCommand(IServiceProvider serviceProvider, bool clearErrorLog, ConfigurationNode nodeToMove, ConfigurationNode siblingNode)
            : base(serviceProvider, clearErrorLog)
        {
            if (nodeToMove == null) throw new ArgumentNullException("nodeToMove");
            if (siblingNode == null) throw new ArgumentNullException("siblingNode");

            this.nodeToMove = nodeToMove;
            this.siblingNode = siblingNode;
        }
开发者ID:bnantz,项目名称:NCS-V1-1,代码行数:24,代码来源:MoveNodeAfterCommand.cs



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap