public NotifyIconWrapper(TaskListViewModel taskListVM)
        {
            InitializeComponent();

            _repository = new TimeIntervalRepository();

            // タイマーのインスタンス生成
            _taskListVM        = taskListVM;
            _taskRecorderTimer = new TaskRecorderTimer();
            _taskRecorderTimer.DailyTaskRecorderTimerTickEventHandler += new TaskRecorderTimer.TimerTickEventHandler(CallBackEventProgress);

            // Work 終了のインスタンス作成
            _endWorkVM = new EndWorkViewModel(_taskRecorderTimer);
            _endWorkVM.DailyTaskRecorderActionChangeEventHandler += new EndWorkViewModel.ActionChangeEventHandler(CallBackStartAction);

            // コンテキストメニューのイベントを設定
            this.toolStripMenuItem_Exit.Click     += this.toolStripMenuItem_Exit_Click;
            this.toolStripMenuItem_Start.Click    += this.toolStripMenuItem_Start_Click;
            this.toolStripMenuItem_Break.Click    += this.toolStripMenuItem_Break_Click;
            this.toolStripMenuItem_Settings.Click += this.toolStripMenuItem_Settings_Click;
            this.toolStripMenuItem_TaskEdit.Click += this.toolStripMenuItem_TaskEdit_Click;

            // TextBox の初期化
            toolStripMenuItem_TimeText.Text = "00:00";
        }
예제 #2
0
         public MovieController()
        {
            string cnn = ConfigurationManager.ConnectionStrings["CinemaCnn"].ToString();
            var dbContext = new DatabaseContext(cnn);

            var movieRepository = new MovieRepository(dbContext);
            var theaterRepository = new TheaterRepository(dbContext);
            var genreRepository = new GenreRepository(dbContext);
            var timeIntervalRepository = new TimeIntervalRepository(dbContext);
            var userRepository = new UserRepository(dbContext);
            var movieUserRepository = new MovieUserRepository(dbContext);
             _db = dbContext;
            

            _movieRepository = movieRepository;
            _genreRepository = genreRepository;
            _theaterRepository = theaterRepository;
            _timeIntervalRepository = timeIntervalRepository;
             _userRepository = userRepository;
             _movieUserRepository = movieUserRepository;

            _movieService = new MovieService(movieRepository, theaterRepository, 
                _genreRepository, timeIntervalRepository);
            _genreService = new GenreService(genreRepository);
            _theaterService = new TheaterService(theaterRepository);
            _movieUserService = new MovieUserService(movieUserRepository, movieRepository, userRepository);
        }
        public void Execute(object parameter)
        {
            var timeIntervalVM = parameter as SettingsViewModel;

            TimeInterval timeInterval = new TimeInterval(
                new IntervalMinute(timeIntervalVM.WorkInterval),
                new IntervalMinute(timeIntervalVM.BreakInterval));

            TimeIntervalRepository repository = new TimeIntervalRepository();

            repository.Save(timeInterval);
        }