${res:Templates.File.Struct.Description}
/// Description of ${ClassName}.
///
public struct ${ClassName} : IEquatable<${ClassName}>
{
int member; // this is just an example member, replace it with your own struct members!
#region Equals and GetHashCode implementation
// The code in this region is useful if you want to use this structure in collections.
// If you don't need it, you can just remove the region and the ": IEquatable<${ClassName}>" declaration.
public override bool Equals(object obj)
{
if (obj is ${ClassName})
return Equals((${ClassName})obj); // use Equals method below
else
return false;
}
public bool Equals(${ClassName} other)
{
// add comparisions for all members here
return this.member == other.member;
}
public override int GetHashCode()
{
// combine the hash codes of all members here (e.g. with XOR operator ^)
return member.GetHashCode();
}
public static bool operator ==(${ClassName} left, ${ClassName} right)
{
return left.Equals(right);
}
public static bool operator !=(${ClassName} left, ${ClassName} right)
{
return !left.Equals(right);
}
#endregion
}
}
]]>