3 namespace ICSharpCode.SharpZipLib.Silverlight.Serialization
6 public class SerializableDateTime : SerializableBase
8 public DateTime DateTime { get; set; }
10 public SerializableDateTime(int year, int month, int day)
12 DateTime = new DateTime(year, month, day);
15 public SerializableDateTime()
20 protected override object GetValue(System.Reflection.FieldInfo field)
22 return field.DeclaringType == typeof (SerializableDateTime) ? field.GetValue(this) : null;
25 protected override void SetValue(System.Reflection.FieldInfo field, object value)
27 if (field.DeclaringType == typeof(SerializableDateTime))
29 field.SetValue(this, value);
33 public bool Equals(SerializableDateTime other)
35 if (ReferenceEquals(null, other))
39 return ReferenceEquals(this, other) || Equals(other.DateTime, DateTime);
42 public override bool Equals(object other)
44 if (ReferenceEquals(null, other))
48 if (ReferenceEquals(this, other))
52 return other.GetType() == typeof (SerializableDateTime) && Equals((SerializableDateTime) other);
55 public override int GetHashCode()
57 return DateTime.GetHashCode();