當前位置: 首頁>>代碼示例>>C#>>正文


C# Design.DesignerVerb類代碼示例

本文整理匯總了C#中System.ComponentModel.Design.DesignerVerb的典型用法代碼示例。如果您正苦於以下問題:C# DesignerVerb類的具體用法?C# DesignerVerb怎麽用?C# DesignerVerb使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


DesignerVerb類屬於System.ComponentModel.Design命名空間,在下文中一共展示了DesignerVerb類的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的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


注:本文中的System.ComponentModel.Design.DesignerVerb類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。