public override object Deserialize(TextReader tr) { var offsetString = tr.ReadToEnd(); var offset = new UtcOffset(offsetString); return(offset); }
public void MergeFrom(DateTime other) { if (other == null) { return; } if (other.Year != 0) { Year = other.Year; } if (other.Month != 0) { Month = other.Month; } if (other.Day != 0) { Day = other.Day; } if (other.Hours != 0) { Hours = other.Hours; } if (other.Minutes != 0) { Minutes = other.Minutes; } if (other.Seconds != 0) { Seconds = other.Seconds; } if (other.Nanos != 0) { Nanos = other.Nanos; } switch (other.TimeOffsetCase) { case TimeOffsetOneofCase.UtcOffset: if (UtcOffset == null) { UtcOffset = new global::Google.Protobuf.WellKnownTypes.Duration(); } UtcOffset.MergeFrom(other.UtcOffset); break; case TimeOffsetOneofCase.TimeZone: if (TimeZone == null) { TimeZone = new global::Google.Type.TimeZone(); } TimeZone.MergeFrom(other.TimeZone); break; } _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); }
public override int GetHashCode() { int hash = 1; if (Year != 0) { hash ^= Year.GetHashCode(); } if (Month != 0) { hash ^= Month.GetHashCode(); } if (Day != 0) { hash ^= Day.GetHashCode(); } if (Hours != 0) { hash ^= Hours.GetHashCode(); } if (Minutes != 0) { hash ^= Minutes.GetHashCode(); } if (Seconds != 0) { hash ^= Seconds.GetHashCode(); } if (Nanos != 0) { hash ^= Nanos.GetHashCode(); } if (timeOffsetCase_ == TimeOffsetOneofCase.UtcOffset) { hash ^= UtcOffset.GetHashCode(); } if (timeOffsetCase_ == TimeOffsetOneofCase.TimeZone) { hash ^= TimeZone.GetHashCode(); } hash ^= (int)timeOffsetCase_; if (_unknownFields != null) { hash ^= _unknownFields.GetHashCode(); } return(hash); }
public override string ToString() { return(Name + (HasUtcOffset ? " UTC" + UtcOffset.ToString("+#;-#") : "") + (HasLatLongCoordinates ? " " + Latitude + ";" + Longitude : "")); }
public override int GetHashCode() { return(Year ^ (Month << 28) ^ (Day << 22) ^ (Hour << 14) ^ (Minute << 8) ^ (Second << 6) ^ UtcOffset.GetHashCode()); }