2014-01-28 11:19:27 +08:00
|
|
|
|
using System;
|
|
|
|
|
using System.Collections.Generic;
|
2014-01-29 18:33:24 +08:00
|
|
|
|
using Wox.Plugin;
|
2014-01-28 11:19:27 +08:00
|
|
|
|
|
2014-01-29 22:44:57 +08:00
|
|
|
|
namespace Wox.Infrastructure.UserSettings
|
2014-01-28 11:19:27 +08:00
|
|
|
|
{
|
|
|
|
|
[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;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|