예제 #1
0
        public override List <ICompletionData> GetCompletionData(string txt, SelectedContentArgs SelectedContentArgs)
        {
            List <ICompletionData> list = new List <ICompletionData>();

            string        CurrentLine     = SelectedContentArgs.CaretLineText().TrimStart();
            bool          IsAtStartOfLine = CurrentLine.Length == 1;
            List <string> KeyWords        = mPlugInTextFileEditor.CompletionDataKeyWords;

            if (SelectedContentArgs.IsAtStartOfLine() || IsAtStartOfLine)
            {
                foreach (string KeyWord in KeyWords)
                {
                    if (txt.ToUpper() == KeyWord.Substring(0, 1).ToUpper())
                    {
                        list.Add(new PlugInTextCompletionData(KeyWord, mPlugInTextFileEditor.CompletionDataKeyWords));
                    }
                }
            }
            return(list);
        }
예제 #2
0
        public override Page GetSelectedContentPageEditor(SelectedContentArgs SelectedContentArgs)
        {
            ReadOnlyCollection <FoldingSection> list = SelectedContentArgs.GetFoldingsAtCaretPosition();

            if (list == null)
            {
                return(null);
            }
            if (list.Count > 0)
            {
                string txt          = list[0].TextContent;
                string StartKeyWord = mPlugInTextFileEditor.TableEditorPageDict["StartKeyWord"];
                string EndKeyWord   = mPlugInTextFileEditor.TableEditorPageDict["EndKeyWord"];
                string KeyWordForTableLocationIndication = mPlugInTextFileEditor.TableEditorPageDict["KeyWordForTableLocationIndication"];
                int    CaretPosition = SelectedContentArgs.CaretPosition - SelectedContentArgs.GetFoldingOffSet();

                int StartKeyWordPosition = txt.IndexOf(StartKeyWord);
                int EndKeyWordPosition   = txt.IndexOf(EndKeyWord);
                int KeyWordForTableLocationIndicationPosition = txt.IndexOf(KeyWordForTableLocationIndication);

                string TextAfterKeyWordForTableLocationIndication = string.Empty;
                if (KeyWordForTableLocationIndicationPosition != -1)
                {
                    TextAfterKeyWordForTableLocationIndication = txt.Substring(KeyWordForTableLocationIndicationPosition);
                }

                int AfterKeyWordStartKeyWordPosition = KeyWordForTableLocationIndicationPosition + TextAfterKeyWordForTableLocationIndication.IndexOf(StartKeyWord);
                int AfterKeyWordEndKeyWordPosition   = KeyWordForTableLocationIndicationPosition + TextAfterKeyWordForTableLocationIndication.IndexOf(EndKeyWord);

                if ((CaretPosition > StartKeyWordPosition && CaretPosition < EndKeyWordPosition) || (CaretPosition > AfterKeyWordStartKeyWordPosition && CaretPosition < AfterKeyWordEndKeyWordPosition))
                {
                    TableEditorPage p = new TableEditorPage(SelectedContentArgs, StartKeyWord, EndKeyWord, KeyWordForTableLocationIndication);
                    return(p);
                }
            }
            return(null);
        }
예제 #3
0
 public override List <ICompletionData> GetCompletionData(string txt, SelectedContentArgs SelectedContentArgs)
 {
     // throw new System.NotImplementedException();
     return(null);
 }
예제 #4
0
 public override Page GetSelectedContentPageEditor(SelectedContentArgs SelectedContentArgs)
 {
     // throw new System.NotImplementedException();
     return(null);
 }