Exemple #1
0
        public bool InsertAction(TextArea textArea, char ch)
        {
            if (dotnetName != null)
            {
                CodeCompletionDataUsageCache.IncrementUsage(dotnetName);
            }
            IClass c = this.Class;

            if (c != null && text.Length > c.Name.Length)
            {
                textArea.InsertString(text.Substring(0, c.Name.Length + 1));
                TextLocation start = textArea.Caret.Position;
                TextLocation end;
                int          pos = text.IndexOf(',');
                if (pos < 0)
                {
                    textArea.InsertString(text.Substring(c.Name.Length + 1));
                    end    = textArea.Caret.Position;
                    end.X -= 1;
                }
                else
                {
                    textArea.InsertString(text.Substring(c.Name.Length + 1, pos - c.Name.Length - 1));
                    end = textArea.Caret.Position;
                    textArea.InsertString(text.Substring(pos));
                }
                textArea.Caret.Position = start;
                textArea.SelectionManager.SetSelection(start, end);
                if (!char.IsLetterOrDigit(ch))
                {
                    return(true);
                }
            }
            else
            {
                textArea.InsertString(text);
            }
            return(false);
        }
Exemple #2
0
 void InitializePriority(string dotnetName)
 {
     this.dotnetName = dotnetName;
     priority        = CodeCompletionDataUsageCache.GetPriority(dotnetName, true);
 }