Exemplo n.º 1
0
 public QuickInfoSession(QuickInfoState state, SnapshotPoint triggerPoint, bool trackMouse, IQuickInfoBroker quickInfoBroker, ITextView textView)
 {
     if (state.QuickInfoService == null)
     {
         throw new ArgumentException();
     }
     if (triggerPoint.Snapshot != state.Snapshot)
     {
         throw new ArgumentNullException(nameof(triggerPoint));
     }
     if (quickInfoBroker == null)
     {
         throw new ArgumentNullException(nameof(quickInfoBroker));
     }
     if (textView == null)
     {
         throw new ArgumentNullException(nameof(textView));
     }
     State                        = state;
     this.triggerPoint            = triggerPoint;
     this.trackMouse              = trackMouse;
     this.quickInfoBroker         = quickInfoBroker;
     this.textView                = textView;
     this.cancellationTokenSource = new CancellationTokenSource();
     this.cancellationToken       = cancellationTokenSource.Token;
 }
Exemplo n.º 2
0
		public QuickInfoSession(QuickInfoState state, SnapshotPoint triggerPoint, bool trackMouse, IQuickInfoBroker quickInfoBroker, ITextView textView) {
			if (state.QuickInfoService == null)
				throw new ArgumentException();
			if (triggerPoint.Snapshot != state.Snapshot)
				throw new ArgumentNullException(nameof(triggerPoint));
			if (quickInfoBroker == null)
				throw new ArgumentNullException(nameof(quickInfoBroker));
			if (textView == null)
				throw new ArgumentNullException(nameof(textView));
			State = state;
			this.triggerPoint = triggerPoint;
			this.trackMouse = trackMouse;
			this.quickInfoBroker = quickInfoBroker;
			this.textView = textView;
			cancellationTokenSource = new CancellationTokenSource();
			cancellationToken = cancellationTokenSource.Token;
		}
Exemplo n.º 3
0
        public bool TryTrigger(SnapshotPoint point, bool trackMouse)
        {
            if (point.Snapshot == null)
            {
                throw new ArgumentException();
            }
            var info = QuickInfoState.Create(point.Snapshot);

            if (info == null)
            {
                return(false);
            }

            currentQuickInfoSession?.Dispose();
            currentQuickInfoSession           = new QuickInfoSession(info.Value, point, trackMouse, quickInfoBroker, textView);
            currentQuickInfoSession.Disposed += QuickInfoSession_Disposed;
            currentQuickInfoSession.Start();

            return(true);
        }