/// <summary> /// Returns a <see cref="System.String" /> that represents this instance. /// </summary> /// <returns> /// A <see cref="System.String" /> that represents this instance. /// </returns> public override string ToString() { StringBuilder sb = new StringBuilder(); if (DidAttend.HasValue) { sb.Append((PersonAlias != null && PersonAlias.Person != null) ? PersonAlias.Person.ToStringSafe() + " " : ""); sb.Append(DidAttend.Value ? "attended " : "did not attend "); sb.Append(Group != null ? Group.ToStringSafe() + " " : ""); if (DidAttend.HasValue && DidAttend.Value) { sb.AppendFormat("on {0} at {1} ", StartDateTime.ToShortDateString(), StartDateTime.ToShortTimeString()); if (EndDateTime.HasValue) { sb.AppendFormat("until {0} at {1} ", EndDateTime.Value.ToShortDateString(), EndDateTime.Value.ToShortTimeString()); } } sb.Append(Location != null ? "in " + Location.ToStringSafe() : ""); } return(sb.ToString().Trim()); }
/// <summary> /// Returns a <see cref="System.String" /> that represents this instance. /// </summary> /// <returns> /// A <see cref="System.String" /> that represents this instance. /// </returns> public override string ToString() { return(Group.ToStringSafe() + " at " + Location.ToStringSafe()); }