-
Notifications
You must be signed in to change notification settings - Fork 1
/
frmSettings1.cs
84 lines (75 loc) · 3.23 KB
/
frmSettings1.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
82
83
84
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
using System.Configuration;
namespace HotFolderPrinterFoxitPdf
{
public partial class frmSettings1 : Form
{
private string configSelectedPrinter = String.Empty;
public frmSettings1()
{
InitializeComponent();
this.Icon = Properties.Resources.burningFolder1;
//
configSelectedPrinter = HFP.GetConfig("selectedPrinter");
foreach (string printer in System.Drawing.Printing.PrinterSettings.InstalledPrinters)
{
if (configSelectedPrinter == String.Empty)
{
configSelectedPrinter = printer;
HFP.SetConfig("selectedPrinter", printer);
}
cbSettingsSelectedPrinter.Items.Add(printer);
}
cbSettingsSelectedPrinter.SelectedIndex = cbSettingsSelectedPrinter.FindStringExact(configSelectedPrinter);
nudSettingsHotFolderQueueRescanTimeMS.Value = Convert.ToInt32(HFP.GetConfig("queueRescanTimeMS"));
tbSettingsHotFolderQueueDir.Text = HFP.GetConfig("queueDir");
tbSettingsHotFolderProcessedDir.Text = HFP.GetConfig("processedDir");
tbSettingsLogFile.Text = HFP.GetConfig("logFile");
}
private void cbSettingsSelectedPrinter_SelectedIndexChanged(object sender, EventArgs e)
{
#pragma warning disable CS8604 // Possible null reference argument.
HFP.SetConfig("selectedPrinter", cbSettingsSelectedPrinter.SelectedItem.ToString());
#pragma warning restore CS8604 // Possible null reference argument.
}
private void btnSettingsHotFolderQueueDirBrowse_Click(object sender, EventArgs e)
{
DialogResult result = folderBrowserDialog1.ShowDialog();
if (result == DialogResult.OK)
{
HFP.SetConfig("queueDir", folderBrowserDialog1.SelectedPath);
tbSettingsHotFolderQueueDir.Text = folderBrowserDialog1.SelectedPath;
}
}
private void btnSettingsHotFolderProcessedDirBrowse_Click(object sender, EventArgs e)
{
DialogResult result = folderBrowserDialog1.ShowDialog();
if (result == DialogResult.OK)
{
HFP.SetConfig("processedDir", folderBrowserDialog1.SelectedPath);
tbSettingsHotFolderProcessedDir.Text = folderBrowserDialog1.SelectedPath;
}
}
private void nudSettingsHotFolderQueueRescanTimeMS_ValueChanged(object sender, EventArgs e)
{
HFP.SetConfig("queueRescanTimeMS", Convert.ToString(nudSettingsHotFolderQueueRescanTimeMS.Value));
}
private void btnSettingsLogFileBrowse_Click(object sender, EventArgs e)
{
DialogResult result = saveFileDialog1.ShowDialog();
if (result == DialogResult.OK)
{
HFP.SetConfig("logFile", saveFileDialog1.FileName);
tbSettingsLogFile.Text = saveFileDialog1.FileName;
}
}
}
}