mirror of
https://github.com/microsoft/PowerToys.git
synced 2026-04-08 04:07:40 +02:00
Add web search feature & some UI changes.
This commit is contained in:
43
Wox.Infrastructure/UserSettings/UserSelectedRecords.cs
Normal file
43
Wox.Infrastructure/UserSettings/UserSelectedRecords.cs
Normal file
@@ -0,0 +1,43 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using Wox.Plugin;
|
||||
|
||||
namespace Wox.Infrastructure.UserSettings
|
||||
{
|
||||
[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;
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user