This repository has been archived by the owner on Jul 13, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathNewProjectDialog.cs
76 lines (62 loc) · 2.01 KB
/
NewProjectDialog.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.IO;
using System.Text;
using System.Windows.Forms;
namespace LEdit
{
public partial class NewProjectDialog : Form
{
public string ROMFile, ProjectName, ProjectFolder;
public NewProjectDialog()
{
InitializeComponent();
}
private void groupBox1_Enter(object sender, EventArgs e)
{
}
private void Form1_Load(object sender, EventArgs e)
{
}
private void button4_Click(object sender, EventArgs e)
{
ROMFile = txtROMFile.Text;
ProjectName = txtName.Text;
ProjectFolder = txtFolder.Text;
}
private void button1_Click(object sender, EventArgs e)
{
if (selectROMDialog.ShowDialog() != DialogResult.Cancel)
{
txtROMFile.Text = selectROMDialog.FileName;
FileInfo nfo = new FileInfo(selectROMDialog.FileName);
ProjectName = nfo.Name.Substring(0, nfo.Name.Length - nfo.Extension.Length);
txtName.Text = ProjectName;
}
}
private void txtName_TextChanged(object sender, EventArgs e)
{
ProjectName = txtName.Text;
if (ProjectName.Length > 0)
{
DirectoryInfo dir = new DirectoryInfo(
Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments) +
Path.DirectorySeparatorChar +
"Meine LEdit-Projekte" +
Path.DirectorySeparatorChar +
ProjectName);
txtFolder.Text = dir.FullName;
}
}
private void button2_Click(object sender, EventArgs e)
{
if (selectFolderDialog.ShowDialog() != DialogResult.Cancel)
{
txtFolder.Text = selectFolderDialog.SelectedPath;
}
}
}
}