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

📄 createproject.cs

📁 编译器
💻 CS
字号:
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Drawing;
using System.Data;
using System.Text;
using System.Windows.Forms;
using System.IO;

namespace PlxCompiler
{
    public partial class CreateProject : UserControl
    {
        private string dir;
        PlxCompiler.Information infor1;
        PlxCompiler.Form1 form1;
        public CreateProject(PlxCompiler.Form1 parent, PlxCompiler.Information infor)
        {
            InitializeComponent();
            this.Parent = parent;
            infor1 = infor;
            form1 = parent;
        }
       
        //
        private void confirm_Click(object sender, EventArgs e)
        {
            if (!Directory.Exists(dir) && textBox1.Text != "" && textBox2.Text != null)
            {
                dir = textBox2.Text + "\\" + textBox1.Text;
                Directory.CreateDirectory(dir);
                //MessageBox.Show("Directory Created successful...", "Created", MessageBoxButtons.OK, MessageBoxIcon.Information);
                infor1.AddTree(textBox1.Text);
                form1.modifyProject(dir);
                this.Dispose();
            }

            else if (textBox1.Text == "") MessageBox.Show("Input project name....", "Project", MessageBoxButtons.OK, MessageBoxIcon.Warning);

            else if (textBox2.Text == "") MessageBox.Show("Input project location....", "Project", MessageBoxButtons.OK, MessageBoxIcon.Warning);
            else   MessageBox.Show("Directory already exists....", "Exists", MessageBoxButtons.OK, MessageBoxIcon.Warning);
               
        }
        //
        private void cancel_Click(object sender, EventArgs e)
        {
            this.Dispose();
        }

        private void browse_Click(object sender, EventArgs e)
        {
            folderBrowserDialog1.Description = "select a directory";
            if (folderBrowserDialog1.ShowDialog() == DialogResult.OK)
            {

                textBox2.Text = folderBrowserDialog1.SelectedPath;
            }
        }
    }
}

⌨️ 快捷键说明

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