示例#1
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>
        /// <param name="languageService">The Lua LanguageService.</param>
        public CodeOutlineCache(SourceOutlinerControl control, DTE dte, LanguageService languageService)
        {
            Debug.Assert(control != null);
            Debug.Assert(dte != null);

            this.languageService = languageService;
            this.control = control;
            this.dte = dte;

            // Initialize the events.
            AdviseCodeModelEvents();
        }
示例#2
0
        /// <summary>
        /// Initializes a new instance of the SourceOutlineToolWindow class.
        /// </summary>
        public SourceOutlineToolWindow()
            : base(null)
        {
            Caption = Resources.ToolWindowTitle;

            // 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 (LuaCodeElementType)))
            {
                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;
        }
示例#3
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>
        /// <param name="languageService">The Lua LanguageService.</param>
        public CodeOutlineFileManager(SourceOutlinerControl control, DTE dte,
            Document d, SourceOutlineToolWindow toolWindow, LanguageService languageService)
        {
            this.languageService = languageService;
            this.control = control;
            this.dte = dte;
            sourceOutlineToolWindow = toolWindow;
            viewType = ViewType.TreeView;
            searchCriteria = new SearchCriteria(CodeElementType.All);
            currentFilterText = "";
            currentDocument = d;

            codeTreeView = new TreeView();
            codeFilterView = new TreeView();

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

            //
            // codeFilterView
            //
            codeFilterView.Dock = DockStyle.Fill;
            codeFilterView.HideSelection = false;
            codeFilterView.Location = new Point(0, 45);
            codeFilterView.Name = "codeFilterView";
            codeFilterView.ShowNodeToolTips = true;
            codeFilterView.Size = new Size(352, 294);
            codeFilterView.TabIndex = 3;
            codeFilterView.Visible = false;
            codeFilterView.ShowLines = false;
            codeFilterView.ShowRootLines = false;
            codeFilterView.FullRowSelect = true;
        }