예제 #1
0
파일: Form1.cs 프로젝트: panchul/WPC
        /// <summary>
        /// Analyze the html in the text box.
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void btnAnalyze_Click(object sender, EventArgs e)
        {
            if (rtb.Text.Trim().Length == 0)
            {
                return;
            }

            HtmlAnalyzer analyzer = new HtmlAnalyzer(rtb.Text);

            txtTextToHtmlRatio.Text       = string.Format("{0:0.000}%", analyzer.TextToHtmlRatio);
            txtTextToTotalPercentage.Text = string.Format("{0:0.000}%", analyzer.TextToTotalPercentage);
            txtHtmlToTotalPercentage.Text = string.Format("{0:0.000}%", analyzer.HtmlToTotalPercentage);
            txtTotalChars.Text            = analyzer.TotalChars.ToString();

            rtbText.Text = analyzer.Text;
        }
예제 #2
0
파일: Form1.cs 프로젝트: morefun0302/WPC
        /// <summary>
        /// Analyze the html in the text box.
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void btnAnalyze_Click(object sender, EventArgs e)
        {
            if (rtb.Text.Trim().Length == 0)
            {
                return;
            }

            HtmlAnalyzer analyzer = new HtmlAnalyzer(rtb.Text);

            txtTextToHtmlRatio.Text = string.Format("{0:0.000}%", analyzer.TextToHtmlRatio);
            txtTextToTotalPercentage.Text = string.Format("{0:0.000}%", analyzer.TextToTotalPercentage);
            txtHtmlToTotalPercentage.Text = string.Format("{0:0.000}%", analyzer.HtmlToTotalPercentage);
            txtTotalChars.Text = analyzer.TotalChars.ToString();

            rtbText.Text = analyzer.Text;
        }