Skip to content

Commit

Permalink
Merge pull request #18 from emoacht/develop
Browse files Browse the repository at this point in the history
Develop
  • Loading branch information
emoacht authored Sep 8, 2021
2 parents efb4d51 + 673c07f commit a5853ff
Show file tree
Hide file tree
Showing 27 changed files with 922 additions and 1,243 deletions.
7 changes: 1 addition & 6 deletions Source/Installer/Product.wxs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi">
<Product Id="*" Name="Wifinian" Manufacturer="emoacht" Version="2.9.0"
<Product Id="*" Name="Wifinian" Manufacturer="emoacht" Version="3.0.0"
Language="1033" Codepage="1252" UpgradeCode="{A8357D71-600C-462A-AEEE-BF1B988DD2E4}">
<Package Id="*" InstallerVersion="500" Compressed="yes"
InstallScope="perMachine" InstallPrivileges="elevated"
Expand Down Expand Up @@ -121,10 +121,6 @@
<File Id="AgencyLibrary"
Source="$(var.Wifinian.TargetDir)" Name="StartupAgency.dll" KeyPath="yes"/>
</Component>
<Component Id="BridgeLibrary" Guid="{44985F46-8974-48CF-B4EA-F33446826B8C}">
<File Id="BridgeLibrary"
Source="$(var.Wifinian.TargetDir)" Name="StartupBridge.dll" KeyPath="yes"/>
</Component>

