mirror of
https://github.com/microsoft/PowerToys.git
synced 2026-04-07 19:57:07 +02:00
Remove instance logic for BinaryStorage and JsonStorage, part 1
1. part of #389 2. huge refactoring
This commit is contained in:
@@ -1,44 +1,22 @@
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel;
|
||||
using Newtonsoft.Json;
|
||||
using Wox.Infrastructure.Storage;
|
||||
using JsonProperty = Newtonsoft.Json.JsonPropertyAttribute;
|
||||
|
||||
namespace Wox.Plugin.Everything
|
||||
{
|
||||
public class ContextMenuStorage : JsonStrorage<ContextMenuStorage>
|
||||
public class Settings
|
||||
{
|
||||
[JsonProperty] public List<ContextMenu> ContextMenus = new List<ContextMenu>();
|
||||
public List<ContextMenu> ContextMenus = new List<ContextMenu>();
|
||||
|
||||
[JsonProperty]
|
||||
public int MaxSearchCount { get; set; }
|
||||
|
||||
public IPublicAPI API { get; set; }
|
||||
|
||||
protected override string FileName { get; } = "EverythingContextMenu";
|
||||
|
||||
protected override void OnAfterLoad(ContextMenuStorage obj)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
protected override ContextMenuStorage LoadDefault()
|
||||
{
|
||||
MaxSearchCount = 100;
|
||||
return this;
|
||||
}
|
||||
public int MaxSearchCount { get; set; } = 100;
|
||||
}
|
||||
|
||||
public class ContextMenu
|
||||
{
|
||||
[JsonProperty]
|
||||
public string Name { get; set; }
|
||||
|
||||
[JsonProperty]
|
||||
public string Command { get; set; }
|
||||
|
||||
[JsonProperty]
|
||||
public string Argument { get; set; }
|
||||
|
||||
[JsonProperty]
|
||||
public string ImagePath { get; set; }
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user