public bool ReplacePattern(string a, string b, int c, ref EnvDTE.TextRanges d) { return(false); }
public bool ReplacePattern(EnvDTE.TextPoint a, string st1, string st2, int i, ref EnvDTE.TextRanges r) { return(false); }
/// <summary> /// This actually removes the text or, if there are errors, logs them to the task list. /// /// There are six cases to handle: /// <no tags> -> true /// <just a start> -> error /// <just an end> -> error /// <end> <start> -> error /// <start> <start> -> error /// <start> <end> -> success -- remove *and* proceed to loop again! /// </summary> /// <param name="TextDoc"> Document upon which to operate. </param> /// <param name="currentPos"> The current position from which execution should proceed. </param> /// <param name="begin"> String denoting the begin tag to find. </param> /// <param name="end"> String denoting the end tag to find. </param> /// <param name="linesRemoved"> Number of lines that have already been removed from the file. </param> private bool ExtractTextHelper(EnvDTE.Document doc, EnvDTE.EditPoint currentPos, string begin, string end, EnvDTE.ProjectItems projSourceItems, int linesRemoved) { EnvDTE.EditPoint startTagPoint, endTagPoint, nextStartTagPoint; EnvDTE.TextRanges trIgnore = null; bool fGotStart, fGotEnd, fGotNextStart; startTagPoint = currentPos.CreateEditPoint(); endTagPoint = currentPos.CreateEditPoint(); fGotStart = startTagPoint.FindPattern(begin, (int)EnvDTE.vsFindOptions.vsFindOptionsNone, ref startTagPoint, ref trIgnore); fGotEnd = endTagPoint.FindPattern(end, (int)EnvDTE.vsFindOptions.vsFindOptionsNone, ref endTagPoint, ref trIgnore); if (!fGotStart && !fGotEnd) { return(true); } if (fGotStart && !fGotEnd) { // Error, end tag expected after startTagPoint string strError = AMResources.GetLocalizedString("TagValidationMissingEndAfter"); // m_taskWindow.LogErrorToTaskWindow(System.String.Format(strError, end), // projSourceItems.Item(doc.Name).get_FileNames(1), startTagPoint.Line + linesRemoved); return(false); } if (fGotEnd && !fGotStart) { // Error, start tag expected before endTagPoint string strError = AMResources.GetLocalizedString("TagValidationMissingStartBefore"); // m_taskWindow.LogErrorToTaskWindow(System.String.Format(strError, begin), // projSourceItems.Item(doc.Name).get_FileNames(1), endTagPoint.Line + linesRemoved); return(false); } if (endTagPoint.AbsoluteCharOffset < startTagPoint.AbsoluteCharOffset) { // Error, start tag expected before endTagPoint string strError = AMResources.GetLocalizedString("TagValidationMissingStartBefore"); // m_taskWindow.LogErrorToTaskWindow(System.String.Format(strError, begin), // projSourceItems.Item(doc.Name).get_FileNames(1), endTagPoint.Line + linesRemoved); return(false); } nextStartTagPoint = startTagPoint.CreateEditPoint(); fGotNextStart = nextStartTagPoint.FindPattern(begin, (int)EnvDTE.vsFindOptions.vsFindOptionsNone, ref nextStartTagPoint, ref trIgnore); if (fGotNextStart && (endTagPoint.AbsoluteCharOffset > nextStartTagPoint.AbsoluteCharOffset)) { // Error, end tag expected before endTagPoint string strError = AMResources.GetLocalizedString("TagValidationMissingEndBefore"); // m_taskWindow.LogErrorToTaskWindow(System.String.Format(strError, end), // projSourceItems.Item(doc.Name).get_FileNames(1), nextStartTagPoint.Line + linesRemoved); return(false); } if (startTagPoint.AbsoluteCharOffset < endTagPoint.AbsoluteCharOffset) { linesRemoved += (endTagPoint.Line - startTagPoint.Line); startTagPoint.CharLeft(begin.Length); startTagPoint.Delete((object)endTagPoint); return(ExtractTextHelper(doc, endTagPoint, begin, end, projSourceItems, linesRemoved)); } System.Diagnostics.Debug.Assert(false, "Impossible code path followed in ExtractTextHelper()"); return(true); }
public bool FindPattern(string st, int i, ref EnvDTE.EditPoint j, ref EnvDTE.TextRanges f) { return(false); }