Ejemplo n.º 1
0
 private void DemoteProperties()
 {
     this.calendarWriter.WriteProperty(PropertyId.Method, CalendarUtil.CalendarMethodToString(base.Context.Method));
     this.calendarWriter.WriteProperty(PropertyId.ProductId, "Microsoft Exchange Server 2010");
     this.calendarWriter.WriteProperty(PropertyId.Version, "2.0");
     if (!string.IsNullOrEmpty(base.Context.CalendarName))
     {
         this.calendarWriter.StartProperty("X-WR-CALNAME");
         this.calendarWriter.WritePropertyValue(base.Context.CalendarName);
     }
     if (base.Context.Type != CalendarType.Default)
     {
         this.calendarWriter.StartProperty("X-MICROSOFT-CALSCALE");
         this.calendarWriter.WritePropertyValue(CalendarUtil.CalendarTypeToString(base.Context.Type));
     }
 }
Ejemplo n.º 2
0
 internal static bool CanConvertToMeetingMessage(Item item)
 {
     return(CalendarUtil.GetICalMethod(item) != CalendarMethod.None || ObjectClass.IsFailedInboundICal(item.ClassName));
 }
Ejemplo n.º 3
0
 internal static BusyType BusyTypeFromString(string busyStatusString)
 {
     return(CalendarUtil.BusyTypeFromStringOrDefault(busyStatusString, BusyType.Busy));
 }
Ejemplo n.º 4
0
        protected override bool ValidateProperty(CalendarPropertyBase calendarProperty)
        {
            bool       result     = true;
            PropertyId propertyId = calendarProperty.CalendarPropertyId.PropertyId;

            if (propertyId <= PropertyId.DateTimeStart)
            {
                if (propertyId != PropertyId.Unknown)
                {
                    if (propertyId == PropertyId.DateTimeStart)
                    {
                        if (calendarProperty is CalendarDateTime)
                        {
                            this.dtStart = (CalendarDateTime)calendarProperty;
                        }
                        else
                        {
                            result = false;
                        }
                    }
                }
                else if (string.Compare(calendarProperty.CalendarPropertyId.PropertyName, "X-MICROSOFT-RRULE", StringComparison.CurrentCultureIgnoreCase) == 0)
                {
                    Recurrence recurrence = calendarProperty.Value as Recurrence;
                    if (this.xicalRule != null || recurrence == null || !this.ValidateRRule(recurrence))
                    {
                        result = false;
                    }
                    else
                    {
                        this.xicalRule = recurrence;
                        CalendarParameter parameter = calendarProperty.GetParameter("X-MICROSOFT-ISLEAPMONTH");
                        if (parameter != null)
                        {
                            bool?flag = CalendarUtil.BooleanFromString((string)parameter.Value);
                            if (flag == null)
                            {
                                result = false;
                            }
                            else
                            {
                                this.isLeapMonth = flag.Value;
                            }
                        }
                    }
                }
                else if (string.Compare(calendarProperty.CalendarPropertyId.PropertyName, "X-ALT-DESC", StringComparison.CurrentCultureIgnoreCase) == 0)
                {
                    result = this.ProcessXAltDesc(calendarProperty);
                }
            }
            else if (propertyId != PropertyId.Uid)
            {
                if (propertyId == PropertyId.RecurrenceRule)
                {
                    Recurrence recurrence2 = calendarProperty.Value as Recurrence;
                    if (this.icalRule != null || recurrence2 == null || !this.ValidateRRule(recurrence2))
                    {
                        result = false;
                    }
                    else
                    {
                        this.icalRule = recurrence2;
                    }
                }
            }
            else
            {
                string text = calendarProperty.Value as string;
                if (text == null)
                {
                    result = false;
                }
                else
                {
                    this.uid = text;
                }
            }
            return(result);
        }