/// <summary> /// For public use only /// </summary> /// <param name="PatternList"></param> /// <param name="StartWord"></param> /// <param name="IgnoreStartWord"></param> /// <returns></returns> public Word.Word FindLeftWordByPatternList(PatternList PatternList, Word.Word StartWord, bool IgnoreStartWord) { int i = StartWord.Index; if (IgnoreStartWord) { i--; } while (i >= 0) { Word.Word w = this[i]; if (w.Pattern != null) { if (w.Pattern.Parent != null) { if (w.Pattern.Parent == PatternList && w.Type != WordType.Space && w.Type != WordType.Tab) { return(w); } } } i--; } return(null); }
/// <summary> /// For public use only /// </summary> /// <param name="PatternListName"></param> /// <param name="StartWord"></param> /// <param name="IgnoreStartWord"></param> /// <returns></returns> public Word.Word FindRightWordByPatternListName(string PatternListName, Word.Word StartWord, bool IgnoreStartWord) { int i = StartWord.Index; if (IgnoreStartWord) { i++; } while (i < words.Count) { Word.Word w = this[i]; if (w.Pattern != null) { if (w.Pattern.Parent != null) { if (w.Pattern.Parent.Name == PatternListName && w.Type != WordType.Space && w.Type != WordType.Tab) { return(w); } } } i++; } return(null); }
public Word.Word Add(string text) { var xw = new Word.Word { Row = this, Text = text }; words.Add(xw); return(xw); }
/// <summary> /// For public use only /// </summary> /// <param name="BlockTypeName"></param> /// <param name="StartWord"></param> /// <param name="IgnoreStartWord"></param> /// <returns></returns> public Word.Word FindRightWordByBlockTypeName(string BlockTypeName, Word.Word StartWord, bool IgnoreStartWord) { int i = StartWord.Index; if (IgnoreStartWord) { i++; } while (i < words.Count) { Word.Word w = this[i]; if (w.Span.spanDefinition.Name == BlockTypeName && w.Type != WordType.Space && w.Type != WordType.Tab) { return(w); } i++; } return(null); }
/// <summary> /// For public use only /// </summary> /// <param name="spanDefinition"></param> /// <param name="StartWord"></param> /// <param name="IgnoreStartWord"></param> /// <returns></returns> public Word.Word FindLeftWordByBlockType(SpanDefinition spanDefinition, Word.Word StartWord, bool IgnoreStartWord) { int i = StartWord.Index; if (IgnoreStartWord) { i--; } while (i >= 0) { Word.Word w = this[i]; if (w.Span.spanDefinition == spanDefinition && w.Type != WordType.Space && w.Type != WordType.Tab) { return(w); } i--; } return(null); }
/// <summary> /// Returns the index of a specific Word object /// </summary> /// <param name="word">Word object to find</param> /// <returns>index of the word in the row</returns> public int IndexOf(Word.Word word) { return(words.IndexOf(word)); }
/// <summary> /// Adds a word object to this row /// </summary> /// <param name="word">Word object</param> public void Add(Word.Word word) { word.Row = this; words.Add(word); }