internal override StoreObjectValidationError Validate(ValidationContext context, IValidatablePropertyBag validatablePropertyBag)
        {
            string text = validatablePropertyBag.TryGetProperty(InternalSchema.ItemClass) as string;

            if (!string.IsNullOrEmpty(text) && (ObjectClass.IsCalendarItem(text) || ObjectClass.IsRecurrenceException(text) || ObjectClass.IsMeetingMessage(text)) && validatablePropertyBag.IsPropertyDirty(InternalSchema.AppointmentStateInternal))
            {
                object obj = validatablePropertyBag.TryGetProperty(InternalSchema.AppointmentStateInternal);
                if (obj is int)
                {
                    AppointmentStateFlags appointmentStateFlags = (AppointmentStateFlags)obj;
                    if (EnumValidator <AppointmentStateFlags> .IsValidValue(appointmentStateFlags))
                    {
                        PropertyValueTrackingData originalPropertyInformation = validatablePropertyBag.GetOriginalPropertyInformation(InternalSchema.AppointmentStateInternal);
                        if (originalPropertyInformation.PropertyValueState == PropertyTrackingInformation.Modified && originalPropertyInformation.OriginalPropertyValue != null && !PropertyError.IsPropertyNotFound(originalPropertyInformation.OriginalPropertyValue))
                        {
                            AppointmentStateFlags appointmentStateFlags2 = (AppointmentStateFlags)originalPropertyInformation.OriginalPropertyValue;
                            bool flag  = (appointmentStateFlags2 & AppointmentStateFlags.Received) == AppointmentStateFlags.None;
                            bool flag2 = (appointmentStateFlags & AppointmentStateFlags.Received) == AppointmentStateFlags.None;
                            if (flag != flag2)
                            {
                                return(new StoreObjectValidationError(context, InternalSchema.AppointmentStateInternal, obj, this));
                            }
                        }
                    }
                }
            }
            return(null);
        }
        internal override StoreObjectValidationError Validate(ValidationContext context, IValidatablePropertyBag validatablePropertyBag)
        {
            string text = validatablePropertyBag.TryGetProperty(InternalSchema.ItemClass) as string;

            if (!string.IsNullOrEmpty(text) && (ObjectClass.IsCalendarItem(text) || ObjectClass.IsRecurrenceException(text)) && validatablePropertyBag.IsPropertyDirty(InternalSchema.CalendarOriginatorId))
            {
                object obj = validatablePropertyBag.TryGetProperty(InternalSchema.CalendarOriginatorId);
                if (obj is string)
                {
                    string text2 = (string)obj;
                    PropertyValueTrackingData originalPropertyInformation = validatablePropertyBag.GetOriginalPropertyInformation(InternalSchema.CalendarOriginatorId);
                    if (originalPropertyInformation.PropertyValueState == PropertyTrackingInformation.Modified)
                    {
                        MailboxSession mailboxSession = context.Session as MailboxSession;
                        if (mailboxSession != null && originalPropertyInformation.OriginalPropertyValue != null && !PropertyError.IsPropertyNotFound(originalPropertyInformation.OriginalPropertyValue))
                        {
                            string text3 = (string)originalPropertyInformation.OriginalPropertyValue;
                            int?   num   = CalendarOriginatorIdProperty.Compare(text2, text3);
                            if (num != null && num < 0 && !mailboxSession.Capabilities.CanSetCalendarAPIProperties && mailboxSession.LogonType != LogonType.Transport)
                            {
                                ExTraceGlobals.MeetingMessageTracer.TraceError <string, string>((long)this.GetHashCode(), "CalendarOriginatorIdConstraint::Validate. calendar originator value changed. Original = {0}, Current = {1}", text3, text2);
                                return(new StoreObjectValidationError(context, InternalSchema.CalendarOriginatorId, text2, this));
                            }
                        }
                    }
                }
            }
            return(null);
        }
