mirror of
https://github.com/microsoft/PowerToys.git
synced 2024-12-14 11:39:16 +08:00
5ac0837be3
1. Remove ItemDropEvent 2. Remove ShowContextMenus from API 3. Fix context menu item can't be opened ( #535 ), bug introduced from PR #494 (commit 45dbb50) 4. Move open result command and load context menu command back to MainViewModel 5. unify load context menu logic 6. other performance enhancement and potential bug fixed
81 lines
1.5 KiB
C#
81 lines
1.5 KiB
C#
using System;
|
|
using Wox.Core.Plugin;
|
|
using Wox.Core.Resource;
|
|
using Wox.Infrastructure;
|
|
using Wox.Infrastructure.Hotkey;
|
|
using Wox.Plugin;
|
|
using Wox.Storage;
|
|
|
|
namespace Wox.ViewModel
|
|
{
|
|
public class ResultViewModel : BaseViewModel
|
|
{
|
|
#region Private Fields
|
|
|
|
private bool _isSelected;
|
|
|
|
#endregion
|
|
|
|
#region Constructor
|
|
|
|
public ResultViewModel(Result result)
|
|
{
|
|
if (result != null)
|
|
{
|
|
RawResult = result;
|
|
}
|
|
}
|
|
|
|
|
|
#endregion
|
|
|
|
#region ViewModel Properties
|
|
|
|
public string Title => RawResult.Title;
|
|
|
|
public string SubTitle => RawResult.SubTitle;
|
|
|
|
public string FullIcoPath => RawResult.FullIcoPath;
|
|
|
|
public bool IsSelected
|
|
{
|
|
get { return _isSelected; }
|
|
set
|
|
{
|
|
_isSelected = value;
|
|
OnPropertyChanged();
|
|
}
|
|
}
|
|
|
|
#endregion
|
|
|
|
#region Properties
|
|
|
|
public Result RawResult { get; }
|
|
|
|
#endregion
|
|
|
|
public override bool Equals(object obj)
|
|
{
|
|
ResultViewModel r = obj as ResultViewModel;
|
|
if (r != null)
|
|
{
|
|
return RawResult.Equals(r.RawResult);
|
|
}
|
|
|
|
return false;
|
|
}
|
|
|
|
public override int GetHashCode()
|
|
{
|
|
return RawResult.GetHashCode();
|
|
}
|
|
|
|
public override string ToString()
|
|
{
|
|
return RawResult.ToString();
|
|
}
|
|
|
|
}
|
|
}
|