Exemplo n.º 1
0
 public UserController(IUser user, IBookList bookList, IAntiforgery antiforgery, IStringLocalizer <ApplicationUser> localizer)
 {
     _user        = user;
     _bookList    = bookList;
     _antiforgery = antiforgery;
     _localizer   = localizer;
 }
Exemplo n.º 2
0
 public BookController(IBookRegister bookRegister, IBookUpdater bookUpdater,
                       IBookRemover bookRemover, IBookList bookList)
 {
     _bookRegister = bookRegister;
     _bookUpdater  = bookUpdater;
     _bookRemover  = bookRemover;
     _bookList     = bookList;
 }
Exemplo n.º 3
0
        public MainMenu()
        {
#if DEBUG
            _client = new WCFClient("http://127.0.0.1:12345/");
#else
            _client = new WCFClient(EnterUrl());
#endif
        }
Exemplo n.º 4
0
        public WCFClient(string url)
        {
            var myBinding  = new WebHttpBinding();
            var myEndpoint = new EndpointAddress(url);

            _client = new ClientImpl(myBinding, myEndpoint);
            _client.Open();
            _proxy = _client.Proxy;
        }
        static void DoSomeStuffToEnsureThatAllWorks(IBookList list)
        {
            Console.WriteLine("------ GetHashCode ------");
            Console.WriteLine("Book #1: " + book1.GetHashCode());
            Console.WriteLine("Book #2: " + book2.GetHashCode());
            Console.WriteLine("Book #3: " + book3.GetHashCode());
            Console.WriteLine("Book #4: " + book4.GetHashCode());
            Console.WriteLine("Book #5: " + book5.GetHashCode());
            Console.WriteLine("-------------------------");

            Console.WriteLine("--------- Equals --------");
            Console.WriteLine("book1 == book2: " + (book1 == book2));
            Console.WriteLine("book2 != book5: " + (book2 != book5));
            Console.WriteLine("book4.Equals(null): " + book4.Equals(null));
            Console.WriteLine("book4.Equals(book5): " + book4.Equals(book5));
            Console.WriteLine("-------------------------");

            Console.WriteLine("--------- AddBook -------");

            Console.WriteLine("AddBook #1: " + list.AddBook(book1));
            Console.WriteLine("AddBook #2: " + list.AddBook(book2));
            Console.WriteLine("AddBook #3: " + list.AddBook(book3));
            Console.WriteLine("AddBook #4: " + list.AddBook(book4));
            Console.WriteLine("AddBook #5: " + list.AddBook(book5));
            Console.WriteLine("-------------------------");

            Console.WriteLine("---------- Sort ---------");
            Console.WriteLine("Year Increasing: ");
            list.SortBooks(new YearIncreasing());
            Print(list);
            Console.WriteLine("---------");

            Console.WriteLine("Pages Decreasing: ");
            list.SortBooks(new PagesDecreasing());
            Print(list);
            Console.WriteLine("---------");

            Console.WriteLine("Title Increasing: ");
            list.SortBooks(new TitleIncreasing());
            Print(list);
            Console.WriteLine("---------");

            Console.WriteLine("Author Decreasing: ");
            list.SortBooks(new AuthorDecreasing());
            Print(list);
            Console.WriteLine("---------");
            Console.WriteLine("------------------------");

            Console.WriteLine("-------- IndexOf -------");
            Console.WriteLine("IndexOf Book #2: " + list.IndexOfBook(book2));
            Console.WriteLine("IndexOf Book #5: " + list.IndexOfBook(book5));
            Console.WriteLine("IndexOf Book #4: " + list.IndexOfBook(book4));
            Console.WriteLine("IndexOf Book #1: " + list.IndexOfBook(book1));
            Console.WriteLine("IndexOf Book #3: " + list.IndexOfBook(book3));
            Console.WriteLine("-----------------------");
        }
Exemplo n.º 6
0
 public BookController(IBook book, IBookList bookList)
 {
     _book     = book;
     _bookList = bookList;
 }
Exemplo n.º 7
0
 public BookListController(IBookList bookList, IAntiforgery antiforgery, IStringLocalizer <BookList> localizer)
 {
     _bookList    = bookList;
     _antiforgery = antiforgery;
     _localizer   = localizer;
 }
Exemplo n.º 8
0
 public BookListController(IBookList bookList)
 {
     _bookList = bookList;
 }
 public bool Filter(Predicate<Book> predicate, IBookList bookList)
 {
     return bls.Filter(predicate, bookList);
 }
Exemplo n.º 10
0
 public HomeController(IBookList bookList, IUser user)
 {
     _bookList = bookList;
     _user     = user;
 }