Skip to content

Commit

Permalink
Update V1.0.10
Browse files Browse the repository at this point in the history
  • Loading branch information
Irval1337 committed Apr 1, 2021
1 parent 29c3973 commit 4c42bb7
Show file tree
Hide file tree
Showing 23 changed files with 37 additions and 5 deletions.
14 changes: 14 additions & 0 deletions Examples/NotificationExample/Form1.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
using System;
using System.Collections.Generic;
using System.Drawing;
using System.IO;
using System.Windows.Forms;
using NotificationManager;

Expand All @@ -18,6 +20,8 @@ public Form1()
notify1.MaxTextWidth = 250;
notify1.EnableOffset = false;
notify1.HasHighlighting = false;
notify1.onFinish += Finish;
notify1.onClose += Close;

notify2.PositionType = NotificationPosition.Right;
notify2.InvertAdding = true;
Expand Down Expand Up @@ -67,5 +71,15 @@ private void button7_Click(object sender, EventArgs e)
{
notify1.InvertAdding = notify2.InvertAdding = notify3.InvertAdding = notify4.InvertAdding = !notify4.InvertAdding;
}

private void Close(object sender, EventArgs e)
{
File.AppendAllLines("log.txt", new List<string>() { "Closed" });
}

private void Finish(object sender, EventArgs e)
{
File.AppendAllLines("log.txt", new List<string>() { "Finished" });
}
}
}
4 changes: 2 additions & 2 deletions Examples/NotificationExample/NotificationExample.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,8 @@
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<ItemGroup>
<Reference Include="NotificationManager, Version=1.0.9.0, Culture=neutral, processorArchitecture=MSIL">
<HintPath>..\packages\NotificationManager.1.0.9\lib\net472\NotificationManager.dll</HintPath>
<Reference Include="NotificationManager, Version=1.0.10.0, Culture=neutral, processorArchitecture=MSIL">
<HintPath>..\packages\NotificationManager.1.0.10\lib\net472\NotificationManager.dll</HintPath>
</Reference>
<Reference Include="System" />
<Reference Include="System.Core" />
Expand Down
2 changes: 1 addition & 1 deletion Examples/NotificationExample/packages.config
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="NotificationManager" version="1.0.9" targetFramework="net472" />
<package id="NotificationManager" version="1.0.10" targetFramework="net472" />
</packages>
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
10 changes: 10 additions & 0 deletions NotificationLib/NotificationLib/Manager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,16 @@ public class Manager
/// </summary>
public NotificationPosition PositionType = NotificationPosition.Right;

/// <summary>
/// Событие искусственного закрытия уведомления.
/// </summary>
public System.EventHandler onClose = delegate { };

/// <summary>
/// Событие закрытия уведомления по завершении таймера.
/// </summary>
public System.EventHandler onFinish = delegate { };

/// <summary>
/// Смещение уведомлений после закрытия предыдущего.
/// </summary>
Expand Down
8 changes: 8 additions & 0 deletions NotificationLib/NotificationLib/NotificationForm.cs
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@ public NotificationForm()

public Manager manager;

private bool wasClosed = false, state = true;

private enum Action
{
wait,
Expand Down Expand Up @@ -87,6 +89,11 @@ private void timer1_Tick(object sender, EventArgs e)
((NotificationForm)frm).ChangePosition();
}

if (wasClosed)
manager.onClose(sender, e);
else
manager.onFinish(sender, e);

this.Close();
}
break;
Expand Down Expand Up @@ -225,6 +232,7 @@ private void Notification_FormClosing(object sender, FormClosingEventArgs e)

private void button1_Click(object sender, EventArgs e)
{
wasClosed = true;
timer1.Interval = manager.TimerInterval;
action = Action.close;
}
Expand Down
4 changes: 2 additions & 2 deletions NotificationLib/NotificationLib/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -32,5 +32,5 @@
// Можно задать все значения или принять номера сборки и редакции по умолчанию
// используя "*", как показано ниже:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.0.9")]
[assembly: AssemblyFileVersion("1.0.9")]
[assembly: AssemblyVersion("1.0.10")]
[assembly: AssemblyFileVersion("1.0.10")]

0 comments on commit 4c42bb7

Please sign in to comment.