Пример #1
0
        private static void SingletoneImp()
        {
            Console.WriteLine("------Singletone-------");

            Singletone singletone = Singletone.GetObject();

            singletone.Length = 10; singletone.Width = 5;
            Console.WriteLine($"Area: { singletone.GetArea() }");
        }
Пример #2
0
        static void Main(string[] args)
        {
            Singletone staff = Singletone.SingleInstance;

            staff.LogMessage("staff");

            Singletone manager = Singletone.SingleInstance;

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