예제 #1
0
        private void showCompletionWindow(WordData wd)
        {
            if (wd.Word.Length < 3)
            {
                return;
            }

            List <MyCompletionData> list = new List <MyCompletionData>();

            foreach (var str in ScriptEnv.AutoCompleteList)
            {
                string text = str as String;

                if (text.Contains(wd.Word))
                {
                    list.Add(new MyCompletionData(text, wd));
                }
            }

            if (list.Count > 0)
            {
                mCompletionWindow = new CompletionWindow(textEditor.TextArea);
                IList <ICompletionData> data = mCompletionWindow.CompletionList.CompletionData;

                foreach (MyCompletionData cd in list)
                {
                    data.Add(cd);
                }

                mCompletionWindow.Width = 512;
                mCompletionWindow.Show();
                mCompletionWindow.Closed += delegate
                {
                    mCompletionWindow = null;
                };
            }
            else
            {
                if (mCompletionWindow != null)
                {
                    mCompletionWindow.Close();
                }
            }
        }
예제 #2
0
 public MyCompletionData(string text, WordData wd)
 {
     Text      = text;
     mWordData = wd;
 }