Esempio n. 1
0
        static void Main(string[] args)
        {
            MySingleton myCoolSingleton = MySingleton.Instance;

            myCoolSingleton.PrintDetails("heeeelooo you!");
            Parallel.Invoke(
                () => PrintTeacherDetails(),
                () => PrintStudentdetails()
                );
            Console.ReadLine();
        }
Esempio n. 2
0
        private static void PrintStudentdetails()
        {
            MySingleton fromStudent = MySingleton.Instance;

            fromStudent.PrintDetails("From Student");
        }
Esempio n. 3
0
        private static void PrintTeacherDetails()
        {
            MySingleton fromTeacher = MySingleton.Instance;

            fromTeacher.PrintDetails("From Teacher");
        }