code refactoring and add web searches setting window.

This commit is contained in:
qianlifeng
2014-01-28 11:19:27 +08:00
parent 2c17d450dd
commit 84af5a277e
14 changed files with 321 additions and 518 deletions

View File

@@ -0,0 +1,47 @@
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Runtime.Serialization.Formatters.Binary;
using WinAlfred.Helper;
using WinAlfred.Plugin;
namespace WinAlfred.Models
{
[Serializable]
public class UserSelectedRecords
{
private static int hasAddedCount = 0;
public Dictionary<string,int> Records = new Dictionary<string, int>();
public void Add(Result result)
{
if (Records.ContainsKey(result.ToString()))
{
Records[result.ToString()] += 1;
}
else
{
Records.Add(result.ToString(), 1);
}
//hasAddedCount++;
//if (hasAddedCount == 10)
//{
// hasAddedCount = 0;
//}
CommonStorage.Instance.Save();
}
public int GetSelectedCount(Result result)
{
if (Records.ContainsKey(result.ToString()))
{
return Records[result.ToString()];
}
return 0;
}
}
}

View File

@@ -0,0 +1,14 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace WinAlfred.Models
{
public class UserSetting
{
public string Theme { get; set; }
public bool ReplaceWinR { get; set; }
public List<WebSearch> WebSearches { get; set; }
}
}

View File

@@ -0,0 +1,10 @@
namespace WinAlfred.Models
{
public class WebSearch
{
public string Keyword { get; set; }
public string IconPath { get; set; }
public string Website { get; set; }
public string Enabled { get; set; }
}
}