mirror of
https://github.com/xcp-ng/xenadmin.git
synced 2024-12-04 09:01:06 +01:00
CP-36392: Remove base
calls directly based on the object reference.
Two objects will never have the same hash since base methods are based on direct object reference Signed-off-by: Danilo Del Busso <Danilo.Del.Busso@citrix.com>
This commit is contained in:
parent
825c795ea4
commit
2d1e6dcb92
@ -478,19 +478,15 @@ namespace XenAdmin.Controls.CustomDataGraph
|
|||||||
|
|
||||||
public override bool Equals(object obj)
|
public override bool Equals(object obj)
|
||||||
{
|
{
|
||||||
if(!(obj is DataSet))
|
if (!(obj is DataSet other))
|
||||||
return base.Equals(obj);
|
return false;
|
||||||
|
|
||||||
DataSet other = (DataSet)obj;
|
|
||||||
|
|
||||||
return Id == other.Id;
|
return Id == other.Id;
|
||||||
}
|
}
|
||||||
|
|
||||||
public override int GetHashCode()
|
public override int GetHashCode()
|
||||||
{
|
{
|
||||||
if (string.IsNullOrEmpty(Id))
|
return string.IsNullOrEmpty(Id) ? 0 : Id.GetHashCode();
|
||||||
return base.GetHashCode();
|
|
||||||
return Id.GetHashCode();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
internal void InsertPointCollection(List<DataPoint> list)
|
internal void InsertPointCollection(List<DataPoint> list)
|
||||||
|
@ -678,14 +678,14 @@ namespace XenAdmin.Controls.CustomGridView
|
|||||||
|
|
||||||
public override bool Equals(object obj)
|
public override bool Equals(object obj)
|
||||||
{
|
{
|
||||||
if(!(obj is GridRow))
|
if (!(obj is GridRow row))
|
||||||
return base.Equals(obj);
|
return false;
|
||||||
return OpaqueRef == ((GridRow)obj).OpaqueRef;
|
return OpaqueRef == row.OpaqueRef;
|
||||||
}
|
}
|
||||||
|
|
||||||
public override int GetHashCode()
|
public override int GetHashCode()
|
||||||
{
|
{
|
||||||
return base.GetHashCode();
|
return (OpaqueRef != null ? OpaqueRef.GetHashCode() : 0);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -128,7 +128,7 @@ namespace XenAdmin.Controls.DataGridViewEx
|
|||||||
|
|
||||||
public override int GetHashCode()
|
public override int GetHashCode()
|
||||||
{
|
{
|
||||||
return base.GetHashCode();
|
return _nameCell.GetHashCode();
|
||||||
}
|
}
|
||||||
|
|
||||||
public CheckState Checked
|
public CheckState Checked
|
||||||
|
@ -1121,7 +1121,7 @@ namespace XenAdmin.Controls.XenSearch
|
|||||||
|
|
||||||
public override int GetHashCode()
|
public override int GetHashCode()
|
||||||
{
|
{
|
||||||
return base.GetHashCode();
|
return (int) type;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1327,7 +1327,7 @@ namespace XenAdmin.Controls.XenSearch
|
|||||||
|
|
||||||
public override int GetHashCode()
|
public override int GetHashCode()
|
||||||
{
|
{
|
||||||
return base.GetHashCode();
|
return (int) type;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user