Exemplo n.º 1
0
 public VsCommand(IUICommandDescriptor commandDescriptor)
 {
     _commandDescriptor = commandDescriptor;
     CanonicalName      = "openwrap." + commandDescriptor.Noun.ToLowerInvariant() + "." + commandDescriptor.Verb.ToLowerInvariant();
     _description       = commandDescriptor.Description;
     _text = commandDescriptor.Label;
 }
Exemplo n.º 2
0
 public VsCommand(IUICommandDescriptor commandDescriptor)
 {
     _commandDescriptor = commandDescriptor;
     CanonicalName = "openwrap." + commandDescriptor.Noun.ToLowerInvariant() + "." + commandDescriptor.Verb.ToLowerInvariant();
     _description = commandDescriptor.Description;
     _text = commandDescriptor.Label;
 }
Exemplo n.º 3
0
 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;
 }
Exemplo n.º 4
0
        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;
        }
Exemplo n.º 5
0
 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);
 }
Exemplo n.º 6
0
        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);
        }