Beispiel #1
0
 static void Main(string[] args)
 {
     #if DEBUG
     Message m = new Message("Hello");
     try
     {
         MessageStorage.Initialize();
         MessageStorage.PutMessage(m);
         MessageStorage.PutMessage(new Message("World"));
     }
     catch (TypeInitializationException e)
     {
         Console.WriteLine(e.InnerException.ToString());
         Console.ReadKey();
     }
     #endif
 }
 public static void WriteInFile(Message m)
 {
     FileWriter.WriteLine(m.Serialize());
     FileWriter.Flush();
 }
 public static bool PutMessage(Message m)
 {
     MessageList.Add(m);
     WriteInFile(m);
     return true;
 }