Esempio n. 1
0
 public int GetSearchImage(uint grfOptions, IVsTextSpanSet[] ppSpans, out IVsTextImage ppTextImage)
 {
     if (_findTarget != null)
     {
         return(_findTarget.GetSearchImage(grfOptions, ppSpans, out ppTextImage));
     }
     ppTextImage = null;
     return(VSConstants.E_NOTIMPL);
 }
Esempio n. 2
0
        int IVsFindTarget.GetSearchImage(uint grfOptions, IVsTextSpanSet[] ppSpans, out IVsTextImage ppTextImage)
        {
            IVsFindTarget findTarget = GetView(sourceFrame) as IVsFindTarget;

            if (findTarget != null)
            {
                return(findTarget.GetSearchImage(grfOptions, ppSpans, out ppTextImage));
            }
            ppTextImage = null;
            return(VSConstants.E_NOTIMPL);
        }
Esempio n. 3
0
        /// <summary>
        /// 
        /// </summary>
        /// <param name="grfOptions"></param>
        /// <param name="ppSpans"></param>
        /// <param name="ppTextImage"></param>
        int IVsFindTarget.GetSearchImage(uint grfOptions, IVsTextSpanSet[] ppSpans, out IVsTextImage ppTextImage)
        {
            throw new NotImplementedException();//huqf
            ////set the IVsTextSpanSet object
            //if (null != ppSpans && ppSpans.Length > 0)
            //{
            //    ppSpans[0] = (IVsTextSpanSet)this;
            //}

            ////set the IVsTextImage object
            //ppTextImage = (IVsTextImage)this;

            ////attach this text image to the span
            //if (null != ppSpans && ppSpans.Length > 0)
            //{
            //    ErrorHandler.ThrowOnFailure(ppSpans[0].AttachTextImage(ppTextImage));
            //}

            //return VSConstants.S_OK;
        }
Esempio n. 4
0
        /// <summary>
        /// To Release a text image
        /// </summary>
        /// <returns></returns>
        int IVsTextSpanSet.Detach()
        {
            spTextImage = null;
            textSpanArray.RemoveRange(0, textSpanArray.Count);

            return VSConstants.S_OK;
        }
Esempio n. 5
0
        /// <summary>
        /// The environment uses this to get a text image
        /// </summary>
        /// <param name="pText">Pointer to the text image</param>
        /// <returns></returns>
        int IVsTextSpanSet.AttachTextImage(object pText)
        {
            if (null == pText)
                return VSConstants.E_INVALIDARG;

            if (null != spTextImage)
            {
                if (spTextImage.Equals(pText))
                    return VSConstants.S_OK;
            }

            spTextImage = (IVsTextImage)this;

            //get the number of lines in the Text Image
            int lineCount = 0;
            ErrorHandler.ThrowOnFailure(spTextImage.GetLineSize(out lineCount));

            //create a text span for the entire text image
            TextSpan textSpan = new TextSpan();
            textSpan.iStartLine = 0;
            textSpan.iStartIndex = 0;
            textSpan.iEndLine = 0;

            //get the length of the last line
            int lastLineLength = 0;
            if (lineCount > 0)
            {
                textSpan.iEndLine = lineCount - 1;
                ErrorHandler.ThrowOnFailure(spTextImage.GetLineLength(lineCount - 1, out lastLineLength));
            }

            //set the end index corresponding to the last line length
            textSpan.iEndIndex = lastLineLength;

            //add it to the text span array
            textSpanArray.Add(textSpan);

            return VSConstants.S_OK;
        }
Esempio n. 6
0
        /// <summary>
        /// 
        /// </summary>
        /// <param name="grfOptions"></param>
        /// <param name="ppSpans"></param>
        /// <param name="ppTextImage"></param>
        int IVsFindTarget.GetSearchImage(uint grfOptions, IVsTextSpanSet[] ppSpans, out IVsTextImage ppTextImage)
        {
            //set the IVsTextSpanSet object
            if (null != ppSpans && ppSpans.Length > 0)
            {
                ppSpans[0] = (IVsTextSpanSet)this;
            }

            //set the IVsTextImage object
            ppTextImage = (IVsTextImage)this;

            //attach this text image to the span
            if (null != ppSpans && ppSpans.Length > 0)
            {
                ErrorHandler.ThrowOnFailure(ppSpans[0].AttachTextImage(ppTextImage));
            }

            return VSConstants.S_OK;
        }
