Fixed error in comparison function

This commit is contained in:
Terry MacDonald 2021-09-02 14:52:46 +12:00
parent cab056b7fd
commit 7772b27f89
4 changed files with 7 additions and 12 deletions

View File

@ -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);

View File

@ -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);

View File

@ -502,11 +502,6 @@ namespace DisplayMagicianShared
return new List<ScreenPosition>();
}
/*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"); ;

View File

@ -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