Esempio n. 1
0
        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());
        }
Esempio n. 2
0
 void Write(HtmlClipboardFormatWriter writer, string line, HexLinePart part, StringBuilder cssWriter)
 {
     WriteCss(cssWriter, part);
     writer.WriteSpan(cssWriter.ToString(), line.Substring(part.Offset, part.Length));
 }