Esempio n. 7
0
 int IVsFindTarget.GetSearchImage(uint grfOptions, IVsTextSpanSet[] ppSpans, out IVsTextImage ppTextImage) => ((IVsFindTarget)_editorWindow).GetSearchImage(grfOptions, ppSpans, out ppTextImage);
Esempio n. 8
0
 public int GetSearchImage(uint grfOptions, IVsTextSpanSet[] ppSpans, out IVsTextImage ppTextImage)
 {
     return (CommandWindow.VsCodeWindow as IVsFindTarget).GetSearchImage(grfOptions, ppSpans, out ppTextImage);
 }
Esempio n. 9
0
 /// <summary>
 /// Not implemented.
 /// We don't need this function since we implement Find and Replace
 /// </summary>
 /// <param name="grfOptions"></param>
 /// <param name="ppSpans"></param>
 /// <param name="ppTextImage"></param>
 public int GetSearchImage(uint grfOptions, IVsTextSpanSet[] ppSpans, out IVsTextImage ppTextImage)
 {
     ppTextImage = null;
     return VSConstants.E_NOTIMPL; // "GetSearchImage is not implemented, Find and Replace should be used instead"
 }
 public int GetSearchImage(uint grfOptions, IVsTextSpanSet[] ppSpans, out IVsTextImage ppTextImage)
 {
     var findTarget = (IVsFindTarget)_vsCodeWindow;
     return findTarget.GetSearchImage(grfOptions, ppSpans, out ppTextImage);
 }
 public int GetSearchImage(uint grfOptions, IVsTextSpanSet[] ppSpans, out IVsTextImage ppTextImage)
 {
     ppTextImage = null;
     return EditorFindTarget == null ? 0
            : EditorFindTarget.GetSearchImage(grfOptions, ppSpans, out ppTextImage);
 }
        public int GetSearchImage(uint grfOptions, IVsTextSpanSet[] ppSpans, out IVsTextImage ppTextImage)
        {
            var findTarget = (IVsFindTarget)_vsCodeWindow;

            return(findTarget.GetSearchImage(grfOptions, ppSpans, out ppTextImage));
        }
Esempio n. 13
0
 public int GetSearchImage(uint grfOptions, IVsTextSpanSet[] ppSpans, out IVsTextImage ppTextImage)
 {
     return((CommandWindow.VsCodeWindow as IVsFindTarget).GetSearchImage(grfOptions, ppSpans, out ppTextImage));
 }
Esempio n. 14
0
 /// <summary>
 ///
 /// </summary>
 /// <param name="grfOptions"></param>
 /// <param name="ppSpans"></param>
 /// <param name="ppTextImage"></param>
 int IVsFindTarget.GetSearchImage(uint grfOptions, IVsTextSpanSet[] ppSpans, out IVsTextImage ppTextImage)
 {
     return(((IVsFindTarget)_subCodeWindow).GetSearchImage(grfOptions, ppSpans, out ppTextImage));
 }
 int IVsFindTarget.GetSearchImage(uint grfOptions, IVsTextSpanSet[] ppSpans, out IVsTextImage ppTextImage)
 {
     ppTextImage = null;
     try
     {
         ppTextImage = GetTextImage();
     }
     catch { }
     return ppTextImage == null ? VSConstants.E_NOTIMPL : VSConstants.S_OK;
 }
Esempio n. 16
0
 public int GetSearchImage(uint grfOptions, IVsTextSpanSet[] ppSpans, out IVsTextImage ppTextImage)
 {
     return(EditorFindTarget.GetSearchImage(grfOptions, ppSpans, out ppTextImage));
 }
Esempio n. 17
0
 /// <summary>
 /// Not implemented.
 /// We don't need this function since we implement Find and Replace
 /// </summary>
 /// <param name="grfOptions"></param>
 /// <param name="ppSpans"></param>
 /// <param name="ppTextImage"></param>
 public int GetSearchImage(uint grfOptions, IVsTextSpanSet[] ppSpans, out IVsTextImage ppTextImage)
 {
     ppTextImage = null;
     return(VSConstants.E_NOTIMPL); // "GetSearchImage is not implemented, Find and Replace should be used instead"
 }
Esempio n. 18
0
 public int GetSearchImage(uint grfOptions, IVsTextSpanSet[] ppSpans, out IVsTextImage ppTextImage)
 {
     if (_findTarget != null)
     {
         return _findTarget.GetSearchImage(grfOptions, ppSpans, out ppTextImage);
     }
     ppTextImage = null;
     return VSConstants.E_NOTIMPL;
 }