This repository was archived by the owner on Oct 2, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathApplicationSettings.cs
More file actions
67 lines (58 loc) · 2.22 KB
/
ApplicationSettings.cs
File metadata and controls
67 lines (58 loc) · 2.22 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
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
namespace ImageRotateHelper
{
public partial class ApplicationSettings : Form
{
public ApplicationSettings()
{
InitializeComponent();
this.txtJpegFolder.Text = ImageRotateHelper.Properties.Settings.Default.JpegDirectory;
this.txtFilter.Text = ImageRotateHelper.Properties.Settings.Default.FileFilter;
this.HasChanged = false;
this.txtJpegFolder.Focus();
}
public bool HasChanged
{
get;
private set;
}
private void btnCancel_Click(object sender, EventArgs e)
{
this.Close();
}
private void btnSave_Click(object sender, EventArgs e)
{
// VALIDATE DIRECTORY PATH
if (System.IO.Directory.Exists(this.txtJpegFolder.Text))
{
if (ImageRotateHelper.Properties.Settings.Default.JpegDirectory != this.txtJpegFolder.Text || ImageRotateHelper.Properties.Settings.Default.FileFilter != this.txtFilter.Text)
{
this.HasChanged = true;
ImageRotateHelper.Properties.Settings.Default.JpegDirectory = this.txtJpegFolder.Text;
ImageRotateHelper.Properties.Settings.Default.FileFilter = this.txtFilter.Text;
}
this.Close();
}
else
{
MessageBox.Show("Jpeg directory is not valid.", "Directory Invalid", MessageBoxButtons.OK, MessageBoxIcon.Error);
this.txtJpegFolder.Focus();
}
}
private void btnFile_Click(object sender, EventArgs e)
{
if (System.IO.Directory.Exists(this.txtJpegFolder.Text))
this.folderBrowserDialog1.SelectedPath = this.txtJpegFolder.Text;
DialogResult dr = this.folderBrowserDialog1.ShowDialog();
if (dr == System.Windows.Forms.DialogResult.OK)
this.txtJpegFolder.Text = this.folderBrowserDialog1.SelectedPath;
}
}
}