mirror of
https://github.com/Flow-Launcher/Flow.Launcher.git
synced 2026-03-11 08:54:32 +00:00
Implement object.Equals for uwp and win32
This commit is contained in:
parent
85256ef42f
commit
4725b0df07
3 changed files with 30 additions and 1 deletions
|
|
@ -761,6 +761,23 @@ namespace Flow.Launcher.Plugin.Program.Programs
|
|||
{
|
||||
return $"{DisplayName}: {Description}";
|
||||
}
|
||||
|
||||
public override bool Equals(object obj)
|
||||
{
|
||||
if (obj is Application other)
|
||||
{
|
||||
return UniqueIdentifier == other.UniqueIdentifier;
|
||||
}
|
||||
else
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
public override int GetHashCode()
|
||||
{
|
||||
return UniqueIdentifier.GetHashCode();
|
||||
}
|
||||
}
|
||||
|
||||
public enum PackageVersion
|
||||
|
|
|
|||
|
|
@ -586,6 +586,18 @@ namespace Flow.Launcher.Plugin.Program.Programs
|
|||
return UniqueIdentifier == other.UniqueIdentifier;
|
||||
}
|
||||
|
||||
public override bool Equals(object obj)
|
||||
{
|
||||
if (obj is Win32 other)
|
||||
{
|
||||
return UniqueIdentifier == other.UniqueIdentifier;
|
||||
}
|
||||
else
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
private static IEnumerable<string> GetStartMenuPaths()
|
||||
{
|
||||
var directory1 = Environment.GetFolderPath(Environment.SpecialFolder.Programs);
|
||||
|
|
|
|||
|
|
@ -20,7 +20,7 @@ namespace Flow.Launcher.Plugin.Program
|
|||
/// </summary>
|
||||
public List<ProgramSource> DisabledProgramSources { get; set; } = new List<ProgramSource>();
|
||||
|
||||
[Obsolete, JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
|
||||
[Obsolete("Should use GetSuffixes() instead."), JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
|
||||
public string[] ProgramSuffixes { get; set; } = null;
|
||||
public string[] CustomSuffixes { get; set; } = Array.Empty<string>(); // Custom suffixes only
|
||||
public string[] CustomProtocols { get; set; } = Array.Empty<string>();
|
||||
|
|
|
|||
Loading…
Reference in a new issue