public void Run(IVisualStudioPackage package) { // Register handler to receive custom messages from the Dkm components. DkmComponentEventHandler handler = new DkmComponentEventHandler(package); IServiceContainer container = (IServiceContainer)package; container.AddService(handler.GetType(), handler, true); }
public void Run(IVisualStudioPackage package) { // If there is a solution already open, open its file in the server RegisterCurrentSolution(); // Advise solution open/close events so that we can notify the server ListeToSolutionEvents(); }
public void Run(IVisualStudioPackage package) { // Create an IOleCommandTarget wrapping all the priority command handlers var commandTargets = _commandHandlers .Select(c => new SimpleCommandTarget( c.CommandId, () => c.Execute(this, new EventArgs()), () => c.Supported, () => c.Enabled)); var aggregate = new AggregateCommandTarget(commandTargets); var oleCommandTarget = new OleCommandTarget("PackagePriority", aggregate); // Register the ole command target as a VS priority command target var registerPriorityCommandTarget = package.VsRegisterPriorityCommandTarget; uint cookie; int hr = registerPriorityCommandTarget.RegisterPriorityCommandTarget(0, oleCommandTarget, out cookie); try { ErrorHandler.ThrowOnFailure(hr); } catch (Exception e) { Logger.LogError(e, "Error registering priority command handler."); return; } package.DisposeContainer.Add(() => registerPriorityCommandTarget.UnregisterPriorityCommandTarget(cookie)); }
public void SetPackage(IVisualStudioPackage package) { if (_package != null) { throw new InvalidOperationException("Package singleton already set."); } _package = package; }
public void Run(IVisualStudioPackage package) { var mcs = package.OleMenuCommandService; if (mcs == null) { Logger.LogError("Error getting instance of OleMenuCommandService"); return; } _commandHandlers.ForAll(handler => mcs.AddCommand(handler.ToOleMenuCommand())); }
public void Run(IVisualStudioPackage package) { _uiDelayedOperationProcessor.Post(new DelayedOperation { Id = "SolutionExplorerHierarchyInitializer", Delay = TimeSpan.FromSeconds(2.0), Action = () => { var controller = _sourceExplorerHierarchyControllerFactory.CreateController(); controller.Activate(); } }); }
public void Run(IVisualStudioPackage package) { var mcs = package.OleMenuCommandService; if (mcs == null) { Logger.LogError("Error getting instance of OleMenuCommandService"); return; } foreach (var handler in _commandHandlers) { // Create the command for the tool window var command = new MenuCommand(handler.Execute, handler.CommandId); mcs.AddCommand(command); } }
public void Run(IVisualStudioPackage package) { this.Dispose(); }
public void Run(IVisualStudioPackage package) { EnqueueOperation(); }
void IPackagePostDispose.Run(IVisualStudioPackage package) { Dispose(); }
public void Run(IVisualStudioPackage package) { _visualStudioPackageProvider.SetPackage(package); }
public void Run(IVisualStudioPackage package) { _textDocumentTable.TextDocumentOpened += TextDocumentFactoryServiceOnTextDocumentOpened; _textDocumentTable.TextDocumentClosed += TextDocumentFactoryServiceOnTextDocumentClosed; _textDocumentTable.TextDocumentRenamed += TextTextDocumentFactoryServiceOnTextDocumentRenamed; }
public DkmComponentEventHandler(IVisualStudioPackage package) { _package = package; }
public void Run(IVisualStudioPackage package) { _textDocumentFactoryService.TextDocumentCreated += TextDocumentFactoryServiceOnTextDocumentCreated; _textDocumentFactoryService.TextDocumentDisposed += TextDocumentFactoryServiceOnTextDocumentDisposed; }
public void SetPackage(IVisualStudioPackage package) { if (_package != null) throw new InvalidOperationException("Package singleton already set."); _package = package; }
public void Run(IVisualStudioPackage package) { _typedRequestProcessProxy.EventReceived += TypedRequestProcessProxy_EventReceived; }