Exemple #3
0
 internal override StoreObjectValidationError Validate(ValidationContext context, IValidatablePropertyBag validatablePropertyBag)
 {
     if (ObjectClass.IsCalendarItem((validatablePropertyBag.TryGetProperty(InternalSchema.ItemClass) as string) ?? string.Empty))
     {
         PersistablePropertyBag persistablePropertyBag = validatablePropertyBag as PersistablePropertyBag;
         if (persistablePropertyBag != null)
         {
             byte[] largeBinaryProperty = persistablePropertyBag.GetLargeBinaryProperty(InternalSchema.AppointmentRecurrenceBlob);
             if (largeBinaryProperty != null)
             {
                 ExTimeZone createTimeZone = TimeZoneHelper.GetRecurringTimeZoneFromPropertyBag(persistablePropertyBag) ?? ExTimeZone.CurrentTimeZone;
                 try
                 {
                     InternalRecurrence.InternalParse(largeBinaryProperty, persistablePropertyBag.TryGetProperty(InternalSchema.ItemId) as VersionedId, createTimeZone, persistablePropertyBag.ExTimeZone, CalendarItem.DefaultCodePage);
                 }
                 catch (RecurrenceCalendarTypeNotSupportedException ex)
                 {
                     ExTraceGlobals.RecurrenceTracer.TraceDebug <CalendarType>((long)this.GetHashCode(), "RecurrenceBlobConstraint::Validate. Not supported calendar type found. CalendarType:{0}", ex.CalendarType);
                 }
                 catch (RecurrenceFormatException)
                 {
                     return(new StoreObjectValidationError(context, InternalSchema.AppointmentRecurrenceBlob, largeBinaryProperty, this));
                 }
             }
         }
     }
     return(null);
 }
 private static OutlookModule GetModuleForObjectClass(string objectClass)
 {
     if (objectClass == null)
     {
         return(OutlookModule.None);
     }
     if (ObjectClass.IsCalendarFolder(objectClass) || ObjectClass.IsCalendarItem(objectClass))
     {
         return(OutlookModule.Calendar);
     }
     if (ObjectClass.IsContactsFolder(objectClass) || ObjectClass.IsContact(objectClass) || ObjectClass.IsDistributionList(objectClass))
     {
         return(OutlookModule.Contacts);
     }
     if (ObjectClass.IsJournalFolder(objectClass) || ObjectClass.IsJournalItem(objectClass))
     {
         return(OutlookModule.Journal);
     }
     if (ObjectClass.IsNotesFolder(objectClass) || ObjectClass.IsNotesItem(objectClass))
     {
         return(OutlookModule.Notes);
     }
     if (ObjectClass.IsTaskFolder(objectClass) || ObjectClass.IsTask(objectClass))
     {
         return(OutlookModule.Tasks);
     }
     if (ObjectClass.IsMessageFolder(objectClass) || ObjectClass.IsMessage(objectClass, false) || ObjectClass.IsMeetingMessage(objectClass) || ObjectClass.IsTaskRequest(objectClass) || ObjectClass.IsReport(objectClass))
     {
         return(OutlookModule.Mail);
     }
     return(OutlookModule.None);
 }
Exemple #5
0
        internal static Charset GetItemOutboundMimeCharset(Item item, OutboundConversionOptions options)
        {
            Charset charset   = ConvertUtils.GetItemOutboundMimeCharsetInternal(item, options);
            string  className = item.ClassName;

            if (options.DetectionOptions.PreferredCharset == null && charset.CodePage != 54936 && (ObjectClass.IsTaskRequest(className) || ObjectClass.IsMeetingMessage(className) || ObjectClass.IsCalendarItem(className)))
            {
                charset = Charset.GetCharset(65001);
            }
            return(charset);
        }
Exemple #6
0
 public static bool IsCalendarItemOrOccurrence(string itemClass)
 {
     return(ObjectClass.IsCalendarItem(itemClass) || ObjectClass.IsCalendarItemOccurrence(itemClass));
 }
