示例#1
0
        // Constructor. -->
        public LibraryForm()
        {
            // We create only one context in our application, which gets shared among repositories
            LibraryContext context = new LibraryContext();
            // We use a factory object that will create the repositories as they are needed, it also makes
            // sure all the repositories created use the same context.
            RepositoryFactory repFactory = new RepositoryFactory(context);

            this.authorService   = new AuthorService(repFactory);
            this.bookCopyService = new BookCopyService(repFactory);
            this.bookService     = new BookService(repFactory);
            this.loanService     = new LoanService(repFactory);
            this.memberService   = new MemberService(repFactory);

            InitializeComponent();

            this.authorService.OnUpdated(this, EventArgs.Empty);
            this.bookCopyService.OnUpdated(this, EventArgs.Empty);
            this.bookService.OnUpdated(this, EventArgs.Empty);
            this.loanService.OnUpdated(this, EventArgs.Empty);
            this.memberService.OnUpdated(this, EventArgs.Empty);

            UIExtension.ChangeUC(ucHome);
        }
示例#2
0
 private void ChangeTab(Button button, UserControl userControl)
 {
     pnlCurrentTab.Top = button.Top;
     ChangeTabColor(button);
     UIExtension.ChangeUC(userControl);
 }