Exemplo n.º 1
0
        public virtual TextTipData GetTextTipData()
        {
            if (this.textTipData != null)
            {
                return(textTipData);
            }

            // create it
            this.textTipData = new TextTipData(this.service.site);
            return(this.textTipData);
        }
Exemplo n.º 2
0
        /// <include file='doc\ViewFilter.uex' path='docs/doc[@for="ViewFilter.HandleQuickInfo"]/*' />
        /// <summary>This method is called to handle the VsCommands2K.QUICKINFO command.</summary>
        public virtual void HandleQuickInfo()
        {
            TextSpan ts = new TextSpan();

            // Get the caret position
            NativeMethods.ThrowOnFailure(this.textView.GetCaretPos(out ts.iStartLine, out ts.iStartIndex));
            ts.iEndLine  = ts.iStartLine;
            ts.iEndIndex = ts.iStartIndex;

            // Get the tip text at that location.
            // Wait, since the user specifically requested this one...
            string text = this.source.OnSyncQuickInfo(this.textView, ts.iEndLine, ts.iEndIndex);

            if (text == null)   // nothing to show
            {
                return;
            }

            string fullText;

            NativeMethods.ThrowOnFailure(GetFullDataTipText(text, ts, out fullText));

            if (fullText == null)
            {
                return;
            }

            int iPos, iPosEnd, iSpace, iLength;

            // Calculate the stream position
            NativeMethods.ThrowOnFailure(textView.GetNearestPosition(ts.iStartLine, ts.iStartIndex, out iPos, out iSpace));
            NativeMethods.ThrowOnFailure(textView.GetNearestPosition(ts.iEndLine, ts.iEndIndex, out iPosEnd, out iSpace));
            iLength = Math.Max(iPosEnd - iPos, 1);

            // Tear down the method tip window if it's there
            this.source.DismissCompletor();

            // Update the text tip window
            TextTipData textTipData = this.TextTipData;

            textTipData.Update(fullText, iPos, iLength, this.textView);
        }
Exemplo n.º 3
0
 /// <include file='doc\ViewFilter.uex' path='docs/doc[@for="ViewFilter.Dispose"]/*' />
 public virtual void Dispose()
 {
     if (this.textView != null)
     {
         Marshal.ReleaseComObject(this.textView);
         this.textView = null;
     }
     this.service = null;
     if (this.nextTarget != null)
     {
         Marshal.ReleaseComObject(this.nextTarget);
         this.nextTarget = null;
     }
     this.textTipData = null;
     this.mgr         = null;
     if (this.pvaChar != IntPtr.Zero)
     {
         Marshal.FreeCoTaskMem(pvaChar);
         pvaChar = IntPtr.Zero;
     }
     GC.SuppressFinalize(this);
 }
Exemplo n.º 4
0
        /// <include file='doc\ViewFilter.uex' path='docs/doc[@for="ViewFilter.Close"]/*' />
        public virtual void Close()
        {
            Trace.WriteLine("ViewFilter::Close");

            if (textViewEvents != null)
            {
                textViewEvents.Dispose();
                textViewEvents = null;
            }

            if (textView == this.service.LastActiveTextView)
            {
                this.service.OnActiveViewChanged(null);
            }

            textView.RemoveCommandFilter(this); // do not care about HRESULT.
            if (textTipData != null)
            {
                textTipData.Close(textView);
                textTipData = null;
            }

            Dispose();
        }
Exemplo n.º 5
0
    public virtual TextTipData GetTextTipData() {
      if (this.textTipData != null)
        return textTipData;

      // create it 
      this.textTipData = new TextTipData(this.service.site);      
      return this.textTipData;
    }
Exemplo n.º 6
0
        /// <include file='doc\ViewFilter.uex' path='docs/doc[@for="ViewFilter.Close"]/*' />
        public virtual void Close() {
            Trace.WriteLine("ViewFilter::Close");

            if (textViewEvents != null) {
                textViewEvents.Dispose();
                textViewEvents = null;
            }

            if (textView == this.service.LastActiveTextView)
                this.service.OnActiveViewChanged(null);

            textView.RemoveCommandFilter(this); // do not care about HRESULT.
            if (textTipData != null) {
                textTipData.Close(textView);
                textTipData = null;
            }

            Dispose();
        }
Exemplo n.º 7
0
 /// <include file='doc\ViewFilter.uex' path='docs/doc[@for="ViewFilter.Dispose"]/*' />
 public virtual void Dispose() {
     if (this.textView != null) {
         Marshal.ReleaseComObject(this.textView);
         this.textView = null;
     }
     this.service = null;
     if (this.nextTarget != null) {
         Marshal.ReleaseComObject(this.nextTarget);
         this.nextTarget = null;
     }
     this.textTipData = null;
     this.mgr = null;
     if (this.pvaChar != IntPtr.Zero) {
         Marshal.FreeCoTaskMem(pvaChar);
         pvaChar = IntPtr.Zero;
     }
     GC.SuppressFinalize(this);
 }