I'm busy with a small, simple add-in, but the process seems massively complicated and badly documented. Right now, the only event that fires in the add-in is OnConnection. The other two I'm trying to handle just don't seem to exist.
private DTE2 applicationObject;
private SolutionEvents solutionEvents;
public void OnConnection(object application, ext_ConnectMode connectMode, object addInInst, ref Array custom)
{
applicationObject = (DTE2)application;
solutionEvents = ((Events2)applicationObject.Events).SolutionEvents;
solutionEvents.Opened +=new _dispSolutionEvents_OpenedEventHandler(SolutionEvents_Opened);
}
private void SolutionEvents_Opened()
{
Debug.WriteLine("Solution loaded: " + applicationObject.Solution.FullName);
}