예제 #1
0
        /// <summary>
        /// MainViewPresenter ctor. Creates MainView, SetListboxView and handles btnAdd, btnBack, btnDel, btnRename
        /// </summary>
        /// <param name="mainView"></param>
        ///
        public MainViewPresenter(MainView mainView)
        {
            //Create Sets directory upon start
            Directory.CreateDirectory(Base._setsFolder);

            _mainView             = mainView;    //Load mainView from factory
            _mainView.FormClosed += OnFormClose; //Close app on clicking X

            _setModels = (List <SetModel>)GetAllSets.GetAll();
            SetListboxInit(); //Init setListbox on mainViewPresenter load

            //Event handlers
            _mainView.btnAdd.Click    += AddSetPresenterInit;
            _mainView.btnBack.Click   += OnBtnBackClickEventRaised;
            _mainView.btnDel.Click    += OnBtnDelMainClickEventRaised;
            _mainView.btnRename.Click += OnRenameBtnClickEventRaised;
        }
예제 #2
0
 /// <summary>
 /// Create a List<SetModel>
 /// </summary>
 /// <returns></returns>
 public static List <SetModel> CreateAllSets()
 {
     return((List <SetModel>)GetAllSets.GetAll());
 }