Esempio n. 1
0
 public void Init(Config config)
 {
     _config = config;
     InitHourLines();
     InitTargetLine(_config.TargetTimeNum);
     InitMinTimes(_config.MinTimeStartNum);
 }
Esempio n. 2
0
        public WorkTime(DateTime? startDateTime)
        {
            _config = Config.GetInstance();
            _clock = new SystemClock();

            if (startDateTime.HasValue) {
                Init((DateTime)startDateTime);
            }
        }
Esempio n. 3
0
        public WorkTime(IClock clock, string startTimeString, DateTime? startDate)
        {
            _config = Config.GetInstance();
            _clock = clock; // unit testing

            var validStartTime = ValidateStartTimeFormat(startTimeString);
            var startDateTime = InitStartDateTime(validStartTime, startDate);
            Init(startDateTime);
        }
Esempio n. 4
0
        public void Init(Config config)
        {
            _config = config;
            _defaultBackground = gbTimes.Background;
            datePickerStartDate.Text = DateTime.Today.ToShortDateString();

            var now = DateTime.Now;
            var dt = new DateTime(now.Year, now.Month, now.Day, now.Hour, now.Minute, 0);
            dateTimePicker1.Value = dt;
        }
Esempio n. 5
0
        public void Init(WorkTime workTime, Config config)
        {
            if (workTime == null || config == null) { throw new ArgumentException("bla"); }

            _startTime = workTime.StartTime;
            _config = config;

            InitStartTime(workTime);
            InitTargetTime(workTime, RadiusTargetTime);
            InitMinTime(workTime, RadiusMinTime);
            InitMaxTime(workTime, RadiusMaxTime);
        }
Esempio n. 6
0
 public void Init(Config config)
 {
     _config = config;
 }
Esempio n. 7
0
 public WorkTime(IClock clock, DateTime startDateTime)
 {
     _config = Config.GetInstance();
     _clock = clock; // unit testing
     Init(startDateTime);
 }
Esempio n. 8
0
        private void Window_Loaded(object sender, RoutedEventArgs e)
        {
            _config = Config.GetInstance();
            ucTimeAsText.Init(_config);
            ucProgress.Init(_config);
            ucTimeCheckboxes.Init(_config);

            ucTimeCheckboxes.CheckChanged += ucTimeCheckboxes_CheckChanged;
        }
Esempio n. 9
0
 public static Config GetInstance()
 {
     return _instance ?? (_instance = new Config());
 }