static void Main() { Application.EnableVisualStyles(); Application.SetCompatibleTextRenderingDefault(false); BookStore <Book> bs = new BookStore <Book>(); Controller <Book> controller = new Controller <Book>(bs, new Messager(), new StoreWindow <Book>(bs.StoreBooksBindingList, new NewBookWindow())); Application.Run((Form)controller.ControllerMainStoreWindow); }
public Controller(BookStore <T> bS, IMessager messager, IBookStoreWindow <T> storeWindow) { this.ControlerMessager = messager; this.ControllerXMLManager = new XmlManager <BookStore <T> >(); this.controllerBookStore = bS; this.ControllerMainStoreWindow = storeWindow; storeWindow.DGVStoreSource = controllerBookStore.StoreBooksBindingList; ControllerMainStoreWindow.OpenButtonClicked += ControllerMainStoreWindow_OpenButtonClicked; ControllerMainStoreWindow.SaveButtonClicked += ControllerMainStoreWindow_SaveButtonClicked; ControllerMainStoreWindow.HtmlReportButtonClicked += ControllerMainStoreWindow_HtmlReportButtonClicked; ControllerMainStoreWindow.AddButtonClicked += ControllerMainStoreWindow_AddButtonClicked; ControllerMainStoreWindow.DeleteButtonClicked += ControllerMainStoreWindow_DeleteButtonClicked; ControllerMainStoreWindow.EditButtonClicked += ControllerMainStoreWindow_EditButtonClicked; ControllerMainStoreWindow.ErrorOccurred += ControllerMainStoreWindow_ErrorOccurred; }