QueryNumber() public static method

public static QueryNumber ( string prompt, int defaultValue, int minValue, int maxValue ) : int?
prompt string
defaultValue int
minValue int
maxValue int
return int?
Esempio n. 1
0
        }         // 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
Esempio n. 2
0
        }         // 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
Esempio n. 3
0
        }         // 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
Esempio n. 4
0
        }         // 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
Esempio n. 5
0
        }         // 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
Esempio n. 6
0
        }         // 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
Esempio n. 7
0
        }         // 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
Esempio n. 8
0
        }         // 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
Esempio n. 9
0
        }         // 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
Esempio n. 10
0
        }         // 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
Esempio n. 11
0
        }         // 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