示例#1
0
        private void buttonOk_Click(object sender, EventArgs e)
        {
            var Project = new Project {
                Name = textBoxName.Text,
                Path = textBoxFolder.Text
            };
            var cs = new Cs {
                Name = "Program.cs"
            };

            cs.Path = Project.Path + "\\" + Project.Name + "\\" + cs.Name;
            cs.Text =
                "using System;\n\nclass Program{\n\n  static void Main(){\n Console.WriteLine(\"Hello, world\");\n Console.Read();\n}\n}";

            Project.CsFile.Add(cs);
            AddProjectEvent?.Invoke(this, new AddProjectEventArgs {
                Project = Project
            });
        }
示例#2
0
        private void buttonOk_Click(object sender, EventArgs e)
        {
            Project Project = new Project()
            {
                Name = textBoxName.Text,
                Path = textBoxFolder.Text,
            };
            CS cS = new CS()
            {
                Name = "Program.cs"
            };

            cS.Path = Project.Path + "\\" + Project.Name + "\\" + cS.Name;
            cS.Text = "using System;\n\nclass Program{\n\n  static void Main(){\n Console.WriteLine(\"Hello, world\");\n Console.Read();\n}\n}";

            Project.csfile.Add(cS);
            AddProjectEvent?.Invoke(this, new AddProjectEventArgs()
            {
                project = Project
            });
        }