Exemple #1
0
        void parseComment1(StreamReader stream, HtmlTextBlock textNode)
        {
            //注释忽略掉
            string str = "";

            while (!stream.EndOfStream)
            {
                char c = (char)stream.Read();
                str += c;
                if (str.EndsWith("*/"))
                {
                    textNode.Text = textNode.Text.Remove(textNode.Text.Length - 2, 2);
                    break;
                }
            }
        }
Exemple #2
0
        void parseComment2(StreamReader stream, HtmlTextBlock textNode)
        {
            //注释忽略掉
            string str = "";

            while (!stream.EndOfStream)
            {
                char c = (char)stream.Read();
                str += c;
                //textNode.Text += c;
                if (c == (char)10 || c == (char)13)
                {
                    textNode.Text = textNode.Text.Remove(textNode.Text.Length - 2, 2);
                    break;
                }
            }
        }