示例#1
0
 public static void Main()
 {
     var source = new Account<List<LedgerEntry>>(new List<LedgerEntry> { new LedgerEntry("start", 0m), new LedgerEntry("first deposit", 1000m) });
     var destination = new Account<List<LedgerEntry>>(new List<LedgerEntry>());
     var context = new MoneyTransfer<List<LedgerEntry>,List<LedgerEntry>>(source, destination, 245m);
     context.Trans();
     Console.WriteLine("Press enter...");
     Console.ReadLine();
 }
示例#2
0
        public static void Main()
        {
            var source = new Account <List <LedgerEntry> >(new List <LedgerEntry> {
                new LedgerEntry("start", 0m), new LedgerEntry("first deposit", 1000m)
            });
            var destination = new Account <List <LedgerEntry> >(new List <LedgerEntry>());
            var context     = new MoneyTransfer <List <LedgerEntry>, List <LedgerEntry> >(source, destination, 245m);

            context.Trans();
            Console.WriteLine("Press enter...");
            Console.ReadLine();
        }
示例#3
0
文件: Program.cs 项目: runefs/Marvin
 public static void Main()
 {
     try
     {
         System.Diagnostics.Debugger.Launch();
         var list = new List<LedgerEntry>();
         list.Add(new LedgerEntry("start", 0m));
         list.Add(new LedgerEntry("first deposit", 1000m));
         var source = new Account<List<LedgerEntry>>(list);
         var destination = new Account<List<LedgerEntry>>(new List<LedgerEntry>());
         var context = new MoneyTransfer<Account<List<LedgerEntry>>, Account<List<LedgerEntry>>>(source, destination, 245m);
         context.Transfer();
     }
     catch (Exception e)
     {
         Console.WriteLine("Error: " + e.ToString());
     }
 }
示例#4
0
 public static void Main()
 {
     try
     {
         System.Diagnostics.Debugger.Launch();
         var list = new List <LedgerEntry>();
         list.Add(new LedgerEntry("start", 0m));
         list.Add(new LedgerEntry("first deposit", 1000m));
         var source      = new Account <List <LedgerEntry> >(list);
         var destination = new Account <List <LedgerEntry> >(new List <LedgerEntry>());
         var context     = new MoneyTransfer <Account <List <LedgerEntry> >, Account <List <LedgerEntry> > >(source, destination, 245m);
         context.Transfer();
     }
     catch (Exception e)
     {
         Console.WriteLine("Error: " + e.ToString());
     }
 }