コード例 #1
0
        public static CodeCompletionKeyHandler Attach(IntellisenseEditor mainForm, TextEditorControl editor)
        {
            CodeCompletionKeyHandler h = new CodeCompletionKeyHandler(mainForm, editor);

            editor.ActiveTextAreaControl.TextArea.KeyEventHandler += h.TextAreaKeyEventHandler;

            // When the editor is disposed, close the code completion window
            editor.Disposed += h.CloseCodeCompletionWindow;

            return(h);
        }
コード例 #2
0
        public void txtScriptTest()
        {
            frmScript target = new frmScript();                    // TODO: Initialize to an appropriate value

            IntellisenseEditor.IntellisenseEditor expected = null; // TODO: Initialize to an appropriate value
            IntellisenseEditor.IntellisenseEditor actual;
            target.txtScript = expected;
            actual           = target.txtScript;
            Assert.AreEqual(expected, actual);
            Assert.Inconclusive("Verify the correctness of this test method.");
        }
コード例 #3
0
        public static void Register(IntellisenseEditor mainForm)
        {
            // Must be implemented. Gets the parse information for the specified file.
            HostCallback.GetParseInformation = delegate(string fileName) {
                if (fileName != mainForm.DummyFileName)
                {
                    throw new Exception("Unknown file");
                }
                if (mainForm.lastCompilationUnit == null)
                {
                    return(null);
                }
                ParseInformation pi = new ParseInformation();
                pi.ValidCompilationUnit = mainForm.lastCompilationUnit;
                return(pi);
            };

            // Must be implemented. Gets the project content of the active project.
            HostCallback.GetCurrentProjectContent = delegate {
                return(mainForm.myProjectContent);
            };

            // The default implementation just logs to Log4Net. We want to display a MessageBox.
            // Note that we use += here - in this case, we want to keep the default Log4Net implementation.
            HostCallback.ShowError += delegate(string message, Exception ex) {
                MessageBox.Show(message + Environment.NewLine + ex.ToString());
            };
            HostCallback.ShowMessage += delegate(string message) {
                MessageBox.Show(message);
            };
            HostCallback.ShowAssemblyLoadError += delegate(string fileName, string include, string message) {
                MessageBox.Show("Error loading code-completion information for "
                                + include + " from " + fileName
                                + ":\r\n" + message + "\r\n");
            };
        }
コード例 #4
0
 private CodeCompletionKeyHandler(IntellisenseEditor mainForm, TextEditorControl editor)
 {
     this.mainForm = mainForm;
     this.editor   = editor;
 }
コード例 #5
0
 public CodeCompletionProvider(IntellisenseEditor mainForm)
 {
     this.mainForm = mainForm;
 }