当前位置: 首页>>代码示例>>C#>>正文


C# Commands.CommandEntrySet类代码示例

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


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

示例1: MDSubMenuItem

		public MDSubMenuItem (CommandManager manager, CommandEntrySet ces)
		{
			this.ces = ces;

			this.Submenu = new MDMenu (manager, ces);
			this.Title = this.Submenu.Title;
		}
开发者ID:Kalnor,项目名称:monodevelop,代码行数:7,代码来源:MDSubMenuItem.cs

示例2: Add

		public static void Add (this DockItemToolbar toolbar, CommandEntrySet entrySet, Gtk.Widget commandTarget)
		{
			CommandDockBar dockBar = new CommandDockBar (toolbar, commandTarget);
			foreach (CommandEntry entry in entrySet) {
				dockBar.Add (entry);
			}
		}
开发者ID:transformersprimeabcxyz,项目名称:monodevelop-1,代码行数:7,代码来源:DockItemToolbarLoader.cs

示例3: MenuButtonEntry

		public MenuButtonEntry (Gtk.Entry entry, Gtk.Button button)
		{
			if (entry == null) entry = new Gtk.Entry ();
			if (button == null) button = new Gtk.Button (new Gtk.Arrow (Gtk.ArrowType.Right, Gtk.ShadowType.Out));
			
			this.entry = entry;
			this.button = button;
			
			manager = new CommandManager ();
			manager.RegisterGlobalHandler (this);
			
			if (entry.Parent == null)
				PackStart (entry, true, true, 0);
			if (button.Parent == null)
				PackStart (button, false, false, 2);
			
			ActionCommand cmd = new ActionCommand ("InsertOption", "InsertOption", null);
			cmd.CommandArray = true;
			manager.RegisterCommand (cmd);
			entrySet = new CommandEntrySet ();
			entrySet.AddItem ("InsertOption");
			
			button.Clicked += ShowQuickInsertMenu;
			button.StateChanged += ButtonStateChanged;
		}
开发者ID:FreeBSD-DotNet,项目名称:monodevelop,代码行数:25,代码来源:MenuButtonEntry.cs

示例4: MDSubMenuItem

		public MDSubMenuItem (CommandManager manager, CommandEntrySet ces, CommandSource commandSource = CommandSource.MainMenu, object initialCommandTarget = null)
		{
			this.ces = ces;

			this.Submenu = new MDMenu (manager, ces, commandSource, initialCommandTarget);
			this.Title = this.Submenu.Title;
		}
开发者ID:brantwedel,项目名称:monodevelop,代码行数:7,代码来源:MDSubMenuItem.cs

示例5: OnPanelClick

		protected override void OnPanelClick (Gdk.EventButton e, Placement placement)
		{
			if (e.TriggersContextMenu ()) {
				CommandEntrySet opset = new CommandEntrySet ();
				opset.AddItem (CommandSystemCommands.ToolbarList);
				Gtk.Menu menu = manager.CreateMenu (opset);
				menu.Popup (null, null, null, 0, e.Time);
			}
			base.OnPanelClick (e, placement);
		}
开发者ID:pabloescribanoloza,项目名称:monodevelop,代码行数:10,代码来源:CommandFrame.cs

示例6: MDMenu

		public MDMenu (CommandManager manager, CommandEntrySet ces, CommandSource commandSource, object initialCommandTarget)
		{
			this.WeakDelegate = this;

			AutoEnablesItems = false;

			Title = (ces.Name ?? "").Replace ("_", "");

			foreach (CommandEntry ce in ces) {
				if (ce.CommandId == Command.Separator) {
					AddItem (NSMenuItem.SeparatorItem);
					if (!string.IsNullOrEmpty (ce.OverrideLabel))
						AddItem (new MDMenuHeaderItem (ce.OverrideLabel));
					continue;
				}

				if (string.Equals (ce.CommandId as string, servicesID, StringComparison.Ordinal)) {
					AddItem (new MDServicesMenuItem ());
					continue;
				}

				var subset = ce as CommandEntrySet;
				if (subset != null) {
					AddItem (new MDSubMenuItem (manager, subset, commandSource, initialCommandTarget));
					continue;
				}

				var lce = ce as LinkCommandEntry;
				if (lce != null) {
					AddItem (new MDLinkMenuItem (lce));
					continue;
				}

				Command cmd = manager.GetCommand (ce.CommandId);
				if (cmd == null) {
					LoggingService.LogError ("MacMenu: '{0}' maps to null command", ce.CommandId);
					continue;
				}

				if (cmd is CustomCommand) {
					LoggingService.LogWarning ("MacMenu: '{0}' is unsupported custom-rendered command' '", ce.CommandId);
					continue;
				}

				var acmd = cmd as ActionCommand;
				if (acmd == null) {
					LoggingService.LogWarning ("MacMenu: '{0}' has unknown command type '{1}'", cmd.GetType (), ce.CommandId);
					continue;
				}

				AddItem (new MDMenuItem (manager, ce, acmd, commandSource, initialCommandTarget));
			}
		}
