mirror of
https://github.com/microsoft/PowerToys.git
synced 2026-04-06 11:16:51 +02:00
add theme function. And provide two themes default.
This commit is contained in:
44
WinAlfred/Helper/Settings.cs
Normal file
44
WinAlfred/Helper/Settings.cs
Normal file
@@ -0,0 +1,44 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
|
||||
namespace WinAlfred.Helper
|
||||
{
|
||||
public class Settings
|
||||
{
|
||||
private string configPath = Directory.GetCurrentDirectory() + "\\config.ini";
|
||||
private static readonly Settings settings = new Settings();
|
||||
IniParser parser = new IniParser("config.ini");
|
||||
|
||||
public string Theme { get; set; }
|
||||
|
||||
private Settings()
|
||||
{
|
||||
LoadSettings();
|
||||
}
|
||||
|
||||
private void LoadSettings()
|
||||
{
|
||||
if (!File.Exists(configPath)) File.Create(configPath);
|
||||
Theme = parser.GetSetting("ui", "theme");
|
||||
}
|
||||
|
||||
public void SaveSettings()
|
||||
{
|
||||
parser.AddSetting("ui", "theme", Theme);
|
||||
parser.SaveSettings();
|
||||
}
|
||||
|
||||
public static Settings Instance
|
||||
{
|
||||
get
|
||||
{
|
||||
return settings;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user