From 7772b27f891f12ec7680b41bab908b71e01ecd23 Mon Sep 17 00:00:00 2001 From: Terry MacDonald Date: Thu, 2 Sep 2021 14:52:46 +1200 Subject: [PATCH] Fixed error in comparison function --- DisplayMagicianShared/AMD/AMDProfileItem.cs | 6 +++--- DisplayMagicianShared/NVIDIA/NVIDIAProfileItem.cs | 4 ++-- DisplayMagicianShared/ProfileItem.cs | 5 ----- DisplayMagicianShared/Windows/WinProfileItem.cs | 4 ++-- 4 files changed, 7 insertions(+), 12 deletions(-) diff --git a/DisplayMagicianShared/AMD/AMDProfileItem.cs b/DisplayMagicianShared/AMD/AMDProfileItem.cs index 868e0ca..2135a83 100644 --- a/DisplayMagicianShared/AMD/AMDProfileItem.cs +++ b/DisplayMagicianShared/AMD/AMDProfileItem.cs @@ -363,13 +363,13 @@ namespace DisplayMagicianShared.AMD return _screens; } - public int CompareTo(object obj) + /*public int CompareTo(object obj) { - if (!(obj is AMDProfileItem)) throw new ArgumentException("Object to CompareTo is not a AMDProfileItem"); ; + if (!(obj is ProfileItem)) throw new ArgumentException("Object to CompareTo is not a AMDProfileItem"); ; AMDProfileItem otherProfile = (AMDProfileItem)obj; return this.Name.CompareTo(otherProfile.Name); - } + }*/ // The public override for the Object.Equals public override bool Equals(object obj) => this.Equals(obj as AMDProfileItem); diff --git a/DisplayMagicianShared/NVIDIA/NVIDIAProfileItem.cs b/DisplayMagicianShared/NVIDIA/NVIDIAProfileItem.cs index cb533b0..c41d982 100644 --- a/DisplayMagicianShared/NVIDIA/NVIDIAProfileItem.cs +++ b/DisplayMagicianShared/NVIDIA/NVIDIAProfileItem.cs @@ -548,13 +548,13 @@ namespace DisplayMagicianShared.NVIDIA return _screens; } - public int CompareTo(object obj) + /*public int CompareTo(object obj) { if (!(obj is NVIDIAProfileItem)) throw new ArgumentException("Object to CompareTo is not a NVIDIAProfileItem"); ; NVIDIAProfileItem otherProfile = (NVIDIAProfileItem)obj; return this.Name.CompareTo(otherProfile.Name); - } + }*/ // The public override for the Object.Equals public override bool Equals(object obj) => this.Equals(obj as NVIDIAProfileItem); diff --git a/DisplayMagicianShared/ProfileItem.cs b/DisplayMagicianShared/ProfileItem.cs index 92a40f2..f2cdc20 100644 --- a/DisplayMagicianShared/ProfileItem.cs +++ b/DisplayMagicianShared/ProfileItem.cs @@ -502,11 +502,6 @@ namespace DisplayMagicianShared return new List(); } - /*public int CompareTo(ProfileItem other) - { - return this.Name.CompareTo(other.Name); - }*/ - public int CompareTo(object obj) { if (!(obj is ProfileItem)) throw new ArgumentException("Object to CompareTo is not a Shortcut"); ; diff --git a/DisplayMagicianShared/Windows/WinProfileItem.cs b/DisplayMagicianShared/Windows/WinProfileItem.cs index eb2c0e8..fdb3bc9 100644 --- a/DisplayMagicianShared/Windows/WinProfileItem.cs +++ b/DisplayMagicianShared/Windows/WinProfileItem.cs @@ -311,13 +311,13 @@ namespace DisplayMagicianShared.Windows return _screens; } - public int CompareTo(object obj) + /*public int CompareTo(object obj) { if (!(obj is WinProfileItem)) throw new ArgumentException("Object to CompareTo is not a WinProfileItem"); ; WinProfileItem otherProfile = (WinProfileItem)obj; return this.Name.CompareTo(otherProfile.Name); - } + }*/ // The public override for the Object.Equals