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

C# Commands.Command类代码示例

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

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



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

示例1: CommandInfo

		internal CommandInfo (Command cmd)
		{
			text = cmd.Text;
			icon = cmd.Icon;
			accelKey = cmd.AccelKey;
			description = cmd.Description;
		}
开发者ID:transformersprimeabcxyz,项目名称:monodevelop-1,代码行数:7,代码来源:CommandInfo.cs


示例2: CommandResult

 public CommandResult(Command cmd, CommandInfo ci, CommandTargetRoute route, string match, string matchedString, int rank)
     : base(match, matchedString, rank)
 {
     this.ci = ci;
     command = cmd;
     this.route = route;
 }
开发者ID:Kalnor,项目名称:monodevelop,代码行数:7,代码来源:SearchResult.cs


示例3: GetCommand

		public virtual Command GetCommand (CommandManager manager)
		{
			if (localCmd != null) {
				if (manager.GetCommand (localCmd.Id) == null)
					manager.RegisterCommand (localCmd);
				localCmd = null;
			}
				
			return manager.GetCommand (cmdId);
		}
开发者ID:Kalnor,项目名称:monodevelop,代码行数:10,代码来源:CommandEntry.cs


示例4: KeyBindingChangedEventArgs

		public KeyBindingChangedEventArgs (Command command, KeyBinding oldKeyBinding)
		{
			OldKeyBinding = oldKeyBinding;
			Command = command;
		}
开发者ID:Kalnor,项目名称:monodevelop,代码行数:5,代码来源:Command.cs


示例5: KeyBindingChangedEventArgs

		public KeyBindingChangedEventArgs (Command command, string oldBinding)
		{
			this.command = command;
			this.binding = oldBinding;
		}
开发者ID:transformersprimeabcxyz,项目名称:monodevelop-1,代码行数:5,代码来源:Command.cs


示例6: Run

		public void Run (object target, Command cmd, object data)
		{
			MethodInfo mi = (MethodInfo) cmd.HandlerData;
			if (mi != null)
				mi.Invoke (target, new object[] {data} );
		}
开发者ID:aBothe,项目名称:monodevelop,代码行数:6,代码来源:CommandManager.cs


示例7: GetCommandKey

		internal static string GetCommandKey (Command cmd)
		{
			if (cmd.Id is Enum)
				return cmd.Id.GetType () + "." + cmd.Id;
			else
				return cmd.Id.ToString ();
		}
开发者ID:hduregger,项目名称:monodevelop,代码行数:7,代码来源:KeyBindingService.cs


示例8: CreateMenuItem

		static Gtk.MenuItem CreateMenuItem (CommandManager manager, Command cmd, object cmdId, bool isArrayMaster, string overrideLabel, bool disabledVisible)
		{
			cmdId = CommandManager.ToCommandId (cmdId);
			if (cmdId == CommandManager.ToCommandId (Command.Separator))
				return new Gtk.SeparatorMenuItem ();
			
			if (cmd == null)
				cmd = manager.GetCommand (cmdId);

			if (cmd == null) {
				MonoDevelop.Core.LoggingService.LogWarning ("Unknown command '{0}'", cmdId);
				return new Gtk.MenuItem ("<Unknown Command>");
			}
			
			if (cmd is CustomCommand) {
				Gtk.Widget child = (Gtk.Widget) Activator.CreateInstance (((CustomCommand)cmd).WidgetType);
				CustomMenuItem ti = new CustomMenuItem ();
				ti.Child = child;
				return ti;
			}
			
			ActionCommand acmd = cmd as ActionCommand;
			if (acmd.ActionType == ActionType.Normal || (isArrayMaster && acmd.CommandArray))
				return new CommandMenuItem (cmdId, manager, overrideLabel, disabledVisible);
			else
				return new CommandCheckMenuItem (cmdId, manager, overrideLabel, disabledVisible);
		}	
开发者ID:zenek-y,项目名称:monodevelop,代码行数:27,代码来源:CommandEntry.cs


示例9: Add

		public void Add (Command cmd)
		{
			cmds.Add (new CommandEntry (cmd));
		}
开发者ID:transformersprimeabcxyz,项目名称:monodevelop-1,代码行数:4,代码来源:CommandEntrySet.cs


