public static MessageFunctions getInstence() { if (_instance == null) { return(_instance = new MessageFunctions()); } return(new MessageFunctions()); }
static void Main(string[] args) { var ex = MessageFunctions.getInstence(); var exam = new Message("teeext", "0951607142", "0564589456", new TimeSpan(), new DateTime(2020, 10, 4)); var exam2 = new Message("teeeeeext", "0951607142", "0564589459", new TimeSpan(), new DateTime(2010, 10, 4)); var exam3 = new Message("teeeeaaaaaaaaaaeext", "0951607142", "0564589459", new TimeSpan(), new DateTime(2012, 10, 4)); ex.NewMessage(exam); ex.NewMessage(exam2); ex.NewMessage(exam3); ex.Output("0564589459"); Console.WriteLine("///////////////////////////////"); ex.Print(); ex.DeleteMessages(new DateTime(2011, 4, 6)); Console.WriteLine("///////////////////////////////"); ex.Print(); }