예제 #1
0
        /// <include file='doc\CodeWindowManager.uex' path='docs/doc[@for="CodeWindowManager.RemoveAdornments"]/*' />
        /// <summary>Remove drop down combos, view filters, and notify the LanguageService that the Source and
        /// CodeWindowManager is now closed</summary>
        public virtual int RemoveAdornments()
        {
            Trace.WriteLine("CodeWindowManager::RemoveAdornments");
            try {
                if (this.dropDownHelper != null)
                {
                    IVsDropdownBarManager dbm = (IVsDropdownBarManager)this.codeWindow;
                    NativeMethods.ThrowOnFailure(dbm.RemoveDropdownBar());
                    this.dropDownHelper.Done();
                    this.dropDownHelper = null;
                }
            } finally {
                CloseFilters();

                if (this.source != null && this.source.Close())
                {
                    this.service.OnCloseSource(this.source);
                    this.source.Dispose();
                }
                this.source = null;

                service.RemoveCodeWindowManager(this);
                this.codeWindow = null;
            }
            return(NativeMethods.S_OK);
        }
예제 #2
0
        // 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);
            }
        }
예제 #3
0
        /// <include file='doc\CodeWindowManager.uex' path='docs/doc[@for="CodeWindowManager.AddAdornments"]/*' />
        /// <summary>Install the optional TypeAndMemberDropdownBars, and primary and secondary view filters</summary>
        public virtual int AddAdornments()
        {
            Trace.WriteLine("CodeWindowManager::AddAdornments");
            int hr = 0;

            this.service.AddCodeWindowManager(this);

            this.source.Open();

            IVsTextView textView;

            NativeMethods.ThrowOnFailure(this.codeWindow.GetPrimaryView(out textView));

            this.dropDownHelper = this.service.CreateDropDownHelper(textView);
            if (this.dropDownHelper != null)
            {
                IVsDropdownBar        pBar;
                IVsDropdownBarManager dbm = (IVsDropdownBarManager)this.codeWindow;
                int rc = dbm.GetDropdownBar(out pBar);
                if (rc == 0 && pBar != null)
                {
                    NativeMethods.ThrowOnFailure(dbm.RemoveDropdownBar());
                }
                //this.dropDownHelper = new TypeAndMemberDropdownBars(this.service);
                this.dropDownHelper.SynchronizeDropdowns(textView, 0, 0);
                NativeMethods.ThrowOnFailure(dbm.AddDropdownBar(2, this.dropDownHelper));
            }
            // attach view filter to primary view.
            if (textView != null)
            {
                this.OnNewView(textView); // always returns S_OK.
            }
            // attach view filter to secondary view.
            textView = null;
            hr       = this.codeWindow.GetSecondaryView(out textView);
            if (hr == NativeMethods.S_OK && textView != null)
            {
                this.OnNewView(textView); // always returns S_OK.
            }
            return(NativeMethods.S_OK);
        }
예제 #4
0
        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();
        }
예제 #5
0
        /// <include file='doc\CodeWindowManager.uex' path='docs/doc[@for="CodeWindowManager.RemoveAdornments"]/*' />
        /// <summary>Remove drop down combos, view filters, and notify the LanguageService that the Source and
        /// CodeWindowManager is now closed</summary>
        public virtual int RemoveAdornments()
        {
            #if	LANGTRACE
            Trace.WriteLine("CodeWindowManager::RemoveAdornments");
            #endif
            try {
                if (this.dropDownHelper != null) {
                    IVsDropdownBarManager dbm = (IVsDropdownBarManager)this.codeWindow;
                    NativeMethods.ThrowOnFailure(dbm.RemoveDropdownBar());
                    this.dropDownHelper.Done();
                    this.dropDownHelper = null;
                }
            } finally {
                CloseFilters();

                if (this.source != null && this.source.Close()) {
                    this.service.OnCloseSource(this.source);
                    this.source.Dispose();
                }
                this.source = null;

                service.RemoveCodeWindowManager(this);
                this.codeWindow = null;
                this.Close();
            }
            return NativeMethods.S_OK;
        }
예제 #6
0
        /// <include file='doc\CodeWindowManager.uex' path='docs/doc[@for="CodeWindowManager.AddAdornments"]/*' />
        /// <summary>Install the optional TypeAndMemberDropdownBars, and primary and secondary view filters</summary>
        public virtual int AddAdornments()
        {
            #if	LANGTRACE
            Trace.WriteLine("CodeWindowManager::AddAdornments");
            #endif
            int hr = 0;
            this.service.AddCodeWindowManager(this);

            this.source.Open();

            IVsTextView textView;
            NativeMethods.ThrowOnFailure(this.codeWindow.GetPrimaryView(out textView));

            this.dropDownHelper = this.service.CreateDropDownHelper(textView);
            if (this.dropDownHelper != null) {
                IVsDropdownBar pBar;
                IVsDropdownBarManager dbm = (IVsDropdownBarManager)this.codeWindow;
                int rc = dbm.GetDropdownBar(out pBar);
                if (rc == 0 && pBar != null)
                    NativeMethods.ThrowOnFailure(dbm.RemoveDropdownBar());
                //this.dropDownHelper = new TypeAndMemberDropdownBars(this.service);
                this.dropDownHelper.SynchronizeDropdowns(textView, 0, 0);
                NativeMethods.ThrowOnFailure(dbm.AddDropdownBar(2, this.dropDownHelper));
            }
            // attach view filter to primary view.
            if (textView != null)
                this.OnNewView(textView); // always returns S_OK.

            // attach view filter to secondary view.
            textView = null;
            hr = this.codeWindow.GetSecondaryView(out textView);
            if (hr == NativeMethods.S_OK && textView != null)
                this.OnNewView(textView); // always returns S_OK.

            return NativeMethods.S_OK;
        }