public void FixupReferences(SyntaxStrings Owner) { this.owner = Owner; this.TabStops = this.tabStops; this.UseSpaces = this.useSpaces; this.Delimiters = this.delimiters; this.Lines = this.lines; }
private static bool IsWholeWord(Hashtable DelimTable, string String, int Start, int Len, ref int WordStart, ref int WordEnd) { WordStart = Start; WordEnd = Start; int num1 = String.Length; while ((WordStart > 0) && !SyntaxStrings.IsDelimiter(DelimTable, String, WordStart - 1)) { WordStart -= 1; } while ((WordEnd < (num1 - 1)) && !SyntaxStrings.IsDelimiter(DelimTable, String, WordEnd + 1)) { WordEnd += 1; } if (WordStart == Start) { return(Len == ((WordEnd - WordStart) + 1)); } return(false); }
public XmlSyntaxStringsInfo(SyntaxStrings Owner) : this() { this.owner = Owner; }
public static bool Find(IStringList List, Hashtable DelimTable, string String, SearchOptions Options, Regex Expression, ref Point Position, out int Len) { Len = String.Length; if ((String != null) && (String != string.Empty)) { bool flag1 = ((Options & SearchOptions.CaseSensitive) == SearchOptions.None) && (Expression == null); if (flag1) { String = String.ToUpper(); } string text1 = null; int num1 = 0; int num2 = 0; if ((Options & SearchOptions.BackwardSearch) == SearchOptions.None) { Label_031C: if (Position.Y < List.Count) { text1 = List[Position.Y]; if ((Position.X < text1.Length) || (((text1 == string.Empty) && (Position.X == 0)) && (Expression != null))) { if (flag1) { text1 = text1.ToUpper(); } Position.X = Math.Min(Position.X, (int)(text1.Length - 1)); if (Expression != null) { Match match2 = (text1 == string.Empty) ? Expression.Match(text1) : Expression.Match(text1, Position.X); if (match2.Success) { Len = match2.Length; Position.X = match2.Index; } else { Position.X = -1; } } else if (text1 != string.Empty) { Position.X = text1.IndexOf(String, Position.X); } else { Position.X = -1; } if (((Position.X >= 0) && ((Options & SearchOptions.WholeWordsOnly) != SearchOptions.None)) && !SyntaxStrings.IsWholeWord(DelimTable, text1, Position.X, Len, ref num1, ref num2)) { Position.X = (Position.X == num2) ? (Position.X + 1) : num2; goto Label_031C; } if (Position.X >= 0) { return(true); } } Position.Y++; Position.X = 0; goto Label_031C; } } else { Position.Y = Math.Min(Position.Y, (int)(List.Count - 1)); while (Position.Y >= 0) { text1 = List[Position.Y]; if ((Position.X > 0) || (((text1 == string.Empty) && (Position.X == 0)) && (Expression != null))) { if (flag1) { text1 = text1.ToUpper(); } if (Expression != null) { Match match1 = (text1 == string.Empty) ? Expression.Match(text1) : Expression.Match(text1, Math.Min(Position.X, (int)(text1.Length - 1))); if (match1.Success) { Len = match1.Length; Position.X = match1.Index; } else { Position.X = -1; } } else if (text1 != string.Empty) { Position.X = text1.LastIndexOf(String, Math.Min((int)(Position.X - 1), (int)(text1.Length - 1))); } else { Position.X = -1; } if (((Position.X >= 0) && ((Options & SearchOptions.WholeWordsOnly) != SearchOptions.None)) && !SyntaxStrings.IsWholeWord(DelimTable, text1, Position.X, Len, ref num1, ref num2)) { Position.X = num1 - 1; continue; } if (Position.X >= 0) { return(true); } } Position.Y--; if (Position.Y >= 0) { Position.X = List[Position.Y].Length; } } } } return(false); }
public bool Find(string String, SearchOptions Options, Regex Expression, ref Point Position, out int Len) { return(SyntaxStrings.Find(this, this.delimTable, String, Options, Expression, ref Position, out Len)); }