示例10: GetSelectedCommandIter

		bool GetSelectedCommandIter (out TreeIter iter, out Command cmd)
		{
			TreeSelection sel = keyTreeView.Selection;
			if (!sel.GetSelected (out iter)) {
				cmd = null;
				return false;
			}
			
			cmd = (Command)filterModel.GetValue (iter, commandCol);
			if (cmd == null)
				return false;
			
			if (keyStore.GetIterFirst (out iter) && FindIterForCommand (cmd, iter, out iter))
				return true;
			
			throw new Exception ("Did not find command in underlying model");
		}
开发者ID:zenek-y,项目名称:monodevelop,代码行数:17,代码来源:KeyBindingsPanel.cs


示例11: Run

		protected virtual void Run (object target, Command cmd)
		{
			next.Run (target, cmd);
		}
开发者ID:transformersprimeabcxyz,项目名称:monodevelop-1,代码行数:4,代码来源:CustomCommandTargetAttribute.cs


示例12: CheckCommand

            internal SearchResult CheckCommand(Command c, CommandTargetRoute route)
            {
                ActionCommand cmd = c as ActionCommand;
                if (cmd == null || cmd.CommandArray)
                    return null;

                int rank;
                string matchString = cmd.Text.Replace ("_", "");
                if (MatchName (matchString, out rank)) {
                    try {
                        var ci = IdeApp.CommandService.GetCommandInfo (cmd.Id, route);
                        if (ci.Enabled && ci.Visible)
                            return new CommandResult (cmd, ci, route, pattern, matchString, rank);
                    } catch (Exception 	ex) {
                        LoggingService.LogError ("Failure while checking command: " + cmd.Id, ex);
                    }
                }
                return null;
            }
开发者ID:Kalnor,项目名称:monodevelop,代码行数:19,代码来源:CommandSearchCategory.cs


示例13:

		void ICommandTargetHandler.Run (object target, Command cmd)
		{
			Run (target, cmd);
		}
开发者ID:transformersprimeabcxyz,项目名称:monodevelop-1,代码行数:4,代码来源:CustomCommandTargetAttribute.cs


示例14: Run

			protected override void Run (object target, Command cmd)
			{
				NodeCommandHandler nch = (NodeCommandHandler) target;
				if (nch.tree == null) {
					base.Run (target, cmd);
					return;
				}
				try {
					nch.tree.LockUpdates ();
					base.Run (target, cmd);
				} finally {
					nch.tree.UnlockUpdates ();
				}
			}
开发者ID:nieve,项目名称:monodevelop,代码行数:14,代码来源:NodeCommandHandler.cs


示例15: KeyBindingSelectedEventArgs

			public KeyBindingSelectedEventArgs (IEnumerable<string> keys, int selectedKey, Command command, TreeIter iter)
			{
				if (command == null)
					throw new ArgumentNullException (nameof (command));
				AllKeys = new List<string> (keys);
				if (selectedKey < 0 || ((selectedKey != 0 && AllKeys.Count != 0) && selectedKey >= AllKeys.Count))
					throw new ArgumentOutOfRangeException (nameof (selectedKey));
				SelectedKey =  selectedKey;
				Command = command;
				Iter = iter;
			}
开发者ID:kdubau,项目名称:monodevelop,代码行数:11,代码来源:KeyBindingsPanel.cs


