Fix build errors
This commit is contained in:
@@ -1,3 +1,5 @@
|
||||
using Avalonia;
|
||||
using Avalonia.Input.Platform;
|
||||
using FileTime.App.Core.Services;
|
||||
|
||||
namespace FileTime.GuiApp.Services;
|
||||
@@ -6,7 +8,8 @@ public class SystemClipboardService : ISystemClipboardService
|
||||
{
|
||||
public async Task CopyToClipboardAsync(string text)
|
||||
{
|
||||
if (global::Avalonia.Application.Current?.Clipboard is { } clipboard)
|
||||
var clipboard = AvaloniaLocator.Current.GetService<IClipboard>();
|
||||
if (clipboard is not null)
|
||||
{
|
||||
await clipboard.SetTextAsync(text);
|
||||
}
|
||||
|
||||
@@ -88,12 +88,16 @@ public class WindowsContextMenuProvider : IContextMenuProvider
|
||||
}
|
||||
else if (shellKey.GetValue("ExtendedSubCommandsKey") is string extendedCommands)
|
||||
{
|
||||
var rootMenu = new MenuItem() {Header = text, Icon = image};
|
||||
var rootMenuItems = new List<object>();
|
||||
|
||||
ProcessRegistryKey(Registry.ClassesRoot.OpenSubKey(extendedCommands), rootMenuItems, folderPath);
|
||||
|
||||
rootMenu.Items = rootMenuItems.ToArray();
|
||||
var rootMenu = new MenuItem {Header = text, Icon = image};
|
||||
foreach (var item in rootMenuItems)
|
||||
{
|
||||
rootMenu.Items.Add(item);
|
||||
}
|
||||
|
||||
menuItems.Add(rootMenu);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user