Parse() public method

Visual Studio のソースエディターからコピった RTF 文章を、ufcpp で使ってる XML 形式に変換する。
public Parse ( string text ) : string
text string RTF 文章
return string
Exemplo n.º 1
0
        private string?Parse(IDataObject data, Mode mode)
        {
            if (mode == Mode.Asm)
            {
                if (data.GetData(DataFormats.Text) is string text)
                {
                    return(AsmFormatter.MakeHtml(text));
                }
                return(null);
            }

            if (data.GetData(DataFormats.Html) is string html)
            {
                var p = new HtmlParser(mode);
                return(p.Parse(html));
            }

            if (data.GetData(DataFormats.Rtf) is string rtf)
            {
                var p = new RtfParser(mode);
                return(p.Parse(rtf));
            }

            return(null);
        }
Exemplo n.º 2
0
        private string Parse(IDataObject data, Mode mode)
        {
            var html = data.GetData(DataFormats.Html) as string;

            if (html != null)
            {
                var p = new HtmlParser(mode);
                return p.Parse(html);
            }

            var rtf = data.GetData(DataFormats.Rtf) as string;

            if (rtf != null)
            {
                var p = new RtfParser(mode);
                return p.Parse(rtf);
            }

            return null;
        }
Exemplo n.º 3
0
        private string Parse(IDataObject data, Mode mode)
        {
            var html = data.GetData(DataFormats.Html) as string;

            if (html != null)
            {
                var p = new HtmlParser(mode);
                return(p.Parse(html));
            }

            var rtf = data.GetData(DataFormats.Rtf) as string;

            if (rtf != null)
            {
                var p = new RtfParser(mode);
                return(p.Parse(rtf));
            }

            return(null);
        }