Ejemplo n.º 1
0
        /// <summary>
        /// Initializes a new instance of the <see cref="PackageCommands"/> 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 PackageCommands(SaveAllTheTabsPackage package)
        {
            if (package == null)
            {
                throw new ArgumentNullException(nameof(package));
            }

            Package = package;

            var commandService = ServiceProvider.GetService(typeof(IMenuCommandService)) as OleMenuCommandService;
            if (commandService != null)
            {
                SetupCommands(commandService);
            }
        }
Ejemplo n.º 2
0
        /// <summary>
        /// Initializes a new instance of the <see cref="PackageCommands"/> 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 PackageCommands(SaveAllTheTabsPackage package)
        {
            if (package == null)
            {
                throw new ArgumentNullException(nameof(package));
            }

            Package = package;

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

            if (commandService != null)
            {
                SetupCommands(commandService);
            }
        }
 public SavedTabsWindowCommands(SaveAllTheTabsPackage package)
 {
     Package = package;
     CommandService = ((IServiceProvider)package)?.GetService(typeof(IMenuCommandService)) as OleMenuCommandService;
 }
 public RestoreTabsListCommands(SaveAllTheTabsPackage package)
 {
     Package = package;
 }
Ejemplo n.º 5
0
 /// <summary>
 /// Initializes the singleton instance of the command.
 /// </summary>
 /// <param name="package">Owner package, not null.</param>
 public static void Initialize(SaveAllTheTabsPackage package)
 {
     Instance = new PackageCommands(package);
 }
Ejemplo n.º 6
0
 public SavedTabsWindowCommands(SaveAllTheTabsPackage package)
 {
     Package        = package;
     CommandService = ((IServiceProvider)package)?.GetService(typeof(IMenuCommandService)) as OleMenuCommandService;
 }
 public RestoreTabsListCommands(SaveAllTheTabsPackage package)
 {
     Package = package;
 }
Ejemplo n.º 8
0
        public PackageProviderService(SaveAllTheTabsPackage package)
        {
            Package = package;

            ((IServiceContainer)package).AddService(typeof(PackageProviderService), this, true);
        }
Ejemplo n.º 9
0
 /// <summary>
 /// Initializes the singleton instance of the command.
 /// </summary>
 /// <param name="package">Owner package, not null.</param>
 public static void Initialize(SaveAllTheTabsPackage package)
 {
     Instance = new PackageCommands(package);
 }
        public PackageProviderService(SaveAllTheTabsPackage package)
        {
            Package = package;

            ((IServiceContainer)package).AddService(typeof(PackageProviderService), this, true);
        }