Exemple #7
0
 public static StoreObjectType GetObjectType(string itemClass)
 {
     if (ObjectClass.IsOfClass(itemClass, "IPM.Note.Rules.OofTemplate.Microsoft", false))
     {
         return(StoreObjectType.OofMessage);
     }
     if (ObjectClass.IsOfClass(itemClass, "IPM.Note.Rules.ExternalOofTemplate.Microsoft", false))
     {
         return(StoreObjectType.ExternalOofMessage);
     }
     if (ObjectClass.IsOfClass(itemClass, "IPM.Note.Reminder"))
     {
         return(StoreObjectType.ReminderMessage);
     }
     if (ObjectClass.IsOfClass(itemClass, "IPM.Note"))
     {
         return(StoreObjectType.Message);
     }
     if (ObjectClass.IsOfClass(itemClass, "IPM.Post"))
     {
         return(StoreObjectType.Post);
     }
     if (ObjectClass.IsReport(itemClass))
     {
         return(StoreObjectType.Report);
     }
     if (ObjectClass.IsCalendarItem(itemClass))
     {
         return(StoreObjectType.CalendarItem);
     }
     if (ObjectClass.IsCalendarItemSeries(itemClass))
     {
         return(StoreObjectType.CalendarItemSeries);
     }
     if (ObjectClass.IsMeetingRequestSeries(itemClass))
     {
         return(StoreObjectType.MeetingRequestSeries);
     }
     if (ObjectClass.IsMeetingRequest(itemClass))
     {
         return(StoreObjectType.MeetingRequest);
     }
     if (ObjectClass.IsOfClass(itemClass, "IPM.MeetingMessageSeries.Resp"))
     {
         return(StoreObjectType.MeetingResponseSeries);
     }
     if (ObjectClass.IsOfClass(itemClass, "IPM.Schedule.Meeting.Resp"))
     {
         return(StoreObjectType.MeetingResponse);
     }
     if (ObjectClass.IsMeetingCancellationSeries(itemClass))
     {
         return(StoreObjectType.MeetingCancellationSeries);
     }
     if (ObjectClass.IsMeetingCancellation(itemClass))
     {
         return(StoreObjectType.MeetingCancellation);
     }
     if (ObjectClass.IsOfClass(itemClass, "IPM.Schedule.Meeting.Notification.Forward"))
     {
         return(StoreObjectType.MeetingForwardNotification);
     }
     if (ObjectClass.IsOfClass(itemClass, "IPM.MeetingMessageSeries.Notification.Forward"))
     {
         return(StoreObjectType.MeetingForwardNotificationSeries);
     }
     if (ObjectClass.IsOfClass(itemClass, "IPM.Notification.Meeting"))
     {
         return(StoreObjectType.MeetingForwardNotification);
     }
     if (ObjectClass.IsOfClass(itemClass, "IPM.Schedule.Inquiry"))
     {
         return(StoreObjectType.MeetingInquiryMessage);
     }
     if (ObjectClass.IsOfClass(itemClass, "IPM.Contact.Place"))
     {
         return(StoreObjectType.Place);
     }
     if (ObjectClass.IsOfClass(itemClass, "IPM.Contact"))
     {
         return(StoreObjectType.Contact);
     }
     if (ObjectClass.IsOfClass(itemClass, "IPM.UserPhoto.Preview"))
     {
         return(StoreObjectType.UserPhotoPreview);
     }
     if (ObjectClass.IsOfClass(itemClass, "IPM.UserPhoto"))
     {
         return(StoreObjectType.UserPhoto);
     }
     if (ObjectClass.IsOfClass(itemClass, "IPM.DistList"))
     {
         return(StoreObjectType.DistributionList);
     }
     if (ObjectClass.IsOfClass(itemClass, "IPM.Task"))
     {
         return(StoreObjectType.Task);
     }
     if (ObjectClass.IsOfClass(itemClass, "IPM.TaskRequest"))
     {
         return(StoreObjectType.TaskRequest);
     }
     if (ObjectClass.IsOfClass(itemClass, "IPM.ConversationAction"))
     {
         return(StoreObjectType.ConversationActionItem);
     }
     if (ObjectClass.IsOfClass(itemClass, "IPM.Note.rpmsg.Microsoft.Voicemail.UM.CA"))
     {
         return(StoreObjectType.Message);
     }
     if (ObjectClass.IsOfClass(itemClass, "IPM.Note.rpmsg.Microsoft.Voicemail.UM"))
     {
         return(StoreObjectType.Message);
     }
     if (ObjectClass.IsOfClass(itemClass, "IPM.Sharing", false))
     {
         return(StoreObjectType.SharingMessage);
     }
     if (ObjectClass.IsOfClass(itemClass, "IPM.GroupMailbox.JoinRequest"))
     {
         return(StoreObjectType.GroupMailboxRequestMessage);
     }
     if (ObjectClass.IsOfClass(itemClass, "IPM.MailboxAssociation.Group"))
     {
         return(StoreObjectType.MailboxAssociationGroup);
     }
     if (ObjectClass.IsOfClass(itemClass, "IPM.MailboxAssociation.User"))
     {
         return(StoreObjectType.MailboxAssociationUser);
     }
     if (ObjectClass.IsOfClass(itemClass, "IPM.HierarchySync.Metadata"))
     {
         return(StoreObjectType.HierarchySyncMetadata);
     }
     if (ObjectClass.IsSubscriptionDataItem(itemClass))
     {
         return(StoreObjectType.PushNotificationSubscription);
     }
     if (ObjectClass.IsOutlookServiceSubscriptionDataItem(itemClass))
     {
         return(StoreObjectType.OutlookServiceSubscription);
     }
     if (ObjectClass.IsConfigurationItem(itemClass))
     {
         return(StoreObjectType.Configuration);
     }
     if (ObjectClass.IsParkedMeetingMessage(itemClass))
     {
         return(StoreObjectType.ParkedMeetingMessage);
     }
     if (ObjectClass.IsGenericMessage(itemClass))
     {
         return(StoreObjectType.Message);
     }
     if (ObjectClass.IsCalendarFolder(itemClass))
     {
         return(StoreObjectType.CalendarFolder);
     }
     if (ObjectClass.IsContactsFolder(itemClass))
     {
         return(StoreObjectType.ContactsFolder);
     }
     if (ObjectClass.IsTaskFolder(itemClass))
     {
         return(StoreObjectType.TasksFolder);
     }
     if (ObjectClass.IsNotesFolder(itemClass))
     {
         return(StoreObjectType.NotesFolder);
     }
     if (ObjectClass.IsJournalFolder(itemClass))
     {
         return(StoreObjectType.JournalFolder);
     }
     if (ObjectClass.IsShortcutFolder(itemClass))
     {
         return(StoreObjectType.ShortcutFolder);
     }
     if (ObjectClass.IsGenericFolder(itemClass))
     {
         return(StoreObjectType.Folder);
     }
     return(StoreObjectType.Unknown);
 }
Exemple #8
0
 private static bool CanExtractRecipients(string itemClass)
 {
     return(!string.IsNullOrEmpty(itemClass) && (ObjectClass.IsMessage(itemClass, true) || ObjectClass.IsCalendarItem(itemClass)));
 }