void CopyHtml(DataObject dataObj, List <HexLine> lines) { var writer = new HtmlClipboardFormatWriter(); var cssWriter = new StringBuilder(); foreach (var line in lines) { foreach (var part in line.LineParts) { Write(writer, line.Text, part, cssWriter); } writer.WriteBr(); } dataObj.SetData(DataFormats.Html, writer.ToString()); }
void Write(HtmlClipboardFormatWriter writer, string line, HexLinePart part, StringBuilder cssWriter) { WriteCss(cssWriter, part); writer.WriteSpan(cssWriter.ToString(), line.Substring(part.Offset, part.Length)); }
void CopyHtml(DataObject dataObj, List<HexLine> lines) { var writer = new HtmlClipboardFormatWriter(); var cssWriter = new StringBuilder(); foreach (var line in lines) { foreach (var part in line.LineParts) Write(writer, line.Text, part, cssWriter); writer.WriteBr(); } dataObj.SetData(DataFormats.Html, writer.ToString()); }