-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathFormOpenFiles.cs
More file actions
155 lines (121 loc) · 4.1 KB
/
Copy pathFormOpenFiles.cs
File metadata and controls
155 lines (121 loc) · 4.1 KB
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
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
/*
* Created by SharpDevelop.
* User: User
* Date: 14/05/2012
* Time: 15:49
*
* To change this template use Tools | Options | Coding | Edit Standard Headers.
*/
using System;
using System.Drawing;
using System.IO;
using System.Windows.Forms;
namespace WordListAnalyser2
{
/// <summary>
/// Description of FormOpenFiles.
/// </summary>
public partial class FormOpenFiles : Form
{
static string _FilePathA;
public string FilePathA
{
get { return _FilePathA; }
set { _FilePathA = value; }
}
static string _FilePathB;
public string FilePathB
{
get { return _FilePathB; }
set { _FilePathB = value; }
}
public FormOpenFiles()
{
//
// The InitializeComponent() call is required for Windows Forms designer support.
//
InitializeComponent();
//
// TODO: Add constructor code after the InitializeComponent() call.
//
}
void ButtonBrowseFile1Click(object sender, EventArgs e)
{
OpenFileDialog dlg = new OpenFileDialog();
dlg.Filter = "Text Files (*.txt)|*.txt";
dlg.Title = "Open the files to compare file";
dlg.CheckFileExists = true;
//dlg.InitialDirectory = Environment.GetFolderPath(Environment.SpecialFolder.ProgramFiles);
if (dlg.ShowDialog() == DialogResult.OK)
{
this.pathLabelA.Text = dlg.FileName;
_FilePathA = dlg.FileName;
//this.pathLabelA.Text = _FilePathA;
if ((pathLabelA.Text.Length >0) && (pathLabelB.Text.Length >0)){
this.buttonOK.Enabled = true;
} else this.buttonOK.Enabled = false;
try
{
//Save the file and path to the app.config file
//WordListAnalyser2.Properties.Settings1.Default.FilePathA = _FilePathA;
//WordListAnalyser2.Properties.Settings1.Default.Save();
}
catch (Exception ex)
{
MessageBox.Show(ex.Message, "FormOpenFiles", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
}
}
}
void ButtonBrowseFile2Click(object sender, EventArgs e)
{
OpenFileDialog dlg = new OpenFileDialog();
dlg.Filter = "Text Files (*.txt)|*.txt";
dlg.Title = "Open the files to compare file";
dlg.CheckFileExists = true;
//dlg.InitialDirectory = Environment.GetFolderPath(Environment.SpecialFolder.ProgramFiles);
if (dlg.ShowDialog() == DialogResult.OK)
{
this.pathLabelB.Text = dlg.FileName;
_FilePathB = dlg.FileName;
//this.pathLabelB.Text = _FilePathB;
if ((pathLabelA.Text.Length >0) && (pathLabelB.Text.Length >0)){
this.buttonOK.Enabled = true;
} else this.buttonOK.Enabled = false;
try
{
//Save the file and path to the app.config file
//WordListAnalyser2.Properties.Settings1.Default.FilePathB = _FilePathB;
//WordListAnalyser2.Properties.Settings1.Default.Save();
}
catch (Exception ex)
{
MessageBox.Show(ex.Message, "FormOpenFiles", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
}
}
}
void ButtonCancelClick(object sender, EventArgs e)
{
// TODO
}
void FormOpenFilesLoad(object sender, EventArgs e)
{
try {
this.buttonOK.Enabled = false;
/* textBoxFile1.Text = WordListAnalyser2.Properties.Settings1.Default.FilePathA;
textBoxFile1.TextAlign = HorizontalAlignment.Left;
textBoxFile2.Text = WordListAnalyser2.Properties.Settings1.Default.FilePathB;
textBoxFile2.TextAlign = HorizontalAlignment.Left;
textBoxFile2.Select();
textBoxFile1.Select();*/
} catch (Exception ex) {
MessageBox.Show(ex.Message, "FormOpenFilesLoad");
}
}
void PathLabelAClick(object sender, EventArgs e)
{
}
void ButtonOKClick(object sender, EventArgs e)
{
}
}
}