mirror of
https://github.com/2dust/v2rayN.git
synced 2026-11-17 18:04:59 +03:00
Code clean
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
using Avalonia;
|
||||
using Avalonia;
|
||||
using Avalonia.Controls;
|
||||
using Avalonia.Input;
|
||||
using Avalonia.Media.Imaging;
|
||||
@@ -13,7 +13,8 @@ namespace v2rayN.Desktop.Common
|
||||
try
|
||||
{
|
||||
var clipboard = TopLevel.GetTopLevel(owner)?.Clipboard;
|
||||
if (clipboard == null) return null;
|
||||
if (clipboard == null)
|
||||
return null;
|
||||
return await clipboard.GetTextAsync();
|
||||
}
|
||||
catch
|
||||
@@ -27,7 +28,8 @@ namespace v2rayN.Desktop.Common
|
||||
try
|
||||
{
|
||||
var clipboard = TopLevel.GetTopLevel(visual)?.Clipboard;
|
||||
if (clipboard == null) return;
|
||||
if (clipboard == null)
|
||||
return;
|
||||
var dataObject = new DataObject();
|
||||
dataObject.Set(DataFormats.Text, strData);
|
||||
await clipboard.SetDataObjectAsync(dataObject);
|
||||
@@ -51,4 +53,4 @@ namespace v2rayN.Desktop.Common
|
||||
return new(bitmap);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
using Avalonia.Controls;
|
||||
using Avalonia.Controls;
|
||||
using Avalonia.Platform.Storage;
|
||||
using MsBox.Avalonia;
|
||||
using MsBox.Avalonia.Enums;
|
||||
@@ -18,8 +18,9 @@ namespace v2rayN.Desktop.Common
|
||||
public static async Task<string?> OpenFileDialog(Window owner, FilePickerFileType? filter)
|
||||
{
|
||||
var sp = GetStorageProvider(owner);
|
||||
if (sp is null) return null;
|
||||
|
||||
if (sp is null)
|
||||
return null;
|
||||
|
||||
// Start async operation to open the dialog.
|
||||
var files = await sp.OpenFilePickerAsync(new FilePickerOpenOptions
|
||||
{
|
||||
@@ -33,7 +34,8 @@ namespace v2rayN.Desktop.Common
|
||||
public static async Task<string?> SaveFileDialog(Window owner, string filter)
|
||||
{
|
||||
var sp = GetStorageProvider(owner);
|
||||
if (sp is null) return null;
|
||||
if (sp is null)
|
||||
return null;
|
||||
|
||||
// Start async operation to open the dialog.
|
||||
var files = await sp.SaveFilePickerAsync(new FilePickerSaveOptions
|
||||
@@ -49,4 +51,4 @@ namespace v2rayN.Desktop.Common
|
||||
return topLevel?.StorageProvider;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user