예제 #1
0
 public static bool CanGenerateRealization(TextArea textArea)
 {
     try
     {
         if (CodeCompletion.CodeCompletionController.CurrentParser == null)
         {
             return(false);
         }
         ccp = new CodeCompletionProvider();
         Position pos = new Position();
         //string text = "procedure Test(a : integer);\n begin \n x := 1; \n end;";//ccp.GetRealizationTextToAdd(out pos);
         string text = ccp.GetRealizationTextToAdd(textArea.MotherTextEditorControl.FileName, textArea.Caret.Line, textArea.Caret.Column, ref pos, textArea);
         return(text != null && pos.file_name != null);
     }
     catch (Exception e)
     {
         return(false);
     }
 }
예제 #2
0
        public static void GenerateClassOrMethodRealization(TextArea textArea)
        {
            if (CodeCompletion.CodeCompletionController.CurrentParser == null)
            {
                return;
            }
            ccp = new CodeCompletionProvider();
            Position pos = new Position();
            //string text = "procedure Test(a : integer);\n begin \n x := 1; \n end;";//ccp.GetRealizationTextToAdd(out pos);
            string text = ccp.GetRealizationTextToAdd(textArea.MotherTextEditorControl.FileName, textArea.Caret.Line, textArea.Caret.Column, ref pos, textArea);

            if (text != null && pos.file_name != null)
            {
                textArea.Caret.Line   = pos.line - 1;
                textArea.Caret.Column = pos.column - 1;
                textArea.InsertString(text);
                textArea.Caret.Line   = pos.line + 4 - 1;
                textArea.Caret.Column = VisualPABCSingleton.MainForm.UserOptions.CursorTabCount + 1;
            }
        }
 public static void GenerateClassOrMethodRealization(TextArea textArea)
 {
     if (CodeCompletion.CodeCompletionController.CurrentParser == null) return;
     ccp = new CodeCompletionProvider();
     Position pos = new Position();
     //string text = "procedure Test(a : integer);\n begin \n x := 1; \n end;";//ccp.GetRealizationTextToAdd(out pos);
     string text = ccp.GetRealizationTextToAdd(textArea.MotherTextEditorControl.FileName, textArea.Caret.Line, textArea.Caret.Column, ref pos, textArea);
     if (text != null && pos.file_name != null)
     {
         textArea.Caret.Line = pos.line - 1;
         textArea.Caret.Column = pos.column - 1;
         textArea.InsertString(text);
         textArea.Caret.Line = pos.line + 4 - 1;
         textArea.Caret.Column = VisualPABCSingleton.MainForm.UserOptions.CursorTabCount + 1;
     }
 }
 public static bool CanGenerateRealization(TextArea textArea)
 {
     try
     {
         if (CodeCompletion.CodeCompletionController.CurrentParser == null) return false;
         ccp = new CodeCompletionProvider();
         Position pos = new Position();
         //string text = "procedure Test(a : integer);\n begin \n x := 1; \n end;";//ccp.GetRealizationTextToAdd(out pos);
         string text = ccp.GetRealizationTextToAdd(textArea.MotherTextEditorControl.FileName, textArea.Caret.Line, textArea.Caret.Column, ref pos, textArea);
         return text != null && pos.file_name != null;
     }
     catch (Exception e)
     {
         return false;
     }
 }