public static string toString(Message message) { return(new StringBuilder() .Append(message.getSender()) .Append("|") .Append(message.getText()) .Append("|") .Append(message.getDate().ToString()) .ToString()); }
public void addMessage(Message message) { foreach (Message itr in messages) { if (itr.getText() == message.getText()) { return; } } messages.Add(message); }