diff --git a/Examples/NotificationExample/Form1.Designer.cs b/Examples/NotificationExample/Form1.Designer.cs index c67c54a..db7879f 100644 --- a/Examples/NotificationExample/Form1.Designer.cs +++ b/Examples/NotificationExample/Form1.Designer.cs @@ -33,6 +33,7 @@ private void InitializeComponent() this.button3 = new System.Windows.Forms.Button(); this.button4 = new System.Windows.Forms.Button(); this.button5 = new System.Windows.Forms.Button(); + this.button6 = new System.Windows.Forms.Button(); this.SuspendLayout(); // // button1 @@ -47,7 +48,7 @@ private void InitializeComponent() // // button2 // - this.button2.Location = new System.Drawing.Point(12, 128); + this.button2.Location = new System.Drawing.Point(12, 157); this.button2.Name = "button2"; this.button2.Size = new System.Drawing.Size(215, 23); this.button2.TabIndex = 0; @@ -85,12 +86,23 @@ private void InitializeComponent() this.button5.UseVisualStyleBackColor = true; this.button5.Click += new System.EventHandler(this.button5_Click); // + // button6 + // + this.button6.Location = new System.Drawing.Point(12, 128); + this.button6.Name = "button6"; + this.button6.Size = new System.Drawing.Size(215, 23); + this.button6.TabIndex = 0; + this.button6.Text = "Custom"; + this.button6.UseVisualStyleBackColor = true; + this.button6.Click += new System.EventHandler(this.button6_Click); + // // Form1 // this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; - this.ClientSize = new System.Drawing.Size(239, 163); + this.ClientSize = new System.Drawing.Size(239, 188); this.Controls.Add(this.button2); + this.Controls.Add(this.button6); this.Controls.Add(this.button5); this.Controls.Add(this.button4); this.Controls.Add(this.button3); @@ -109,6 +121,7 @@ private void InitializeComponent() private System.Windows.Forms.Button button3; private System.Windows.Forms.Button button4; private System.Windows.Forms.Button button5; + private System.Windows.Forms.Button button6; } } diff --git a/Examples/NotificationExample/Form1.cs b/Examples/NotificationExample/Form1.cs index 5418d01..6534423 100644 --- a/Examples/NotificationExample/Form1.cs +++ b/Examples/NotificationExample/Form1.cs @@ -1,4 +1,5 @@ using System; +using System.Drawing; using System.Windows.Forms; using NotificationManager; @@ -39,5 +40,10 @@ private void button5_Click(object sender, EventArgs e) { notify.Alert("Info", NotificationType.Info); } + + private void button6_Click(object sender, EventArgs e) + { + notify.Alert("С наступающим!", NotificationType.Custom, Color.FromArgb(255, 21, 29, 33), Properties.Resources.logo); + } } } diff --git a/Examples/NotificationExample/NotificationExample.csproj b/Examples/NotificationExample/NotificationExample.csproj index 766b77f..c2e2f7e 100644 --- a/Examples/NotificationExample/NotificationExample.csproj +++ b/Examples/NotificationExample/NotificationExample.csproj @@ -34,7 +34,7 @@ - ..\packages\NotificationManager.1.0.4\lib\net472\NotificationManager.dll + ..\packages\NotificationManager.1.0.5\lib\net472\NotificationManager.dll @@ -60,11 +60,20 @@ Form1.cs + + ResXFileCodeGenerator + Resources.Designer.cs + SettingsSingleFileGenerator Settings.Designer.cs + + True + True + Resources.resx + True Settings.settings @@ -74,6 +83,8 @@ - + + + \ No newline at end of file diff --git a/Examples/NotificationExample/Properties/Resources.Designer.cs b/Examples/NotificationExample/Properties/Resources.Designer.cs new file mode 100644 index 0000000..b89abc5 --- /dev/null +++ b/Examples/NotificationExample/Properties/Resources.Designer.cs @@ -0,0 +1,73 @@ +//------------------------------------------------------------------------------ +// +// Этот код создан программой. +// Исполняемая версия:4.0.30319.42000 +// +// Изменения в этом файле могут привести к неправильной работе и будут потеряны в случае +// повторной генерации кода. +// +//------------------------------------------------------------------------------ + +namespace NotificationExample.Properties { + using System; + + + /// + /// Класс ресурса со строгой типизацией для поиска локализованных строк и т.д. + /// + // Этот класс создан автоматически классом StronglyTypedResourceBuilder + // с помощью такого средства, как ResGen или Visual Studio. + // Чтобы добавить или удалить член, измените файл .ResX и снова запустите ResGen + // с параметром /str или перестройте свой проект VS. + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "16.0.0.0")] + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + internal class Resources { + + private static global::System.Resources.ResourceManager resourceMan; + + private static global::System.Globalization.CultureInfo resourceCulture; + + [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")] + internal Resources() { + } + + /// + /// Возвращает кэшированный экземпляр ResourceManager, использованный этим классом. + /// + [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] + internal static global::System.Resources.ResourceManager ResourceManager { + get { + if (object.ReferenceEquals(resourceMan, null)) { + global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("NotificationExample.Properties.Resources", typeof(Resources).Assembly); + resourceMan = temp; + } + return resourceMan; + } + } + + /// + /// Перезаписывает свойство CurrentUICulture текущего потока для всех + /// обращений к ресурсу с помощью этого класса ресурса со строгой типизацией. + /// + [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] + internal static global::System.Globalization.CultureInfo Culture { + get { + return resourceCulture; + } + set { + resourceCulture = value; + } + } + + /// + /// Поиск локализованного ресурса типа System.Drawing.Bitmap. + /// + internal static System.Drawing.Bitmap logo { + get { + object obj = ResourceManager.GetObject("logo", resourceCulture); + return ((System.Drawing.Bitmap)(obj)); + } + } + } +} diff --git a/Examples/NotificationExample/Properties/Resources.resx b/Examples/NotificationExample/Properties/Resources.resx new file mode 100644 index 0000000..45dc3be --- /dev/null +++ b/Examples/NotificationExample/Properties/Resources.resx @@ -0,0 +1,124 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + + ..\Resources\logo.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + + \ No newline at end of file diff --git a/Examples/NotificationExample/Resources/logo.png b/Examples/NotificationExample/Resources/logo.png new file mode 100644 index 0000000..00d60d5 Binary files /dev/null and b/Examples/NotificationExample/Resources/logo.png differ diff --git a/Examples/NotificationExample/packages.config b/Examples/NotificationExample/packages.config index 13b6469..767c9ac 100644 --- a/Examples/NotificationExample/packages.config +++ b/Examples/NotificationExample/packages.config @@ -1,4 +1,4 @@  - + \ No newline at end of file diff --git a/Examples/packages/NotificationManager.1.0.4/NotificationManager.1.0.4.nupkg b/Examples/packages/NotificationManager.1.0.4/NotificationManager.1.0.4.nupkg deleted file mode 100644 index 047a6a8..0000000 Binary files a/Examples/packages/NotificationManager.1.0.4/NotificationManager.1.0.4.nupkg and /dev/null differ diff --git a/Examples/packages/NotificationManager.1.0.4/lib/net20/NotificationManager.dll b/Examples/packages/NotificationManager.1.0.4/lib/net20/NotificationManager.dll deleted file mode 100644 index b0c5669..0000000 Binary files a/Examples/packages/NotificationManager.1.0.4/lib/net20/NotificationManager.dll and /dev/null differ diff --git a/Examples/packages/NotificationManager.1.0.4/lib/net40/NotificationManager.dll b/Examples/packages/NotificationManager.1.0.4/lib/net40/NotificationManager.dll deleted file mode 100644 index 7c6da06..0000000 Binary files a/Examples/packages/NotificationManager.1.0.4/lib/net40/NotificationManager.dll and /dev/null differ diff --git a/Examples/packages/NotificationManager.1.0.4/lib/net45/NotificationManager.dll b/Examples/packages/NotificationManager.1.0.4/lib/net45/NotificationManager.dll deleted file mode 100644 index 3c9e8e9..0000000 Binary files a/Examples/packages/NotificationManager.1.0.4/lib/net45/NotificationManager.dll and /dev/null differ diff --git a/Examples/packages/NotificationManager.1.0.4/lib/net46/NotificationManager.dll b/Examples/packages/NotificationManager.1.0.4/lib/net46/NotificationManager.dll deleted file mode 100644 index a21de22..0000000 Binary files a/Examples/packages/NotificationManager.1.0.4/lib/net46/NotificationManager.dll and /dev/null differ diff --git a/Examples/packages/NotificationManager.1.0.4/lib/net461/NotificationManager.dll b/Examples/packages/NotificationManager.1.0.4/lib/net461/NotificationManager.dll deleted file mode 100644 index 7167442..0000000 Binary files a/Examples/packages/NotificationManager.1.0.4/lib/net461/NotificationManager.dll and /dev/null differ diff --git a/Examples/packages/NotificationManager.1.0.4/lib/net471/NotificationManager.dll b/Examples/packages/NotificationManager.1.0.4/lib/net471/NotificationManager.dll deleted file mode 100644 index d3e661a..0000000 Binary files a/Examples/packages/NotificationManager.1.0.4/lib/net471/NotificationManager.dll and /dev/null differ diff --git a/Examples/packages/NotificationManager.1.0.4/lib/net472/NotificationManager.dll b/Examples/packages/NotificationManager.1.0.4/lib/net472/NotificationManager.dll deleted file mode 100644 index 002914f..0000000 Binary files a/Examples/packages/NotificationManager.1.0.4/lib/net472/NotificationManager.dll and /dev/null differ diff --git a/Examples/packages/NotificationManager.1.0.4/.signature.p7s b/Examples/packages/NotificationManager.1.0.5/.signature.p7s similarity index 85% rename from Examples/packages/NotificationManager.1.0.4/.signature.p7s rename to Examples/packages/NotificationManager.1.0.5/.signature.p7s index 660c76d..de3e889 100644 Binary files a/Examples/packages/NotificationManager.1.0.4/.signature.p7s and b/Examples/packages/NotificationManager.1.0.5/.signature.p7s differ diff --git a/Examples/packages/NotificationManager.1.0.5/NotificationManager.1.0.5.nupkg b/Examples/packages/NotificationManager.1.0.5/NotificationManager.1.0.5.nupkg new file mode 100644 index 0000000..cf5a37c Binary files /dev/null and b/Examples/packages/NotificationManager.1.0.5/NotificationManager.1.0.5.nupkg differ diff --git a/Examples/packages/NotificationManager.1.0.5/lib/net20/NotificationManager.dll b/Examples/packages/NotificationManager.1.0.5/lib/net20/NotificationManager.dll new file mode 100644 index 0000000..778f895 Binary files /dev/null and b/Examples/packages/NotificationManager.1.0.5/lib/net20/NotificationManager.dll differ diff --git a/Examples/packages/NotificationManager.1.0.5/lib/net40/NotificationManager.dll b/Examples/packages/NotificationManager.1.0.5/lib/net40/NotificationManager.dll new file mode 100644 index 0000000..8eda11f Binary files /dev/null and b/Examples/packages/NotificationManager.1.0.5/lib/net40/NotificationManager.dll differ diff --git a/Examples/packages/NotificationManager.1.0.5/lib/net45/NotificationManager.dll b/Examples/packages/NotificationManager.1.0.5/lib/net45/NotificationManager.dll new file mode 100644 index 0000000..fbe89fd Binary files /dev/null and b/Examples/packages/NotificationManager.1.0.5/lib/net45/NotificationManager.dll differ diff --git a/Examples/packages/NotificationManager.1.0.5/lib/net46/NotificationManager.dll b/Examples/packages/NotificationManager.1.0.5/lib/net46/NotificationManager.dll new file mode 100644 index 0000000..7ece550 Binary files /dev/null and b/Examples/packages/NotificationManager.1.0.5/lib/net46/NotificationManager.dll differ diff --git a/Examples/packages/NotificationManager.1.0.5/lib/net461/NotificationManager.dll b/Examples/packages/NotificationManager.1.0.5/lib/net461/NotificationManager.dll new file mode 100644 index 0000000..dd6be89 Binary files /dev/null and b/Examples/packages/NotificationManager.1.0.5/lib/net461/NotificationManager.dll differ diff --git a/Examples/packages/NotificationManager.1.0.5/lib/net471/NotificationManager.dll b/Examples/packages/NotificationManager.1.0.5/lib/net471/NotificationManager.dll new file mode 100644 index 0000000..716f02b Binary files /dev/null and b/Examples/packages/NotificationManager.1.0.5/lib/net471/NotificationManager.dll differ diff --git a/Examples/packages/NotificationManager.1.0.5/lib/net472/NotificationManager.dll b/Examples/packages/NotificationManager.1.0.5/lib/net472/NotificationManager.dll new file mode 100644 index 0000000..9d28a84 Binary files /dev/null and b/Examples/packages/NotificationManager.1.0.5/lib/net472/NotificationManager.dll differ diff --git a/NotificationLib/NotificationLib/NotificationForm.Designer.cs b/NotificationLib/NotificationLib/NotificationForm.Designer.cs index a8a2a98..5300b0e 100644 --- a/NotificationLib/NotificationLib/NotificationForm.Designer.cs +++ b/NotificationLib/NotificationLib/NotificationForm.Designer.cs @@ -68,9 +68,9 @@ private void InitializeComponent() // pictureBox1 // this.pictureBox1.Image = global::NotificationManager.Properties.Resources.success; - this.pictureBox1.Location = new System.Drawing.Point(10, 17); + this.pictureBox1.Location = new System.Drawing.Point(12, 17); this.pictureBox1.Name = "pictureBox1"; - this.pictureBox1.Size = new System.Drawing.Size(49, 44); + this.pictureBox1.Size = new System.Drawing.Size(45, 45); this.pictureBox1.SizeMode = System.Windows.Forms.PictureBoxSizeMode.Zoom; this.pictureBox1.TabIndex = 5; this.pictureBox1.TabStop = false; diff --git a/NotificationLib/NotificationLib/NotificationForm.cs b/NotificationLib/NotificationLib/NotificationForm.cs index ee4de50..9cdbc22 100644 --- a/NotificationLib/NotificationLib/NotificationForm.cs +++ b/NotificationLib/NotificationLib/NotificationForm.cs @@ -113,6 +113,13 @@ public void showAlert(string msg, NotificationType type, Manager notify) this.timer1.Start(); } + public void showAlert(string msg, NotificationType type, Color color, Image picture, Manager notify) + { + this.pictureBox1.Image = picture; + this.BackColor = color; + showAlert(msg, type, notify); + } + protected override CreateParams CreateParams { get diff --git a/NotificationLib/NotificationLib/Notify.cs b/NotificationLib/NotificationLib/Notify.cs index b774000..f3c3199 100644 --- a/NotificationLib/NotificationLib/Notify.cs +++ b/NotificationLib/NotificationLib/Notify.cs @@ -12,7 +12,7 @@ public class Manager public Colors Colors; public void Alert(string msg, NotificationType type) - { + { if (Properties.Notification.Default.nums < MaxCount) { NotificationForm frm = new NotificationForm(); @@ -20,6 +20,15 @@ public void Alert(string msg, NotificationType type) } } + public void Alert(string msg, NotificationType type, Color color, Image picture) + { + if (Properties.Notification.Default.nums < MaxCount) + { + NotificationForm frm = new NotificationForm(); + frm.showAlert(msg, type, color, picture, this); + } + } + public void CloseAll() { string fname; @@ -39,7 +48,8 @@ public enum NotificationType Success, Warning, Error, - Info + Info, + Custom } public class Colors