private static void AppendDecorationTags(ICollection<ITagMatch> output, IEnumerable<Match> decorationMatches, EMDecorationType type, char decorationSymbol) { var matchesArray = FilterDecorationMatches(decorationMatches, type, decorationSymbol).ToArray(); var pairs = matchesArray.Length; for (var i = 0; i < pairs; ++i) { var match = matchesArray[i]; output.Add(new EMDecorationTag(match.Index, match.Value, type)); } }
public EMDecorationMatch(EMTaggedElementMatch match, EMDecorationType type) : base(match.Index, match.Text, match.ContentStart, match.ContentLength) { Type = type; }
private static IEnumerable<Match> FilterDecorationMatches(IEnumerable<Match> matches, EMDecorationType type, char decorationSymbol) { return matches.Where( m => (type == EMDecorationType.Bold) == m.Length > 1 && m.Value[0] == decorationSymbol); }
protected EMDecorationTag(int index, string text, EMDecorationType type) : base(index, text) { Type = type; }
private static IEnumerable <Match> FilterDecorationMatches(IEnumerable <Match> matches, EMDecorationType type, char decorationSymbol) { return (matches.Where( m => (type == EMDecorationType.Bold) == m.Length > 1 && m.Value[0] == decorationSymbol)); }
private static void AppendDecorationTags(ICollection <ITagMatch> output, IEnumerable <Match> decorationMatches, EMDecorationType type, char decorationSymbol) { var matchesArray = FilterDecorationMatches(decorationMatches, type, decorationSymbol).ToArray(); var pairs = matchesArray.Length; for (var i = 0; i < pairs; ++i) { var match = matchesArray[i]; output.Add(new EMDecorationTag(match.Index, match.Value, type)); } }
public EMDecorationElement(EMDocument doc, EMElementOrigin origin, EMElement parent, EMDecorationType type) : base(doc, origin, parent) { this.type = type; Content = new EMSpanElements(doc, new EMElementOrigin(0, origin.Text), this); }