public virtual void RemoveAdornments() { if (dropDownHelper != null) { IVsDropdownBarManager dbm =(IVsDropdownBarManager)this.codeWindow; dbm.RemoveDropdownBar(); dropDownHelper.Done(); dropDownHelper = null; } foreach (ViewFilter f in this.viewFilters) { f.Close(); } this.viewFilters.Clear(); this.service.CloseSource(this.source); this.source = null; service.RemoveCodeWindowManager(this); this.codeWindow = null; GC.Collect(); }
// IVsCodeWindowManager public virtual void AddAdornments() { this.service.AddCodeWindowManager(this); VsTextView textView; this.codeWindow.GetPrimaryView(out textView ); if (this.service.EnableDropDownCombos) { VsDropdownBar pBar; IVsDropdownBarManager dbm =(IVsDropdownBarManager)this.codeWindow; dbm.GetDropdownBar(out pBar); if (pBar != null) dbm.RemoveDropdownBar(); dropDownHelper = new TypeAndMemberDropdownBars(this.service); dropDownHelper.SynchronizeDropdowns(textView, 0, 0); dbm.AddDropdownBar(2, dropDownHelper); } // attach view filter to primary view. if (textView != null) this.OnNewView(textView); // attach view filter to secondary view. this.codeWindow.GetSecondaryView( out textView ); if (textView != null) this.OnNewView(textView); }