示例#1
0
        private void EventComboBox_SelectedIndexChanged(object sender, EventArgs e)
        {
            var beginEvent = cbxBeginningTime.SelectedItem.ToString();
            var endEvent   = cbxEndingTime.SelectedItem.ToString();

            var beginTime     = CommentLogParser.ParseRawLog(beginEvent).Timestamp;
            var endTime       = CommentLogParser.ParseRawLog(endEvent).Timestamp;
            var eventDuration = (endTime - beginTime);

            txtTimeSpent.Text = (eventDuration.TotalMinutes / 60.00).ToString("0.##");
        }
示例#2
0
        private void cbxDate_SelectedIndexChanged(object sender, EventArgs e)
        {
            DateTime selectedDate;

            if (DateTime.TryParse(cbxDate.SelectedItem.ToString(), out selectedDate))
            {
                var fullPath = Path.Combine(CommentSetting.CommentLogLocation, selectedDate.ToString("yyyyMMdd") + ".txt");
                var logs     = CommentLogParser.GetRawData(fullPath);
                cbxBeginningTime.DataSource = logs;
                cbxEndingTime.DataSource    = new List <string>(logs);
            }
        }