public void HookEvents() { if (!hooked) { hooked = true; afterClosingEventHandler = new _dispSolutionEvents_AfterClosingEventHandler(solutionEvents_AfterClosing); solutionEvents.AfterClosing += afterClosingEventHandler; openedEventHandler = new _dispSolutionEvents_OpenedEventHandler(solutionEvents_Opened); solutionEvents.Opened += openedEventHandler; } }
public void HookEvents() { if (!hooked) { hooked = true; afterClosingEventHandler = new _dispSolutionEvents_AfterClosingEventHandler(solutionEvents_AfterClosing); solutionEvents.AfterClosing += afterClosingEventHandler; openedEventHandler = new _dispSolutionEvents_OpenedEventHandler(solutionEvents_Opened); solutionEvents.Opened += openedEventHandler; } }
private void bindEventsOnSolution() { if (_openedEvent != null) return; _openedEvent = new _dispSolutionEvents_OpenedEventHandler(onSolutionOpened); _solutionEvents.Opened += _openedEvent; _afterClosingEvent = new _dispSolutionEvents_AfterClosingEventHandler(onSolutionClosingFinished); _solutionEvents.AfterClosing += _afterClosingEvent; }
private void bindEventsOnSolution() { if (_openedEvent != null) return; _openedEvent = new _dispSolutionEvents_OpenedEventHandler(onSolutionOpened); _solutionEvents.Opened += _openedEvent; _afterClosingEvent = new _dispSolutionEvents_AfterClosingEventHandler(onSolutionClosingFinished); _solutionEvents.AfterClosing += _afterClosingEvent; }
protected static void CloseSolution(DTE dte) { var mre = new ManualResetEventSlim(); var events = dte.Events.SolutionEvents; _dispSolutionEvents_AfterClosingEventHandler done = () => mre.Set(); events.AfterClosing += done; try { UIThreadInvoker.Invoke((Action)(() => { dte.Solution.Close(false); mre.Wait(); })); } finally { events.AfterClosing -= done; } }