コード例 #1
0
        public void AdjustRecurrenceOutlookPattern(DateTime start, DateTime end)
        {
            var s = start.ToString("HH:mm:sszzz");
            var e = end.ToString("HH:mm:sszzz");

            PatternStartDate  = PatternStartDate.Remove(PatternStartDate.IndexOf("T"));
            PatternStartDate += "T" + s;

            PatternEndDate  = PatternEndDate.Remove(PatternEndDate.IndexOf("T"));
            PatternEndDate += "T" + e;
        }
コード例 #2
0
        public bool Equals(Recurrence other)
        {
            bool result = true;

            result &= Type == other.Type;
            result &= DaysOfTheWeekMask == other.DaysOfTheWeekMask;
            result &= DayOfMonth == other.DayOfMonth;
            result &= Duration == other.Duration;
            result &= Interval == other.Interval;
            result &= Instance == other.Instance;
            result &= Occurrences == other.Occurrences;
            result &= MonthOfYear == other.MonthOfYear;
            result &= NoEndDate && other.NoEndDate;

            if (!string.IsNullOrEmpty(EndTime) && !string.IsNullOrEmpty(other.EndTime))
            {
                result &= EndTime.Equals(other.EndTime);
            }

            if (!string.IsNullOrEmpty(StartTime) && !string.IsNullOrEmpty(other.StartTime))
            {
                result &= StartTime.Equals(other.StartTime);
            }

            if (!string.IsNullOrEmpty(PatternEndDate) && !string.IsNullOrEmpty(other.PatternEndDate))
            {
                result &= PatternEndDate.Equals(other.PatternEndDate);
            }

            if (!string.IsNullOrEmpty(PatternStartDate) && !string.IsNullOrEmpty(other.PatternStartDate))
            {
                result &= PatternStartDate.Equals(other.PatternStartDate);
            }

            return(result);
        }