Esempio n. 1
0
File: Form1.cs Progetto: 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;
        }
Esempio n. 2
0
        /// <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;
        }