⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 ucdatatype.cs

📁 通过数据库结构自动 生成三层结构代码,相当不错的一款软件
💻 CS
字号:
namespace Codematic.UserControls
{
    using System;
    using System.ComponentModel;
    using System.Drawing;
    using System.IO;
    using System.Text;
    using System.Windows.Forms;

    public class UcDatatype : UserControl
    {
        private IContainer components;
        private string filename = (Application.StartupPath + @"\datatype.ini");
        private GroupBox groupBox1;
        private ToolTip toolTip1;
        private RichTextBox txtIniDatatype;

        public UcDatatype()
        {
            this.InitializeComponent();
            StreamReader reader = new StreamReader(this.filename, Encoding.Default);
            string str = reader.ReadToEnd();
            reader.Close();
            this.txtIniDatatype.Text = str;
        }

        protected override void Dispose(bool disposing)
        {
            if (disposing && (this.components != null))
            {
                this.components.Dispose();
            }
            base.Dispose(disposing);
        }

        private void InitializeComponent()
        {
            this.components = new Container();
            ComponentResourceManager manager = new ComponentResourceManager(typeof(UcDatatype));
            this.groupBox1 = new GroupBox();
            this.txtIniDatatype = new RichTextBox();
            this.toolTip1 = new ToolTip(this.components);
            this.groupBox1.SuspendLayout();
            base.SuspendLayout();
            this.groupBox1.Controls.Add(this.txtIniDatatype);
            this.groupBox1.Location = new Point(10, 3);
            this.groupBox1.Name = "groupBox1";
            this.groupBox1.Size = new Size(0x15f, 0xfc);
            this.groupBox1.TabIndex = 0;
            this.groupBox1.TabStop = false;
            this.groupBox1.Text = "字段类型映射";
            this.txtIniDatatype.Dock = DockStyle.Fill;
            this.txtIniDatatype.Location = new Point(3, 0x11);
            this.txtIniDatatype.Name = "txtIniDatatype";
            this.txtIniDatatype.Size = new Size(0x159, 0xe8);
            this.txtIniDatatype.TabIndex = 0;
            this.txtIniDatatype.Text = "";
            this.toolTip1.SetToolTip(this.txtIniDatatype, manager.GetString("txtIniDatatype.ToolTip"));
            this.toolTip1.ToolTipTitle = "[DbToCS] 段,是数据库类型和C#类型的对应关系。";
            base.AutoScaleDimensions = new SizeF(6f, 12f);
            base.AutoScaleMode = AutoScaleMode.Font;
            base.Controls.Add(this.groupBox1);
            base.Name = "UcDatatype";
            base.Size = new Size(0x170, 0x10b);
            this.groupBox1.ResumeLayout(false);
            base.ResumeLayout(false);
        }

        public void SaveIni()
        {
            string[] lines = this.txtIniDatatype.Lines;
            StreamWriter writer = new StreamWriter(this.filename, false, Encoding.Default);
            for (int i = 0; i < lines.Length; i++)
            {
                if (lines[i].Trim() != "")
                {
                    writer.WriteLine(lines[i]);
                }
            }
            writer.Close();
        }
    }
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -