protected override void Dispose(bool disposing) { if (disposing) { tools.Release(); tools = null; sharedTaskManagers.Clear(); sharedTaskManagers = null; if (buildManager != null) { buildManager.UnadviseUpdateSolutionEvents(buildManagerCookie); buildManager = null; } if (solution != null) { solution.UnadviseSolutionEvents(solutionEventsCookie); solution = null; } taskListMenu.Release(); taskListMenu = null; Common.Release(); GC.SuppressFinalize(this); } base.Dispose(disposing); }
protected override void Initialize() { base.Initialize(); // Initialize common functionality Common.Initialize(this); taskListMenu = new RootMenu(); // Initialize fields tools = new Tools(); sharedTaskManagers = new List <TaskManager>(); // Attach to solution events solution = GetService(typeof(SVsSolution)) as IVsSolution; // if (solution == null) throw new NullReferenceException(); solution.AdviseSolutionEvents(this as IVsSolutionEvents, out solutionEventsCookie); // Attach to build events buildManager = GetService(typeof(SVsSolutionBuildManager)) as IVsSolutionBuildManager; // if (buildManager == null) throw new NullReferenceException(); buildManager.AdviseUpdateSolutionEvents(this, out buildManagerCookie); // Add a TaskManagerFactory service (this as System.ComponentModel.Design.IServiceContainer).AddService(typeof(ITaskManagerFactory), this, true); }
protected override void Initialize() { Common.Trace("Package intialize"); base.Initialize(); Common.Trace("Task manager.Initialize()"); // Initialize common functionality Common.Initialize(this); taskListMenu = new RootMenu(); // Initialize fields tools = new Tools(); sharedTaskManagers = new List <TaskManager>(); // Attach to solution events solution = GetService(typeof(SVsSolution)) as IVsSolution; if (solution == null) { Common.Log("Could not get solution"); } solution.AdviseSolutionEvents(this as IVsSolutionEvents, out solutionEventsCookie); // Attach to build events buildManager = GetService(typeof(SVsSolutionBuildManager)) as IVsSolutionBuildManager; if (buildManager == null) { Common.Log("Could not get build manager"); } buildManager.AdviseUpdateSolutionEvents(this, out buildManagerCookie); // Add a TaskManagerFactory service ITaskManagerFactory factory = this as ITaskManagerFactory; (this as System.ComponentModel.Design.IServiceContainer).AddService(typeof(ITaskManagerFactory), factory, true); // Set PID for msbuild tasks Environment.SetEnvironmentVariable("VSPID", System.Diagnostics.Process.GetCurrentProcess().Id.ToString()); }
protected override void Dispose(bool disposing) { if (disposing) { tools.Release(); tools = null; sharedTaskManagers.Clear(); sharedTaskManagers = null; if (buildManager != null) { buildManager.UnadviseUpdateSolutionEvents(buildManagerCookie); buildManager = null; } if (solution != null) { solution.UnadviseSolutionEvents(solutionEventsCookie); solution = null; } taskListMenu.Release(); taskListMenu = null; Common.Release(); GC.SuppressFinalize(this); } base.Dispose(disposing); }
protected override void Initialize() { base.Initialize(); // Initialize common functionality Common.Initialize(this); taskListMenu = new RootMenu(); // Initialize fields tools = new Tools(); sharedTaskManagers = new List<TaskManager>(); // Attach to solution events solution = GetService(typeof(SVsSolution)) as IVsSolution; // if (solution == null) throw new NullReferenceException(); solution.AdviseSolutionEvents(this as IVsSolutionEvents, out solutionEventsCookie); // Attach to build events buildManager = GetService(typeof(SVsSolutionBuildManager)) as IVsSolutionBuildManager; // if (buildManager == null) throw new NullReferenceException(); buildManager.AdviseUpdateSolutionEvents(this, out buildManagerCookie); // Add a TaskManagerFactory service (this as System.ComponentModel.Design.IServiceContainer).AddService(typeof(ITaskManagerFactory), this, true); }
protected override void Initialize() { Common.Trace("Package intialize"); base.Initialize(); Common.Trace("Task manager.Initialize()"); // Initialize common functionality Common.Initialize(this); taskListMenu = new RootMenu(); // Initialize fields tools = new Tools(); sharedTaskManagers = new List<TaskManager>(); // Attach to solution events solution = GetService(typeof(SVsSolution)) as IVsSolution; if (solution == null) Common.Log("Could not get solution"); solution.AdviseSolutionEvents(this as IVsSolutionEvents, out solutionEventsCookie); // Attach to build events buildManager = GetService(typeof(SVsSolutionBuildManager)) as IVsSolutionBuildManager; if (buildManager == null) Common.Log("Could not get build manager"); buildManager.AdviseUpdateSolutionEvents(this, out buildManagerCookie); // Add a TaskManagerFactory service ITaskManagerFactory factory = this as ITaskManagerFactory; (this as System.ComponentModel.Design.IServiceContainer).AddService(typeof(ITaskManagerFactory), factory, true); // Set PID for msbuild tasks Environment.SetEnvironmentVariable( "VSPID", System.Diagnostics.Process.GetCurrentProcess().Id.ToString() ); }