This repository was archived by the owner on Mar 31, 2022. It is now read-only.
forked from gw2scratch/evtc
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathSettingsForm.cs
More file actions
67 lines (59 loc) · 1.29 KB
/
Copy pathSettingsForm.cs
File metadata and controls
67 lines (59 loc) · 1.29 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.IO;
using System.Linq;
using Eto.Drawing;
using Eto.Forms;
using GW2Scratch.ArcdpsLogManager.Configuration;
namespace GW2Scratch.ArcdpsLogManager
{
public class SettingsForm : Form
{
public event EventHandler SettingsSaved;
public SettingsForm()
{
Title = "Settings - arcdps Log Manager";
ClientSize = new Size(400, -1);
MinimumSize = new Size(400, 300);
var pages = new SettingsPage[]
{
new LogsSettingsPage(),
new ApiSettingsPage(),
new DpsReportUploadSettingsPage(),
new UpdateSettingsPage()
};
var tabs = new TabControl();
foreach (var page in pages)
{
tabs.Pages.Add(page);
}
var saveButton = new Button {Text = "Save"};
saveButton.Click += (sender, args) =>
{
foreach (var page in pages)
{
page.SaveSettings();
}
SettingsSaved?.Invoke(this, EventArgs.Empty);
Close();
};
var layout = new DynamicLayout();
layout.BeginVertical(new Padding(10));
{
layout.Add(tabs);
}
layout.EndVertical();
layout.Add(null);
layout.BeginVertical(new Padding(10));
{
layout.BeginHorizontal();
{
layout.Add(null, xscale: true);
layout.Add(saveButton, xscale: false);
}
layout.EndHorizontal();
}
layout.EndVertical();
Content = layout;
}
}
}