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

C# Design.DesignerVerb类代码示例

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

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



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

示例1: AddLocalVerb

		/// The IMenuCommandService deals with two kinds of verbs: 1) local verbs specific
		/// to each designer (i.e. Add/Remove Tab on a TabControl) which are added
		/// and removed on-demand, each time a designer is right-clicked, 2) the rarer
		/// global verbs, which once added are available to all designers,
		/// until removed. This method (not a standard part of IMenuCommandService) is used
		/// to add a local verb. If the verb is already in our global list, we don't add it 
		/// again. It is called through IMenuCommandService.ShowContextMenu().
		public void AddLocalVerb(DesignerVerb verb)
		{
			if ((globalVerbs == null) || (!globalVerbs.Contains(verb)))
			{
				if (cm == null)
				{
					cm = new ContextMenu();
					verbsFromMenuItems = new Hashtable();
					menuItemsFromVerbs = new Hashtable();
				}

				// Verbs and MenuItems are dually mapped to each other, so that we can
				// check for association given either half of the pair. All of our MenuItems
				// use the same event handler, but we can check the event sender to see
				// what verb to invoke. MenuItems like to only be assigned to one Menu in their
				// lifetime, so we have to create a single ContextMenu and use that thereafter.
				// If we were to instead create a ContextMenu every time we need to show one,
				// the MenuItems' click events might not work properly.
				//
				MenuItem menuItem = new MenuItem(verb.Text);
				menuItem.Click += new EventHandler(menuItem_Click);
				verbsFromMenuItems.Add(menuItem, verb);
				menuItemsFromVerbs.Add(verb, menuItem);
				cm.MenuItems.Add(menuItem);
			}
		}
开发者ID:lisiynos,项目名称:pascalabcnet,代码行数:33,代码来源:SampleMenuCommandService.cs


示例2: GetVerbs

        protected override DesignerVerb[] GetVerbs()
        {
            DesignerVerb[] baseVerbs = base.GetVerbs();
            int verbsCount = baseVerbs.Length + 1;
            if (IsBackstageSet) verbsCount = 1;

            bool includeClearSubItems = false;
            MetroAppButton appButton = this.Component as MetroAppButton;
            if (appButton != null && appButton.BackstageTab != null && appButton.SubItems.Count > 0)
            {
                includeClearSubItems = true;
                verbsCount++;
            }

            int verbsOffset = 1;
            DesignerVerb[] verbs = new DesignerVerb[verbsCount];
            verbs[0] = new DesignerVerb((IsBackstageSet ? "Remove Backstage" : "Set Backstage"), new EventHandler(CreateBackstageTab));

            if (includeClearSubItems)
            {
                verbs[1] = new DesignerVerb("Clear Sub-items", new EventHandler(ClearSubItems));
                verbsOffset++;
            }

            if (!IsBackstageSet)
            {
                for (int i = 0; i < baseVerbs.Length; i++)
                {
                    verbs[i + verbsOffset] = baseVerbs[i];
                }
            }

            return verbs;
        }
开发者ID:huamanhtuyen,项目名称:VNACCS,代码行数:34,代码来源:MetroApplicationButtonDesigner.cs


示例3: VerticalTabControlDesigner

		/// <summary>
		/// The default constructor.
		/// </summary>
		public VerticalTabControlDesigner()
			: base()
		{
			DesignerVerb dvbAddPage = new DesignerVerb("Add Tab Page", new EventHandler(AddTabPage));
			DesignerVerb dvbRemovePage = new DesignerVerb("Remove Tab Page", new EventHandler(RemoveTabPage));
			m_dvcVerbs.AddRange(new DesignerVerb[] { dvbAddPage, dvbRemovePage });
		}
开发者ID:etinquis,项目名称:nexusmodmanager,代码行数:10,代码来源:VerticalTabControlDesigner.cs


示例4: GetComponentDesignerActions

 protected override void GetComponentDesignerActions(IComponent component, DesignerActionListCollection actionLists)
 {
     if (component == null)
     {
         throw new ArgumentNullException("component");
     }
     if (actionLists == null)
     {
         throw new ArgumentNullException("actionLists");
     }
     IServiceContainer site = component.Site as IServiceContainer;
     if (site != null)
     {
         DesignerCommandSet service = (DesignerCommandSet) site.GetService(typeof(DesignerCommandSet));
         if (service != null)
         {
             DesignerActionListCollection lists = service.ActionLists;
             if (lists != null)
             {
                 actionLists.AddRange(lists);
             }
         }
         if ((actionLists.Count == 0) || ((actionLists.Count == 1) && (actionLists[0] is ControlDesigner.ControlDesignerActionList)))
         {
             DesignerVerbCollection verbs = service.Verbs;
             if ((verbs != null) && (verbs.Count != 0))
             {
                 DesignerVerb[] array = new DesignerVerb[verbs.Count];
                 verbs.CopyTo(array, 0);
                 actionLists.Add(new DesignerActionVerbList(array));
             }
         }
     }
 }
