Winify

Subversion Repositories:
Compare Path: Rev
With Path: Rev
?path1? @ 43  →  ?path2? @ 44
/trunk/Winify/Settings/SettingsForm.Designer.cs
@@ -71,6 +71,9 @@
this.tableLayoutPanel9 = new System.Windows.Forms.TableLayoutPanel();
this.button5 = new System.Windows.Forms.Button();
this.button6 = new System.Windows.Forms.Button();
this.groupBox6 = new System.Windows.Forms.GroupBox();
this.checkBox2 = new System.Windows.Forms.CheckBox();
this.tableLayoutPanel11 = new System.Windows.Forms.TableLayoutPanel();
this.tabControl1.SuspendLayout();
this.tabPage2.SuspendLayout();
this.flowLayoutPanel2.SuspendLayout();
@@ -91,6 +94,8 @@
this.groupBox4.SuspendLayout();
this.tableLayoutPanel8.SuspendLayout();
this.tableLayoutPanel9.SuspendLayout();
this.groupBox6.SuspendLayout();
this.tableLayoutPanel11.SuspendLayout();
this.SuspendLayout();
//
// tabControl1
@@ -118,6 +123,7 @@
// flowLayoutPanel2
//
this.flowLayoutPanel2.Controls.Add(this.groupBox3);
this.flowLayoutPanel2.Controls.Add(this.groupBox6);
this.flowLayoutPanel2.Dock = System.Windows.Forms.DockStyle.Fill;
this.flowLayoutPanel2.Location = new System.Drawing.Point(0, 0);
this.flowLayoutPanel2.Name = "flowLayoutPanel2";
@@ -381,7 +387,7 @@
this.tableLayoutPanel7.Name = "tableLayoutPanel7";
this.tableLayoutPanel7.RowCount = 1;
this.tableLayoutPanel7.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 100F));
this.tableLayoutPanel7.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 241F));
this.tableLayoutPanel7.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 243F));
this.tableLayoutPanel7.Size = new System.Drawing.Size(538, 243);
this.tableLayoutPanel7.TabIndex = 0;
//
@@ -579,6 +585,41 @@
this.button6.UseVisualStyleBackColor = true;
this.button6.Click += new System.EventHandler(this.Button6_Click);
//
// groupBox6
//
this.groupBox6.Controls.Add(this.tableLayoutPanel11);
this.groupBox6.Location = new System.Drawing.Point(262, 3);
this.groupBox6.Name = "groupBox6";
this.groupBox6.Size = new System.Drawing.Size(200, 53);
this.groupBox6.TabIndex = 1;
this.groupBox6.TabStop = false;
this.groupBox6.Text = "Miscellaneous";
//
// checkBox2
//
this.checkBox2.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Left | System.Windows.Forms.AnchorStyles.Right)));
this.checkBox2.AutoSize = true;
this.checkBox2.Location = new System.Drawing.Point(3, 8);
this.checkBox2.Name = "checkBox2";
this.checkBox2.Size = new System.Drawing.Size(188, 17);
this.checkBox2.TabIndex = 0;
this.checkBox2.Text = "Ignore self-signed certificates";
this.checkBox2.UseVisualStyleBackColor = true;
this.checkBox2.CheckedChanged += new System.EventHandler(this.CheckBox2_CheckedChanged);
//
// tableLayoutPanel11
//
this.tableLayoutPanel11.ColumnCount = 1;
this.tableLayoutPanel11.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 50F));
this.tableLayoutPanel11.Controls.Add(this.checkBox2, 0, 0);
this.tableLayoutPanel11.Dock = System.Windows.Forms.DockStyle.Fill;
this.tableLayoutPanel11.Location = new System.Drawing.Point(3, 16);
this.tableLayoutPanel11.Name = "tableLayoutPanel11";
this.tableLayoutPanel11.RowCount = 1;
this.tableLayoutPanel11.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 50F));
this.tableLayoutPanel11.Size = new System.Drawing.Size(194, 34);
this.tableLayoutPanel11.TabIndex = 0;
//
// SettingsForm
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
@@ -612,6 +653,9 @@
this.groupBox4.ResumeLayout(false);
this.tableLayoutPanel8.ResumeLayout(false);
this.tableLayoutPanel9.ResumeLayout(false);
this.groupBox6.ResumeLayout(false);
this.tableLayoutPanel11.ResumeLayout(false);
this.tableLayoutPanel11.PerformLayout();
this.ResumeLayout(false);
 
}
@@ -659,5 +703,8 @@
private System.Windows.Forms.TableLayoutPanel tableLayoutPanel9;
private System.Windows.Forms.Button button5;
private System.Windows.Forms.Button button6;
private System.Windows.Forms.GroupBox groupBox6;
private System.Windows.Forms.TableLayoutPanel tableLayoutPanel11;
private System.Windows.Forms.CheckBox checkBox2;
}
}
/trunk/Winify/Settings/SettingsForm.cs
@@ -31,6 +31,7 @@
private Server _server;
private readonly MainForm _mainForm;
private readonly CancellationToken _cancellationToken;
private readonly BindingSource _configurationBindingSource;
 
