Skip to content
This repository has been archived by the owner on Jun 2, 2023. It is now read-only.

Commit

Permalink
53X Again 12!
Browse files Browse the repository at this point in the history
  • Loading branch information
Taiizor authored and Taiizor committed Apr 13, 2021
1 parent 320e455 commit e1cfe7b
Show file tree
Hide file tree
Showing 13 changed files with 264 additions and 89 deletions.
2 changes: 1 addition & 1 deletion src/Witcher/Notify/Manager/Management.Designer.cs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

95 changes: 60 additions & 35 deletions src/Witcher/Notify/Manager/Management.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
using System;
#region Imports

using System;
using System.Drawing;
using System.Linq;
using System.Windows.Forms;
Expand All @@ -7,8 +9,12 @@
using static Taskbar.Enum.Enums;
using static Witcher.Witcher.Property;

#endregion

namespace Witcher.Notify.Manager
{
#region Management

public partial class WitcherManagement : Form
{
public WitcherManagement()
Expand All @@ -22,61 +28,78 @@ private void Control_Tick(object sender, EventArgs e)

foreach (Form OpenForm in Application.OpenForms)
{
if (OpenForm.Text.Contains(Values.Form))
if (OpenForm.Text.StartsWith(Values.StandardForm))
{
int ID1 = Convert.ToInt32(OpenForm.Text.Replace(Values.Form, ""));

if (ID1 >= 1)
if (Standard_Control(OpenForm))
{
bool State = true;
break;
}
}
}

foreach (Form CheckForm in Application.OpenForms)
{
if (CheckForm.Text.Contains(Values.Form))
{
int ID2 = ID1 - 1;
if (CheckForm.Text == Values.Form + ID2)
{
State = false;
break;
}
}
}
Control.Start();
}

private static bool Standard_Control(Form OpenForm)
{
int ID1 = Convert.ToInt32(OpenForm.Text.Replace(Values.StandardForm, ""));

if (ID1 >= 1)
{
bool State = true;

if (State)
foreach (Form CheckForm in Application.OpenForms)
{
if (CheckForm.Text.StartsWith(Values.StandardForm))
{
int ID2 = ID1 - 1;
if (CheckForm.Text == Values.StandardForm + ID2)
{
if (Values.Data.Location == EdgeLocationType.BotRight || Values.Data.Location == EdgeLocationType.BotLeft)
{
OpenForm.Location = new Point(OpenForm.Location.X, OpenForm.Location.Y + OpenForm.Height);
}
else
{
OpenForm.Location = new Point(OpenForm.Location.X, OpenForm.Location.Y - OpenForm.Height);
}

OpenForm.Text = Values.Form + (ID1 - 1);
State = false;
break;
}
}
}

if (State)
{
if (Values.Location == EdgeLocationType.BotRight || Values.Location == EdgeLocationType.BotCenter || Values.Location == EdgeLocationType.BotLeft || Values.Location == EdgeLocationType.LeftCenter || Values.Location == EdgeLocationType.FullCenter)
{
OpenForm.Location = new Point(OpenForm.Location.X, OpenForm.Location.Y + OpenForm.Height);
}
else
{
OpenForm.Location = new Point(OpenForm.Location.X, OpenForm.Location.Y - OpenForm.Height);
}

OpenForm.Text = Values.StandardForm + (ID1 - 1);
return true;
}
}

Control.Start();
return false;
}

private void Notification_Tick(object sender, EventArgs e)
{
Notification.Stop();

if (Values.Datas.Any() && ActiveOpen < MaxOpen)
try
{
foreach (Structs.Data Data in Values.Datas)
if (Values.Datas.Any() && ActiveOpen < MaxOpen)
{
Witcher.Notify.Show(Data);
Values.Datas.Remove(Data);
break;
foreach (Structs.Data Data in Values.Datas)
{
Witcher.Notify.Show(Data);
Values.Datas.Remove(Data);
break;
}
}
}
catch
{
//throw;
}

Notification.Start();
}
Expand All @@ -86,4 +109,6 @@ private void Management_FormClosing(object sender, FormClosingEventArgs e)
e.Cancel = true;
}
}

#endregion
}
9 changes: 4 additions & 5 deletions src/Witcher/Notify/Manager/Management.resx
Original file line number Diff line number Diff line change
Expand Up @@ -117,11 +117,10 @@
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<assembly alias="System.Drawing" name="System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
<data name="Control.TrayLocation" type="System.Drawing.Point, System.Drawing">
<metadata name="Control.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>17, 17</value>
</data>
<data name="Notification.TrayLocation" type="System.Drawing.Point, System.Drawing">
</metadata>
<metadata name="Notification.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>104, 17</value>
</data>
</metadata>
</root>

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
using System;
#region Imports

using System;
using System.Drawing;
using System.Windows.Forms;
using Witcher.Struct;
Expand All @@ -8,24 +10,33 @@
using static Witcher.Enum.Enums;
using static Witcher.Witcher.Property;

#endregion

