Beispiel #1
0
        /// <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());
        }
Beispiel #2
0
        /// <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()
        {
            var sb = new StringBuilder();

            sb.AppendFormat("{0} ", this.AllowOrDeny == "A" ? "Allow" : "Deny");

            if (SpecialRole != Model.SpecialRole.None)
            {
                sb.AppendFormat("{0} ", SpecialRole.ToStringSafe().SplitCase());
            }
            else if (PersonAlias != null)
            {
                sb.AppendFormat("{0} ", PersonAlias.ToStringSafe());
            }
            else if (Group != null)
            {
                sb.AppendFormat("{0} ", Group.ToStringSafe());
            }

            sb.AppendFormat("{0} Access", Action);

            return(sb.ToString());
        }
Beispiel #3
0
 /// <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());
 }