#endregion
 
@@ -39,6 +40,8 @@
public SettingsForm()
{
InitializeComponent();
 
Utilities.WindowState.FormTracker.Track(this);
}
 
public SettingsForm(MainForm mainForm) : this()
@@ -55,7 +58,15 @@
 
_serverBindingSource = new BindingSource();
_serverBindingSource.DataSource = _server;
_configurationBindingSource = new BindingSource();
_configurationBindingSource.DataSource = _mainForm.Configuration;
 
checkBox1.DataBindings.Add(new Binding("Checked", _configurationBindingSource,
nameof(_mainForm.Configuration.LaunchOnBoot), true, DataSourceUpdateMode.OnPropertyChanged));
 
checkBox2.DataBindings.Add(new Binding("Checked", _configurationBindingSource,
nameof(_mainForm.Configuration.IgnoreSelfSignedCertificates), true, DataSourceUpdateMode.OnPropertyChanged));
 
serverNameTextBox.DataBindings.Add(new Binding("Text", _serverBindingSource, nameof(_server.Name), true,
DataSourceUpdateMode.OnPropertyChanged));
serverUrlTextBox.DataBindings.Add(new Binding("Text", _serverBindingSource, nameof(_server.Url), true,
@@ -122,10 +133,7 @@
 
private void Button2_Click(object sender, EventArgs e)
{
if (listBox1.SelectedItem is Server server)
{
_servers.Server.Remove(server);
}
if (listBox1.SelectedItem is Server server) _servers.Server.Remove(server);
}
 
private void ListBox1_SelectedIndexChanged(object sender, EventArgs e)
@@ -142,24 +150,15 @@
 
private void Button3_Click(object sender, EventArgs e)
{
if (listBox2.SelectedItem is Announcement announcement)
{
_announcements.Announcement.Remove(announcement);
}
if (listBox2.SelectedItem is Announcement announcement) _announcements.Announcement.Remove(announcement);
}
 
private void Button4_Click(object sender, EventArgs e)
{
var announcement = new Announcement();
if (int.TryParse(appIdTextBox.Text, out var appId))
{
announcement.AppId = appId;
}
if (int.TryParse(appIdTextBox.Text, out var appId)) announcement.AppId = appId;
 
if (int.TryParse(lingerTimeTextBox.Text, out var lingerTime))
{
announcement.LingerTime = lingerTime;
}
if (int.TryParse(lingerTimeTextBox.Text, out var lingerTime)) announcement.LingerTime = lingerTime;
 
_announcements.Announcement.Add(announcement);
 
@@ -198,5 +197,13 @@
}
 
#endregion
 
private void CheckBox2_CheckedChanged(object sender, EventArgs e)
{
_mainForm.Configuration.IgnoreSelfSignedCertificates = ((CheckBox)sender).Checked;
 
_mainForm.ChangedConfigurationContinuation.Schedule(TimeSpan.FromSeconds(1),
async () => { await _mainForm.SaveConfiguration(); }, _cancellationToken);
}
}
}