Winify

Subversion Repositories:
Compare Path: Rev
With Path: Rev
?path1? @ 70  →  ?path2? @ 71
/trunk/Announcements/Announcement.cs
@@ -41,7 +41,7 @@
}
 
[XmlElement(ElementName = "LingerTime")]
public int LingerTime
public decimal LingerTime
{
get => _lingerTime;
set
@@ -66,6 +66,19 @@
}
}
 
[XmlElement(ElementName = "Ignore")]
public bool Ignore
{
get => _ignore;
set
{
if (value == _ignore) return;
 
_ignore = value;
OnPropertyChanged();
}
}
 
#endregion
 
#region Private Delegates, Events, Enums, Properties, Indexers and Fields
@@ -72,10 +85,12 @@
 
private int _appId = -1;
 
private int _lingerTime = 5000;
private decimal _lingerTime = 5000;
 
private string _speak = string.Empty;
 
private bool _ignore = false;
 
#endregion
 
#region Constructors, Destructors and Finalizers
/trunk/Winify/MainForm.cs
@@ -202,9 +202,19 @@
continue;
}
 
if (announcement.Ignore)
{
return;
}
 
if (announcement.LingerTime <= 0)
{
return;
}
 
var configuredNotification = new ToastForm(
$"{e.Message.Title} ({e.Message.Server.Name}/{e.Message.AppId})",
e.Message.Message, announcement.LingerTime, e.Image);
e.Message.Message, (int)announcement.LingerTime, e.Image);
 
await _toasts.Queue(configuredNotification);
 
