mirror of
https://github.com/Microsoft/calculator.git
synced 2025-08-20 21:33:10 -07:00
Update App.xaml.cs
Implemented guard clause to improve readability of OnActivated
This commit is contained in:
parent
88c22ca81e
commit
1189ce9086
1 changed files with 16 additions and 17 deletions
|
@ -73,8 +73,8 @@ namespace CalculatorApp
|
||||||
|
|
||||||
protected override void OnActivated(IActivatedEventArgs args)
|
protected override void OnActivated(IActivatedEventArgs args)
|
||||||
{
|
{
|
||||||
if (args.Kind == ActivationKind.Protocol)
|
if (args.Kind != ActivationKind.Protocol) return;
|
||||||
{
|
|
||||||
if (args.IsSnapshotProtocol())
|
if (args.IsSnapshotProtocol())
|
||||||
{
|
{
|
||||||
var protoArgs = (IProtocolActivatedEventArgs)args;
|
var protoArgs = (IProtocolActivatedEventArgs)args;
|
||||||
|
@ -92,7 +92,6 @@ namespace CalculatorApp
|
||||||
OnAppLaunch(args, null, false);
|
OnAppLaunch(args, null, false);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
private void OnAppLaunch(IActivatedEventArgs args, object arguments, bool isPreLaunch)
|
private void OnAppLaunch(IActivatedEventArgs args, object arguments, bool isPreLaunch)
|
||||||
{
|
{
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue