public static QueryNumber ( string prompt, int defaultValue, int minValue, int maxValue ) : int? | ||
prompt | string | |
defaultValue | int | |
minValue | int | |
maxValue | int | |
Результат | int? |
} // QueryDay // ---------------------------------------------------------------------- public bool QueryHour() { int?hour = ConsoleTool.QueryNumber("Hour (0..23) [enter=" + Hour + "]: ", Hour, 0, TimeSpec.HoursPerDay - 1); if (!hour.HasValue) { return(false); } Hour = hour.Value; return(true); } // QueryHour
} // QueryHour // ---------------------------------------------------------------------- public bool QueryMinute() { int?minute = ConsoleTool.QueryNumber("Minute (0..59) [enter=" + Minute + "]: ", Minute, 0, TimeSpec.MinutesPerHour - 1); if (!minute.HasValue) { return(false); } Minute = minute.Value; return(true); } // QueryMinute
} // QueryPeriodCount // ---------------------------------------------------------------------- public bool QueryYear() { int?year = ConsoleTool.QueryNumber("Year [enter=" + Year + "]: ", Year, DateTime.MinValue.Year, DateTime.MaxValue.Year); if (!year.HasValue) { return(false); } Year = year.Value; return(true); } // QueryYear
} // QueryYearWeekType // ---------------------------------------------------------------------- public bool QueryDay() { int?day = ConsoleTool.QueryNumber("Day (1..31) [enter=" + Day + "]: ", Day, 1, 31); if (!day.HasValue) { return(false); } Day = day.Value; return(true); } // QueryDay
} // QueryYearMonth // ---------------------------------------------------------------------- public bool QueryWeek() { int?week = ConsoleTool.QueryNumber("Week (1..53) [enter=" + Week + "]: ", Week, 1, 53); if (!week.HasValue) { return(false); } Week = week.Value; return(true); } // QueryWeek
} // QueryCulture // ---------------------------------------------------------------------- public bool QueryPeriodCount() { int?periodCount = ConsoleTool.QueryNumber("Period count [enter=" + PeriodCount + "]: ", PeriodCount, 1, 10000); if (!periodCount.HasValue) { return(false); } PeriodCount = periodCount.Value; return(true); } // QueryPeriodCount
} // QueryWeek // ---------------------------------------------------------------------- public bool QueryYearWeekType() { int?weekType = ConsoleTool.QueryNumber("Week type (0..1) [enter=" + (int)YearWeekType + "/" + YearWeekType + "]: ", (int)YearWeekType, 0, 2); if (!weekType.HasValue) { return(false); } YearWeekType = (YearWeekType)weekType.Value; return(true); } // QueryYearWeekType
} // QueryYearQuarter // ---------------------------------------------------------------------- public bool QueryYearMonth() { int?yearMonth = ConsoleTool.QueryNumber("Month (1..12) [enter=" + (int)Month + "/" + Month + "]: ", (int)Month, 1, TimeSpec.QuartersPerYear); if (!yearMonth.HasValue) { return(false); } Month = (YearMonth)yearMonth.Value; return(true); } // QueryYearMonth
} // QueryYearHalfyear // ---------------------------------------------------------------------- public bool QueryYearQuarter() { int?yearQuarter = ConsoleTool.QueryNumber("Quarter (1..4) [enter=" + (int)Quarter + "/" + Quarter + "]: ", (int)Quarter, 1, TimeSpec.QuartersPerYear); if (!yearQuarter.HasValue) { return(false); } Quarter = (YearQuarter)yearQuarter.Value; return(true); } // QueryYearQuarter
} // QueryYearBaseMonth // ---------------------------------------------------------------------- public bool QueryYearHalfyear() { int?halfyear = ConsoleTool.QueryNumber("Halfyear (1..2) [enter=" + (int)Halfyear + "/" + Halfyear + "]: ", (int)Halfyear, 1, TimeSpec.HalfyearsPerYear); if (!halfyear.HasValue) { return(false); } Halfyear = (YearHalfyear)halfyear.Value; return(true); } // QueryYearHalfyear
} // QueryYear // ---------------------------------------------------------------------- public bool QueryYearBaseMonth() { int?yearStartMonth = ConsoleTool.QueryNumber("Year start month (1..12) [enter=" + (int)YearBaseMonth + "/" + YearBaseMonth + "]: ", (int)YearBaseMonth, 1, TimeSpec.MonthsPerYear); if (!yearStartMonth.HasValue) { return(false); } YearBaseMonth = (YearMonth)yearStartMonth.Value; return(true); } // QueryYearBaseMonth