/// <summary> /// Used to get/add posts to the Data Access Layer /// </summary> /// <returns>ToString method to write to the listbox</returns> public override string ToString() { int Length; string Name = Account.Name; for (Length = Name.Length; Length < 20;) { Name = Name.Insert(Name.Length, " "); Length = Name.Length; } return(Name + Text.PadRight(90) + Likes.ToString().PadRight(12) + Attachment.PadRight(20) + ID); }
public override string ToString() { StringBuilder sb = new StringBuilder(); sb.AppendLine(Title); sb.Append(Likes.ToString()); sb.Append(" Likes - "); sb.AppendLine(Moment.ToString()); sb.AppendLine(Content); sb.AppendLine("Comments:"); foreach (Comment x in Comments) { sb.AppendLine(x.ToString()); } return(sb.ToString()); }
public override string ToString() { StringBuilder builder = new StringBuilder(); builder.AppendLine(Title); builder.Append(Likes.ToString()); builder.Append(" Likes - "); builder.AppendLine(Moment.ToString("dd/MM/yyyy HH:mm:ss")); builder.AppendLine(Content); builder.AppendLine("Comments:"); foreach (Comment item in Comments) { builder.AppendLine(item.Text); } return(builder.ToString()); }