tieuquyngok1995 / ToolSupportUchida

1 stars 1 forks source link

main1 #19

Closed tieuquyngok1995 closed 3 years ago

tieuquyngok1995 commented 3 years ago

using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Drawing; using System.Linq; using System.Text; using System.Threading.Tasks; using System.Windows.Forms;

namespace ConvertToModel { public partial class Form1 : Form { private List CommentList = new List();

    private List<string> PropertyList = new List<string>();

    private List<string> TypeList = new List<string>();

    private List<string> ResultList = new List<string>();

    private readonly string[] DELI = new[] { "\r\n" };

    private bool isCsharp = true;

    private bool isJs = false;

    private bool isHtml = false;

    private Dictionary<string, string> typescriptKeyword = new Dictionary<string, string>
    {
        { "function", " = (): void => { \r\n}" },
        { "void", " = (): void => { \r\n}" },

        { "integer", "number" },
        { "string", "string" },
        { "checkbox", "boolean" },
        { "JQuery", "JQuery" },
        { "object[]", "object" },
        { "object", "object" },
        { "List<Record<string, any>>", "Record<string, any>[]" },

        { "float", "number" },
        { "double", "number" },
        { "int", "number" },
        { "decimal", "number" },
        { "long", "number" },
        { "number", "number" },
        { "bool", "boolean" },
        { "boolean", "boolean" },
        { "char", "string" },

        { "button", "button" },
        { "label", "label" },
        { "text", "text" },
        { "radio", "checkbox" },
        { "spread", "spread" },
        { "selectbox", "selectbox" },
    };

    public Form1()
    {
        InitializeComponent();
    }

    #region TextBox 
    private void tbComment_TextChanged(object sender, EventArgs e)
    {
        CommentList.Clear();
        CommentList = tbComment.Text.Replace("\t","").Split(DELI, StringSplitOptions.RemoveEmptyEntries).ToList();

        lblLogicCount.Text = string.Concat(CommentList.Count, " row");
        Convert();
    }