Exemple #1
0
        public ParkRateViewModel(ParkRateConfig config)
        {
            _config = config;
            var now = DateTime.Now;

            PropertyChanged += (sender, args) => { UpdateFields(args); };

            _arrivalTimeColor = HelpColor;
            _leaveTimeColor   = HelpColor;
            _dateTimeParser   = new DateTimeParser();

            _paySlackTime        = config.PaySlackTime;
            _payInAdvance        = config.PayInAdvance;
            _payEveryMinutes     = config.PayEveryMinutes;
            _payAmountPerHour    = StringToDecimal(config.PayAmountPerHour, _payAmountPerHour);
            _payAmountPerHourStr = config.PayAmountPerHour;
            _slackTime           = config.SlackTime;

            LeaveTimeStr   = now.ToString(DateTimeParser.TimeFormat);
            LeaveDateStr   = now.ToString(DateTimeParser.DateFormat);
            ArrivalTimeStr = ComputeArrivalTime(now);
            ArrivalDateStr = _leaveDateStr;

            ComputeExamples();
        }
Exemple #2
0
 public void UpdateWithConfig(ParkRateConfig config)
 {
     PaySlackTime        = config.PaySlackTime;
     PayInAdvance        = config.PayInAdvance;
     PayEveryMinutes     = config.PayEveryMinutes;
     PayAmountPerHourStr = config.PayAmountPerHour;
     SlackTime           = config.SlackTime;
     ArrivalTimeStr      = string.Empty;
 }