本文整理汇总了C#中MonoDevelop.Components.Commands.Command类的典型用法代码示例。如果您正苦于以下问题:C# Command类的具体用法?C# Command怎么用?C# Command使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
Command类属于MonoDevelop.Components.Commands命名空间,在下文中一共展示了Command类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: CommandInfo
internal CommandInfo (Command cmd)
{
text = cmd.Text;
icon = cmd.Icon;
accelKey = cmd.AccelKey;
description = cmd.Description;
}
示例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;
}
示例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);
}
示例4: KeyBindingChangedEventArgs
public KeyBindingChangedEventArgs (Command command, KeyBinding oldKeyBinding)
{
OldKeyBinding = oldKeyBinding;
Command = command;
}
示例5: KeyBindingChangedEventArgs
public KeyBindingChangedEventArgs (Command command, string oldBinding)
{
this.command = command;
this.binding = oldBinding;
}
示例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} );
}
示例7: GetCommandKey
internal static string GetCommandKey (Command cmd)
{
if (cmd.Id is Enum)
return cmd.Id.GetType () + "." + cmd.Id;
else
return cmd.Id.ToString ();
}
示例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);
}
示例9: Add
public void Add (Command cmd)
{
cmds.Add (new CommandEntry (cmd));
}
示例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");
}
示例11: Run
protected virtual void Run (object target, Command cmd)
{
next.Run (target, cmd);
}
示例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;
}
示例13:
void ICommandTargetHandler.Run (object target, Command cmd)
{
Run (target, cmd);
}
示例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 ();
}
}
示例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;
}