internal TokenTimeRange(int position, TimeRangeKeywordsType range)
     : base(position)
 {
     index = 0;
     timeRangeType = TimeRangeType.DEFAULT;
     timeRange = range;
 }
 internal TokenTimeRange(int position, int val, TimeRangeType type)
     : base(position)
 {
     index = val;
     timeRangeType = type;
     timeRange = TimeRangeKeywordsType.NONE;
     Logger.Info("Created an time range token object", "TokenTimeRange::TokenTimeRange");
 }
 /// <summary>
 /// Checks if a time range crosses the day boundary and returns a boolean indicating whether it does.
 /// </summary>
 /// <param name="timeRangeKeyword"></param>
 /// <returns>True if positive; false if otherwise</returns>
 public static bool IsTimeRangeOverDayBoundary(TimeRangeKeywordsType timeRangeKeyword)
 {
     int timeRangeStartHour, timeRangeEndHour;
     timeRangeKeywordsStartTime.TryGetValue(timeRangeKeyword, out timeRangeStartHour);
     timeRangeKeywordsEndTime.TryGetValue(timeRangeKeyword, out timeRangeEndHour);
     if (timeRangeEndHour <= timeRangeStartHour)
     {
         return true;
     }
     return false;
 }
 /// <summary>
 /// Resets enums to their default values.
 /// </summary>
 /// <returns>Nothing.</returns>
 private void ResetEnumerations()
 {
     commandType = CommandType.INVALID;
     currentMode = ContextType.STARTTIME;
     currentSpecifier = ContextType.CURRENT;
     sortType = SortType.DEFAULT;
     searchType = SearchType.NONE;
     timeRangeType = TimeRangeType.DEFAULT;
     timeRangeOne = TimeRangeKeywordsType.NONE;
     timeRangeTwo = TimeRangeKeywordsType.NONE;
 }
        /// <summary>
        /// Initializes the generator's configuration to it's default values.
        /// </summary>
        /// <returns></returns>
        public void InitializeNewConfiguration()
        {
            commandType = new CommandType();
            isSpecific = new DateTimeSpecificity();
            timeRangeType = new TimeRangeType();
            timeRangeOne = new TimeRangeKeywordsType();
            timeRangeTwo = new TimeRangeKeywordsType();
            sortType = new SortType();
            searchType = new SearchType();
            taskName = null;
            taskRangeIndex = null;
            timeRangeIndex = 0;
            rangeIsAll = false;
            startDateTime = null; endDateTime = null;
            startTimeOnly = null; endTimeOnly = null;
            startDateOnly = null; endDateOnly = null;
            startDayOfWeekSet = false; endDayOfWeekSet = false;
            currentSpecifier = new ContextType();
            currentMode = new ContextType();
            crossDayBoundary = false;

            ResetEnumerations();
        }
Exemple #6
0
 /// <summary>
 /// Set the Default Time Range of Morning,Afternoon,Evening and Night
 /// </summary>
 /// <param name="timeRange">Set type of TimeRange</param>
 /// <param name="startTime">Set Starting Time</param>
 /// <param name="endTime">Set Ending Time</param>
 public void SetTimeRange(TimeRangeKeywordsType timeRange, int startTime, int endTime)
 {
     settingInfo.userTimeRangeKeywordsStartTime[timeRange] = startTime;
     settingInfo.userTimeRangeKeywordsEndTime[timeRange] = endTime;
     EventHandlers.UpdateSettings(settingInfo);
 }
Exemple #7
0
 public int GetStartTime(TimeRangeKeywordsType timeRange)
 {
     return settingInfo.userTimeRangeKeywordsStartTime[timeRange];
 }
        private void timeRangeKeywordTree_AfterSelect(object sender, TreeViewEventArgs e)
        {
            this.commandTree.SelectedNode = null;
            this.contextTree.SelectedNode = null;
            this.timeRangeTree.SelectedNode = null;
            this.rangeController.Enabled = true;
            schedPostponePanel.Hide();

            this.commandTree.SelectedNode = null;
            this.selectedType = SelectedType.TimeRangeKeywordsSelected;
            string selected = timeRangeKeywordTree.SelectedNode.Text;
            this.selectedTimeRangeKeywordType = ConvertStringToTimeRangeKeyword(selected);

            UpdateFlexiCommandList();
            UpdateDescription();
            UpdateTimeRangeUI();
        }