Exemple #1
0
        // ========================================
        // method
        // ========================================
        public override void Execute()
        {
            var data = new DataObject();
            var copy = _target.CopyBlocksAndInlines(_range);

            data.SetData(StyledTextConsts.BlocksAndInlinesFormat.Name, false, copy);

            /// plain text
            {
                var writer = new PlainTextWriter();
                var text   = writer.ToPlainText(copy);
                data.SetText(text, TextDataFormat.UnicodeText);
            }

            /// html
            if (SupportHtml)
            {
                var writer = new HtmlWriter();
                var html   = writer.ToHtml(copy);
                data.SetData(DataFormats.Html, ClipboardUtil.GetCFHtmlMemoryStream(html));
            }

            Clipboard.SetDataObject(data, true);
        }