public AutoExpander(
            IWpfTextView textView,
            IVsOutliningManager outlining,
            IVsfSettings settings)
        {
            this.settings = settings;
              this.theView = textView;
              this.outliningManager = outlining;
              this.expandMode = settings.AutoExpandRegions;

              this.theView.Closed += OnViewClosed;
              this.settings.SettingsChanged += OnSettingsChanged;

              if ( expandMode == AutoExpandMode.Disable ) {
            outlining.Enabled = false;
              } else if ( expandMode == AutoExpandMode.Expand ) {
            // in most cases, this is enough to
            // expand all outlining as necessary.
            // However, it does not appear to work
            // if the solution is just opened
            // so take notice of when regions are
            // collapsed and do it again just in case
            // Try expanding it when the window gets focus
            // as a last chance for Visual Basic
            this.theView.LayoutChanged += OnLayoutChanged;
            this.outliningManager.RegionsCollapsed += OnRegionsCollapsed;
            this.theView.GotAggregateFocus += OnGotFocus;
              }
        }
        public AutoExpander(
            IWpfTextView textView,
            IVsOutliningManager outlining,
            IVsfSettings settings)
        {
            this.settings         = settings;
            this.theView          = textView;
            this.outliningManager = outlining;
            this.expandMode       = settings.AutoExpandRegions;

            this.theView.Closed           += OnViewClosed;
            this.settings.SettingsChanged += OnSettingsChanged;

            if (this.expandMode == AutoExpandMode.Disable)
            {
                outlining.Enabled = false;
            }
            else if (this.expandMode == AutoExpandMode.Expand)
            {
                // in most cases, this is enough to
                // expand all outlining as necessary.
                // However, it does not appear to work
                // if the solution is just opened
                // so take notice of when regions are
                // collapsed and do it again just in case
                // Try expanding it when the window gets focus
                // as a last chance for Visual Basic
                this.theView.LayoutChanged             += OnLayoutChanged;
                this.outliningManager.RegionsCollapsed += OnRegionsCollapsed;
                this.theView.GotAggregateFocus         += OnGotFocus;
            }
        }
Exemple #3
0
        public AutoExpander(
            IWpfTextView textView,
            IVsOutliningManager outlining,
            AutoExpandMode mode)
        {
            this.expandMode       = mode;
            this.theView          = textView;
            this.outliningManager = outlining;

            this.theView.Closed         += OnViewClosed;
            VsfSettings.SettingsUpdated += OnSettingsUpdated;
            if (expandMode == AutoExpandMode.Disable)
            {
                outlining.Enabled = false;
            }
            else if (expandMode == AutoExpandMode.Expand)
            {
                // in most cases, this is enough to
                // expand all outlining as necessary.
                // However, it does not appear to work
                // if the solution is just opened
                // so take notice of when regions are
                // collapsed and do it again just in case
                this.theView.LayoutChanged             += OnLayoutChanged;
                this.outliningManager.RegionsCollapsed += OnRegionsCollapsed;
            }
        }