开发者ID:Reegenerator,项目名称:Sample-CustomizeDatasetCS,代码行数:34,代码来源:WebFormsDesignerActionService.cs


示例5: DesignerToolStripMenuItem

 public DesignerToolStripMenuItem(string text, DesignerVerb verb)
     : base(text)
 {
     if (verb == null)
         throw new ArgumentNullException("verb");
     Verb = verb;
 }
开发者ID:die-Deutsche-Orthopaedie,项目名称:LiteDevelop,代码行数:7,代码来源:MenuService.cs


示例6: InitControl

 protected void InitControl()
 {
     base.RenderMode = ToolStripRenderMode.ManagerRenderMode;
     base.Renderer = myRenderer;
     myRenderer.RenderMode = this.RenderStyle;
     insPage = new DesignerVerb("Insert tab page", new EventHandler(OnInsertPageClicked));
 }
开发者ID:Nullstr1ng,项目名称:MultiRDPClient.NET,代码行数:7,代码来源:TabStrip.cs


示例7: InfoDataSetEditor

 public InfoDataSetEditor()
     : base()
 {
     DesignerVerb createVerb = new DesignerVerb("Save To Report", new EventHandler(OnCreate));
     this.Verbs.Add(createVerb);
     DesignerVerb createXSDVerb = new DesignerVerb("Create XSD File", new EventHandler(OnCreateXSD));
     this.Verbs.Add(createXSDVerb);
 }
开发者ID:san90279,项目名称:UK_OAS,代码行数:8,代码来源:InfoDataSetEditor.cs


示例8: ContextMenuCommand

 public ContextMenuCommand(DesignerVerb verb)
     : base(verb.Text)
 {
     this.Enabled = verb.Enabled;
     //				this.Checked = verb.Checked;
         this.verb = verb;
         Click += InvokeCommand;
 }
开发者ID:2594636985,项目名称:SharpDevelop,代码行数:8,代码来源:DesignerVerbSubmenuBuilder.cs


示例9: ManagedPanelDesigner

        public ManagedPanelDesigner()
            : base()
        {

            DesignerVerb verb1 = new DesignerVerb("Select PanelManager", OnSelectManager);
            m_verbs.Add(verb1);

        }
开发者ID:devfinity-fx,项目名称:cpms_z,代码行数:8,代码来源:ManagedPanelDesigner.cs


示例10: FAMonthViewDesigner

        public FAMonthViewDesigner()
        {
            showTodayButton = new DesignerVerb("Show/Hide Today Button", (sender, e) => ShowTodayButton()) { Checked = false };
            showEmptyButton = new DesignerVerb("Show/Hide Empty Button", (sender, e) => ShowEmptyButton()) { Checked = false };

            designerVerbs.Add(showTodayButton);
            designerVerbs.Add(showEmptyButton);
        }
开发者ID:HEskandari,项目名称:FarsiLibrary,代码行数:8,代码来源:FAMonthViewDesigner.cs


示例11: DesignerActionVerbItem

 public DesignerActionVerbItem(DesignerVerb verb)
 {
     if (verb == null)
     {
         throw new ArgumentNullException();
     }
     this._targetVerb = verb;
 }
开发者ID:pritesh-mandowara-sp,项目名称:DecompliedDotNetLibraries,代码行数:8,代码来源:DesignerActionVerbItem.cs


示例12: AddRange

 /// <devdoc>
 ///    <para>[To be supplied.]</para>
 /// </devdoc>
 public void AddRange(DesignerVerb[] value) {
     if (value == null) {
         throw new ArgumentNullException("value");
     }
     for (int i = 0; ((i) < (value.Length)); i = ((i) + (1))) {
         this.Add(value[i]);
     }
 }
开发者ID:gbarnett,项目名称:shared-source-cli-2.0,代码行数:11,代码来源:designerverbcollection.cs


