Esempio n. 1
0
        static void Main(string[] args)
        {
            Singleton fromTeacher = Singleton.GetInstance;

            fromTeacher.PrintDetails("From Teacher");
            Singleton fromStudent = Singleton.GetInstance;

            fromStudent.PrintDetails("From Student");

            Console.ReadLine();
        }
Esempio n. 2
0
        static void Main(string[] args)
        {
            Singleton fromEmployee = Singleton.Instance;

            fromEmployee.PrintDetails("This is the first message");

            Singleton fromStudent = Singleton.Instance;

            fromStudent.PrintDetails("This is the second message");

            Console.ReadLine();
        }
Esempio n. 3
0
        private static void PrintCustomer()
        {
            Singleton s1 = Singleton.Instance;

            s1.PrintDetails("Customer");
        }
Esempio n. 4
0
        private static void PrintEmployee()
        {
            Singleton s2 = Singleton.Instance;

            s2.PrintDetails("Employee");
        }
Esempio n. 5
0
        private static void DisplayEmployee()
        {
            Singleton employee = Singleton.GetInstance;

            employee.PrintDetails("From Employee");
        }
Esempio n. 6
0
        private static void DisplayStudent()
        {
            Singleton student = Singleton.GetInstance;

            student.PrintDetails("From Student");
        }
Esempio n. 7
0
        private static void FromStu()
        {
            Singleton fromStudent = Singleton.GetInstance; // suppose this was needed in student class

            fromStudent.PrintDetails("from student");
        }
Esempio n. 8
0
        private static void FromEmp()
        {
            Singleton fromEmployee = Singleton.GetInstance;// suppose this was needed on employee class

            fromEmployee.PrintDetails("from employee");
        }
Esempio n. 9
0
        private static void PrintEmployeeDetails()
        {
            Singleton fromEmployee = Singleton.GetInstance;

            fromEmployee.PrintDetails("from employee");
        }
Esempio n. 10
0
        private static void PrintStudentDetails()
        {
            Singleton fromStudent = Singleton.GetInstance;

            fromStudent.PrintDetails("from student");
        }
Esempio n. 11
0
        public static void PrintObjectA1Details()
        {
            Singleton objectA1 = Singleton.GetInstance;

            objectA1.PrintDetails("This is from Object A1, Thread Safety");
        }