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); }
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); }
/// <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; }
/// <summary> /// To Release a text image /// </summary> /// <returns></returns> int IVsTextSpanSet.Detach() { spTextImage = null; textSpanArray.RemoveRange(0, textSpanArray.Count); return VSConstants.S_OK; }
/// <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; }
/// <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; }
int IVsFindTarget.GetSearchImage(uint grfOptions, IVsTextSpanSet[] ppSpans, out IVsTextImage ppTextImage) => ((IVsFindTarget)_editorWindow).GetSearchImage(grfOptions, ppSpans, out ppTextImage);
public int GetSearchImage(uint grfOptions, IVsTextSpanSet[] ppSpans, out IVsTextImage ppTextImage) { return (CommandWindow.VsCodeWindow as IVsFindTarget).GetSearchImage(grfOptions, ppSpans, out ppTextImage); }
/// <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)); }
public int GetSearchImage(uint grfOptions, IVsTextSpanSet[] ppSpans, out IVsTextImage ppTextImage) { return((CommandWindow.VsCodeWindow as IVsFindTarget).GetSearchImage(grfOptions, ppSpans, out ppTextImage)); }
/// <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; }
public int GetSearchImage(uint grfOptions, IVsTextSpanSet[] ppSpans, out IVsTextImage ppTextImage) { return(EditorFindTarget.GetSearchImage(grfOptions, ppSpans, out ppTextImage)); }
/// <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) { if (_findTarget != null) { return _findTarget.GetSearchImage(grfOptions, ppSpans, out ppTextImage); } ppTextImage = null; return VSConstants.E_NOTIMPL; }