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;
 }
Esempio n. 5
0
        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);
        }
Esempio n. 6
0
        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) {
      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)
 {
     _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;
            }

            _commandHandlers.ForAll(handler =>
                                    mcs.AddCommand(handler.ToOleMenuCommand()));
        }
        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)
        {
            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);
            }
        }
Esempio n. 13
0
 public void Run(IVisualStudioPackage package) {
   this.Dispose();
 }
Esempio n. 14
0
 public void Run(IVisualStudioPackage package) {
   EnqueueOperation();
 }
Esempio n. 15
0
 void IPackagePostDispose.Run(IVisualStudioPackage package)
 {
     Dispose();
 }
 public void Run(IVisualStudioPackage package)
 {
     _visualStudioPackageProvider.SetPackage(package);
 }
 public void Run(IVisualStudioPackage package)
 {
     this.Dispose();
 }
Esempio n. 18
0
 public void Run(IVisualStudioPackage package)
 {
     _textDocumentTable.TextDocumentOpened  += TextDocumentFactoryServiceOnTextDocumentOpened;
     _textDocumentTable.TextDocumentClosed  += TextDocumentFactoryServiceOnTextDocumentClosed;
     _textDocumentTable.TextDocumentRenamed += TextTextDocumentFactoryServiceOnTextDocumentRenamed;
 }
Esempio n. 19
0
 public DkmComponentEventHandler(IVisualStudioPackage package)
 {
     _package = package;
 }
Esempio n. 20
0
 public void Run(IVisualStudioPackage package)
 {
     _textDocumentFactoryService.TextDocumentCreated  += TextDocumentFactoryServiceOnTextDocumentCreated;
     _textDocumentFactoryService.TextDocumentDisposed += TextDocumentFactoryServiceOnTextDocumentDisposed;
 }
 public void Run(IVisualStudioPackage package) {
   _visualStudioPackageProvider.SetPackage(package);
 }
 public void SetPackage(IVisualStudioPackage package) {
   if (_package != null)
     throw new InvalidOperationException("Package singleton already set.");
   _package = package;
 }
Esempio n. 23
0
 public void Run(IVisualStudioPackage package)
 {
     _typedRequestProcessProxy.EventReceived += TypedRequestProcessProxy_EventReceived;
 }
Esempio n. 24
0
 public void Run(IVisualStudioPackage package)
 {
     EnqueueOperation();
 }
 public void Run(IVisualStudioPackage package) {
   _textDocumentFactoryService.TextDocumentCreated += TextDocumentFactoryServiceOnTextDocumentCreated;
   _textDocumentFactoryService.TextDocumentDisposed += TextDocumentFactoryServiceOnTextDocumentDisposed;
 }
Esempio n. 26
0
 public DkmComponentEventHandler(IVisualStudioPackage package)
 {
     _package = package;
 }
Esempio n. 27
0
 public void Run(IVisualStudioPackage package) {
   _typedRequestProcessProxy.EventReceived += TypedRequestProcessProxy_EventReceived;
 }