예제 #1
0
        //=====================================================================

        /// <summary>
        /// Default constructor
        /// </summary>
        /// <remarks>See <see cref="Reset"/> for a description of the default state of the recurrence object</remarks>
        /// <overloads>There are three constructors for this class</overloads>
        public Recurrence()
        {
            byMonth = new UniqueIntegerCollection(1, 12, false);
            byWeekNo = new UniqueIntegerCollection(-53, 53, false);
            byYearDay = new UniqueIntegerCollection(-366, 366, false);
            byMonthDay = new UniqueIntegerCollection(-31, 31, false);
            byHour = new UniqueIntegerCollection(0, 23, true);
            byMinute = new UniqueIntegerCollection(0, 59, true);
            bySecond = new UniqueIntegerCollection(0, 59, true);
            bySetPos = new UniqueIntegerCollection(-366, 366, false);
            byDay = new DayInstanceCollection();
            customProps = new StringCollection();

            isSecondUsed = new bool[60];
            isMinuteUsed = new bool[60];
            isHourUsed = new bool[24];
            isDayUsed = new bool[7];       // When filtered, instance isn't used
            isMonthDayUsed = new bool[32];
            isNegMonthDayUsed = new bool[32];  // Negative days
            isYearDayUsed = new bool[367];
            isNegYearDayUsed = new bool[367];  // Negative days
            isMonthUsed = new bool[12];

            this.Parse(null);
        }
예제 #2
0
        /// <summary>
        /// Add integer collection values to the description
        /// </summary>
        private static void AddIntegerCollection(StringBuilder sb, UniqueIntegerCollection uic, string desc,
          ref bool addComma)
        {
            for(int idx = 0; idx < uic.Count; idx++)
            {
                if(idx == 0)
                {
                    if(addComma)
                        sb.Append(",");
                    else
                        addComma = true;

                    sb.Append(LR.GetString("RDThe"));
                }

                if(uic[idx] < 0)
                {
                    sb.Append(uic[idx] * -1);
                    sb.Append(DayInstance.NumericSuffix(uic[idx]));
                    sb.Append(' ');
                    sb.Append(LR.GetString("DIFromEnd"));
                }
                else
                {
                    sb.Append(uic[idx]);
                    sb.Append(DayInstance.NumericSuffix(uic[idx]));
                }

                if(idx < uic.Count - 2)
                    sb.Append(", ");
                else
                    if(idx < uic.Count - 1)
                    {
                        if(idx != 0)
                            sb.Append(",");

                        sb.Append(LR.GetString("RDAnd"));
                    }
            }

            if(uic.Count != 0)
                sb.Append(LR.GetString(desc));
        }