private static bool ValuesEqual(object value1, object value2)
 {
     if (value1 == null && value2 == null)
     {
         return(true);
     }
     if (value1 == null || value2 == null)
     {
         return(false);
     }
     if (!value1.GetType().Equals(value2.GetType()))
     {
         return(false);
     }
     if (value1 is string)
     {
         return(((string)value1).Equals((string)value2));
     }
     if (value1 is IEquatable <T> )
     {
         return(((IEquatable <T>)value1).Equals((T)((object)value2)));
     }
     return(value1.GetType().IsArray&& AttributedValue <T> .ArraysEqual(value1, value2));
 }
 public bool Equals(AttributedValue <T> other)
 {
     return(other != null && (object.ReferenceEquals(this, other) || (AttributedValue <T> .ArraysEqual(this.attributions, other.attributions) && AttributedValue <T> .ValuesEqual(this.Value, other.Value))));
 }