Add ProgramSources settings (code only, without GUI) #42

This commit is contained in:
Yeechan Lu
2014-03-19 04:05:27 +08:00
parent baa50069cf
commit cf0d7067eb
11 changed files with 151 additions and 11 deletions

View File

@@ -63,6 +63,7 @@ namespace Wox.Infrastructure
Instance.UserSetting.Theme = "Dark";
Instance.UserSetting.ReplaceWinR = true;
Instance.UserSetting.WebSearches = Instance.UserSetting.LoadDefaultWebSearches();
Instance.UserSetting.ProgramSources = Instance.UserSetting.LoadDefaultProgramSources();
Instance.UserSetting.Hotkey = "Win + W";
}

View File

@@ -0,0 +1,18 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace Wox.Infrastructure.UserSettings
{
[Serializable]
public class ProgramSource
{
public string Location { get; set; }
public string Assembly { get; set; }
public string Type { get; set; }
public int BounsPoints { get; set; }
public bool Enabled { get; set; }
public Dictionary<string, string> Meta { get; set; }
}
}

View File

@@ -9,6 +9,7 @@ namespace Wox.Infrastructure.UserSettings
public string Theme { get; set; }
public bool ReplaceWinR { get; set; }
public List<WebSearch> WebSearches { get; set; }
public List<ProgramSource> ProgramSources { get; set; }
public List<CustomPluginHotkey> CustomPluginHotkeys { get; set; }
public bool StartWoxOnSystemStartup { get; set; }
@@ -39,5 +40,29 @@ namespace Wox.Infrastructure.UserSettings
return webSearches;
}
public List<ProgramSource> LoadDefaultProgramSources()
{
var list = new List<ProgramSource>();
list.Add(new ProgramSource()
{
BounsPoints = 0,
Enabled = true,
Type = "CommonStartMenuProgramSource"
});
list.Add(new ProgramSource()
{
BounsPoints = 0,
Enabled = true,
Type = "UserStartMenuProgramSource"
});
list.Add(new ProgramSource()
{
BounsPoints = -10,
Enabled = true,
Type = "AppPathsProgramSource"
});
return list;
}
}
}

View File

@@ -56,6 +56,7 @@
<Compile Include="IniParser.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
<Compile Include="UserSettings\PluginHotkey.cs" />
<Compile Include="UserSettings\ProgramSource.cs" />
<Compile Include="UserSettings\UserSelectedRecords.cs" />
<Compile Include="UserSettings\UserSetting.cs" />
<Compile Include="UserSettings\WebSearch.cs" />