开发者ID:FreeBSD-DotNet,项目名称:monodevelop,代码行数:53,代码来源:MDMenu.cs

示例7: MyPostProcessor

		CommandEntrySet MyPostProcessor(CommandEntrySet input)
		{
			var toRemove = new List<CommandEntry> ();
			foreach(CommandEntry ce in input)
			{
				var theSet = ce as CommandEntrySet;
				if (theSet != null)
					MyPostProcessor (theSet);

				var id = ce.CommandId as string;
				if (isBlackListed (id))
					toRemove.Add (ce);
			}
//			foreach (var r in toRemove)
//				input.Remove (r);

			return input;
		}
开发者ID:0xb1dd1e,项目名称:MonoDevelop.UnityMode,代码行数:18,代码来源:StartupHandler.cs

示例8: CreateInstance

		public override object CreateInstance ()
		{
			if (label == null) label = Id;

			label = StringParserService.Parse (label);
			if (icon != null) icon = CommandCodon.GetStockId (Addin, icon);
			CommandEntrySet cset = new CommandEntrySet (label, icon);
			cset.CommandId = Id;
			cset.AutoHide = autohide;
			foreach (InstanceExtensionNode e in ChildNodes) {
				CommandEntry ce = e.CreateInstance () as CommandEntry;
				if (ce != null)
					cset.Add (ce);
				else
					throw new InvalidOperationException ("Invalid ItemSet child: " + e);
			}
			return cset;
		}
开发者ID:FreeBSD-DotNet,项目名称:monodevelop,代码行数:18,代码来源:ItemSetCodon.cs

示例9: Run

		protected override void Run ()
		{
			var doc = MonoDevelop.Ide.IdeApp.Workbench.ActiveDocument;
			var view = doc.GetContent<MonoDevelop.SourceEditor.SourceEditorView> ();
			if (view == null) {
				LoggingService.LogWarning ("ShowFixesHandler could not find a SourceEditorView");
				return;
			}
			var widget = view.TextEditor;
			var pt = view.DocumentToScreenLocation (doc.Editor.Caret.Location);
			
			var ces = new CommandEntrySet ();
			ces.AddItem (AnalysisCommands.FixOperations);
			var menu = MonoDevelop.Ide.IdeApp.CommandService.CreateMenu (ces);
			
			menu.Popup (null, null, delegate (Menu mn, out int x, out int y, out bool push_in) {
				x = pt.X;
				y = pt.Y;
				push_in = true;
				//if the menu would be off the bottom of the screen, "drop" it upwards
				if (y + mn.Requisition.Height > widget.Screen.Height)
					y -= mn.Requisition.Height + (int)widget.LineHeight;
			}, 0, Global.CurrentEventTime);
		}
开发者ID:yayanyang,项目名称:monodevelop,代码行数:24,代码来源:AnalysisCommands.cs

示例10: CreateToolbar

		/// <summary>
		/// Creates a toolbar.
		/// </summary>
		/// <returns>
		/// The toolbar.
		/// </returns>
		/// <param name='id'>
		/// Identifier of the toolbar
		/// </param>
		/// <param name='entrySet'>
		/// Entry with the command definitions
		/// </param>
		/// <param name='initialTarget'>
		/// Initial command route target. The command handler will start looking for command handlers in this object.
		/// </param>
		public Gtk.Toolbar CreateToolbar (string id, CommandEntrySet entrySet, object initialTarget)
		{
			CommandToolbar toolbar = new CommandToolbar (this, id, entrySet.Name);
			toolbar.InitialCommandTarget = initialTarget;
			
			foreach (CommandEntry entry in entrySet) {
				Gtk.ToolItem ti = entry.CreateToolItem (this);
				CustomItem ci = ti.Child as CustomItem;
				if (ci != null)
					ci.SetToolbarStyle (toolbar);
				toolbar.Add (ti);
			}
			ToolbarTracker tt = new ToolbarTracker ();
			tt.Track (toolbar);
			return toolbar;
		}
