Beispiel #1
0
        private Item BindToItemWithItemClass(StoreObjectId id, string itemClass, PropertyDefinition[] properties)
        {
            Item result;

            if (ObjectClass.IsReport(itemClass))
            {
                result = ReportMessage.Bind(this.mailboxSession, id, properties);
            }
            else if (ObjectClass.IsMessage(itemClass, false))
            {
                result = MessageItem.Bind(this.mailboxSession, id, properties);
            }
            else if (ObjectClass.IsPost(itemClass))
            {
                result = PostItem.Bind(this.mailboxSession, id, properties);
            }
            else if (ObjectClass.IsCalendarItem(itemClass))
            {
                result = CalendarItem.Bind(this.mailboxSession, id, properties);
            }
            else if (ObjectClass.IsMeetingRequest(itemClass))
            {
                result = MeetingRequest.Bind(this.mailboxSession, id, properties);
            }
            else if (ObjectClass.IsMeetingResponse(itemClass))
            {
                result = MeetingResponse.Bind(this.mailboxSession, id, properties);
            }
            else if (ObjectClass.IsMeetingCancellation(itemClass))
            {
                result = MeetingCancellation.Bind(this.mailboxSession, id, properties);
            }
            else if (ObjectClass.IsContact(itemClass))
            {
                result = Contact.Bind(this.mailboxSession, id, properties);
            }
            else if (ObjectClass.IsTask(itemClass))
            {
                Task task = Task.Bind(this.mailboxSession, id, true, properties);
                task.SuppressRecurrenceAdjustment = true;
                result = task;
            }
            else if (ObjectClass.IsDistributionList(itemClass))
            {
                result = DistributionList.Bind(this.mailboxSession, id, properties);
            }
            else if (ObjectClass.IsGenericMessage(itemClass))
            {
                result = MessageItem.Bind(this.mailboxSession, id, properties);
            }
            else
            {
                result = Item.Bind(this.mailboxSession, id, properties);
            }
            return(result);
        }
Beispiel #2
0
 protected Item BindItem(Item item, ExchangeService service, PropertySet propertySet)
 {
     if (item.GetType() == typeof(Microsoft.Exchange.WebServices.Data.Appointment))
     {
         return(Appointment.Bind(service, item.Id, propertySet));
     }
     else if (item.GetType() == typeof(Microsoft.Exchange.WebServices.Data.Task))
     {
         return(Task.Bind(service, item.Id, propertySet));
     }
     else if (item.GetType() == typeof(Microsoft.Exchange.WebServices.Data.Contact))
     {
         return(Contact.Bind(service, item.Id, propertySet));
     }
     else if (item.GetType() == typeof(Microsoft.Exchange.WebServices.Data.ContactGroup))
     {
         return(ContactGroup.Bind(service, item.Id, propertySet));
     }
     else if (item.GetType() == typeof(Microsoft.Exchange.WebServices.Data.PostItem))
     {
         return(PostItem.Bind(service, item.Id, propertySet));
     }
     else if (item.GetType() == typeof(Microsoft.Exchange.WebServices.Data.MeetingCancellation))
     {
         return(MeetingCancellation.Bind(service, item.Id, propertySet));
     }
     else if (item.GetType() == typeof(Microsoft.Exchange.WebServices.Data.MeetingRequest))
     {
         return(MeetingRequest.Bind(service, item.Id, propertySet));
     }
     else if (item.GetType() == typeof(Microsoft.Exchange.WebServices.Data.MeetingResponse))
     {
         return(MeetingResponse.Bind(service, item.Id, propertySet));
     }
     else if (item.GetType() == typeof(Microsoft.Exchange.WebServices.Data.MeetingMessage))
     {
         return(MeetingMessage.Bind(service, item.Id, propertySet));
     }
     else if (item.GetType() == typeof(Microsoft.Exchange.WebServices.Data.EmailMessage))
     {
         return(EmailMessage.Bind(service, item.Id, propertySet));
     }
     else
     {
         throw new Exception("Unknown Exchange Item type: " + item.GetType().FullName);
     }
 }
 // Token: 0x060007B7 RID: 1975 RVA: 0x00037A84 File Offset: 0x00035C84
 private void HandleResponsesWithSameSequenceNumber(MailboxSession itemStore, MeetingMessage item, VersionedId iid, object[] rowProperties, string sentRepresenting, ref OldMessageDeletion.LatestItemInfo latestInfo, List <VersionedId> itemsToDelete, ref bool hasAttachments, ref bool hasBody)
 {
     if (!this.SentRepresentingMatches(sentRepresenting, rowProperties[5]))
     {
         return;
     }
     if (rowProperties[6] is PropertyError || !(rowProperties[6] is ExDateTime))
     {
         return;
     }
     if (rowProperties[7] is PropertyError || !(rowProperties[7] is bool) || (bool)rowProperties[7])
     {
         return;
     }
     try
     {
         using (MeetingResponse meetingResponse = MeetingResponse.Bind(item.Session, iid))
         {
             if (meetingResponse.Body.Size > 0L)
             {
                 return;
             }
         }
     }
     catch (VirusDetectedException e)
     {
         OldMessageDeletion.Tracer.TraceError <object, VersionedId>((long)this.GetHashCode(), "{0}: A virus was detected in the CalendarItem associated with this message {1}. This message will be skipped.", TraceContext.Get(), iid);
         CalendarAssistantLog.LogEntry(itemStore, e, false, "A virus was detected in the CalendarItem associated with this message {0}. This message will be skipped.", new object[]
         {
             iid
         });
         return;
     }
     catch (VirusMessageDeletedException e2)
     {
         OldMessageDeletion.Tracer.TraceError <object, VersionedId>((long)this.GetHashCode(), "{0}: A virus was detected in the CalendarItem associated with this message and was deleted {1}. This message will be skipped.", TraceContext.Get(), iid);
         CalendarAssistantLog.LogEntry(itemStore, e2, false, "A virus was detected in the CalendarItem associated with this message and was deleted {0}. This message will be skipped.", new object[]
         {
             iid
         });
         return;
     }
     catch (StoragePermanentException ex)
     {
         OldMessageDeletion.Tracer.TraceError <object, StoragePermanentException>((long)this.GetHashCode(), "{0}: Exception caught when opening response and getting the body: {1}", TraceContext.Get(), ex);
         CalendarAssistantLog.LogEntry(itemStore, ex, false, "Exception caught when opening response and getting the body for message id {0}", new object[]
         {
             iid
         });
         return;
     }
     catch (StorageTransientException ex2)
     {
         OldMessageDeletion.Tracer.TraceError <object, StorageTransientException>((long)this.GetHashCode(), "{0}: Exception caught when opening response and getting the body: {1}", TraceContext.Get(), ex2);
         CalendarAssistantLog.LogEntry(itemStore, ex2, false, "Exception caught when opening response and getting the body for message id {0}", new object[]
         {
             iid
         });
         return;
     }
     if (latestInfo.LatestClientSubmitTime < (ExDateTime)rowProperties[6])
     {
         if (!hasAttachments && !hasBody)
         {
             itemsToDelete.Add(latestInfo.LatestItemId);
             latestInfo.LatestItemId           = iid;
             latestInfo.LatestClientSubmitTime = (ExDateTime)rowProperties[6];
             hasAttachments = false;
             hasBody        = false;
             return;
         }
     }
     else
     {
         itemsToDelete.Add(iid);
     }
 }