private static void setSegments(WriteableNiconicoWebTextSegment segment,NiconicoWebTextSegmenter segmenter) { segment.Segments = new NiconicoWebTextSegmentCollection(segment, segmenter.WritablePartialDivide(segment.FriendlyText, segment)); }
internal static INiconicoWebTextSegment ParseHtmlInvalidElementWebText(Match match, NiconicoWebTextSegmenter segmenter, INiconicoWebTextSegment parent) { var segment = new WriteableNiconicoWebTextSegment(match.Value, string.Empty, NiconicoWebTextSegmentType.HtmlInvalidElement, NiconicoWebTextDecorateFlags.None, parent, null); segment.Segments = new NiconicoWebTextSegmentCollection(segment, segmenter.WritablePartialDivide(segment.Text.Substring(1, segment.Text.Length - 1), segment)); return segment; }
internal static INiconicoWebTextSegment ParseHtmlUnderLineWebText(Match match, NiconicoWebTextSegmenter segmenter, INiconicoWebTextSegment parent) { var segment = new WriteableNiconicoWebTextSegment(match.Value, match.Groups[NiconicoWebTextPatternIndexs.underLineTextGroupNumber].Value, NiconicoWebTextSegmentType.HtmlUnderLineElement, NiconicoWebTextDecorateFlags.DecoratedUnderLineFlag, parent, null); setSegments(segment, segmenter); return segment; }
internal static WriteableNiconicoWebTextSegment ParseHtmlFontWebText(Match match, NiconicoWebTextSegmenter segmenter, INiconicoWebTextSegment parent) { var segment = new WriteableNiconicoWebTextSegment(match.Value,match.Groups[NiconicoWebTextPatternIndexs.fontTextGroupNumber].Value, NiconicoWebTextSegmentType.HtmlFontElement,NiconicoWebTextDecorateFlags.None, parent,null); var readOnlySegment = HtmlFontNiconicoWebTextSegment<INiconicoWebTextSegment>.ParseWebTextPartial(match, parent); segment.FontElementSize = readOnlySegment.FontElementSize; setSegments(segment, segmenter); if (readOnlySegment.DecoratedColor) { segment.Color = readOnlySegment.Color; segment.decorateFlag_ |= NiconicoWebTextDecorateFlags.DecoratedColorFlag; } return segment; }