示例16: HitTest

			KeyBindingHitTestResult HitTest (double mouseX, double mouseY)
			{
				KeyBindingHitTestResult result = new KeyBindingHitTestResult ();
				TreeIter iter;
				TreePath path;
				int cellx, celly, mx, my;
				mx = (int)mouseX;
				my = (int)mouseY;

				if (!GetCellPosition (mx, my, out cellx, out celly, out iter, out path))
					return result;

				Text = keyBindingsTree.Model.GetValue (iter, bindingCol) as string ?? string.Empty;
				Command = keyBindingsTree.Model.GetValue (iter, commandCol) as Command;

				var filter = keyBindingsTree.Model as TreeModelFilter;
				if (filter != null)
					iter = filter.ConvertIterToChildIter (iter);

				result.Command = Command;
				result.AllKeys = Text.Split (new char [] { ' ' }, StringSplitOptions.RemoveEmptyEntries).ToList ();
				result.Iter = iter;

				using (var layout = new Pango.Layout (keyBindingsTree.PangoContext)) {

					// GetCellArea reports the outer cell bounds, therefore we need to add 2px
					var xpad = (int)Xpad + 2;
					var cellBounds = keyBindingsTree.GetCellArea (path, keyBindingsPanel.bindingTVCol);
					keyBindingsTree.ConvertBinWindowToWidgetCoords (cellBounds.X, cellBounds.Y, out cellBounds.X, out cellBounds.Y);
					int i = 0;
					foreach (var key in result.AllKeys) {
						layout.SetText (KeyBindingManager.BindingToDisplayLabel (key, false));
						layout.FontDescription = KeySymbolFont;
						int w, h;
						layout.GetPixelSize (out w, out h);

						int buttonWidth = w + (2 * KeyHPadding);
						int buttonHeight = h + (2 * KeyVPadding);
						var ypad = 2 + ((cellBounds.Height / 2) - (buttonHeight / 2));

						if (cellx > xpad && cellx <= xpad + buttonWidth &&
						    celly > ypad && celly <= ypad + buttonHeight) {
							keyBindingsPanel.bindingTVCol.CellGetPosition (this, out cellx, out w);
							cellBounds.X += cellx;

							result.SelectedKey = i;
							result.ButtonBounds = new Gdk.Rectangle (cellBounds.X + xpad, cellBounds.Y + ypad, buttonWidth, buttonHeight);
							result.ButtonBounds.Inflate (0, 2);
							return result;
						}

						xpad += buttonWidth + Spacing;
						i++;
					}
				}
				return result;
			}
开发者ID:kdubau,项目名称:monodevelop,代码行数:57,代码来源:KeyBindingsPanel.cs


示例17: SelectCommand

		void SelectCommand (Command cmd)
		{
			//item may not be visible if the list is filtered
			searchEntry.Entry.Text = "";
			
			TreeIter iter;
			if (!keyStore.GetIterFirst (out iter))
				return;
			do {
				TreeIter citer;
				keyStore.IterChildren (out citer, iter);
				do {
					Command command = (Command) keyStore.GetValue (citer, commandCol);
					if (command == cmd) {
						TreePath path = keyStore.GetPath (citer);
						keyTreeView.ExpandToPath (path);
						keyTreeView.Selection.SelectPath (path);
						keyTreeView.ScrollToCell (path, keyTreeView.Columns[0], true, 0.5f, 0f);
						return;
					}
				} while (keyStore.IterNext (ref citer));
			} while (keyStore.IterNext (ref iter));
		}
开发者ID:zenek-y,项目名称:monodevelop,代码行数:23,代码来源:KeyBindingsPanel.cs


示例18: CheckCommand

			internal SearchResult CheckCommand (Command c)
			{
				ActionCommand cmd = c as ActionCommand;
				if (cmd == null || cmd.CommandArray)
					return null;

				int rank;
				string matchString = cmd.Text.Replace ("_", "");
				if (MatchName (matchString, out rank)) {
					var ci = IdeApp.CommandService.GetCommandInfo (cmd.Id);
					if (ci.Enabled && ci.Visible)
						return new CommandResult (cmd, pattern, matchString, rank);
				}
				return null;
			}
开发者ID:RainsSoft,项目名称:playscript-monodevelop,代码行数:15,代码来源:CommandSearchCategory.cs


示例19: CommandEntry

		public CommandEntry (Command localCmd) : this (localCmd.Id, null, true)
		{
			this.localCmd = localCmd;
		}
开发者ID:zenek-y,项目名称:monodevelop,代码行数:4,代码来源:CommandEntry.cs


示例20: UnregisterCommand

		/// <summary>
		/// Unregisters a command.
		/// </summary>
		/// <param name='cmd'>
		/// The command.
		/// </param>
		public void UnregisterCommand (Command cmd)
		{
			bindings.UnregisterCommand (cmd);
			cmds.Remove (cmd.Id);
		}
开发者ID:aBothe,项目名称:monodevelop,代码行数:11,代码来源:CommandManager.cs



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

专题导读
上一篇:
C# Commands.CommandArrayInfo类代码示例发布时间:2022-05-26
下一篇:
C# Commands.ActionCommand类代码示例发布时间: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