Implement WebSearch feature.

This commit is contained in:
qianlifeng
2014-02-02 16:15:34 +08:00
parent 76fa97e0a0
commit 495e0ce89b
8 changed files with 122 additions and 42 deletions

View File

@@ -47,9 +47,21 @@ namespace Wox.Infrastructure
}
catch (Exception e)
{
//on-op, keep default storage
LoadDefaultUserSetting();
}
}
else
{
LoadDefaultUserSetting();
}
}
private static void LoadDefaultUserSetting()
{
//default setting
Instance.UserSetting.Theme = "Default";
Instance.UserSetting.ReplaceWinR = true;
Instance.UserSetting.WebSearches = Instance.UserSetting.LoadDefaultWebSearches();
}
public static CommonStorage Instance
@@ -70,6 +82,5 @@ namespace Wox.Infrastructure
return storage;
}
}
}
}

View File

@@ -9,15 +9,7 @@ namespace Wox.Infrastructure.UserSettings
public bool ReplaceWinR { get; set; }
public List<WebSearch> WebSearches { get; set; }
public UserSetting()
{
//default setting
Theme = "Default";
ReplaceWinR = true;
WebSearches = LoadDefaultWebSearches();
}
private List<WebSearch> LoadDefaultWebSearches()
public List<WebSearch> LoadDefaultWebSearches()
{
List<WebSearch> webSearches = new List<WebSearch>();