Ejemplo n.º 1
0
        /// <summary>
        /// The entry point of program.
        /// </summary>
        /// <param name="args"></param>
        static void Main(string[] args)
        {
            try
            {
                // Create matn discipline.
                Discipline matn = new Discipline();
                // Create physics discipline.
                Discipline physics = new Discipline();
                // Check equality GUID of matan and physics - false.
                Console.WriteLine(matn.Equals(physics));
                // Deeply clone physics to phizra.
                Discipline phizra = (Discipline)physics.Clone();
                // Check equality GUID of matan and physics - true.
                Console.WriteLine(phizra.Equals(physics));

                for (int i = 0; i < physics.listOfLectures.Count; i++)
                {
                    // Output certain lection to display.
                    Console.WriteLine(physics[i]);
                }

                for (int i = 0; i < phizra.listOfLectures.Count; i++)
                {
                    // Output certain lection to display.
                    Console.WriteLine(phizra[i]);
                }
            }
            catch (Exception e)
            {
                Console.WriteLine($"Error: {e.Message}");
            }
        }
Ejemplo n.º 2
0
        /// <summary>
        /// entry point method
        /// </summary>
        /// <param name="args"></param>
        static void Main()
        {
            try
            {
                var matn    = new Discipline();
                var physics = new Discipline();

                Console.WriteLine(matn.Equals(physics));
                var laboratory = (Discipline)physics.Clone();
                Console.WriteLine(laboratory.Equals(physics));

                for (int i = 0; i < physics.ListOfLectures.Count; i++)
                {
                    Console.WriteLine(physics[i]);
                }

                for (int i = 0; i < laboratory.ListOfLectures.Count; i++)
                {
                    Console.WriteLine(laboratory[i]);
                }
            }
            catch (Exception ex)
            {
                Console.WriteLine($"Error: {ex.Message}");
                Console.WriteLine($"Stack trace: {ex.StackTrace}");
            }
        }