コード例 #1
0
 static void Main(string[] args)
 {
     Console.WriteLine("We will convert BDT 1000 to other languages");
     CurrencyContext bdtCurrency = new CurrencyContext(1000);
     CurrencyExpression bdConvert = new BDTConverter();
     bdConvert.interpret(bdtCurrency, "usd");
     Console.WriteLine("After conversion "+bdtCurrency.Output.ToString());
     Console.ReadLine();
 }
コード例 #2
0
        static void Main(string[] args)
        {
            Console.WriteLine("We will convert BDT 1000 to other languages");
            CurrencyContext    bdtCurrency = new CurrencyContext(1000);
            CurrencyExpression bdConvert   = new BDTConverter();

            bdConvert.interpret(bdtCurrency, "usd");
            Console.WriteLine("After conversion " + bdtCurrency.Output.ToString());
            Console.ReadLine();
        }
コード例 #3
0
 public void interpret(CurrencyContext acontext, string type)
 {
     if (type == "usd")
     {
         acontext.Output = usd(acontext.Input);
     }
     else if (type == "bdt")
     {
         acontext.Output = bdt(acontext.Input);
     }
     else if (type == "gbp")
     {
         acontext.Output = gbp(acontext.Input);
     }
     else if (type == "myr")
     {
         acontext.Output = myr(acontext.Input);
     }
 }
コード例 #4
0
 public void interpret(CurrencyContext acontext, string type)
 {
     if (type == "usd")
     {
         acontext.Output=usd(acontext.Input);
     }
     else if (type == "bdt")
     {
         acontext.Output = bdt(acontext.Input);
     }
     else if (type == "gbp")
     {
         acontext.Output=gbp(acontext.Input);
     }
     else if (type == "myr")
     {
         acontext.Output=myr(acontext.Input);
     }
 }