Guest User

Untitled

a guest
Feb 6th, 2018
104
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.52 KB | None | 0 0
  1. interface ILoginHandler
  2. {
  3. Task LoginAsync();
  4. }
  5.  
  6. public class DefaultLoginHandler : ILoginHandler
  7. {
  8. private username, password;
  9.  
  10. public DefaultLoginHandler(string username, string password){ this.username = username; this.password = password; }
  11.  
  12. public async Task LoginAsync() => login logic
  13. }
  14.  
  15. public class Site : ILoginHandler
  16. {
  17. ILoginHandler loginHandler;
  18.  
  19. public Site(ILoginHandler loginHandler){this.loginHandler = loginHandler; }
  20.  
  21. public async Task LoginAsync() => await loginHandler.LoginAsync();
  22. }
Add Comment
Please, Sign In to add comment