Esempio n. 1
0
        /// <summary>
        /// Initializes a new instance of the <see cref="WrapperCommandBase"/> class.
        /// Adds our command handlers for menu (commands must exist in the command table file)
        /// </summary>
        /// <param name="package">Owner package, not null.</param>
        protected WrapperCommandBase(VsRompPackage package, int commandId)
        {
            this.Package = package ?? throw new ArgumentNullException("package");

            if (this.ServiceProvider.GetService(typeof(IMenuCommandService)) is OleMenuCommandService commandService)
            {
                var menuCommandID = new CommandID(CommandSet, commandId);
                var menuItem      = new MenuCommand((s, e) => this.Run(), menuCommandID);
                commandService.AddCommand(menuItem);
            }
        }
Esempio n. 2
0
        /// <summary>
        /// Initializes a new instance of the <see cref="PushCommand"/> class.
        /// Adds our command handlers for menu (commands must exist in the command table file)
        /// </summary>
        /// <param name="package">Owner package, not null.</param>
        private PushCommand(VsRompPackage package)
        {
            if (package == null)
            {
                throw new ArgumentNullException("package");
            }

            this.package = package;

            OleMenuCommandService commandService = this.ServiceProvider.GetService(typeof(IMenuCommandService)) as OleMenuCommandService;

            if (commandService != null)
            {
                var menuCommandID = new CommandID(CommandSet, CommandId);
                var menuItem      = new MenuCommand(this.MenuItemCallback, menuCommandID);
                commandService.AddCommand(menuItem);
            }
        }
Esempio n. 3
0
 /// <summary>
 /// Initializes the singleton instance of the command.
 /// </summary>
 /// <param name="package">Owner package, not null.</param>
 public static void Initialize(VsRompPackage package)
 {
     Instance = new TestCommand(package);
 }
Esempio n. 4
0
 /// <summary>
 /// Initializes a new instance of the <see cref="TestCommand"/> class.
 /// Adds our command handlers for menu (commands must exist in the command table file)
 /// </summary>
 /// <param name="package">Owner package, not null.</param>
 private TestCommand(VsRompPackage package) : base(package, CommandId)
 {
 }
Esempio n. 5
0
 /// <summary>
 /// Initializes a new instance of the <see cref="ValidateCommand"/> class.
 /// Adds our command handlers for menu (commands must exist in the command table file)
 /// </summary>
 /// <param name="package">Owner package, not null.</param>
 private ValidateCommand(VsRompPackage package) : base(package, CommandId)
 {
 }
Esempio n. 6
0
 /// <summary>
 /// Initializes the singleton instance of the command.
 /// </summary>
 /// <param name="package">Owner package, not null.</param>
 public static void Initialize(VsRompPackage package)
 {
     Instance = new ConfigureCommand(package);
 }