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

Commit

Permalink
53X Again 23!
Browse files Browse the repository at this point in the history
  • Loading branch information
Taiizor authored and Taiizor committed Apr 12, 2021
1 parent c3d9f04 commit 17efb8e
Show file tree
Hide file tree
Showing 6 changed files with 255 additions and 65 deletions.
108 changes: 105 additions & 3 deletions src/Taskbar/Taskbar.cs
Original file line number Diff line number Diff line change
Expand Up @@ -140,6 +140,101 @@ public static Point Location(Screen Screen, Enums.EdgeLocationType Edge, int Wid
/// </summary>
public class Simple
{
/// <summary>
/// Gets taskbar size.
/// </summary>
/// <returns></returns>
public static Size Size(Screen Screen)
{
try
{
int Width = Screen.Bounds.Width - Screen.WorkingArea.Width;
int Height = Screen.Bounds.Height - Screen.WorkingArea.Height;

return Detect(Screen) switch
{
Enums.LocationType.Left => new(Width == 0 ? 2 : Width, Screen.Bounds.Height),
Enums.LocationType.Top => new(Screen.Bounds.Width, Height == 0 ? 2 : Height),
Enums.LocationType.Right => new(Width == 0 ? 2 : Width, Screen.Bounds.Height),
_ => new(Screen.Bounds.Width, Height == 0 ? 2 : Height),
};
}
catch
{
throw new Exception(Values.Exception);
}
}

/// <summary>
/// Gets taskbar size.
/// </summary>
/// <returns></returns>
public static Size SingleSize
{
get
{
try
{
return Size(Screen.PrimaryScreen);
}
catch
{
throw new Exception(Values.Exception);
}
}
}

/// <summary>
/// Gets detect multiple screen taskbar size list value.
/// </summary>
public static List<Size> MultiSizeList
{
get
{
try
{
List<Size> Result = new();

foreach (Screen Screen in Screen.AllScreens)
{
Result.Add(Size(Screen));
}

return Result;
}
catch
{
throw new Exception(Values.Exception);
}
}
}

/// <summary>
/// Gets detect multiple screen taskbar size dictionary value.
/// </summary>
public static Dictionary<int, Size> MultiSizeDictionary
{
get
{
try
{
Dictionary<int, Size> Result = new();
int Count = 0;

foreach (Screen Screen in Screen.AllScreens)
{
Result.Add(Count++, Size(Screen));
}

return Result;
}
catch
{
throw new Exception(Values.Exception);
}
}
}

/// <summary>
/// Gets detect screen taskbar location.
/// </summary>
Expand Down Expand Up @@ -581,9 +676,16 @@ public static Size Size
{
try
{
//Detecting position
//width - height
return new(0, 0);
int Width = Data.Rect.Right - Data.Rect.Left;
int Height = Data.Rect.Bot - Data.Rect.Top;

return Position switch
{
Enums.LocationType.Left => new(AutoHide ? 2 : Data.Rect.Right, Data.Rect.Bot),
Enums.LocationType.Top => new(Data.Rect.Right, AutoHide ? 2 : Data.Rect.Bot),
Enums.LocationType.Right => new(AutoHide ? 2 : Width, Data.Rect.Bot),
_ => new(Data.Rect.Right, AutoHide ? 2 : Height),
};
}
catch
{
Expand Down
4 changes: 2 additions & 2 deletions src/Taskbar/Taskbar.csproj
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>net48</TargetFramework>
<!--<TargetFramework>net48</TargetFramework>-->
<!--<TargetFrameworks>net48;net5.0-windows;net6.0-windows</TargetFrameworks>-->
<!--<TargetFrameworks>net40;net45;net451;net452;net46;net461;net462;net47;net471;net472;net48;net5.0-windows;net6.0-windows</TargetFrameworks>-->
<!--<TargetFrameworks>net40;net45;net451;net452;net46;net461;net462;net47;net471;net472;net48;netcoreapp3.0-windows;netcoreapp3.1-windows;net5.0-windows;net6.0-windows</TargetFrameworks>-->
<TargetFrameworks>net40;net45;net451;net452;net46;net461;net462;net47;net471;net472;net48;netcoreapp3.0-windows;netcoreapp3.1-windows;net5.0-windows;net6.0-windows</TargetFrameworks>
<UseWindowsForms>true</UseWindowsForms>
<ApplicationIcon>Resources\ICO.ico</ApplicationIcon>
<Version>1.0.0.4</Version>
Expand Down
80 changes: 67 additions & 13 deletions src/Taskbar_CR/Main.Designer.cs

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

Loading

0 comments on commit 17efb8e

Please sign in to comment.