<Component Id="VisualManifest" Guid="{4DD773D0-D642-40DC-9576-D535D0AF89EB}">
<Condition><![CDATA[VEM = "yes"]]></Condition>
Expand Down Expand Up @@ -178,7 +174,6 @@
<ComponentRef Id="WifiLibrary"/>
<ComponentRef Id="FrameLibrary"/>
<ComponentRef Id="AgencyLibrary"/>
<ComponentRef Id="BridgeLibrary"/>
<ComponentRef Id="VisualManifest"/>
<ComponentRef Id="ApplicationShortcut"/>
<ComponentRef Id="ApplicationWorkingFolder"/>
Expand Down
69 changes: 29 additions & 40 deletions Source/ReactivePropertyTest/ReactivePropertyTest.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -37,52 +37,13 @@
</PropertyGroup>
<ItemGroup>
<Reference Include="Microsoft.CSharp" />
<Reference Include="Microsoft.Xaml.Behaviors, Version=1.1.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
<HintPath>..\packages\Microsoft.Xaml.Behaviors.Wpf.1.1.31\lib\net45\Microsoft.Xaml.Behaviors.dll</HintPath>
</Reference>
<Reference Include="PresentationCore" />
<Reference Include="PresentationFramework" />
<Reference Include="ReactiveProperty, Version=7.10.0.0, Culture=neutral, PublicKeyToken=910d1732782c71cb, processorArchitecture=MSIL">
<HintPath>..\packages\ReactiveProperty.7.10.0\lib\netstandard2.0\ReactiveProperty.dll</HintPath>
</Reference>
<Reference Include="ReactiveProperty.Core, Version=7.10.0.0, Culture=neutral, PublicKeyToken=910d1732782c71cb, processorArchitecture=MSIL">
<HintPath>..\packages\ReactiveProperty.Core.7.10.0\lib\netstandard2.0\ReactiveProperty.Core.dll</HintPath>
</Reference>
<Reference Include="System" />
<Reference Include="System.ComponentModel.Annotations, Version=4.2.1.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
<HintPath>..\packages\System.ComponentModel.Annotations.5.0.0\lib\net461\System.ComponentModel.Annotations.dll</HintPath>
</Reference>
<Reference Include="System.ComponentModel.DataAnnotations" />
<Reference Include="System.Core" />
<Reference Include="System.Data" />
<Reference Include="System.Reactive, Version=5.0.0.0, Culture=neutral, PublicKeyToken=94bc3704cddfc263, processorArchitecture=MSIL">
<HintPath>..\packages\System.Reactive.5.0.0\lib\net472\System.Reactive.dll</HintPath>
</Reference>
<Reference Include="System.Reactive.Core, Version=3.0.6000.0, Culture=neutral, PublicKeyToken=94bc3704cddfc263, processorArchitecture=MSIL">
<HintPath>..\packages\System.Reactive.Core.5.0.0\lib\net472\System.Reactive.Core.dll</HintPath>
</Reference>
<Reference Include="System.Reactive.Interfaces, Version=3.0.6000.0, Culture=neutral, PublicKeyToken=94bc3704cddfc263, processorArchitecture=MSIL">
<HintPath>..\packages\System.Reactive.Interfaces.5.0.0\lib\net472\System.Reactive.Interfaces.dll</HintPath>
</Reference>
<Reference Include="System.Reactive.Linq, Version=3.0.6000.0, Culture=neutral, PublicKeyToken=94bc3704cddfc263, processorArchitecture=MSIL">
<HintPath>..\packages\System.Reactive.Linq.5.0.0\lib\net472\System.Reactive.Linq.dll</HintPath>
</Reference>
<Reference Include="System.Reactive.PlatformServices, Version=3.0.6000.0, Culture=neutral, PublicKeyToken=94bc3704cddfc263, processorArchitecture=MSIL">
<HintPath>..\packages\System.Reactive.PlatformServices.5.0.0\lib\net472\System.Reactive.PlatformServices.dll</HintPath>
</Reference>
<Reference Include="System.Reactive.Windows.Threading, Version=3.0.6000.0, Culture=neutral, PublicKeyToken=94bc3704cddfc263, processorArchitecture=MSIL">
<HintPath>..\packages\System.Reactive.Windows.Threading.5.0.0\lib\net472\System.Reactive.Windows.Threading.dll</HintPath>
</Reference>
<Reference Include="System.Runtime.CompilerServices.Unsafe, Version=5.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
<HintPath>..\packages\System.Runtime.CompilerServices.Unsafe.5.0.0\lib\net45\System.Runtime.CompilerServices.Unsafe.dll</HintPath>
</Reference>
<Reference Include="System.Runtime.Serialization" />
<Reference Include="System.Threading.Tasks.Extensions, Version=4.2.0.1, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL">
<HintPath>..\packages\System.Threading.Tasks.Extensions.4.5.4\lib\net461\System.Threading.Tasks.Extensions.dll</HintPath>
</Reference>
<Reference Include="System.ValueTuple, Version=4.0.3.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL">
<HintPath>..\packages\System.ValueTuple.4.5.0\lib\net47\System.ValueTuple.dll</HintPath>
</Reference>
<Reference Include="System.Windows" />
<Reference Include="System.Windows.Forms" />
<Reference Include="System.Xaml">
Expand Down Expand Up @@ -132,7 +93,6 @@
<Generator>ResXFileCodeGenerator</Generator>
<LastGenOutput>Resources.Designer.cs</LastGenOutput>
</EmbeddedResource>
<None Include="packages.config" />
<None Include="Properties\Settings.settings">
<Generator>SettingsSingleFileGenerator</Generator>
<LastGenOutput>Settings.Designer.cs</LastGenOutput>
Expand All @@ -144,5 +104,34 @@
<SubType>Designer</SubType>
</None>
</ItemGroup>
<ItemGroup>
<PackageReference Include="Microsoft.Xaml.Behaviors.Wpf">
<Version>1.1.31</Version>
</PackageReference>
<PackageReference Include="ReactiveProperty">
<Version>7.12.0</Version>
</PackageReference>
<PackageReference Include="System.Reactive.Core">
<Version>5.0.0</Version>
</PackageReference>
<PackageReference Include="System.Reactive.Interfaces">
<Version>5.0.0</Version>
</PackageReference>
<PackageReference Include="System.Reactive.Linq">
<Version>5.0.0</Version>
</PackageReference>
<PackageReference Include="System.Reactive.PlatformServices">
<Version>5.0.0</Version>
</PackageReference>
<PackageReference Include="System.Reactive.Windows.Threading">
<Version>5.0.0</Version>
</PackageReference>
<PackageReference Include="System.Runtime.CompilerServices.Unsafe">
<Version>5.0.0</Version>
</PackageReference>
<PackageReference Include="System.ValueTuple">
<Version>4.5.0</Version>
</PackageReference>
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
</Project>
16 changes: 0 additions & 16 deletions Source/ReactivePropertyTest/packages.config

This file was deleted.

9 changes: 5 additions & 4 deletions Source/VisualStateTest/VisualStateTest.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -37,9 +37,6 @@
</PropertyGroup>
<ItemGroup>
<Reference Include="Microsoft.CSharp" />
<Reference Include="Microsoft.Xaml.Behaviors, Version=1.1.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
<HintPath>..\packages\Microsoft.Xaml.Behaviors.Wpf.1.1.31\lib\net45\Microsoft.Xaml.Behaviors.dll</HintPath>
</Reference>
<Reference Include="PresentationCore" />
<Reference Include="PresentationFramework" />
<Reference Include="System" />
Expand Down Expand Up @@ -90,7 +87,6 @@
<Generator>ResXFileCodeGenerator</Generator>
<LastGenOutput>Resources.Designer.cs</LastGenOutput>
</EmbeddedResource>
<None Include="packages.config" />
<None Include="Properties\Settings.settings">
<Generator>SettingsSingleFileGenerator</Generator>
<LastGenOutput>Settings.Designer.cs</LastGenOutput>
Expand All @@ -102,5 +98,10 @@
<SubType>Designer</SubType>
</None>
</ItemGroup>
<ItemGroup>
<PackageReference Include="Microsoft.Xaml.Behaviors.Wpf">
<Version>1.1.31</Version>
</PackageReference>
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
</Project>
4 changes: 0 additions & 4 deletions Source/VisualStateTest/packages.config

