public VsCommand(IUICommandDescriptor commandDescriptor) { _commandDescriptor = commandDescriptor; CanonicalName = "openwrap." + commandDescriptor.Noun.ToLowerInvariant() + "." + commandDescriptor.Verb.ToLowerInvariant(); _description = commandDescriptor.Description; _text = commandDescriptor.Label; }
Guid GetGroupId(IUICommandDescriptor commandDescriptor) { if (commandDescriptor.Context == UICommandContext.Global) return new Guid(VsConstants.COMMANDS_GROUP_GLOBAL); if (commandDescriptor.Context == UICommandContext.Solution) return new Guid(VsConstants.COMMANDS_GROUP_SOLUTION); if (commandDescriptor.Context == UICommandContext.OpenWrapProject || commandDescriptor.Context == UICommandContext.StandardProject) return new Guid(VsConstants.COMMANDS_GROUP_PROJECT); return Guid.Empty; }
public bool TryAdd(IUICommandDescriptor command) { var vsCommand = new VsCommand(command).Register(); if (vsCommand == null) return false; this[vsCommand.CommandGroupGuid, vsCommand.CommandId] = vsCommand; if (command.Context == UICommandContext.Global) { vsCommand.RegisterUI(ToolsMenu); } return true; }
Guid GetGroupId(IUICommandDescriptor commandDescriptor) { if (commandDescriptor.Context == UICommandContext.Global) { return(new Guid(VsConstants.COMMANDS_GROUP_GLOBAL)); } if (commandDescriptor.Context == UICommandContext.Solution) { return(new Guid(VsConstants.COMMANDS_GROUP_SOLUTION)); } if (commandDescriptor.Context == UICommandContext.OpenWrapProject || commandDescriptor.Context == UICommandContext.StandardProject) { return(new Guid(VsConstants.COMMANDS_GROUP_PROJECT)); } return(Guid.Empty); }
public bool TryAdd(IUICommandDescriptor command) { var vsCommand = new VsCommand(command).Register(); if (vsCommand == null) { return(false); } this[vsCommand.CommandGroupGuid, vsCommand.CommandId] = vsCommand; if (command.Context == UICommandContext.Global) { vsCommand.RegisterUI(ToolsMenu); } return(true); }