-
Notifications
You must be signed in to change notification settings - Fork 3
/
FrmLoadScene.cs
81 lines (73 loc) · 1.56 KB
/
FrmLoadScene.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
77
78
79
80
81
/*
* Created by SharpDevelop.
* User: NCDyson
* Date: 8/11/2017
* Time: 6:21 AM
*
* To change this template use Tools | Options | Coding | Edit Standard Headers.
*/
using System;
using System.Drawing;
using System.Windows.Forms;
using System.Collections.Generic;
using System.IO;
namespace StudioCCS
{
/// <summary>
/// Description of FrmLoadScene.
/// </summary>
public partial class FrmLoadScene : Form
{
public List<String> FileNames = new List<string>();
public string Path = "";
public FrmLoadScene()
{
//
// The InitializeComponent() call is required for Windows Forms designer support.
//
InitializeComponent();
//
// TODO: Add constructor code after the InitializeComponent() call.
//
}
void BtnSelectDirClick(object sender, EventArgs e)
{
var result = folderDialog.ShowDialog();
if(result == DialogResult.OK)
{
txtDir.Text = folderDialog.SelectedPath;
Path = folderDialog.SelectedPath;
if(CheckDir())
{
btnOk.Enabled = true;
}
}
}
private bool CheckDir()
{
int existCount = 0;
foreach(var fname in FileNames)
{
string fpath = Path + "/" + fname;
var tmpItem = new ListViewItem(fpath);
if(File.Exists(fpath))
{
existCount++;
tmpItem.Text += " - FOUND";
}
else
{
tmpItem.Text += " - NOT FOUND";
tmpItem.ForeColor = Color.Red;
}
sceneList.Items.Add(tmpItem);
}
if(existCount == FileNames.Count) return true;
return false;
}
void FrmLoadSceneLoad(object sender, EventArgs e)
{
CheckDir();
}
}
}