コード例 #1
0
 /// <summary>
 /// <para>Adds a a <see cref="ValidateNodeCommand"/> and <see cref="RemoveNodeCommand"/> if the parent node is not readonly.</para>
 /// </summary>
 protected override void OnAddMenuItems()
 {
     if (!Parent.GetType().Equals(typeof(ReadOnlyConfigurationSectionNode)))
     {
         AddMenuItem(ConfigurationMenuItem.CreateRemoveNodeCommand(Site, this));
     }
     AddMenuItem(ConfigurationMenuItem.CreateValidateNodeCommand(Site, this));
 }
コード例 #2
0
        /// <summary>
        /// <para>Adds a <see cref="ValidateNodeCommand"/>, a command for creating <see cref="XmlIncludeTypeNode"/> objects and if the parent node is not readonly, a <see cref="RemoveNodeCommand"/> to the menus for the user interface.</para>
        /// </summary>
        protected override void OnAddMenuItems()
        {
            if (!Parent.GetType().Equals(typeof(ReadOnlyConfigurationSectionNode)))
            {
                AddMenuItem(ConfigurationMenuItem.CreateRemoveNodeCommand(Site, this));
            }
            AddMenuItem(ConfigurationMenuItem.CreateValidateNodeCommand(Site, this));
            ConfigurationMenuItem item = new ConfigurationMenuItem(SR.XmlIncludeTypeMenuItem,
                                                                   new AddChildNodeCommand(Site, typeof(XmlIncludeTypeNode)),
                                                                   this,
                                                                   Shortcut.None,
                                                                   SR.GenericCreateStatusText(SR.XmlIncludeTypeMenuItem),
                                                                   InsertionPoint.New);

            AddMenuItem(item);
        }
コード例 #3
0
 /// <summary>
 /// <para>Allows nodes that override to add menu items for the user interface.</para>
 /// </summary>
 /// <remarks>
 /// <para>Call <seealso cref="AddMenuItem"/> for every menu item that needs to be added to the user interface.</para>
 /// <para>By default, the base class adds the <see cref="ValidateNodeCommand"/> and <see cref="RemoveNodeCommand"/></para>
 /// </remarks>
 protected virtual void OnAddMenuItems()
 {
     currentContainerService.MenuItems.Add(ConfigurationMenuItem.CreateValidateNodeCommand(Site, this));
     currentContainerService.MenuItems.Add(ConfigurationMenuItem.CreateRemoveNodeCommand(Site, this));
 }