WARNING: THIS SITE IS A MIRROR OF GITHUB.COM / IT CANNOT LOGIN OR REGISTER ACCOUNTS / THE CONTENTS ARE PROVIDED AS-IS / THIS SITE ASSUMES NO RESPONSIBILITY FOR ANY DISPLAYED CONTENT OR LINKS / IF YOU FOUND SOMETHING MAY NOT GOOD FOR EVERYONE, CONTACT ADMIN AT ilovescratch@foxmail.com
Skip to content

Commit 2d5d665

Browse files
committed
优化为空判断
1 parent 386a87d commit 2d5d665

File tree

3 files changed

+7
-7
lines changed

3 files changed

+7
-7
lines changed

UotanToolbox/Features/Appmgr/AppmgrViewModel.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -337,7 +337,7 @@ public async Task RunApp()
337337
MainViewModel sukiViewModel = GlobalData.MainViewModelInstance;
338338
if (sukiViewModel.Status == GetTranslation("Home_Android"))
339339
{
340-
if (SelectedApplication() != "")
340+
if (!string.IsNullOrEmpty(SelectedApplication()))
341341
{
342342
_ = await CallExternalProgram.ADB($"-s {Global.thisdevice} shell monkey -p {SelectedApplication()} 1");
343343
}
@@ -382,7 +382,7 @@ public async Task DisableApp()
382382
MainViewModel sukiViewModel = GlobalData.MainViewModelInstance;
383383
if (sukiViewModel.Status == GetTranslation("Home_Android"))
384384
{
385-
if (SelectedApplication() != "")
385+
if (!string.IsNullOrEmpty(SelectedApplication()))
386386
{
387387
_ = await CallExternalProgram.ADB($"-s {Global.thisdevice} shell pm disable {SelectedApplication()}");
388388
}

UotanToolbox/Features/Scrcpy/ScrcpyViewModel.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ await Dispatcher.UIThread.InvokeAsync(async () =>
8080

8181
if (EnableVirtualScreen)
8282
{
83-
if (VirtualScreenDisplaySize != "")
83+
if (!string.IsNullOrEmpty(VirtualScreenDisplaySize))
8484
{
8585
arg += $"--new-display={VirtualScreenDisplaySize} ";
8686
}
@@ -90,14 +90,14 @@ await Dispatcher.UIThread.InvokeAsync(async () =>
9090
}
9191
}
9292

93-
if (VirtualScreenPackage != "")
93+
if (!string.IsNullOrEmpty(VirtualScreenPackage))
9494
{
9595
arg += $"--start-app={VirtualScreenPackage} ";
9696
}
9797

9898

9999

100-
if (WindowTitle is not "" and not null)
100+
if (!string.IsNullOrEmpty(WindowTitle))
101101
{
102102
arg += $"--window-title \"{WindowTitle.Replace("\"", "\\\"")}\" ";
103103
}

UotanToolbox/Features/Wiredflash/WiredflashView.axaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@
3939
Text="FASTBOOT" />
4040
<TextBox Width="600" Name="FastbootFile"
4141
Text=""
42-
theme:TextBoxExtensions.AddDeleteButton="False"/>
42+
theme:TextBoxExtensions.AddDeleteButton="True"/>
4343
<Button Height="35"
4444
Padding="10,0,10,0"
4545
Click="OpenFastbootFile"
@@ -54,7 +54,7 @@
5454
Text="FASTBOOTD" />
5555
<TextBox Width="600" Name="FastbootdFile"
5656
Text=""
57-
theme:TextBoxExtensions.AddDeleteButton="False"/>
57+
theme:TextBoxExtensions.AddDeleteButton="True"/>
5858
<Button Height="35"
5959
Padding="10,0,10,0"
6060
Click="OpenFastbootdFile"

0 commit comments

Comments
 (0)