开发者ID:aBothe,项目名称:monodevelop,代码行数:31,代码来源:CommandManager.cs

示例11: ShowContextMenu

		/// <summary>
		/// Shows a context menu.
		/// </summary>
		/// <param name='parent'>
		/// Widget for which the context menu is being shown
		/// </param>
		/// <param name='evt'>
		/// Current event
		/// </param>
		/// <param name='entrySet'>
		/// Entry with the command definitions
		/// </param>
		/// <param name='initialCommandTarget'>
		/// Initial command route target. The command handler will start looking for command handlers in this object.
		/// </param>
		public bool ShowContextMenu (Gtk.Widget parent, Gdk.EventButton evt, CommandEntrySet entrySet,
			object initialCommandTarget = null)
		{
			if (Platform.IsMac) {
				parent.GrabFocus ();
				int x, y;
				if (evt != null) {
					x = (int)evt.X;
					y = (int)evt.Y;
				} else {
					Gdk.Display.Default.GetPointer (out x, out y);
				}
				return DesktopService.ShowContextMenu (this, parent, x, y, entrySet, initialCommandTarget);
			} else {
				var menu = CreateMenu (entrySet);
				if (menu != null)
					ShowContextMenu (parent, evt, menu, initialCommandTarget);

				return true;
			}
		}
开发者ID:aBothe,项目名称:monodevelop,代码行数:36,代码来源:CommandManager.cs

示例12: CreateMenu

		/// <summary>
		/// Creates a menu.
		/// </summary>
		/// <returns>
		/// The menu.
		/// </returns>
		/// <param name='entrySet'>
		/// Entry with the command definitions
		/// </param>
		public Gtk.Menu CreateMenu (CommandEntrySet entrySet)
		{
			return CreateMenu (entrySet, new CommandMenu (this));
		}
开发者ID:aBothe,项目名称:monodevelop,代码行数:13,代码来源:CommandManager.cs

示例13: CreateMenuBar

		/// <summary>
		/// Creates a menu bar.
		/// </summary>
		/// <returns>
		/// The menu bar.
		/// </returns>
		/// <param name='name'>
		/// Unused
		/// </param>
		/// <param name='entrySet'>
		/// Entry set with the definition of the commands to be included in the menu bar
		/// </param>
		public Gtk.MenuBar CreateMenuBar (string name, CommandEntrySet entrySet)
		{
			Gtk.MenuBar topMenu = new CommandMenuBar (this);
			foreach (CommandEntry entry in entrySet) {
				Gtk.MenuItem mi = entry.CreateMenuItem (this);
				CustomItem ci = mi.Child as CustomItem;
				if (ci != null)
					ci.SetMenuStyle (topMenu);
				topMenu.Append (mi);
			}
			return topMenu;
		}
开发者ID:aBothe,项目名称:monodevelop,代码行数:24,代码来源:CommandManager.cs

示例14: ShowContextMenu

		public void ShowContextMenu (CommandEntrySet entrySet, object initialTarget)
		{
			CommandMenu menu = (CommandMenu) CreateMenu (entrySet);
			ShowContextMenu (menu, initialTarget);
		}
开发者ID:Tak,项目名称:monodevelop-novell,代码行数:5,代码来源:CommandManager.cs

示例15: Initialize

		public void Initialize (IPadWindow window)
		{
			// Toolbar and menu definitions
			
			ActionCommand gotoCmd = new ActionCommand (LocalCommands.GoToFile, GettextCatalog.GetString ("Go to File"));
			ActionCommand propertiesCmd = new ActionCommand (LocalCommands.Properties, GettextCatalog.GetString ("Properties"), Gtk.Stock.Properties);
			
			menuSet = new CommandEntrySet ();
			menuSet.Add (gotoCmd);
			menuSet.AddSeparator ();
			menuSet.AddItem (DebugCommands.EnableDisableBreakpoint);
			menuSet.AddItem (DebugCommands.ClearAllBreakpoints);
			menuSet.AddItem (DebugCommands.DisableAllBreakpoints);
			menuSet.AddItem (EditCommands.DeleteKey);
			menuSet.AddSeparator ();
			menuSet.Add (propertiesCmd);
			
			CommandEntrySet toolbarSet = new CommandEntrySet ();
			toolbarSet.AddItem (DebugCommands.EnableDisableBreakpoint);
			toolbarSet.AddItem (DebugCommands.ClearAllBreakpoints);
			toolbarSet.AddItem (DebugCommands.DisableAllBreakpoints);
			toolbarSet.AddItem (EditCommands.Delete);
			toolbarSet.AddSeparator ();
			toolbarSet.Add (propertiesCmd);
			
			// The breakpoint list
			
			store = new TreeStore (typeof(string), typeof (bool), typeof(string), typeof(object), typeof(string), typeof(string), typeof(string), typeof(string));

			tree = new PadTreeView ();
			tree.Model = store;
			tree.RulesHint = true;
			tree.HeadersVisible = true;
			tree.DoPopupMenu = ShowPopup;
			tree.KeyPressEvent += OnKeyPressEvent;
			
			treeState = new TreeViewState (tree, (int) Columns.Breakpoint);
							
			TreeViewColumn col = new TreeViewColumn ();
			CellRenderer crp = new CellRendererIcon ();
			col.PackStart (crp, false);
			col.AddAttribute (crp, "stock_id", (int) Columns.Icon);
			tree.AppendColumn (col);
			
			Gtk.CellRendererToggle toggleRender = new Gtk.CellRendererToggle ();
			toggleRender.Toggled += new ToggledHandler (ItemToggled);
			col = new TreeViewColumn ();
			col.PackStart (toggleRender, false);
			col.AddAttribute (toggleRender, "active", (int) Columns.Selected);
			tree.AppendColumn (col);
			
			TreeViewColumn FrameCol = new TreeViewColumn ();
			CellRenderer crt = tree.TextRenderer;
			FrameCol.Title = GettextCatalog.GetString ("Name");
			FrameCol.PackStart (crt, true);
			FrameCol.AddAttribute (crt, "text", (int) Columns.FileName);
			FrameCol.Resizable = true;
			FrameCol.Alignment = 0.0f;
			tree.AppendColumn (FrameCol);

			col = tree.AppendColumn (GettextCatalog.GetString ("Condition"), crt, "text", (int) Columns.Condition);
			col.Resizable = true;
			
			col = tree.AppendColumn (GettextCatalog.GetString ("Trace Expression"), crt, "text", (int) Columns.TraceExp);
			col.Resizable = true;
			
			col = tree.AppendColumn (GettextCatalog.GetString ("Hit Count"), crt, "text", (int) Columns.HitCount);
			col.Resizable = true;
			
			col = tree.AppendColumn (GettextCatalog.GetString ("Last Trace"), crt, "text", (int) Columns.LastTrace);
			col.Resizable = true;
			
			sw = new Gtk.ScrolledWindow ();
			sw.ShadowType = ShadowType.None;
			sw.Add (tree);
			
			control = sw;
			
			control.ShowAll ();
			
			bps = DebuggingService.Breakpoints;
			
			UpdateDisplay ();

			breakpointUpdatedHandler = DispatchService.GuiDispatch<EventHandler<BreakpointEventArgs>> (OnBreakpointUpdated);
			breakpointRemovedHandler = DispatchService.GuiDispatch<EventHandler<BreakpointEventArgs>> (OnBreakpointRemoved);
			breakpointAddedHandler = DispatchService.GuiDispatch<EventHandler<BreakpointEventArgs>> (OnBreakpointAdded);
			breakpointChangedHandler = DispatchService.GuiDispatch<EventHandler> (OnBreakpointChanged);
			
			DebuggingService.Breakpoints.BreakpointAdded += breakpointAddedHandler;
			DebuggingService.Breakpoints.BreakpointRemoved += breakpointRemovedHandler;
			DebuggingService.Breakpoints.Changed += breakpointChangedHandler;
			DebuggingService.Breakpoints.BreakpointUpdated += breakpointUpdatedHandler;
			
			DebuggingService.PausedEvent += OnDebuggerStatusCheck;
			DebuggingService.ResumedEvent += OnDebuggerStatusCheck;
			DebuggingService.StoppedEvent += OnDebuggerStatusCheck;
			
			tree.RowActivated += OnRowActivated;
			
//.........这里部分代码省略.........
开发者ID:IBBoard,项目名称:monodevelop,代码行数:101,代码来源:BreakpointPad.cs


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