Пример #1
0
        // Declared Public for unit testing.

        /// <summary>
        /// Initializes a new instance of the SourceOutlineToolWindow class.
        /// </summary>
        public SourceOutlinerToolWindow() : base(null)
        {
            Caption = Resources.SourceOutlinerWindowTitle;

            // Set the image that will appear on the tab of the window frame
            // when docked with another window.
            // The resource ID correspond to the one defined in the resx file,
            // while the Index is the offset in the bitmap strip. Each image in
            // the strip is 16x16.
            BitmapResourceID = 301;
            BitmapIndex      = 1;

            _control = new SourceOutlinerControl();

            // Populate the filter dropdown in the combo box with the
            // list of possible code elements to be displayed.
            foreach (string name in Enum.GetNames(typeof(CodeElementType)))
            {
                _control.filterToolStripCombo.Items.Add(name);
            }
            _control.filterToolStripCombo.SelectedIndex = 0;

            // Wire up the event handlers for the UI.
            _control.filterToolStripCombo.SelectedIndexChanged += toolStripComboBox_SelectedIndexChanged;
            _control.filterStringTextBox.TextChanged           += filterStringTextBox_TextChanged;
            _control.filterStringTextBox.KeyDown   += filterStringTextBox_KeyDown;
            _control.filterStringTextBox.KeyPress  += filterStringTextBox_KeyPress;
            _control.filterStringTextBox.MouseDown += filterStringTextBox_MouseDown;
            _control.filterStringTextBox.Enter     += filterStringTextBox_Enter;
            _control.filterStringTextBox.Leave     += filterStringTextBox_Leave;
            _control.clearFilterButton.Click       += clearFilterButton_Click;
        }
Пример #2
0
        /// <summary>
        /// Initializes a new instance of the CodeOutlineCache class.
        /// </summary>
        /// <param name="control">The SourceOutlinerControl.</param>
        /// <param name="dte">A DTE object exposing the Visual Studio automation object model.</param>
        public CodeOutlineCache(SourceOutlinerControl control, EnvDTE.DTE dte)
        {
            Debug.Assert(control != null);
            Debug.Assert(dte != null);

            _control = control;
            _dte     = dte;

            // Initialize the events.
            AdviseCodeModelEvents();
        }
Пример #3
0
        /// <summary>
        /// Initializes a new instance of the CodeOutlineCache class.
        /// </summary>
        /// <param name="control">The SourceOutlinerControl.</param>
        /// <param name="dte">A DTE object exposing the Visual Studio automation object model.</param>
        public CodeOutlineCache(SourceOutlinerControl control, EnvDTE.DTE dte)
        {
            Debug.Assert(control != null);
            Debug.Assert(dte != null);

            _control = control;
            _dte = dte;

            // Initialize the events.
            AdviseCodeModelEvents();
        }
Пример #4
0
        /// <summary>
        /// Initializes a new instance of the CodeOutlineFileManager class.
        /// </summary>
        /// <param name="control">The outline control object.</param>
        /// <param name="dte">A DTE object exposing the Visual Studio automation object model.</param>
        /// <param name="d">The source file Document.</param>
        /// <param name="toolWindow">The tool window for the package.</param>
        public CodeOutlineFileManager(SourceOutlinerControl control, EnvDTE.DTE dte,
            Document d, SourceOutlinerToolWindow toolWindow)
        {
            _control = control;
            _dte = dte;
            _sourceOutlinerToolWindow = toolWindow;
            _viewType = ViewType.TreeView;
            _searchCriteria = new SearchCriteria(CodeElementType.All);
            _currentFilterText = "";
            _currentDocument = d;

            _codeTreeView = new System.Windows.Forms.TreeView();
            _codeFilterView = new System.Windows.Forms.TreeView();

            //
            // _codeTreeView
            //
            _codeTreeView.Dock = System.Windows.Forms.DockStyle.Fill;
            _codeTreeView.HideSelection = false;
            _codeTreeView.Location = new System.Drawing.Point(0, 45);
            _codeTreeView.Name = "codeTreeView";
            _codeTreeView.ShowNodeToolTips = true;
            _codeTreeView.Size = new System.Drawing.Size(352, 294);
            _codeTreeView.TabIndex = 2;

            //
            // _codeFilterView
            //
            _codeFilterView.Dock = System.Windows.Forms.DockStyle.Fill;
            _codeFilterView.HideSelection = false;
            _codeFilterView.Location = new System.Drawing.Point(0, 45);
            _codeFilterView.Name = "codeFilterView";
            _codeFilterView.ShowNodeToolTips = true;
            _codeFilterView.Size = new System.Drawing.Size(352, 294);
            _codeFilterView.TabIndex = 3;
            _codeFilterView.Visible = false;
            _codeFilterView.ShowLines = false;
            _codeFilterView.ShowRootLines = false;
            _codeFilterView.FullRowSelect = true;
        }
Пример #5
0
        // Declared Public for unit testing.
        /// <summary>
        /// Initializes a new instance of the SourceOutlineToolWindow class.
        /// </summary>
        public SourceOutlinerToolWindow()
            : base(null)
        {
            Caption = Resources.SourceOutlinerWindowTitle;

            // Set the image that will appear on the tab of the window frame
            // when docked with another window.
            // The resource ID correspond to the one defined in the resx file,
            // while the Index is the offset in the bitmap strip. Each image in
            // the strip is 16x16.
            BitmapResourceID = 301;
            BitmapIndex = 1;

            _control = new SourceOutlinerControl();

            // Populate the filter dropdown in the combo box with the
            // list of possible code elements to be displayed.
            foreach (string name in Enum.GetNames(typeof (CodeElementType)))
            {
                _control.filterToolStripCombo.Items.Add(name);
            }
            _control.filterToolStripCombo.SelectedIndex = 0;

            // Wire up the event handlers for the UI.
            _control.filterToolStripCombo.SelectedIndexChanged += toolStripComboBox_SelectedIndexChanged;
            _control.filterStringTextBox.TextChanged += filterStringTextBox_TextChanged;
            _control.filterStringTextBox.KeyDown += filterStringTextBox_KeyDown;
            _control.filterStringTextBox.KeyPress += filterStringTextBox_KeyPress;
            _control.filterStringTextBox.MouseDown += filterStringTextBox_MouseDown;
            _control.filterStringTextBox.Enter += filterStringTextBox_Enter;
            _control.filterStringTextBox.Leave += filterStringTextBox_Leave;
            _control.clearFilterButton.Click += clearFilterButton_Click;
        }