Skip to content

Commit

Permalink
优化代码
Browse files Browse the repository at this point in the history
  • Loading branch information
wherewhere committed Oct 13, 2024
1 parent 161b956 commit e0d0f05
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 13 deletions.
2 changes: 1 addition & 1 deletion .github/ISSUE_TEMPLATE/bug_report.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ body:
required: true
attributes:
label: App version
description: Specify the version of Coolapk Lite you're using.
description: Specify the version of CoreAppUWP you're using.
options:
- "0.0.1"
- type: dropdown
Expand Down
2 changes: 1 addition & 1 deletion CoreAppUWP/App.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ public App()
InitializeComponent();
UnhandledException += Application_UnhandledException;
AppDomain.CurrentDomain.UnhandledException += CurrentDomain_UnhandledException;
FocusVisualKind = AnalyticsInfo.VersionInfo.DeviceFamily == "Windows.Xbox" ? FocusVisualKind.Reveal : FocusVisualKind.HighVisibility;
if (AnalyticsInfo.VersionInfo.DeviceFamily == "Windows.Xbox") { FocusVisualKind = FocusVisualKind.Reveal; }
}

/// <summary>
Expand Down
4 changes: 2 additions & 2 deletions CoreAppUWP/Common/ThreadSwitcher.cs
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ public void GetResult() { }
IThreadSwitcher IThreadSwitcher.GetAwaiter() => this;

/// <inheritdoc/>
public void OnCompleted(Action continuation) => _ = Dispatcher.RunAsync(Priority, () => continuation());
public void OnCompleted(Action continuation) => _ = Dispatcher.RunAsync(Priority, continuation.Invoke);
}

/// <summary>
Expand All @@ -89,7 +89,7 @@ public void GetResult() { }
IThreadSwitcher IThreadSwitcher.GetAwaiter() => this;

/// <inheritdoc/>
public void OnCompleted(Action continuation) => _ = Dispatcher.TryEnqueue(Priority, () => continuation());
public void OnCompleted(Action continuation) => _ = Dispatcher.TryEnqueue(Priority, continuation.Invoke);
}

/// <summary>
Expand Down
13 changes: 5 additions & 8 deletions CoreAppUWP/Common/WeakEvent.cs
Original file line number Diff line number Diff line change
Expand Up @@ -34,15 +34,12 @@ public bool Equals(Action<TEventArgs> callback) =>
&& _reference.Target == callback.Target
&& _method == callback.GetMethodInfo();

public override bool Equals(object obj)
public override bool Equals(object obj) => obj switch
{
return obj switch
{
Method other => Equals(other),
Action<TEventArgs> callback => Equals(callback),
_ => false,
};
}
Method other => Equals(other),
Action<TEventArgs> callback => Equals(callback),
_ => false,
};

public override int GetHashCode() => (_reference, _method).GetHashCode();

Expand Down
2 changes: 1 addition & 1 deletion CoreAppUWP/CoreAppUWP.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
<TrimMode>partial</TrimMode>
<UseWinUI>True</UseWinUI>
<VersionPrefix>0.0.1</VersionPrefix>
<WindowsSdkPackageVersion>10.0.22621.42</WindowsSdkPackageVersion>
<WindowsSdkPackageVersion>10.0.22621.48</WindowsSdkPackageVersion>
</PropertyGroup>

<ItemGroup>
Expand Down

0 comments on commit e0d0f05

Please sign in to comment.