Exemplo n.º 1
0
 public ChainViewModel()
 {
     approverChain = factory.CreateChain(
         new Myself(),
         new LocalManager(),
         new Level2Manager(),
         new Level1Manager());
     AddRequest1Command    = new Command(() => RequestApproval(1));
     AddRequest100Command  = new Command(() => RequestApproval(100));
     AddRequest1000Command = new Command(() => RequestApproval(1000));
     AddRequestALotCommand = new Command(() => RequestApproval(1000000));
 }
Exemplo n.º 2
0
 public ExtendingViewModel()
 {
   Dictionary<IApprover, string> approvers = new Dictionary<IApprover, string>()
   {
     {new Myself(), "me"},
     {new LocalManager(), "*****@*****.**"},
     {new Level2Manager(), "*****@*****.**"},
     {new Level1Manager(), "*****@*****.**"}
   };
   mailService = new MailService(approvers);
   ApprovalAccounts.Add(CompanyAccount);
   factory = new Factory(mailService, OnApprovedRejected, CompanyAccount, account => ApprovalAccounts.Add(account));
   approverChain = factory.CreateChain(approvers.Keys);
   AddRequest1Command = new Command(() => RequestApproval(1));
   AddRequest100Command = new Command(() => RequestApproval(100));
   AddRequest1000Command = new Command(() => RequestApproval(1000));
   AddRequestALotCommand = new Command(() => RequestApproval(1000000));
 }