4 using Microsoft.VisualStudio;
5 using Microsoft.VisualStudio.Shell.Interop;
7 namespace SiliconStudio.
Paradox.VisualStudio
11 private IVsSolution solution;
12 private uint solutionEventsCookie;
23 solution = serviceProvider.GetService(typeof(SVsSolution)) as IVsSolution;
26 solution.AdviseSolutionEvents(
this, out solutionEventsCookie);
32 return VSConstants.S_OK;
37 return VSConstants.S_OK;
42 pfShouldDelayLoadToNextIdle =
false;
43 return VSConstants.S_OK;
48 return VSConstants.S_OK;
53 return VSConstants.S_OK;
58 var afterSolutionBackgroundLoadComplete = AfterSolutionBackgroundLoadComplete;
59 if (afterSolutionBackgroundLoadComplete != null)
60 afterSolutionBackgroundLoadComplete();
61 return VSConstants.S_OK;
64 #region IVsSolutionEvents Members
66 int IVsSolutionEvents.OnAfterCloseSolution(
object pUnkReserved)
68 return VSConstants.S_OK;
71 int IVsSolutionEvents.OnAfterLoadProject(IVsHierarchy pStubHierarchy, IVsHierarchy pRealHierarchy)
73 return VSConstants.S_OK;
76 int IVsSolutionEvents.OnAfterOpenProject(IVsHierarchy pHierarchy,
int fAdded)
78 var afterProjectOpened = AfterProjectOpened;
79 if (afterProjectOpened != null)
80 afterProjectOpened(pHierarchy);
81 return VSConstants.S_OK;
84 int IVsSolutionEvents.OnAfterOpenSolution(
object pUnkReserved,
int fNewSolution)
86 var afterSolutionLoaded = AfterSolutionLoaded;
87 if (afterSolutionLoaded != null)
88 afterSolutionLoaded();
89 return VSConstants.S_OK;
92 int IVsSolutionEvents.OnBeforeCloseProject(IVsHierarchy pHierarchy,
int fRemoved)
94 var beforeProjectClosed = BeforeProjectClosed;
95 if (beforeProjectClosed != null)
96 beforeProjectClosed(pHierarchy);
97 return VSConstants.S_OK;
100 int IVsSolutionEvents.OnBeforeCloseSolution(
object pUnkReserved)
102 var beforeSolutionClosed = BeforeSolutionClosed;
103 if (beforeSolutionClosed != null)
104 beforeSolutionClosed();
105 return VSConstants.S_OK;
108 int IVsSolutionEvents.OnBeforeUnloadProject(IVsHierarchy pRealHierarchy, IVsHierarchy pStubHierarchy)
110 return VSConstants.S_OK;
113 int IVsSolutionEvents.OnQueryCloseProject(IVsHierarchy pHierarchy,
int fRemoving, ref
int pfCancel)
115 return VSConstants.S_OK;
118 int IVsSolutionEvents.OnQueryCloseSolution(
object pUnkReserved, ref
int pfCancel)
120 return VSConstants.S_OK;
123 int IVsSolutionEvents.OnQueryUnloadProject(IVsHierarchy pRealHierarchy, ref
int pfCancel)
125 return VSConstants.S_OK;
130 #region IDisposable Members
134 if (solution != null && solutionEventsCookie != 0)
136 GC.SuppressFinalize(
this);
137 solution.UnadviseSolutionEvents(solutionEventsCookie);
138 AfterSolutionLoaded = null;
139 BeforeSolutionClosed = null;
140 solutionEventsCookie = 0;
int OnBeforeBackgroundSolutionLoadBegins()
Action AfterSolutionBackgroundLoadComplete
SolutionEventsListener(IServiceProvider serviceProvider)
int OnAfterBackgroundSolutionLoadComplete()
Action< IVsHierarchy > BeforeProjectClosed
Action AfterSolutionLoaded
int OnQueryBackgroundLoadProjectBatch(out bool pfShouldDelayLoadToNextIdle)
int OnBeforeLoadProjectBatch(bool fIsBackgroundIdleBatch)
Action< IVsHierarchy > AfterProjectOpened
Action BeforeSolutionClosed
int OnBeforeOpenSolution(string pszSolutionFilename)
int OnAfterLoadProjectBatch(bool fIsBackgroundIdleBatch)