mirror of
https://github.com/microsoft/PowerToys.git
synced 2026-04-07 19:57:07 +02:00
User/lamotile/add powerrename settings (#1813)
* added powerrename settings * removed pop-up message * removed unused files * revrted changes to old settings * updated solution file * added ToJsonString() method * added JSON property for the powertoy name
This commit is contained in:
@@ -0,0 +1,67 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Text;
|
||||
using System.Text.Json;
|
||||
using System.Text.Json.Serialization;
|
||||
|
||||
namespace Microsoft.PowerToys.Settings.UI.Lib
|
||||
{
|
||||
public class PowerRenameSettings : BasePTModuleSettings
|
||||
{
|
||||
public PowerRenameProperties properties { get; set; }
|
||||
|
||||
public PowerRenameSettings()
|
||||
{
|
||||
this.properties = new PowerRenameProperties();
|
||||
this.version = "1";
|
||||
this.name = "_unset_";
|
||||
}
|
||||
|
||||
public PowerRenameSettings(string ptName)
|
||||
{
|
||||
this.properties = new PowerRenameProperties();
|
||||
this.version = "1";
|
||||
this.name = ptName;
|
||||
}
|
||||
|
||||
public override string ToJsonString()
|
||||
{
|
||||
return JsonSerializer.Serialize(this);
|
||||
}
|
||||
}
|
||||
|
||||
public class PowerRenameProperties
|
||||
{
|
||||
public PowerRenameProperties()
|
||||
{
|
||||
this.bool_persist_input = new BoolProperty();
|
||||
this.bool_mru_enabled = new BoolProperty();
|
||||
this.int_max_mru_size = new IntProperty();
|
||||
this.bool_show_icon_on_menu = new BoolProperty();
|
||||
this.bool_show_extended_menu = new BoolProperty();
|
||||
}
|
||||
|
||||
public BoolProperty bool_persist_input { get; set; }
|
||||
public BoolProperty bool_mru_enabled { get; set; }
|
||||
public IntProperty int_max_mru_size { get; set; }
|
||||
public BoolProperty bool_show_icon_on_menu { get; set; }
|
||||
public BoolProperty bool_show_extended_menu { get; set; }
|
||||
}
|
||||
|
||||
public class SndPowerRenameSettings
|
||||
{
|
||||
[JsonPropertyName("PowerRename")]
|
||||
public PowerRenameSettings PowerRename { get; set; }
|
||||
|
||||
public SndPowerRenameSettings(PowerRenameSettings settings)
|
||||
{
|
||||
this.PowerRename = settings;
|
||||
}
|
||||
|
||||
public string ToJsonString()
|
||||
{
|
||||
return JsonSerializer.Serialize(this);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user