///''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' // Overriden Package Implementation #region Package Members /// <summary> /// Initialization of the package; this method is called right after the package is sited, so this is the place /// where you can put all the initilaization code that rely on services provided by VisualStudio. /// </summary> protected override void Initialize() { base.Initialize(); CurrentPackage = this; this.GlobalSettingsWatcher.SettingsCleared = this.OnSettingsCleared; this.SolutionSettingsWatcher.SettingsCleared = this.OnSettingsCleared; //Every 5 seconds, we check the window titles in case we missed an event. this.ResetTitleTimer = new System.Windows.Forms.Timer { Interval = 5000 }; this.ResetTitleTimer.Tick += this.UpdateWindowTitleAsync; this.ResetTitleTimer.Start(); }
//Private VersionSpecificAssembly As Assembly /// <summary> /// Default constructor of the package. /// Inside this method you can place any initialization code that does not require /// any Visual Studio service because at this point the package object is created but /// not sited yet inside Visual Studio environment. The place to do all the other /// initialization is the Initialize method. /// </summary> public RenameVSWindowTitle() { CurrentPackage = this; Globals.DTE = (DTE2)GetGlobalService(typeof(DTE)); Globals.DTE.Events.DebuggerEvents.OnEnterBreakMode += this.OnIdeEvent; Globals.DTE.Events.DebuggerEvents.OnEnterRunMode += this.OnIdeEvent; Globals.DTE.Events.DebuggerEvents.OnEnterDesignMode += this.OnIdeEvent; Globals.DTE.Events.DebuggerEvents.OnContextChanged += this.OnIdeEvent; Globals.DTE.Events.SolutionEvents.AfterClosing += this.OnIdeSolutionEvent; Globals.DTE.Events.SolutionEvents.Opened += this.OnIdeSolutionEvent; Globals.DTE.Events.SolutionEvents.Renamed += this.OnIdeSolutionEvent; Globals.DTE.Events.WindowEvents.WindowCreated += this.OnIdeEvent; Globals.DTE.Events.WindowEvents.WindowClosing += this.OnIdeEvent; Globals.DTE.Events.WindowEvents.WindowActivated += this.OnIdeEvent; Globals.DTE.Events.DocumentEvents.DocumentOpened += this.OnIdeEvent; Globals.DTE.Events.DocumentEvents.DocumentClosing += this.OnIdeEvent; }