mirror of
https://github.com/microsoft/PowerToys.git
synced 2024-12-14 03:37:10 +08:00
updated user selected record
This commit is contained in:
parent
c90dd0e818
commit
b3fdc4bb96
@ -12,21 +12,23 @@ namespace Wox.Storage
|
||||
|
||||
public void Add(Result result)
|
||||
{
|
||||
if (records.ContainsKey(result.ToString()))
|
||||
var key = result.ToString();
|
||||
if (records.TryGetValue(key, out int value))
|
||||
{
|
||||
records[result.ToString()] += 1;
|
||||
records[key] = value + 1;
|
||||
}
|
||||
else
|
||||
{
|
||||
records.Add(result.ToString(), 1);
|
||||
records.Add(key, 1);
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
public int GetSelectedCount(Result result)
|
||||
{
|
||||
if (records.ContainsKey(result.ToString()))
|
||||
if (records.TryGetValue(result.ToString(), out int value))
|
||||
{
|
||||
return records[result.ToString()];
|
||||
return value;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user