コード例 #1
0
ファイル: Program.cs プロジェクト: Haradorn/Challenge
        static void Main()
        {
            Application.EnableVisualStyles();
            Application.SetCompatibleTextRenderingDefault(false);
            BookStore  bs         = new BookStore();
            Controller controller = new Controller(bs, new Messager(), new mainForm(bs.StoreBooksBindingList));

            Application.Run((Form)controller.ControllerMainStoreWindow);
        }
コード例 #2
0
        public Controller(BookStore bookStore, IMessager messager, IBookStoreWindow storeWindow)
        {
            this.ControlerMessager    = messager;
            this.ControllerXMLManager = new XmlManager <BookStore>();
            this.controllerBookStore  = bookStore;

            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;
        }