Esempio n. 1
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;
        }
Esempio n. 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>
        /// <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();
        }