This file was deleted.

3 changes: 3 additions & 0 deletions Source/Wifinian/AppController.cs
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ internal class AppController : DisposableBase
private readonly object _profilesLock = new object();

public NotifyIconContainer NotifyIconContainer { get; }
public WindowPainter WindowPainter { get; }

private readonly IWlanWorker _worker;
public bool IsWorkable => _worker.IsWorkable;
Expand Down Expand Up @@ -64,6 +65,7 @@ public AppController(AppKeeper keeper, IWlanWorker worker)
NotifyIconContainer = new NotifyIconContainer();
NotifyIconContainer.MouseLeftButtonClick += OnMainWindowShowRequested;
NotifyIconContainer.MouseRightButtonClick += OnMenuWindowShowRequested;
WindowPainter = new WindowPainter();

this._worker = worker;

Expand Down Expand Up @@ -189,6 +191,7 @@ protected override void Dispose(bool disposing)
{
_worker?.Dispose();
NotifyIconContainer.Dispose();
WindowPainter.Dispose();
Settings.Current.Dispose();
}

Expand Down
6 changes: 3 additions & 3 deletions Source/Wifinian/Helper/HsbColor.cs
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ public float H
get => _h;
set
{
if (value is (< 0F or >= 360F))
if (value is < 0F or >= 360F)
throw new ArgumentOutOfRangeException(nameof(value), value, "The range of hue: 0.0 <= value < 360.0");

_h = value;
Expand All @@ -44,7 +44,7 @@ public float S
get => _s;
set
{
if (value is (< 0F or > 1F))
if (value is < 0F or > 1F)
throw new ArgumentOutOfRangeException(nameof(value), value, "The range of saturation: 0.0 <= value <= 1.0");

_s = value;
Expand All @@ -60,7 +60,7 @@ public float B
get => _b;
set
{
if (value is (< 0F or > 1F))
if (value is < 0F or > 1F)
throw new ArgumentOutOfRangeException(nameof(value), value, "The range of brightness: 0.0 <= value <= 1.0");

_b = value;
Expand Down
31 changes: 16 additions & 15 deletions Source/Wifinian/Helper/OsVersion.cs
Original file line number Diff line number Diff line change
Expand Up @@ -13,35 +13,36 @@ namespace Wifinian.Helper
internal static class OsVersion
{
/// <summary>
/// Whether OS is Windows Vista or newer
/// Whether OS is Windows 7 (6.1) or greater
/// </summary>
/// <remarks>Windows Vista = version 6.0</remarks>
public static bool IsVistaOrNewer => IsEqualToOrNewer(6);
public static bool Is7OrGreater => IsEqualToOrGreaterThan(6, 1);

/// <summary>
/// Whether OS is Windows 8 or newer
/// Whether OS is Windows 8 (6.2) or greater
/// </summary>
/// <remarks>Windows 8 = version 6.2</remarks>
public static bool Is8OrNewer => IsEqualToOrNewer(6, 2);
public static bool Is8OrGreater => IsEqualToOrGreaterThan(6, 2);

/// <summary>
/// Whether OS is Windows 8.1 or newer
/// Whether OS is Windows 8.1 (6.3) or greater
/// </summary>
/// <remarks>Windows 8.1 = version 6.3</remarks>
public static bool Is81OrNewer => IsEqualToOrNewer(6, 3);
public static bool Is8Point1OrGreater => IsEqualToOrGreaterThan(6, 3);

/// <summary>
/// Whether OS is Windows 10 (Threshold 1) or newer
/// Whether OS is Windows 10 (10.0.10240) or greater
/// </summary>
/// <remarks>Windows 10 (Threshold 1) = version 10.0.10240</remarks>
public static bool Is10Threshold1OrNewer => IsEqualToOrNewer(10, 0, 10240);
public static bool Is10OrGreater => IsEqualToOrGreaterThan(10, 0, 10240);

/// <summary>
/// Whether OS is Windows 11 (10.0.22000) or greater
/// </summary>
public static bool Is11OrGreater => IsEqualToOrGreaterThan(10, 0, 22000);

#region Cache

private static readonly Dictionary<string, bool> _cache = new Dictionary<string, bool>();
private static readonly object _lock = new object();
private static readonly Dictionary<string, bool> _cache = new();
private static readonly object _lock = new();

private static bool IsEqualToOrNewer(int major, int minor = 0, int build = 0, [CallerMemberName] string propertyName = null)
private static bool IsEqualToOrGreaterThan(int major, int minor = 0, int build = 0, [CallerMemberName] string propertyName = null)
{
lock (_lock)
{
Expand Down
Binary file modified Source/Wifinian/Library/ScreenFrame.dll
Binary file not shown.
Loading

0 comments on commit a5853ff

Please sign in to comment.