Beispiel #1
0
 public static ConsoleStringList GetInstance()
 {
     if (instance == null)
     {
         instance = new ConsoleStringList();
     }
     return(instance);
 }
Beispiel #2
0
        static void Main(string[] args)
        {
            string            lineFromConsole;
            ConsoleStringList slist = ConsoleStringList.GetInstance();

            Console.WriteLine("Input your strings or 'exit':");
            lineFromConsole = Console.ReadLine();
            while (lineFromConsole != "exit")
            {
                slist.AddStringToList(lineFromConsole);
                lineFromConsole = Console.ReadLine();
            }
            Console.WriteLine(slist.showAll());
            Console.ReadLine();
        }