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); }
public async Task <T> GetServiceAsync <T>(AsyncPackage package) => (T)await package.GetServiceAsync(typeof(T));
public BreakpointManager(AsyncPackage package) { m_package = package; }
/// <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); }
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); }
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(); }
public Task InitializeAsync(AsyncPackage package, CancellationToken token) => package.SetupCommandAsync(CommandSet, CommandId, OnExecuteAsync, token);
private SnapWindowToPos6(int positionKey, int displayIndex, AsyncPackage package, OleMenuCommandService commandService) : base(6, positionKey, displayIndex, package, commandService) { }
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); }
public static async task InitializeAsync(AsyncPackage package, string name) { _output = await package.GetServiceAsync(typeof(SVsOutputWindow)) as IVsOutputWindow; _name = name; }
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); }
public static Task InitializeAsync(AsyncPackage package, MusicPlayer player) { _player = player; return(InitializeAsync(package)); }
public static void Initialize(AsyncPackage package, OleMenuCommandService commandService) { Instance = new ExportCommand(package, commandService); }
public TyeServicesProvider(SessionConfiguration sessionConfiguration, TyeExplorerLogger logger, AsyncPackage package) { _sessionConfiguration = sessionConfiguration; _logger = logger; _package = package; _client.BaseAddress = ApiUri; _client.Timeout = ApiTimeout; _serializer = JsonSerializer.CreateDefault(); }
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; }
private ClearMefCache(AsyncPackage package) { this.ServiceProvider = package; }
public GetXamlFromCodeWindowBaseCommand(AsyncPackage package, ILogger logger) : base(package, logger) { }
/// <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); } }
public void ShowSettings() { AsyncPackage.ShowOptionPage(typeof(ClangGeneralOptionsView)); }
public static void Initialize(AsyncPackage package, OleMenuCommandService commandService, ExtensionService es) { Instance = new ImportCommand(package, commandService, es); }
public static async Task <DTE2> GetDteAsync(AsyncPackage package) => (DTE2)await package.GetServiceAsync(typeof(DTE));
public async Task InitializeAsync(AsyncPackage package) { await DiffOpenFilesCommand.InitializeAsync(package, this); await DiffSolutionExplorerFilesCommand.InitializeAsync(package, this); }
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); } }
public VsExtensionApiService(AsyncPackage package) { this.package = package; }