예제 #1
0
 public void Dismiss()
 {
     if (IsDismissed)
     {
         return;
     }
     IsDismissed      = true;
     TextView.Closed -= TextView_Closed;
     completionSessionCommandTargetFilter?.Close();
     completionSessionCommandTargetFilter = null;
     Dismissed?.Invoke(this, EventArgs.Empty);
     if (completionSources != null)
     {
         foreach (var source in completionSources)
         {
             source.Dispose();
         }
         completionSources = null;
     }
 }
예제 #2
0
        public void Start()
        {
            if (IsStarted)
            {
                throw new InvalidOperationException();
            }
            if (IsDismissed)
            {
                throw new InvalidOperationException();
            }
            IsStarted         = true;
            completionSources = CreateCompletionSources();

            var list = new List <CompletionSet>();

            foreach (var source in completionSources)
            {
                source.AugmentCompletionSession(this, list);
            }
            foreach (var cc in list)
            {
                completionSets.Add(cc);
            }

            if (completionSets.Count == 0)
            {
                Dismiss();
            }
            else
            {
                SelectedCompletionSet = completionSets[0];
                completionPresenter   = intellisensePresenterFactoryService.TryCreateIntellisensePresenter(this);
                if (completionPresenter == null)
                {
                    Dismiss();
                    return;
                }
                PresenterChanged?.Invoke(this, EventArgs.Empty);
                completionSessionCommandTargetFilter = new CompletionSessionCommandTargetFilter(this);
            }
        }
예제 #3
0
        public void Start()
        {
            if (IsStarted)
            {
                throw new InvalidOperationException();
            }
            if (IsDismissed)
            {
                throw new InvalidOperationException();
            }
            IsStarted = true;
            this.completionSources = CreateCompletionSources();

            var list = new List <CompletionCollection>();

            foreach (var source in completionSources)
            {
                source.AugmentCompletionSession(this, list);
            }
            foreach (var cc in list)
            {
                completionCollections.Add(cc);
            }

            if (completionCollections.Count == 0)
            {
                Dismiss();
            }
            else
            {
                SelectedCompletionCollection = completionCollections[0];
                completionPresenter          = completionPresenterProvider.Create(this);
                Debug.Assert(completionPresenter != null);
                PresenterChanged?.Invoke(this, EventArgs.Empty);
                completionSessionCommandTargetFilter = new CompletionSessionCommandTargetFilter(this);
            }
        }
예제 #4
0
		public void Dismiss() {
			if (IsDismissed)
				return;
			IsDismissed = true;
			TextView.Closed -= TextView_Closed;
			completionSessionCommandTargetFilter?.Close();
			completionSessionCommandTargetFilter = null;
			Dismissed?.Invoke(this, EventArgs.Empty);
			if (completionSources != null) {
				foreach (var source in completionSources)
					source.Dispose();
				completionSources = null;
			}
		}
예제 #5
0
		public void Start() {
			if (IsStarted)
				throw new InvalidOperationException();
			if (IsDismissed)
				throw new InvalidOperationException();
			IsStarted = true;
			completionSources = CreateCompletionSources();

			var list = new List<CompletionSet>();
			foreach (var source in completionSources)
				source.AugmentCompletionSession(this, list);
			foreach (var cc in list)
				completionSets.Add(cc);

			if (completionSets.Count == 0)
				Dismiss();
			else {
				SelectedCompletionSet = completionSets[0];
				completionPresenter = intellisensePresenterFactoryService.TryCreateIntellisensePresenter(this);
				if (completionPresenter == null) {
					Dismiss();
					return;
				}
				PresenterChanged?.Invoke(this, EventArgs.Empty);
				completionSessionCommandTargetFilter = new CompletionSessionCommandTargetFilter(this);
			}
		}