public override string ToString() { if (IsNull) { throw new System.ArgumentException("ToString failed, this is null or not loaded", "this"); } else { string retStr = base.ToString(); if (EventParent == null) { retStr += mDelim + "0"; } else { retStr += mDelim + EventParent.UniqueID.ToString(); } retStr += mDelim + EventChildren.Count.ToString(); for (int i = 0; i < EventChildren.Count; i++) { retStr += mDelim + EventChildren[i].UniqueID.ToString(); } retStr += mDelim + ItemChildren.Count.ToString(); for (int i = 0; i < ItemChildren.Count; i++) { retStr += mDelim + ItemChildren[i].UniqueID.ToString(); } retStr += mDelim + EventTimeInfo.ToString(); retStr += mDelim + EventLocation.ToString(); retStr += mDelim + IsPublic.ToString(); retStr += mDelim + PrivacyType.ToString(); return(retStr); } }
// Exceptions: // System.ArgumentException: // Other object is null // The argument to compare is not a UserBase // Refering object (this) is null public override int CompareTo(object other) { if (other == null) { throw new System.ArgumentException("Other object is null", "other"); } EventTimeInfo eventTimeInfo = other as EventTimeInfo; if (eventTimeInfo == null) { throw new System.ArgumentException("The argument to compare is not a eventTimeInfo", "other"); } if (IsNull)// || (!IsLoaded())) { throw new System.ArgumentException("Refering object (this) is null", "this"); } return(this.ToString().CompareTo(eventTimeInfo.ToString())); }