예제 #1
0
        static void Main(string[] args)
        {
            Console.WriteLine("1 - Japan");
            Console.WriteLine("2 - Spain");
            Console.WriteLine("3 - US");
            string country;

            for (; ;)
            {
                Console.Write("Choose a Country : ");
                country = Console.ReadLine();
                try {
                    if (Int32.Parse(country) >= 4)
                    {
                        Console.WriteLine("Choose the correct option!!");
                    }
                    else
                    {
                        break;
                    }
                } catch (System.FormatException) {
                    Console.WriteLine("Choose a No. !!");
                }
            }
            Console.WriteLine(country);
            //Japan japan = new Japan(20);

            Coke  coke  = new Coke("Coke", 20, 12.99);
            Pepsi pepsi = new Pepsi("Pepsi", 10, 2.30);

            SodasVendingMachine <IJapanesSoda> jSodaVending = new SodasVendingMachine <IJapanesSoda>(25, "SODA");

            jSodaVending.SodaList.Add(coke);
            jSodaVending.SodaList.Add(pepsi);

            Japan japan = new Japan();

            japan.vendingMachines.Add((VendingMachine <IJapanesSoda>)jSodaVending);
            Console.WriteLine(jSodaVending.Name);
            japan.vendingMachines.ForEach(v => {
                Console.WriteLine($"{v.Name}");
            });
        }
예제 #2
0
 internal static global::System.Runtime.InteropServices.HandleRef getCPtr(Japan obj)
 {
     return((obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero) : obj.swigCPtr);
 }
예제 #3
0
파일: Japan.cs 프로젝트: minikie/test
 internal static global::System.Runtime.InteropServices.HandleRef getCPtr(Japan obj) {
   return (obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero) : obj.swigCPtr;
 }
예제 #4
0
 public bool CountOfLeapYearsBetweenYears(int year, int month, int day)
 {
     return(Japan.IsPublicHoliday(new DateTime(year, month, day)));
 }