From 6ad11812e2387ad5ffa7fb3261115318dc20c9b0 Mon Sep 17 00:00:00 2001 From: "H. Utku Maden" Date: Tue, 24 Dec 2024 22:10:24 +0300 Subject: [PATCH] Add hash function to Gradient. --- Dashboard.Common/Gradient.cs | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/Dashboard.Common/Gradient.cs b/Dashboard.Common/Gradient.cs index 5536742..aa1b447 100644 --- a/Dashboard.Common/Gradient.cs +++ b/Dashboard.Common/Gradient.cs @@ -155,5 +155,14 @@ namespace Dashboard { _stops.RemoveAt(index); } + + public override int GetHashCode() + { + HashCode code = new HashCode(); + code.Add(Count); + foreach (GradientStop item in this) + code.Add(item.GetHashCode()); + return code.ToHashCode(); + } } }