Esempio n. 1
0
        static void Main(string[] args)
        {
            var j = new Journal();

            j.AddEntry("I cried today");
            j.AddEntry("I ate a bug");
            WriteLine(j);

            var p        = new Persistance();
            var filename = @"c:\tmp\journal.txt";

            p.SaveToFile(j, filename, true);
            Process.Start(filename);  //this brings file to foreground
        }
Esempio n. 2
0
        static void Main(string[] args)
        {
            Console.WriteLine("SingleRespnsibility Principle/Pattern");

            Remainder rem = new Remainder();

            rem.AddRemainders("Make Tea at 11");
            rem.AddRemainders("Meeting at 12");
            rem.AddRemainders("Lunch at 1");

            Console.WriteLine(rem);

            Persistance persistance = new Persistance();
            string      filename    = @"D:\remainders.txt";

            persistance.SaveToFile(rem, filename, true);
        }
Esempio n. 3
0
        static void Main(string[] args)
        {
            var j = new Journal();

            j.AddEntry("I cried today.");
            j.AddEntry("I ate a bug.");
            j.AddEntry("I need a job.");

            var p        = new Persistance();
            var filename = @"c:\temp\journal.txt";

            p.SaveToFile(j, filename, true);

            Process.Start(filename);

            Console.WriteLine(j);
            Console.ReadKey();
        }