Beispiel #1
0
        private static void SingletoneImp()
        {
            Console.WriteLine("------Singletone-------");

            Singletone singletone = Singletone.GetObject();

            singletone.Length = 10; singletone.Width = 5;
            Console.WriteLine($"Area: { singletone.GetArea() }");
        }
        static void Main(string[] args)
        {
            Singletone staff = Singletone.SingleInstance;

            staff.LogMessage("staff");

            Singletone manager = Singletone.SingleInstance;

            manager.LogMessage("manager object");
            Console.ReadKey();
        }