Exemple #1
0
        static void Main(string[] args)
        {
            Magazine magazine =
                new Magazine("How to find...", Frequency.Yearly, new DateTime(2016, 11, 12), 1, new Article[] { new Article() });


            Console.WriteLine("Yarly: " + magazine[Frequency.Yearly]);
            Console.WriteLine("Monthly: " + magazine[Frequency.Montly]);
            Console.WriteLine("Weekly: " + magazine[Frequency.Weekly]);

            magazine.Shedule  = Frequency.Yearly;
            magazine.Articles = new Article[] { new Article(new Person("Poll", "Tripp", new DateTime(1, 1, 1)), "Word's war", 6.7) };
            magazine.Edition  = 500;
            magazine.Release  = DateTime.Now;
            magazine.Title    = "Last hope";

            Console.WriteLine(magazine);

            Article[] articles = new Article[]
            {
                new Article(new Person("Poll", "Tripp", new DateTime(1, 1, 1)), "Word's war", 6.7),
                new Article(new Person("Mia", "Ogliche", new DateTime(1, 1, 1)), "Girl with lovely heart", 4.3),
                new Article(new Person("Stiv", "Nesh", new DateTime(1, 1, 1)), "Evangelism", 9.1)
            };

            magazine.AddArticles(articles);

            Console.WriteLine(magazine);

            TMethod();

            Console.ReadLine();
        }
Exemple #2
0
        public override object DeepCopy()
        {
            Magazine obj = new Magazine(Title, Shedule, Release, Edition);

            Article[] a = new Article[ArticlesList.Count];
            for (int i = 0; i < ArticlesList.Count; i++)
            {
                a[i] = new Article((ArticlesList[i]).Author, (ArticlesList[i]).Title, (ArticlesList[i]).Rating);
            }

            obj.AddArticles(a);

            Person[] p = new Person[Editors.Count];
            for (int i = 0; i < Editors.Count; i++)
            {
                p[i] = new Person((Editors[i]).Name, (Editors[i]).Surname, (Editors[i]).Birthday);
            }

            obj.AddEditors(p);
            return(obj);
        }