本文整理汇总了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);
}
}
示例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;
}
示例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 });
}
示例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));
}
}
}
}
示例5: DesignerToolStripMenuItem
public DesignerToolStripMenuItem(string text, DesignerVerb verb)
: base(text)
{
if (verb == null)
throw new ArgumentNullException("verb");
Verb = verb;
}
示例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));
}
示例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);
}
示例8: ContextMenuCommand
public ContextMenuCommand(DesignerVerb verb)
: base(verb.Text)
{
this.Enabled = verb.Enabled;
// this.Checked = verb.Checked;
this.verb = verb;
Click += InvokeCommand;
}
示例9: ManagedPanelDesigner
public ManagedPanelDesigner()
: base()
{
DesignerVerb verb1 = new DesignerVerb("Select PanelManager", OnSelectManager);
m_verbs.Add(verb1);
}
示例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);
}
示例11: DesignerActionVerbItem
public DesignerActionVerbItem(DesignerVerb verb)
{
if (verb == null)
{
throw new ArgumentNullException();
}
this._targetVerb = verb;
}
示例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]);
}
}
示例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);
}
示例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;
}
示例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);
}
}