Esempio n. 1
0
        public override void SelectBestMatch()
        {
            ITextSnapshot snapshot  = ApplicableTo.TextBuffer.CurrentSnapshot;
            string        typedText = ApplicableTo.GetText(snapshot);

            if (string.IsNullOrWhiteSpace(typedText))
            {
                if (this.WritableCompletions.Any())
                {
                    SelectionStatus = new CompletionSelectionStatus(WritableCompletions.First(), true, true);
                }

                return;
            }

            foreach (CrmCompletion comp in WritableCompletions)
            {
                if (comp.IsMatch(typedText))
                {
                    SelectionStatus = new CompletionSelectionStatus(comp, true, true);
                    return;
                }
            }
        }
Esempio n. 2
0
        public override void SelectBestMatch()
        {
            ITextSnapshot snapshot  = ApplicableTo.TextBuffer.CurrentSnapshot;
            string        typedText = ApplicableTo.GetText(snapshot);

            if (string.IsNullOrWhiteSpace(typedText))
            {
                if (this.WritableCompletions.Any())
                {
                    SelectionStatus = new CompletionSelectionStatus(WritableCompletions.First(), true, true);
                }

                return;
            }

            foreach (Completion comp in WritableCompletions)
            {
                if (comp.DisplayText.IndexOf(typedText, StringComparison.InvariantCultureIgnoreCase) > -1)
                {
                    SelectionStatus = new CompletionSelectionStatus(comp, true, true);
                    return;
                }
            }
        }