mirror of
https://github.com/microsoft/PowerToys.git
synced 2024-12-15 12:09:18 +08:00
39edf1a8ed
1. part of #389 2. file rename 3. fixup
35 lines
809 B
C#
35 lines
809 B
C#
using System.Collections.Generic;
|
|
using Newtonsoft.Json;
|
|
using Wox.Infrastructure.Storage;
|
|
using Wox.Plugin;
|
|
|
|
namespace Wox.Storage
|
|
{
|
|
public class UserSelectedRecord
|
|
{
|
|
[JsonProperty]
|
|
private 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);
|
|
}
|
|
}
|
|
|
|
public int GetSelectedCount(Result result)
|
|
{
|
|
if (records.ContainsKey(result.ToString()))
|
|
{
|
|
return records[result.ToString()];
|
|
}
|
|
return 0;
|
|
}
|
|
}
|
|
}
|