示例#1
0
        private void ActivatePlugin()
        {
            ModuleProxy.GetInstance().Module = this;

            _applicationManager = ApplicationManager.GetInstance();
            _codeAssistManager  = CodeAssistManager.GetInstance();

            ToolStripMenuItem editMenu = _mainForm.GetMenuItemByName(
                QuickSharp.Editor.Constants.UI_EDIT_MENU);

            if (editMenu == null)
            {
                return;
            }

            _codeAssist = MenuTools.CreateMenuItem(
                Constants.UI_EDIT_MENU_CODE_ASSIST,
                Resources.MainEditMenuCodeAssist,
                null,
                Keys.Control | Keys.Space, null,
                UI_EDIT_MENU_CODE_ASSIST_Click);

            _codeAssist.Enabled = false;

            editMenu.DropDownItems.Add(_codeAssist);

            _mainForm.ClientWindow.ActiveDocumentChanged +=
                new EventHandler(_mainForm_ActiveDocumentChanged);
        }
示例#2
0
        /// <summary>
        /// Get a reference to the CodeAssistManager singleton.
        /// </summary>
        /// <returns>A reference to the CodeAssistMananger.</returns>
        public static CodeAssistManager GetInstance()
        {
            if (_singleton == null)
            {
                _singleton = new CodeAssistManager();
            }

            return(_singleton);
        }