示例13: EasilyReportDesigner

        //public EasilyReportDesigner()
        //{
        //    designerHost = null;
        //}
        public EasilyReportDesigner()
            : base()
        {
            DesignerVerb createVerb = new DesignerVerb("Open Design Form", new EventHandler(OnOpen));
            this.Verbs.Add(createVerb);

            //createVerb = new DesignerVerb("Import Table", new EventHandler(OnImport));
            //this.Verbs.Add(createVerb);
        }
开发者ID:san90279,项目名称:UK_OAS,代码行数:13,代码来源:EasilyReportDesigner.cs


示例14: CreateStandardVerb

        private DesignerVerb CreateStandardVerb(string text, CommandID command, EventHandler eventHandler)
        {
            var verb = new DesignerVerb(text, (o, e) => this.GlobalInvoke(command));
            if (eventHandler != null)
            {
                AddCommand(new MenuCommand(eventHandler, command));
            }

            return verb;
        }
开发者ID:die-Deutsche-Orthopaedie,项目名称:LiteDevelop,代码行数:10,代码来源:MenuCommandService.cs


示例15: AddRange

	// Add a range of values to this collection.
	public void AddRange(DesignerVerb[] value)
			{
				if(value == null)
				{
					throw new ArgumentNullException("value");
				}
				foreach(DesignerVerb verb in value)
				{
					Add(verb);
				}
			}
开发者ID:jjenki11,项目名称:blaze-chem-rendering,代码行数:12,代码来源:DesignerVerbCollection.cs


示例16: AddRange

 public void AddRange(DesignerVerb[] value)
 {
     if (value == null)
     {
         throw new ArgumentNullException("value");
     }
     for (int i = 0; i < value.Length; i++)
     {
         this.Add(value[i]);
     }
 }
开发者ID:pritesh-mandowara-sp,项目名称:DecompliedDotNetLibraries,代码行数:11,代码来源:DesignerVerbCollection.cs


示例17: FABaseDesigner

        public FABaseDesigner()
        {
            changeService = null;
            designerVerbs = new DesignerVerbCollection();

            ShowAbout = new DesignerVerb("About Farsi Libraries", OnShowAbout);
            ShowAbout.Checked = false;
            designerVerbs.Add(ShowAbout);

            Designers.Add(this);
        }
开发者ID:HEskandari,项目名称:FarsiLibrary,代码行数:11,代码来源:FABaseDesigner.cs


示例18: AddVerb

		public virtual void AddVerb (DesignerVerb verb)
		{
			if (verb == null)
				throw new ArgumentNullException ("verb");
			this.EnsureVerbs ();
			if (!_verbs.Contains (verb)) {
				if (_globalVerbs == null)
					_globalVerbs = new DesignerVerbCollection ();
				_globalVerbs.Add (verb);
			}
			this.OnCommandsChanged (new MenuCommandsChangedEventArgs (MenuCommandsChangedType.CommandAdded, verb));
		}
开发者ID:Profit0004,项目名称:mono,代码行数:12,代码来源:MenuCommandService.cs


示例19: FAMultiViewDesigner

        public FAMultiViewDesigner()
        {
            toDayView = new DesignerVerb("To DayView", (sender, e) => ShowDayView()) { Checked = false };
            toMonthView = new DesignerVerb("To MonthView", (sender, e) => ShowMonthView()) { Checked = false };
            showTodayButton = new DesignerVerb("Show/Hide Today Button", (sender, e) => ShowTodayButton()) { Checked = false };
            showEmptyButton = new DesignerVerb("Show/Hide Empty Button", (sender, e) => ShowEmptyButton()) { Checked = false };

            designerVerbs.Add(toDayView);
            designerVerbs.Add(toMonthView);
            designerVerbs.Add(showTodayButton);
            designerVerbs.Add(showEmptyButton);
        }
开发者ID:HEskandari,项目名称:FarsiLibrary,代码行数:12,代码来源:FAMultiViewDesigner.cs


示例20: PanelManagerDesigner

        public PanelManagerDesigner()
            : base()
        {

            DesignerVerb verb1 = new DesignerVerb("Add MangedPanel", OnAddPanel);
            DesignerVerb verb2 = new DesignerVerb("Remove ManagedPanel", OnRemovePanel);
            m_verbs.AddRange(new DesignerVerb[] {
    				verb1,
    				verb2
    			});

        }
开发者ID:devfinity-fx,项目名称:cpms_z,代码行数:12,代码来源:PanelManagerDesigner.cs



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

专题导读
上一篇:
C# Design.MenuCommand类代码示例发布时间:2022-05-26
下一篇:
C# Design.DesignerActionItemCollection类代码示例发布时间:2022-05-26
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

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

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

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