<commit_before>﻿using My.AspNetCore.WebForms.Rendering;
using System;
using System.IO;
using System.Text.Encodings.Web;
using System.Threading.Tasks;
using System.Collections.Generic;

namespace My.AspNetCore.WebForms.Controls
{
    public class TextBox : Control, IPostBackDataHandler
    {
        public event EventHandler TextChanged;

        public string Text { get; set; }

        public int BorderWidth { get; set; }

        public BorderStyle BorderStyle { get; set; } = BorderStyle.None;

        public string BorderColor { get; set; }

        public string BackColor { get; set; }

        public string ForeColor { get; set; }

        public string CssClass { get; set; }

        public bool Enabled { get; set; } = true;

        public int Height { get; set; }

        public int Width { get; set; }

        public string ToolTip { get; set; }

        public Font Font { get; set; }

        public TextBoxMode TextMode { get; set; } = TextBoxMode.SingleLine;

        public int Columns { get; set; }

        public int Rows { get; set; }

        public bool ReadOnly { get; set; }

        protected virtual void OnTextChanged(EventArgs e)
        {
            TextChanged?.Invoke(this, e);
        }

        public async override Task RenderAsync(TextWriter writer)
        {
            var tagName = "input";

            if (TextMode == TextBoxMode.MultiLine)
            {
                tagName = "textarea";
            }

            var tagBuilder = new TagBuilder(tagName)
            {
                TagRenderMode = TagRenderMode.SelfClosing
            };

            tagBuilder.Attributes.Add("name", Name);
            switch (TextMode)
            {
                case TextBoxMode.SingleLine:
                    tagBuilder.Attributes.Add("type", "text");
                    break;<commit_msg>Add default rows & columns for MultiLine TextBox<commit_after>﻿using My.AspNetCore.WebForms.Rendering;
using System;
using System.IO;
using System.Text.Encodings.Web;
using System.Threading.Tasks;
using System.Collections.Generic;

namespace My.AspNetCore.WebForms.Controls
{
    public class TextBox : Control, IPostBackDataHandler
    {
        private const int DefaultMutliLineRows = 2;
        private const int DefaultMutliLineColumns = 20;

        public event EventHandler TextChanged;

        public string Text { get; set; }

        public int BorderWidth { get; set; }

        public BorderStyle BorderStyle { get; set; } = BorderStyle.None;

        public string BorderColor { get; set; }

        public string BackColor { get; set; }

        public string ForeColor { get; set; }

        public string CssClass { get; set; }

        public bool Enabled { get; set; } = true;

        public int Height { get; set; }

        public int Width { get; set; }

        public string ToolTip { get; set; }

        public Font Font { get; set; }

        public TextBoxMode TextMode { get; set; } = TextBoxMode.SingleLine;

        public int Columns { get; set; } = DefaultMutliLineColumns;

        public int Rows { get; set; } = DefaultMutliLineRows;

        public bool ReadOnly { get; set; }

        protected virtual void OnTextChanged(EventArgs e)
        {
            TextChanged?.Invoke(this, e);
        }

        public async override Task RenderAsync(TextWriter writer)
        {
            var tagName = "input";

            if (TextMode == TextBoxMode.MultiLine)
            {
                tagName = "textarea";
            }

            var tagBuilder = new TagBuilder(tagName)
            {
                TagRenderMode = TagRenderMode.SelfClosing
            };

            tagBuilder.Attributes.Add("name", Name);
            switch (TextMode)
            {
                case TextBoxMode.SingleLine:
                    tagBuilder.Attributes.Add("type", "text");
                    break;
{'fraction_non_alphanumeric': 0.0851994851994852, 'fraction_numerical': 0.0007722007722007722, 'mean_word_length': 1.9328301886792454, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1879531', 'n_tokens_mistral': 1062, 'n_tokens_neox': 1002, 'n_words': 301}