/trunk/Winify/Settings/SettingsForm.Designer.cs
@@ -77,7 +77,7 @@
this.label4 = new System.Windows.Forms.Label();
this.appIdTextBox = new System.Windows.Forms.TextBox();
this.label6 = new System.Windows.Forms.Label();
this.lingerTimeTextBox = new System.Windows.Forms.TextBox();
this.numericUpDown2 = new System.Windows.Forms.NumericUpDown();
this.tableLayoutPanel4 = new System.Windows.Forms.TableLayoutPanel();
this.tableLayoutPanel5 = new System.Windows.Forms.TableLayoutPanel();
this.button4 = new System.Windows.Forms.Button();
@@ -98,6 +98,8 @@
this.tableLayoutPanel9 = new System.Windows.Forms.TableLayoutPanel();
this.button5 = new System.Windows.Forms.Button();
this.button6 = new System.Windows.Forms.Button();
this.label14 = new System.Windows.Forms.Label();
this.checkBox5 = new System.Windows.Forms.CheckBox();
this.tabControl1.SuspendLayout();
this.tabPage2.SuspendLayout();
this.flowLayoutPanel2.SuspendLayout();
@@ -121,6 +123,7 @@
this.tableLayoutPanel7.SuspendLayout();
this.groupBox2.SuspendLayout();
this.tableLayoutPanel10.SuspendLayout();
((System.ComponentModel.ISupportInitialize)(this.numericUpDown2)).BeginInit();
this.tableLayoutPanel4.SuspendLayout();
this.tableLayoutPanel5.SuspendLayout();
this.groupBox4.SuspendLayout();
@@ -617,13 +620,17 @@
this.tableLayoutPanel10.Controls.Add(this.label4, 0, 0);
this.tableLayoutPanel10.Controls.Add(this.appIdTextBox, 1, 0);
this.tableLayoutPanel10.Controls.Add(this.label6, 0, 1);
this.tableLayoutPanel10.Controls.Add(this.lingerTimeTextBox, 1, 1);
this.tableLayoutPanel10.Controls.Add(this.numericUpDown2, 1, 1);
this.tableLayoutPanel10.Controls.Add(this.label14, 0, 2);
this.tableLayoutPanel10.Controls.Add(this.checkBox5, 1, 2);
this.tableLayoutPanel10.Dock = System.Windows.Forms.DockStyle.Fill;
this.tableLayoutPanel10.Location = new System.Drawing.Point(3, 16);
this.tableLayoutPanel10.Name = "tableLayoutPanel10";
this.tableLayoutPanel10.RowCount = 2;
this.tableLayoutPanel10.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 33.33333F));
this.tableLayoutPanel10.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 33.33333F));
this.tableLayoutPanel10.RowCount = 4;
this.tableLayoutPanel10.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 28F));
this.tableLayoutPanel10.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 28F));
this.tableLayoutPanel10.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 28F));
this.tableLayoutPanel10.RowStyles.Add(new System.Windows.Forms.RowStyle());
this.tableLayoutPanel10.Size = new System.Drawing.Size(257, 218);
this.tableLayoutPanel10.TabIndex = 4;
//
@@ -631,7 +638,7 @@
//
this.label4.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Left | System.Windows.Forms.AnchorStyles.Right)));
this.label4.AutoSize = true;
this.label4.Location = new System.Drawing.Point(3, 48);
this.label4.Location = new System.Drawing.Point(3, 7);
this.label4.Name = "label4";
this.label4.Size = new System.Drawing.Size(58, 13);
this.label4.TabIndex = 0;
@@ -641,7 +648,7 @@
// appIdTextBox
//
this.appIdTextBox.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Left | System.Windows.Forms.AnchorStyles.Right)));
this.appIdTextBox.Location = new System.Drawing.Point(67, 44);
this.appIdTextBox.Location = new System.Drawing.Point(67, 4);
this.appIdTextBox.Name = "appIdTextBox";
this.appIdTextBox.Size = new System.Drawing.Size(187, 20);
this.appIdTextBox.TabIndex = 1;
@@ -650,7 +657,7 @@
//
this.label6.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Left | System.Windows.Forms.AnchorStyles.Right)));
this.label6.AutoSize = true;
this.label6.Location = new System.Drawing.Point(3, 157);
this.label6.Location = new System.Drawing.Point(3, 35);
this.label6.Name = "label6";
this.label6.Size = new System.Drawing.Size(58, 13);
this.label6.TabIndex = 2;
@@ -657,13 +664,28 @@
this.label6.Text = "Timeout";
this.label6.TextAlign = System.Drawing.ContentAlignment.MiddleRight;
//
// lingerTimeTextBox
// numericUpDown2
//
this.lingerTimeTextBox.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Left | System.Windows.Forms.AnchorStyles.Right)));
this.lingerTimeTextBox.Location = new System.Drawing.Point(67, 153);
this.lingerTimeTextBox.Name = "lingerTimeTextBox";
this.lingerTimeTextBox.Size = new System.Drawing.Size(187, 20);
this.lingerTimeTextBox.TabIndex = 3;
this.numericUpDown2.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Left | System.Windows.Forms.AnchorStyles.Right)));
this.numericUpDown2.Location = new System.Drawing.Point(67, 32);
this.numericUpDown2.Maximum = new decimal(new int[] {
10000,
0,
0,
0});
this.numericUpDown2.Minimum = new decimal(new int[] {
1,
0,
0,
0});
this.numericUpDown2.Name = "numericUpDown2";
this.numericUpDown2.Size = new System.Drawing.Size(187, 20);
this.numericUpDown2.TabIndex = 1;
this.numericUpDown2.Value = new decimal(new int[] {
1,
0,
0,
0});
//
// tableLayoutPanel4
//
@@ -902,6 +924,28 @@
this.button6.UseVisualStyleBackColor = true;
this.button6.Click += new System.EventHandler(this.Button6_Click);
//
// label14
//
this.label14.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Left | System.Windows.Forms.AnchorStyles.Right)));
this.label14.AutoSize = true;
this.label14.Location = new System.Drawing.Point(3, 63);
this.label14.Name = "label14";
this.label14.Size = new System.Drawing.Size(58, 13);
this.label14.TabIndex = 3;
this.label14.Text = "Ignore";
this.label14.TextAlign = System.Drawing.ContentAlignment.MiddleRight;
//
// checkBox5
//
this.checkBox5.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Left | System.Windows.Forms.AnchorStyles.Right)));
this.checkBox5.AutoSize = true;
this.checkBox5.Location = new System.Drawing.Point(67, 61);
this.checkBox5.Name = "checkBox5";
this.checkBox5.Size = new System.Drawing.Size(187, 17);
this.checkBox5.TabIndex = 4;
this.checkBox5.Text = "Enable";
this.checkBox5.UseVisualStyleBackColor = true;
//
// SettingsForm
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
@@ -941,6 +985,7 @@
this.groupBox2.ResumeLayout(false);
this.tableLayoutPanel10.ResumeLayout(false);
this.tableLayoutPanel10.PerformLayout();
((System.ComponentModel.ISupportInitialize)(this.numericUpDown2)).EndInit();
this.tableLayoutPanel4.ResumeLayout(false);
this.tableLayoutPanel5.ResumeLayout(false);
this.groupBox4.ResumeLayout(false);
@@ -985,7 +1030,6 @@
private Label label4;
private TextBox appIdTextBox;
private Label label6;
private TextBox lingerTimeTextBox;
private TableLayoutPanel tableLayoutPanel4;
private TableLayoutPanel tableLayoutPanel5;
private Button button4;
@@ -1020,5 +1064,8 @@
private Label label13;
private TrackBar trackBar1;
private TextBox textBox4;
private NumericUpDown numericUpDown2;
private Label label14;
private CheckBox checkBox5;
}
}
/trunk/Winify/Settings/SettingsForm.cs
@@ -161,8 +161,6 @@
var announcement = new Announcement();
if (int.TryParse(appIdTextBox.Text, out var appId)) announcement.AppId = appId;
 
if (int.TryParse(lingerTimeTextBox.Text, out var lingerTime)) announcement.LingerTime = lingerTime;
 
_announcements.Announcement.Add(announcement);
 
Save?.Invoke(this, new SettingsSavedEventArgs(_servers, _announcements));
@@ -280,9 +278,12 @@
appIdTextBox.DataBindings.Add(new Binding("Text", _announcementBindingSource, nameof(_announcement.AppId),
true,
DataSourceUpdateMode.OnPropertyChanged));
lingerTimeTextBox.DataBindings.Add(new Binding("Text", _announcementBindingSource,
numericUpDown2.DataBindings.Add(new Binding("Value", _announcementBindingSource,
nameof(_announcement.LingerTime), true,
DataSourceUpdateMode.OnPropertyChanged));
checkBox5.DataBindings.Add(
new Binding("Checked", _announcementBindingSource, nameof(_announcement.Ignore), true,
DataSourceUpdateMode.OnPropertyChanged));
 
listBox2.DataSource = _announcements.Announcement;
listBox2.DisplayMember = "Id";