Exemplo n.º 1
0
        private DocLine ReadLine(string lt)
        {
            var dl = new DocLine();
            var str = String.Empty;

            if ((str = ReadPragma("#", lt)) != null)
            {
                dl.Text = str.TrimStart('#');
                dl.Type = LineType.CodeItem;
            }
            else if ((str = ReadPragma(">>>", lt)) != null)
            {
                dl.Text = str;
                dl.Type = LineType.EvalCode;
            }
            else if ((str = ReadPragma(">>", lt)) != null)
            {
                dl.Text = str;
                dl.Type = LineType.ElaCode;
            }
            else if ((str = ReadPragma(">", lt)) != null)
            {
                dl.Text = str;
                dl.Type = LineType.Code;
            }
            else if ((str = ReadPragma("|", lt)) != null)
            {
                dl.Text = str;
                dl.Type = LineType.Table;
            }
            else if ((str = ReadPragma("===", lt)) != null)
            {
                dl.Text = str;
                dl.Type = LineType.Header3;
            }
            else if ((str = ReadPragma("==", lt)) != null)
            {
                dl.Text = str;
                dl.Type = LineType.Header2;
            }
            else if ((str = ReadPragma("=", lt)) != null)
            {
                dl.Text = str;
                dl.Type = LineType.Header1;
            }
            else if ((str = ReadPragma("*", lt)) != null)
            {
                dl.Text = str;
                dl.Type = LineType.List;
            }
            else if ((str = ReadPragma("\\", lt)) != null)
            {
                dl.Text = str;
                dl.Type = LineType.Text;
            }
            else
            {
                dl.Text = lt;
                dl.Type = LineType.Text;
            }

            return dl;
        }
Exemplo n.º 2
0
        private DocLine ReadLine(string lt)
        {
            var dl  = new DocLine();
            var str = String.Empty;

            if ((str = ReadPragma("#", lt)) != null)
            {
                dl.Text = str.TrimStart('#');
                dl.Type = LineType.CodeItem;
            }
            else if ((str = ReadPragma(">>>", lt)) != null)
            {
                dl.Text = str;
                dl.Type = LineType.EvalCode;
            }
            else if ((str = ReadPragma(">>", lt)) != null)
            {
                dl.Text = str;
                dl.Type = LineType.ElaCode;
            }
            else if ((str = ReadPragma(">", lt)) != null)
            {
                dl.Text = str;
                dl.Type = LineType.Code;
            }
            else if ((str = ReadPragma("|", lt)) != null)
            {
                dl.Text = str;
                dl.Type = LineType.Table;
            }
            else if ((str = ReadPragma("===", lt)) != null)
            {
                dl.Text = str;
                dl.Type = LineType.Header3;
            }
            else if ((str = ReadPragma("==", lt)) != null)
            {
                dl.Text = str;
                dl.Type = LineType.Header2;
            }
            else if ((str = ReadPragma("=", lt)) != null)
            {
                dl.Text = str;
                dl.Type = LineType.Header1;
            }
            else if ((str = ReadPragma("*", lt)) != null)
            {
                dl.Text = str;
                dl.Type = LineType.List;
            }
            else if ((str = ReadPragma("\\", lt)) != null)
            {
                dl.Text = str;
                dl.Type = LineType.Text;
            }
            else
            {
                dl.Text = lt;
                dl.Type = LineType.Text;
            }

            return(dl);
        }