コード例 #1
0
ファイル: Program.cs プロジェクト: PashaEagle/Sharaga
        public static void Main(string[] args)
        {
            Message  mes, mes2, mes3;
            Republic ukraine = new Republic();
            Monarchy spain   = new Monarchy("Spain", 70000000);
            Kingdom  uk      = new Kingdom("United Kingdom", 140000000);

            ukraine.Name       = "Ukraine";
            ukraine.Population = 41000000;

            mes = ukraine.Info;

            mes2  = spain.Info;
            mes2 += uk.Info;
            mes3  = mes + mes2;
            mes3();

            Console.WriteLine();

            IDerzhava[] masiv = new IDerzhava[3];

            masiv[0] = ukraine;
            masiv[1] = spain;
            masiv[2] = uk;

            foreach (IDerzhava derzh in masiv)
            {
                mes += derzh.Info;
            }

            mes.Invoke();
        }
コード例 #2
0
ファイル: Program.cs プロジェクト: PashaEagle/Sharaga
        public static void Main(string[] args)
        {
            Republic ukraine = new Republic();
            Monarchy spain   = new Monarchy("Spain", 70000000);
            Kingdom  uk      = new Kingdom("United Kingdom", 140000000);

            ukraine.Name       = "Ukraine";
            ukraine.Population = 41000000;

            ukraine.Info();
            spain.Info();
            uk.Info();

            Console.WriteLine();

            IDerzhava[] masiv = new IDerzhava[3];

            masiv[0] = ukraine;
            masiv[1] = spain;
            masiv[2] = uk;

            foreach (IDerzhava derzh in masiv)
            {
                derzh.Info();
            }
        }