namespace Witcher.Notify.Standard
{
public partial class NYB : Form
#region Standard

/// <summary>
///
/// </summary>
public partial class WitcherStandard : Form
{
private Structs.Data Local = Values.Data;
private StateType Stage = StateType.Show;

private int Time = 0;

public NYB(Structs.Data Data)
public WitcherStandard(Structs.Data Data)
{
InitializeComponent();

Text = Values.Form;
Text = Values.StandardForm;

Local = Data;

if (Data.Theme == ThemaType.Dark)
TopMost = Local.Top;

if (Local.Theme == ThemaType.Dark)
{
BackColor = Color.FromArgb(38, 38, 38);
TEXT.ForeColor = Color.Gainsboro;
Expand All @@ -36,10 +47,10 @@ public NYB(Structs.Data Data)
TEXT.ForeColor = Color.FromArgb(38, 38, 38);
}

TEXT.Text = Data.Text;
TEXT.Font = Data.Font;
TEXT.Text = Local.Text;
TEXT.Font = Local.Font;

switch (Data.Alert)
switch (Local.Alert)
{
case AlertType.Success:
LEFT.BackColor = Color.SeaGreen;
Expand All @@ -58,33 +69,57 @@ public NYB(Structs.Data Data)
BAR.ProgressColor = LEFT.BackColor;
}

private void NYB_Load(object sender, EventArgs e)
private void Standard_Load(object sender, EventArgs e)
{
Location = SingleLocation(Local.Location, Width, Height, (ActiveOpen * Height) + Local.Distance);

if (Local.Location == EdgeLocationType.BotRight)
{
LEFT.Dock = DockStyle.Right;
Location = new Point(Location.X + (ActiveOpen * Height), Location.Y + Local.Distance);
Location = new Point(Location.X + (ActiveOpen * Height), Location.Y - Local.Distance);
}
else if (Local.Location == EdgeLocationType.BotCenter)
{
Location = new Point(Location.X, Location.Y - Local.Distance);
}
else if (Local.Location == EdgeLocationType.BotLeft)
{
Location = new Point(Location.X - (ActiveOpen * Height), Location.Y + Local.Distance);
Location = new Point(Location.X - (ActiveOpen * Height), Location.Y - Local.Distance);
}
else if (Local.Location == EdgeLocationType.TopRight)
{
LEFT.Dock = DockStyle.Right;
Location = new Point(Location.X + (ActiveOpen * Height), Location.Y - Local.Distance);
Location = new Point(Location.X + (ActiveOpen * Height), Location.Y + Local.Distance);
BAR.Dock = DockStyle.Top;
}
else
else if (Local.Location == EdgeLocationType.TopCenter)
{
Location = new Point(Location.X - (ActiveOpen * Height), Location.Y - Local.Distance);
Location = new Point(Location.X, Location.Y + Local.Distance);
BAR.Dock = DockStyle.Top;
}
else if (Local.Location == EdgeLocationType.TopLeft)
{
Location = new Point(Location.X - (ActiveOpen * Height), Location.Y + Local.Distance);
BAR.Dock = DockStyle.Top;
}
else if (Local.Location == EdgeLocationType.LeftCenter)
{
Location = new Point(Location.X - (ActiveOpen * Height), Location.Y - (ActiveOpen * Height));
BAR.Dock = DockStyle.Top;
}
else if (Local.Location == EdgeLocationType.RightCenter)
{
Location = new Point(Location.X + (ActiveOpen * Height), Location.Y + (ActiveOpen * Height));
}
else if (Local.Location == EdgeLocationType.CalcCenter)
{
Location = new Point(Location.X, Location.Y + (ActiveOpen * Height));
}
else if (Local.Location == EdgeLocationType.FullCenter)
{
Location = new Point(Location.X, Location.Y - (ActiveOpen * Height));
BAR.Dock = DockStyle.Top;
}

Text += ActiveOpen;
ActiveOpen++;
Text += ActiveOpen++;
}

private void CLOSE_MouseEnter(object sender, EventArgs e)
Expand Down Expand Up @@ -123,13 +158,13 @@ private void General_Tick(object sender, EventArgs e)
if (Local.Distance > 0)
{
Local.Distance -= 2;
if (Local.Location == EdgeLocationType.BotRight || Local.Location == EdgeLocationType.BotLeft)
if (Local.Location == EdgeLocationType.BotRight || Local.Location == EdgeLocationType.BotCenter || Local.Location == EdgeLocationType.BotLeft || Local.Location == EdgeLocationType.LeftCenter || Local.Location == EdgeLocationType.FullCenter)
{
Location = new Point(Location.X, Location.Y - 2);
Location = new Point(Location.X, Location.Y + 2);
}
else
{
Location = new Point(Location.X, Location.Y + 2);
Location = new Point(Location.X, Location.Y - 2);
}
}
else
Expand All @@ -138,7 +173,7 @@ private void General_Tick(object sender, EventArgs e)
}
break;
case StateType.Close:
if (Text == Values.Form + "0")
if (Text == Values.StandardForm + "0")
{
if (Time <= Local.Time)
{
Expand Down Expand Up @@ -166,14 +201,14 @@ private void General_Tick(object sender, EventArgs e)
}
else
{
NYB_FormClosed(sender, e);
Standard_FormClosed(sender, e);
Dispose();
}
break;
}
}

private void NYB_LocationChanged(object sender, EventArgs e)
private void Standard_LocationChanged(object sender, EventArgs e)
{
if (General.Enabled && Stage == StateType.Close)
{
Expand All @@ -182,9 +217,11 @@ private void NYB_LocationChanged(object sender, EventArgs e)
}
}

private void NYB_FormClosed(object sender, EventArgs e)
private void Standard_FormClosed(object sender, EventArgs e)
{
ActiveOpen--;
}
}

#endregion
}
Loading

0 comments on commit e1cfe7b

Please sign in to comment.