public static async task Initialize(AsyncPackage package)
        {
            var commandService = await package.GetServiceAsync(typeof(IMenuCommandService)) as OleMenuCommandService;
            var dte = await package.GetServiceAsync(typeof(DTE)) as DTE2;

            Instance = new AddCommand(commandService, dte);
        }
        private ClearCache(OleMenuCommandService commandService, AsyncPackage package)
        {
            ServiceProvider = package;

            var commandID = new CommandID(PackageGuids.guidClearCachePackageCmdSet, PackageIds.ClearCacheId);
            var button = new MenuCommand(DeleteCacheFolder, commandID);
            commandService.AddCommand(button);
        }
Пример #3
0
 public async Task <T> GetServiceAsync <T>(AsyncPackage package) =>
 (T)await package.GetServiceAsync(typeof(T));
Пример #4
0
 public BreakpointManager(AsyncPackage package)
 {
     m_package = package;
 }
Пример #5
0
        /// <summary>
        /// Initializes the singleton instance of the command.
        /// </summary>
        /// <param name="package">Owner package, not null.</param>
        public static async System.Threading.Tasks.Task InitializeAsync(CommandsController aCommandsController, AsyncPackage aPackage, Guid aGuid, int aId)
        {
            // Switch to the main thread - the call to AddCommand in SettingsCommand's constructor requires
            // the UI thread.
            await ThreadHelper.JoinableTaskFactory.SwitchToMainThreadAsync(aPackage.DisposalToken);

            OleMenuCommandService commandService = await aPackage.GetServiceAsync((typeof(IMenuCommandService))) as OleMenuCommandService;

            Instance = new SettingsCommand(aCommandsController, commandService, aPackage, aGuid, aId);
        }
Пример #6
0
 public static void Initialize(AsyncPackage package)
 {
     Instance = new ClearMefCache(package);
 }
 public static void Initialize(AsyncPackage package, OleMenuCommandService commandService, ILibraryCommandService libraryCommandService, IDependenciesFactory dependenciesFactory)
 {
     Instance = new InstallLibraryCommand(package, commandService, libraryCommandService, dependenciesFactory);
 }
Пример #8
0
 public ProjectHelper(AsyncPackage asyncPackage) : this(asyncPackage, asyncPackage.JoinableTaskFactory)
 {
 }
        /// <summary>
        /// Initializes the singleton instance of the command.
        /// </summary>
        /// <param name="package">Owner package, not null.</param>
        public static async Task InitializeAsync(AsyncPackage package)
        {
            Instance = new DetectCsprojCommand(package);

            await Instance.InitializeAsync();
        }
Пример #10
0
 public Task InitializeAsync(AsyncPackage package, CancellationToken token)
 => package.SetupCommandAsync(CommandSet, CommandId, OnExecuteAsync, token);
Пример #11
0
 private SnapWindowToPos6(int positionKey, int displayIndex, AsyncPackage package, OleMenuCommandService commandService)
     : base(6, positionKey, displayIndex, package, commandService)
 {
 }
Пример #12
0
 public static async Task InitializeAsync(AsyncPackage pkg)
 => Instance = new SnapWindowToPos6(1, 0, pkg, await pkg.GetMenuService());
        public static async Task InitializeAsync(AsyncPackage package)
        {
            var commandService = await package.GetServiceAsync(typeof(IMenuCommandService)) as OleMenuCommandService;

            Instance = new PackageManagerToolWindowCommand(package, commandService);
        }
Пример #14
0
    public static async task InitializeAsync(AsyncPackage package, string name)
    {
        _output = await package.GetServiceAsync(typeof(SVsOutputWindow)) as IVsOutputWindow;

        _name = name;
    }
Пример #15
0
 public static async task InitializeAsync(AsyncPackage package, string name)
 {
     _output = await package.GetServiceAsync(typeof(SVsOutputWindow)) as IVsOutputWindow;
     _name = name;
 }
Пример #16
0
 public static void ShowWarnMessageBox(AsyncPackage package, string message) =>
 ShowMessageBox(package, message, OLEMSGICON.OLEMSGICON_WARNING, false);
 public static async System.Threading.Tasks.Task InitializeAsync(AsyncPackage package)
 {
     var commandService = await package.GetServiceAsync(typeof(IMenuCommandService)) as OleMenuCommandService;
     Instance = new ClearCache(commandService, package);
 }
Пример #18
0
 public static Task InitializeAsync(AsyncPackage package, MusicPlayer player)
 {
     _player = player;
     return(InitializeAsync(package));
 }
Пример #19
0
 public static void Initialize(AsyncPackage package, OleMenuCommandService commandService)
 {
     Instance = new ExportCommand(package, commandService);
 }
Пример #20
0
 public TyeServicesProvider(SessionConfiguration sessionConfiguration, TyeExplorerLogger logger, AsyncPackage package)
 {
     _sessionConfiguration = sessionConfiguration;
     _logger             = logger;
     _package            = package;
     _client.BaseAddress = ApiUri;
     _client.Timeout     = ApiTimeout;
     _serializer         = JsonSerializer.CreateDefault();
 }
Пример #21
0
 public static async System.Threading.Tasks.Task InitializeAsync(AsyncPackage package)
 {
     Instance = new ToggleAudioCommand();
     await Instance.InitalizeAsync(package);
 }
 public static void Initialize(AsyncPackage package, ViewModelLocator vmLocator)
 {
     _package          = package;
     _viewModelLocator = vmLocator;
 }
Пример #23
0
 private ClearMefCache(AsyncPackage package)
 {
     this.ServiceProvider = package;
 }
Пример #24
0
 public GetXamlFromCodeWindowBaseCommand(AsyncPackage package, ILogger logger)
     : base(package, logger)
 {
 }
Пример #25
0
 /// <summary>
 /// Initializes a new instance of the <see cref="SettingsCommand"/> 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 SettingsCommand(CommandsController aCommandsController, OleMenuCommandService aCommandService, AsyncPackage aPackage, Guid aGuid, int aId)
     : base(aPackage, aGuid, aId)
 {
     if (null != aCommandService)
     {
         var menuCommandID = new CommandID(CommandSet, Id);
         var menuItem      = new OleMenuCommand(aCommandsController.Execute, menuCommandID);
         aCommandService.AddCommand(menuItem);
     }
 }
Пример #26
0
        public static async System.Threading.Tasks.Task InitializeAsync(AsyncPackage package)
        {
            var commandService = await package.GetServiceAsync(typeof(IMenuCommandService)) as OleMenuCommandService;

            Instance = new ClearCache(commandService, package);
        }
Пример #27
0
 public void ShowSettings()
 {
     AsyncPackage.ShowOptionPage(typeof(ClangGeneralOptionsView));
 }
Пример #28
0
 public static void Initialize(AsyncPackage package, OleMenuCommandService commandService, ExtensionService es)
 {
     Instance = new ImportCommand(package, commandService, es);
 }
Пример #29
0
 public static async Task <DTE2> GetDteAsync(AsyncPackage package) =>
 (DTE2)await package.GetServiceAsync(typeof(DTE));
Пример #30
0
        public async Task InitializeAsync(AsyncPackage package)
        {
            await DiffOpenFilesCommand.InitializeAsync(package, this);

            await DiffSolutionExplorerFilesCommand.InitializeAsync(package, this);
        }
Пример #31
0
 public static bool ShowInfoMessageBox(
     AsyncPackage package, string message, bool isCancellable = false) =>
 1 == ShowMessageBox(package, message, OLEMSGICON.OLEMSGICON_INFO, isCancellable);
 public static void Initialize(AsyncPackage package)
 {
     Instance = new OpenFolderButtonProjectNode(package);
 }
 /// <summary>
 /// Initializes a new instance of the <see cref="IgnoreFormatCommand"/> class.
 /// Adds our command handlers for menu (commands must exist in the command table file)
 /// </summary>
 /// <param name="package">Owner package, not null.</param>
 /// <param name="commandService">Command service to add command to, not null.</param>
 private IgnoreFormatCommand(CommandController aCommandController, OleMenuCommandService aCommandService, AsyncPackage aPackage, Guid aGuid, int aId)
     : base(aPackage, aGuid, aId)
 {
     if (null != aCommandService)
     {
         var menuCommandID = new CommandID(CommandSet, Id);
         var menuItem      = new OleMenuCommand(aCommandController.Execute, menuCommandID);
         menuItem.BeforeQueryStatus += aCommandController.VisibilityOnBeforeCommand;
         aCommandService.AddCommand(menuItem);
     }
 }
Пример #34
0
 public VsExtensionApiService(AsyncPackage package)
 {
     this.package = package;
 }