// Token: 0x06002EC3 RID: 11971 RVA: 0x0010C8E0 File Offset: 0x0010AAE0
		private void ProcessFolderCountAdvisor(OwaFolderCountAdvisor folderCountAdvisor)
		{
			if (folderCountAdvisor == null)
			{
				throw new ArgumentNullException("folderCountAdvisor");
			}
			MailboxSession mailboxSession = null;
			if (folderCountAdvisor.FolderId == null)
			{
				if (!folderCountAdvisor.MailboxOwner.MailboxInfo.IsAggregated)
				{
					mailboxSession = base.UserContext.MailboxSession;
				}
				else
				{
					mailboxSession = base.UserContext.GetArchiveMailboxSession(folderCountAdvisor.MailboxOwner);
				}
			}
			else
			{
				try
				{
					mailboxSession = (folderCountAdvisor.FolderId.GetSession(base.UserContext) as MailboxSession);
				}
				catch (ObjectNotFoundException)
				{
					return;
				}
			}
			if (mailboxSession != null)
			{
				Dictionary<StoreObjectId, ItemCountPair> itemCounts = folderCountAdvisor.GetItemCounts(mailboxSession);
				if (itemCounts == null)
				{
					return;
				}
				IDictionaryEnumerator dictionaryEnumerator = itemCounts.GetEnumerator();
				while (dictionaryEnumerator.MoveNext())
				{
					ItemCountPair countPair = (ItemCountPair)dictionaryEnumerator.Value;
					if (countPair.ItemCount != -1L || countPair.UnreadItemCount != -1L)
					{
						OwaStoreObjectId owaStoreObjectId = OwaStoreObjectId.CreateFromSessionFolderId(base.UserContext, mailboxSession, (StoreObjectId)dictionaryEnumerator.Key);
						this.RenderUpdateCountJavascript(owaStoreObjectId, countPair);
						if (owaStoreObjectId.StoreObjectType == StoreObjectType.Folder)
						{
							StoreObjectId folderId = StoreObjectId.FromProviderSpecificId(owaStoreObjectId.StoreObjectId.ProviderLevelItemId, StoreObjectType.OutlookSearchFolder);
							this.RenderUpdateCountJavascript(OwaStoreObjectId.CreateFromSessionFolderId(base.UserContext, mailboxSession, folderId), countPair);
							StoreObjectId folderId2 = StoreObjectId.FromProviderSpecificId(owaStoreObjectId.StoreObjectId.ProviderLevelItemId, StoreObjectType.SearchFolder);
							this.RenderUpdateCountJavascript(OwaStoreObjectId.CreateFromSessionFolderId(base.UserContext, mailboxSession, folderId2), countPair);
						}
					}
				}
				return;
			}
		}
Exemple #2
0
        protected MessageItem OpenMessage(byte[] messageEntryId)
        {
            if (messageEntryId == null)
            {
                throw new InvalidRuleException(string.Format("Rule {0} is invalid since its message template id is null.", this.rule.Name));
            }
            StoreId itemId = StoreObjectId.FromProviderSpecificId(messageEntryId);

            return(Item.BindAsMessage(this.Context.StoreSession, itemId, StoreObjectSchema.ContentConversionProperties));
        }
Exemple #3
0
        // Token: 0x06000B32 RID: 2866 RVA: 0x00048320 File Offset: 0x00046520
        private static bool IsInboxOrJunkFolder(byte[] entryId, StoreObjectId inboxEntryId, StoreObjectId junkFolderEntryId)
        {
            if (entryId == null)
            {
                return(false);
            }
            StoreObjectId id = StoreObjectId.FromProviderSpecificId(entryId, StoreObjectType.Folder);

            return((inboxEntryId != null && inboxEntryId.Equals(id)) || (junkFolderEntryId != null && junkFolderEntryId.Equals(id)));
        }
 // Token: 0x06000115 RID: 277 RVA: 0x0000710C File Offset: 0x0000530C
 private static void CloneSmsItem(MailboxSession session, MessageItem source, MailboxData mailboxData, Recipient recipient, ConversationIndex conversationIndex)
 {
     using (MessageItem messageItem = MessageItem.CloneMessage(session, StoreObjectId.FromProviderSpecificId(mailboxData.SentItemsFolderId), source))
     {
         RecipientCollection recipients = messageItem.Recipients;
         recipients.Clear();
         recipients.Add(recipient);
         SentItemsProcessor.SaveSmsItem(messageItem, conversationIndex);
     }
 }
Exemple #5
0
 protected StoreObjectId GetFolderId(byte[] entryId)
 {
     if (entryId != null)
     {
         return(StoreObjectId.FromProviderSpecificId(entryId));
     }
     if (!base.IsPublicFolderMailbox)
     {
         return(this.GetMailboxSession().GetDefaultFolderId(DefaultFolderType.Configuration));
     }
     return(this.GetPublicFolderSession().GetPublicFolderRootId());
 }
        // Token: 0x06000278 RID: 632 RVA: 0x0000E2DC File Offset: 0x0000C4DC
        private Item TryOpenItem(MailboxSession mailboxSession, MapiEvent mapiEvent)
        {
            Item item = null;

            if (mapiEvent.ItemEntryId != null && mapiEvent.ItemType == ObjectType.MAPI_MESSAGE && (mapiEvent.EventMask & MapiEventTypeFlags.ObjectDeleted) == (MapiEventTypeFlags)0)
            {
                ExTraceGlobals.EventDispatcherTracer.TraceDebug <EventDispatcherPrivate>((long)this.GetHashCode(), "{0}: Getting itemId...", this);
                StoreObjectId storeObjectId = StoreObjectId.FromProviderSpecificId(mapiEvent.ItemEntryId);
                ExTraceGlobals.EventDispatcherTracer.TraceDebug <EventDispatcherPrivate, StoreObjectId>((long)this.GetHashCode(), "{0}: Binding to item: {1}", this, storeObjectId);
                Exception ex   = null;
                bool      flag = false;
                try
                {
                    item = Item.Bind(mailboxSession, storeObjectId, base.Assistants.PreloadItemProperties);
                    ExTraceGlobals.EventDispatcherTracer.TraceDebug <EventDispatcherPrivate>((long)this.GetHashCode(), "{0}: Bound item. Opening item...", this);
                    item.OpenAsReadWrite();
                    ExTraceGlobals.EventDispatcherTracer.TraceDebug <EventDispatcherPrivate>((long)this.GetHashCode(), "{0}: Opened item.", this);
                    flag = true;
                }
                catch (ObjectNotFoundException ex2)
                {
                    ex = ex2;
                }
                catch (ConversionFailedException ex3)
                {
                    ex = ex3;
                }
                catch (VirusMessageDeletedException ex4)
                {
                    ex = ex4;
                }
                finally
                {
                    if (!flag && item != null)
                    {
                        item.Dispose();
                        item = null;
                    }
                }
                if (ex != null)
                {
                    ExTraceGlobals.EventDispatcherTracer.TraceError((long)this.GetHashCode(), "{0}: failed to open itemId {1} for eventId {2}.  Exception: {3}", new object[]
                    {
                        this,
                        storeObjectId,
                        mapiEvent.EventCounter,
                        ex
                    });
                }
            }
            return(item);
        }
            private bool TryGetDeliveryFolderId(MbxTransportMailItem rmi, MailboxSession mailBoxSession, out StoreId deliveryFolderId)
            {
                deliveryFolderId = null;
                string textHeaderValue = ContentAggregationAgentFactory.ContentAggregationAgent.GetTextHeaderValue(rmi, "X-MS-Exchange-Organization-DeliveryFolder");

                if (string.IsNullOrEmpty(textHeaderValue))
                {
                    ExTraceGlobals.DeliveryAgentTracer.TraceDebug(rmi.RecordId, "Delivery Folder ID property is empty.");
                    return(false);
                }
                byte[] array = null;
                try
                {
                    array = HexConverter.HexStringToByteArray(textHeaderValue);
                }
                catch (FormatException arg)
                {
                    ExTraceGlobals.DeliveryAgentTracer.TraceError <FormatException>(rmi.RecordId, "Could not get Delivery Folder ID due to an invalid Mail Item header - Exception: {0}", arg);
                    return(false);
                }
                if (!IdConverter.IsFolderId(array))
                {
                    ExTraceGlobals.DeliveryAgentTracer.TraceError <string>(rmi.RecordId, "Can't open folder, id {0} is not a valid Exchange folder entry id.", array.ToString());
                    return(false);
                }
                try
                {
                    deliveryFolderId = StoreObjectId.FromProviderSpecificId(array);
                }
                catch (ArgumentException arg2)
                {
                    ExTraceGlobals.DeliveryAgentTracer.TraceError <ArgumentException>(rmi.RecordId, "Could not get Delivery Folder ID. Can't convert header value to StoreObjectId - Exception: {0}", arg2);
                    return(false);
                }
                bool result;

                try
                {
                    using (Folder.Bind(mailBoxSession, deliveryFolderId))
                    {
                        result = true;
                    }
                }
                catch (ObjectNotFoundException arg3)
                {
                    ExTraceGlobals.DeliveryAgentTracer.TraceError <StoreId, ObjectNotFoundException>(rmi.RecordId, "Can't open folder. Folder id {0} does not exist - Exception: {1}", deliveryFolderId, arg3);
                    result = false;
                }
                return(result);
            }
Exemple #8
0
        protected virtual bool TryGetSeriesMasterIdForPrInstance(IDictionary <Microsoft.Exchange.Data.PropertyDefinition, int> propertyIndices, IList values, IStoreSession session, out string seriesMasterId)
        {
            int    index;
            object obj;

            if (propertyIndices.TryGetValue(ItemSchema.Id, out index) && (obj = values[index]) is StoreId)
            {
                StoreObjectId storeObjectId = StoreId.GetStoreObjectId((StoreId)obj);
                StoreObjectId storeId       = StoreObjectId.FromProviderSpecificId(storeObjectId.ProviderLevelItemId, StoreObjectType.CalendarItem);
                seriesMasterId = this.IdConverter.ToStringId(storeId, session);
                return(true);
            }
            seriesMasterId = null;
            return(false);
        }
        // Token: 0x060008C1 RID: 2241 RVA: 0x0003C230 File Offset: 0x0003A430
        private void ProcessObjectMoved(MapiEvent mapiEvent, MailboxSession mailboxSession, StoreObjectId parentId, IList <SynchronizableFolderType> folderTypes)
        {
            if (this.CalendarSyncAssistantHelper.IsDeletedItemsFolder(mailboxSession, parentId))
            {
                SharingFolderAssistant.GeneralTracer.TraceDebug <object, MapiEvent, string>((long)this.GetHashCode(), "{0}: SharingFolderAssistant.ProcessObjectMoved for event {1} deleted a move to deleted items for mailbox {2}.", TraceContext.Get(), mapiEvent, mailboxSession.DisplayName);
                this.CalendarSyncAssistantHelper.DecrementSubscriptionCount(mailboxSession, folderTypes[0]);
                return;
            }
            StoreObjectId parentId2 = StoreObjectId.FromProviderSpecificId(mapiEvent.OldParentEntryId, StoreObjectType.CalendarFolder);

            if (this.CalendarSyncAssistantHelper.IsDeletedItemsFolder(mailboxSession, parentId2))
            {
                SharingFolderAssistant.GeneralTracer.TraceDebug <object, MapiEvent, string>((long)this.GetHashCode(), "{0}: SharingFolderAssistant.ProcessObjectMoved for event {1} detected a move out of deleted items for mailbox {2}.", TraceContext.Get(), mapiEvent, mailboxSession.DisplayName);
                this.CalendarSyncAssistantHelper.IncrementSubscriptionCount(mailboxSession, folderTypes[0]);
            }
        }
Exemple #10
0
        byte[] IMailbox.GetSessionSpecificEntryId(byte[] entryId)
        {
            MrsTracer.Provider.Function("MapiMailbox.GetSessionSpecificEntryId", new object[0]);
            base.CheckDisposed();
            base.VerifyMailboxConnection(VerifyMailboxConnectionFlags.None);
            long folderFid;

            if (entryId.Length == 22)
            {
                folderFid = this.StoreSession.IdConverter.GetIdFromLongTermId(entryId);
            }
            else
            {
                folderFid = this.StoreSession.IdConverter.GetFidFromId(StoreObjectId.FromProviderSpecificId(entryId));
            }
            return(this.StoreSession.IdConverter.CreateFolderId(folderFid).ProviderLevelItemId);
        }
 void IFolder.DeleteMessages(byte[][] entryIds)
 {
     MrsTracer.Provider.Function("StorageFolder.DeleteMessages: {0}", new object[]
     {
         this.DisplayNameForTracing
     });
     MapiUtils.ProcessMapiCallInBatches <byte[]>(entryIds, delegate(byte[][] batch)
     {
         using (this.Mailbox.RHTracker.Start())
         {
             StoreObjectId[] array = new StoreObjectId[batch.Length];
             for (int i = 0; i < batch.Length; i++)
             {
                 array[i] = StoreObjectId.FromProviderSpecificId(batch[i]);
             }
             this.CoreFolder.DeleteItems(DeleteItemFlags.HardDelete, array);
         }
     });
 }
        public override uint LoadFromStore()
        {
            uint result = 0U;

            ExTraceGlobals.FaultInjectionTracer.TraceTest(2615553341U);
            try
            {
                this.OpenStore();
                base.StoreDriverTracer.StoreDriverSubmissionTracer.TracePass(base.StoreDriverTracer.MessageProbeActivityId, 0L, "Bind to message item");
                StoreId    storeId = StoreObjectId.FromProviderSpecificId(this.mapiSubmissionInfo.EntryId);
                ExDateTime dt      = (base.Context == null) ? default(ExDateTime) : ExDateTime.UtcNow;
                try
                {
                    base.Item = StoreProvider.GetMessageItem(base.Session, storeId, StoreObjectSchema.ContentConversionProperties);
                }
                finally
                {
                    if (base.Context != null)
                    {
                        TimeSpan additionalLatency = ExDateTime.UtcNow - dt;
                        base.Context.AddRpcLatency(additionalLatency, "Bind message");
                    }
                }
                if (!base.IsSubmitMessage)
                {
                    base.StoreDriverTracer.StoreDriverSubmissionTracer.TracePass(base.StoreDriverTracer.MessageProbeActivityId, 0L, "Notification recieved for a message that wasn't submitted");
                    base.Dispose();
                    result = 9U;
                }
            }
            catch (ObjectNotFoundException)
            {
                base.StoreDriverTracer.StoreDriverSubmissionTracer.TracePass(base.StoreDriverTracer.MessageProbeActivityId, 0L, "Message was deleted prior to MailSubmitted event processing completed");
                result = 6U;
            }
            catch (VirusMessageDeletedException)
            {
                base.StoreDriverTracer.StoreDriverSubmissionTracer.TracePass(base.StoreDriverTracer.MessageProbeActivityId, 0L, "Item was marked for deletion by a virus scanner.");
                result = 8U;
            }
            return(result);
        }
 void IDestinationFolder.SetReadFlagsOnMessages(SetReadFlags flags, byte[][] entryIds)
 {
     MrsTracer.Provider.Function("StorageDestinationFolder.SetReadFlagsOnMessages: {0}", new object[]
     {
         base.DisplayNameForTracing
     });
     MapiUtils.ProcessMapiCallInBatches <byte[]>(entryIds, delegate(byte[][] batch)
     {
         StoreObjectId[] array = new StoreObjectId[batch.Length];
         for (int i = 0; i < batch.Length; i++)
         {
             array[i] = StoreObjectId.FromProviderSpecificId(batch[i]);
         }
         using (this.Mailbox.RHTracker.Start())
         {
             bool flag;
             this.CoreFolder.SetReadFlags((int)flags, array, out flag);
         }
     });
 }
Exemple #14
0
        private UMMailboxConfiguration GetPresentationObject(UMSubscriber subscriber)
        {
            UMMailboxConfiguration ummailboxConfiguration = new UMMailboxConfiguration(this.DataObject.Identity);

            ummailboxConfiguration.Greeting = subscriber.ConfigFolder.CurrentMailboxGreetingType;
            ummailboxConfiguration.DefaultPlayOnPhoneNumber           = subscriber.ConfigFolder.PlayOnPhoneDialString;
            ummailboxConfiguration.ReadOldestUnreadVoiceMessagesFirst = subscriber.ConfigFolder.ReadUnreadVoicemailInFIFOOrder;
            ummailboxConfiguration.ReceivedVoiceMailPreviewEnabled    = subscriber.ConfigFolder.ReceivedVoiceMailPreviewEnabled;
            ummailboxConfiguration.SentVoiceMailPreviewEnabled        = subscriber.ConfigFolder.SentVoiceMailPreviewEnabled;
            byte[]          entryId       = Convert.FromBase64String(subscriber.ConfigFolder.TelephoneAccessFolderEmail);
            StoreObjectId   storeObjectId = StoreObjectId.FromProviderSpecificId(entryId);
            ADUser          dataObject    = this.DataObject;
            MailboxFolderId identity      = new MailboxFolderId(dataObject.Id, storeObjectId, null);

            using (MailboxFolderDataProvider mailboxFolderDataProvider = new MailboxFolderDataProvider(base.SessionSettings, this.DataObject, "get-ummailboxconfiguration"))
            {
                ummailboxConfiguration.FolderToReadEmailsFrom = (MailboxFolder)mailboxFolderDataProvider.Read <MailboxFolder>(identity);
            }
            return(ummailboxConfiguration);
        }
Exemple #15
0
 public virtual void UpdateDeferredError()
 {
     if (this.daeMessageEntryIds == null || this.daeMessageEntryIds.Count == 0)
     {
         return;
     }
     base.DeliveredMessage.Load(DeferredError.EntryId);
     byte[] deliveredMessageEntryId = base.DeliveredMessage[StoreObjectSchema.EntryId] as byte[];
     if (deliveredMessageEntryId == null)
     {
         base.TraceDebug("Delivered Message EntryId is null");
         return;
     }
     using (List <byte[]> .Enumerator enumerator = this.daeMessageEntryIds.GetEnumerator())
     {
         while (enumerator.MoveNext())
         {
             byte[] daeEntryId = enumerator.Current;
             if (daeEntryId != null)
             {
                 Exception argument;
                 if (!RuleUtil.TryRunStoreCode(delegate
                 {
                     StoreObjectId storeObjectId = StoreObjectId.FromProviderSpecificId(daeEntryId);
                     if (storeObjectId != null)
                     {
                         using (Item item = Microsoft.Exchange.Data.Storage.Item.Bind(this.StoreSession, storeObjectId))
                         {
                             item.OpenAsReadWrite();
                             item[ItemSchema.OriginalMessageEntryId] = deliveredMessageEntryId;
                             item.Save(SaveMode.NoConflictResolution);
                         }
                     }
                 }, out argument))
                 {
                     base.TraceDebug <byte[], Exception>("Can't set pr_dam_original_entryid on DeferredError message id {0}, and the exception is: {1}", daeEntryId, argument);
                 }
             }
         }
     }
 }
Exemple #16
0
        public bool ShouldLogContact(StoreObjectId itemId, CoreItem item)
        {
            string text = (string)item.PropertyBag.TryGetProperty(StoreObjectSchema.ItemClass);

            if (!ObjectClass.IsContact(text))
            {
                if (ObjectClass.IsDistributionList(text))
                {
                    StoreObjectId storeObjectId   = StoreObjectId.FromProviderSpecificId((byte[])item.PropertyBag.TryGetProperty(StoreObjectSchema.ParentEntryId));
                    StoreObjectId defaultFolderId = ((MailboxSession)item.Session).GetDefaultFolderId(DefaultFolderType.ImContactList);
                    if (object.Equals(storeObjectId, defaultFolderId))
                    {
                        return(true);
                    }
                    UcsTracker.Tracer.TraceDebug((long)this.GetHashCode(), "UcsTracker.ShouldLogContact: Skipping PDL with Class - {0}, ParentFolderId - {1}, ImContactListFolderId - {2}, Id - {3}", new object[]
                    {
                        text,
                        storeObjectId,
                        defaultFolderId,
                        itemId
                    });
                }
                return(true);
            }
            StoreObjectId storeObjectId2   = StoreObjectId.FromProviderSpecificId((byte[])item.PropertyBag.TryGetProperty(StoreObjectSchema.ParentEntryId));
            StoreObjectId defaultFolderId2 = ((MailboxSession)item.Session).GetDefaultFolderId(DefaultFolderType.QuickContacts);

            if (object.Equals(storeObjectId2, defaultFolderId2))
            {
                return(true);
            }
            UcsTracker.Tracer.TraceDebug((long)this.GetHashCode(), "UcsTracker.ShouldLogContact: Skipping contact item with Class - {0}, ParentFolderId - {1}, QuickContactsFolderId - {2}, Id - {3}", new object[]
            {
                text,
                storeObjectId2,
                defaultFolderId2,
                itemId
            });
            return(false);
        }
        private static string LoadUserOofSettingsByItemId(MailboxSession itemStore)
        {
            string result = null;

            try
            {
                object obj = itemStore.Mailbox.TryGetProperty(MailboxSchema.UserOofSettingsItemId);
                if (!(obj is PropertyError) && obj != null)
                {
                    StoreObjectId itemId = StoreObjectId.FromProviderSpecificId((byte[])obj, StoreObjectType.Message);
                    result = UserOofSettingsStorage.settingsStorageHandler.GetItemContent(itemStore, itemId);
                }
            }
            catch (ArgumentOutOfRangeException arg)
            {
                UserOofSettingsStorage.Tracer.TraceError <IExchangePrincipal, ArgumentOutOfRangeException>(0L, "Mailbox:{0}: Exception on converting OOF settings item id to StoreObjectId, exception = {1}, loading OOF settings item by folder query.", itemStore.MailboxOwner, arg);
            }
            catch (CorruptDataException arg2)
            {
                UserOofSettingsStorage.Tracer.TraceError <IExchangePrincipal, CorruptDataException>(0L, "Mailbox:{0}: Exception on converting OOF settings item id to StoreObjectId, exception = {1}, loading OOF settings item by folder query.", itemStore.MailboxOwner, arg2);
            }
            return(result);
        }
        // Token: 0x0600077A RID: 1914 RVA: 0x00034F74 File Offset: 0x00033174
        private void HandlePermissionChange(MapiEvent mapiEvent, MailboxSession itemStore, StoreObject item, List <KeyValuePair <string, object> > customDataToLog)
        {
            if (mapiEvent.ItemEntryId == null || itemStore.IsGroupMailbox())
            {
                return;
            }
            StoreObjectId storeObjectId   = StoreObjectId.FromProviderSpecificId(mapiEvent.ItemEntryId, StoreObjectType.Folder);
            StoreObjectId defaultFolderId = itemStore.GetDefaultFolderId(DefaultFolderType.Root);

            if (storeObjectId != null && defaultFolderId != null)
            {
                if (!storeObjectId.Equals(defaultFolderId) && !ObjectClass.IsCalendarFolder(mapiEvent.ObjectClass))
                {
                    return;
                }
                using (Folder folder = Folder.Bind(itemStore, storeObjectId))
                {
                    string text = CalendarLoggingHelper.GetCalendarPermissionsLog(itemStore, folder);
                    if (!string.IsNullOrEmpty(text))
                    {
                        text = string.Format("Client Type: {0} New Permission Table:\n{1}", mapiEvent.ClientType, text);
                    }
                    else
                    {
                        text = string.Format("Client Type: {0} Mailbox session or folder was null", mapiEvent.ClientType);
                    }
                    CalendarPermissionsLog.LogEntry(itemStore, text, new object[0]);
                    return;
                }
            }
            if (storeObjectId == null)
            {
                CalendarAssistant.GeneralTracer.TraceError <object, byte[]>((long)this.GetHashCode(), "{0}: Unable to bind to a calendar folder with FolderId {1}", TraceContext.Get(), mapiEvent.ItemEntryId);
                return;
            }
            CalendarAssistant.GeneralTracer.TraceError <object, Guid>((long)this.GetHashCode(), "{0}: Unable to bind to the root folder for Mailbox {1}", TraceContext.Get(), mapiEvent.MailboxGuid);
        }
Exemple #19
0
        private void WriteReplyAction(byte[] replyTemplateMessageId, Guid replyGuid, bool includeSubject)
        {
            this.writer.WriteAttributeString("ReplyTemplateGuid", replyGuid.ToString());
            Exception exception;

            if (!RuleUtil.TryRunStoreCode(delegate
            {
                try
                {
                    StoreId itemId = StoreObjectId.FromProviderSpecificId(replyTemplateMessageId);
                    using (MessageItem messageItem = Item.BindAsMessage(this.session, itemId, StoreObjectSchema.ContentConversionProperties))
                    {
                        if (includeSubject)
                        {
                            this.writer.WriteAttributeString("ReplySubject", messageItem.Subject);
                        }
                        using (TextReader textReader = messageItem.Body.OpenTextReader(BodyFormat.TextPlain))
                        {
                            string text = textReader.ReadToEnd();
                            this.writer.WriteStartElement("ReplyBody");
                            this.writer.WriteString(Environment.NewLine);
                            this.writer.WriteString(text);
                            this.writer.WriteString(Environment.NewLine);
                            this.writer.WriteEndElement();
                        }
                    }
                }
                catch (ObjectNotFoundException)
                {
                    this.writer.WriteAttributeString("ReplySubject", ServerStrings.RuleWriterObjectNotFound);
                }
            }, out exception))
            {
                this.WriteExceptionElement("Opening reply template message", exception);
            }
            this.WriteBinaryData("ReplyTemplateMessageId", replyTemplateMessageId);
        }
        bool IDestinationFolder.SetSearchCriteria(RestrictionData restriction, byte[][] entryIds, SearchCriteriaFlags flags)
        {
            MrsTracer.Provider.Function("StorageDestinationFolder.SetSearchCriteria: {0}", new object[]
            {
                base.DisplayNameForTracing
            });
            QueryFilter queryFilter = restriction.GetQueryFilter(base.Mailbox.StoreSession);

            StoreId[] array = null;
            if (entryIds != null && entryIds.Length > 0)
            {
                array = new StoreId[entryIds.Length];
                for (int i = 0; i < entryIds.Length; i++)
                {
                    array[i] = StoreObjectId.FromProviderSpecificId(entryIds[i]);
                }
            }
            using (base.Mailbox.RHTracker.Start())
            {
                SearchFolderCriteria searchFolderCriteria = new SearchFolderCriteria(queryFilter, array);
                base.CoreFolder.SetSearchCriteria(searchFolderCriteria, this.ConvertSearchCriteriaFlags(flags));
            }
            return(true);
        }
        private static ReplyTemplate FindByTemplateGuid(MailboxSession session, RuleAction.OOFReply ruleAction)
        {
            MessageItem messageItem = null;

            try
            {
                using (Folder folder = Folder.Bind(session, DefaultFolderType.Inbox))
                {
                    byte[] replyTemplateEntryIdFromTemplateGuid = ReplyTemplate.GetReplyTemplateEntryIdFromTemplateGuid(folder, ruleAction.ReplyTemplateGuid);
                    if (replyTemplateEntryIdFromTemplateGuid != null)
                    {
                        StoreObjectId storeObjectId = StoreObjectId.FromProviderSpecificId(replyTemplateEntryIdFromTemplateGuid);
                        messageItem = MessageItem.Bind(session, storeObjectId, new PropertyDefinition[]
                        {
                            ItemSchema.ReplyTemplateId
                        });
                        messageItem.OpenAsReadWrite();
                        ReplyTemplate.Tracer.TraceDebug <IExchangePrincipal, Guid, byte[]>(0L, "Mailbox:{0}: Found reply template by GUID. GUID={1}, Entry Id={2}", session.MailboxOwner, ruleAction.ReplyTemplateGuid, storeObjectId.GetBytes());
                    }
                    else
                    {
                        ReplyTemplate.Tracer.TraceDebug <IExchangePrincipal, Guid>(0L, "Mailbox:{0}: Found no reply template by GUID. GUID={1}", session.MailboxOwner, ruleAction.ReplyTemplateGuid);
                        messageItem = null;
                    }
                }
            }
            catch (ObjectNotFoundException)
            {
                return(null);
            }
            if (messageItem != null)
            {
                return(new ReplyTemplate(messageItem));
            }
            return(null);
        }
Exemple #22
0
        public static FolderRec Create(StoreSession storageSession, NativeStorePropertyDefinition[] definitions, object[] values)
        {
            PropValue[]        array      = new PropValue[definitions.Length];
            ICollection <uint> collection = PropertyTagCache.Cache.PropertyTagsFromPropertyDefinitions(storageSession, definitions);

            byte[] array2 = null;
            int    num    = 0;

            foreach (uint num2 in collection)
            {
                if (num2 == 268370178U)
                {
                    array2 = storageSession.IdConverter.GetLongTermIdFromId(storageSession.IdConverter.GetFidFromId(StoreObjectId.FromProviderSpecificId((byte[])values[num])));
                }
                num++;
            }
            num = 0;
            foreach (uint num3 in collection)
            {
                object  obj     = values[num];
                PropTag propTag = (PropTag)num3;
                if (propTag == PropTag.LTID)
                {
                    obj = array2;
                }
                if (obj == null)
                {
                    propTag = propTag.ChangePropType(PropType.Null);
                }
                else if (obj is PropertyError)
                {
                    propTag = propTag.ChangePropType(PropType.Error);
                    obj     = (int)((PropertyError)obj).PropertyErrorCode;
                }
                else if (obj is ExDateTime)
                {
                    obj = (DateTime)((ExDateTime)obj);
                }
                array[num] = new PropValue(propTag, obj);
                num++;
            }
            return(FolderRec.Create(storageSession, array));
        }
        // Token: 0x060004A3 RID: 1187 RVA: 0x00022124 File Offset: 0x00020324
        protected override void HandleEventInternal(MapiEvent mapiEvent, MailboxSession itemStore, StoreObject item, List <KeyValuePair <string, object> > customDataToLog)
        {
            ElcEventBasedAssistant.Tracer.TraceDebug <MapiEvent>((long)this.GetHashCode(), "MapiEvent is handled: {0}", mapiEvent);
            this.ManageCache(mapiEvent.MailboxGuid);
            if (this.IsIgnorableDraft(mapiEvent, item))
            {
                return;
            }
            CachedState cachedState = AssistantsService.CachedObjectsList.GetCachedState(mapiEvent.MailboxGuid);

            cachedState.LockForRead();
            UserRetentionPolicyCache userRetentionPolicyCache = null;

            try
            {
                userRetentionPolicyCache = RetentionPolicyCheck.DetailedCheckForRetentionPolicy(mapiEvent, itemStore, item, cachedState);
            }
            finally
            {
                cachedState.ReleaseReaderLock();
            }
            if (RetentionPolicyCheck.IsEventConfigChange(mapiEvent))
            {
                ElcEventBasedAssistant.Tracer.TraceDebug <object, MapiEvent>((long)this.GetHashCode(), "{0}: updated configuration {1}", TraceContext.Get(), mapiEvent);
                return;
            }
            if (userRetentionPolicyCache != null && userRetentionPolicyCache.UnderRetentionPolicy)
            {
                bool flag = false;
                if (!this.IsEventOnRelevantFolder(userRetentionPolicyCache, mapiEvent))
                {
                    return;
                }
                if (mapiEvent.ClientType == MapiEventClientTypes.Transport && !this.InSentItems(userRetentionPolicyCache, mapiEvent))
                {
                    ElcEventBasedAssistant.Tracer.TraceDebug <ElcEventBasedAssistant, MapiEvent>((long)this.GetHashCode(), "{0} Event is from transport and item not in SentItems. Ignoring from HandleEvent. Mapievent: {1}", this, mapiEvent);
                    return;
                }
                if (TagAssistantHelper.IsConflictableItem(mapiEvent.ObjectClass, mapiEvent.ParentEntryId, userRetentionPolicyCache.DeletedItemsId))
                {
                    return;
                }
                if ((mapiEvent.EventMask & MapiEventTypeFlags.ObjectMoved) != (MapiEventTypeFlags)0 && mapiEvent.ItemType == ObjectType.MAPI_FOLDER)
                {
                    userRetentionPolicyCache.ResetFolderCaches();
                }
                StoreObjectId storeObjectId = StoreObjectId.FromProviderSpecificId(mapiEvent.ItemEntryId);
                if (mapiEvent.ItemType == ObjectType.MAPI_FOLDER && item == null && mapiEvent.ItemEntryId != null && (mapiEvent.EventMask & MapiEventTypeFlags.ObjectDeleted) == (MapiEventTypeFlags)0)
                {
                    Exception ex = null;
                    try
                    {
                        ElcEventBasedAssistant.Tracer.TraceDebug <object, MapiEvent>((long)this.GetHashCode(), "{0}: A folder was changed and needs to be manually loaded {1}", TraceContext.Get(), mapiEvent);
                        item = Folder.Bind(itemStore, storeObjectId, ElcEventBasedAssistantType.InternalPreloadItemProperties);
                        flag = true;
                    }
                    catch (ObjectNotFoundException ex2)
                    {
                        ex = ex2;
                    }
                    catch (ConversionFailedException ex3)
                    {
                        ex = ex3;
                    }
                    catch (VirusMessageDeletedException ex4)
                    {
                        ex = ex4;
                    }
                    if (ex != null)
                    {
                        ElcEventBasedAssistant.Tracer.TraceDebug <ElcEventBasedAssistant, Exception>((long)this.GetHashCode(), "{0}: Problems loading a folder. It will not be processed. Exception: {1}", this, ex);
                        return;
                    }
                }
                try
                {
                    StoreObjectId     parentId          = StoreObjectId.FromProviderSpecificId(mapiEvent.ParentEntryId);
                    ElcEventProcessor elcEventProcessor = ElcEventProcessor.GetElcEventProcessor();
                    elcEventProcessor.ValidateStoreObject(userRetentionPolicyCache, itemStore, parentId, storeObjectId, item, mapiEvent);
                }
                finally
                {
                    if (flag)
                    {
                        item.Dispose();
                    }
                }
            }
        }
Exemple #24
0
        private void RenderAppointmentData(CalendarViewBase view, int i, ExDateTime itemStart, ExDateTime itemEnd)
        {
            ICalendarDataSource     dataSource      = view.DataSource;
            CalendarItemTypeWrapper wrappedItemType = dataSource.GetWrappedItemType(i);

            this.output.Write("new Item(\"");
            OwaStoreObjectId            itemId    = dataSource.GetItemId(i);
            string                      changeKey = dataSource.GetChangeKey(i);
            PublishedCalendarDataSource publishedCalendarDataSource = dataSource as PublishedCalendarDataSource;

            if (publishedCalendarDataSource != null && publishedCalendarDataSource.DetailLevel != DetailLevelEnumType.AvailabilityOnly)
            {
                StoreObjectId itemStoreObjectId = publishedCalendarDataSource.GetItemStoreObjectId(i);
                Utilities.JavascriptEncode(itemStoreObjectId.ToString(), this.output);
                this.output.Write("\",\"");
                if (this.IsOneOfRecurrence(wrappedItemType))
                {
                    StoreObjectId storeObjectId = StoreObjectId.FromProviderSpecificId(itemStoreObjectId.ProviderLevelItemId);
                    Utilities.JavascriptEncode(storeObjectId.ToString(), this.output);
                }
                else
                {
                    this.output.Write("0");
                }
            }
            else
            {
                if (itemId != null)
                {
                    Utilities.JavascriptEncode(itemId.ToString(), this.output);
                }
                this.output.Write("\",\"");
                if (itemId != null && this.IsOneOfRecurrence(wrappedItemType))
                {
                    OwaStoreObjectId providerLevelItemId = itemId.ProviderLevelItemId;
                    Utilities.JavascriptEncode(providerLevelItemId.ToString(), this.output);
                }
                else
                {
                    this.output.Write("0");
                }
            }
            this.output.Write("\",\"");
            if (changeKey != null)
            {
                Utilities.JavascriptEncode(changeKey, this.output);
            }
            this.output.Write("\",\"");
            this.output.Write(DateTimeUtilities.GetJavascriptDate(itemStart));
            this.output.Write("\",\"");
            this.output.Write(DateTimeUtilities.GetJavascriptDate(itemEnd));
            this.output.Write("\",\"");
            Utilities.JavascriptEncode(dataSource.GetSubject(i), this.output);
            this.output.Write("\",\"");
            Utilities.JavascriptEncode(dataSource.GetLocation(i), this.output);
            BusyTypeWrapper wrappedBusyType = dataSource.GetWrappedBusyType(i);

            this.output.Write("\",");
            this.output.Write((int)wrappedBusyType);
            this.output.Write(",\"");
            if (itemId != null)
            {
                Utilities.JavascriptEncode(ObjectClass.GetContainerMessageClass(itemId.StoreObjectType), this.output);
            }
            this.output.Write("\"");
            bool flag = dataSource.IsMeeting(i);

            this.output.Write(flag ? ",1" : ",0");
            this.output.Write(dataSource.IsCancelled(i) ? ",1" : ",0");
            bool flag2 = dataSource.IsOrganizer(i);

            this.output.Write(flag2 ? ",1" : ",0");
            this.output.Write(",\"");
            if (flag)
            {
                Utilities.JavascriptEncode(dataSource.GetOrganizerDisplayName(i), this.output);
            }
            this.output.Write("\"");
            bool flag3 = dataSource.IsPrivate(i);

            this.output.Write(flag3 ? ",1," : ",0,");
            this.output.Write((int)wrappedItemType);
            this.output.Write(dataSource.HasAttachment(i) ? ",1" : ",0");
            this.output.Write(",\"");
            this.output.Write(dataSource.GetCssClassName(i));
            this.output.Write("\"");
            this.output.Write(")");
        }
        // Token: 0x06000A39 RID: 2617 RVA: 0x00043718 File Offset: 0x00041918
        public bool IsEventInteresting(MapiEvent mapiEvent)
        {
            if (ObjectType.MAPI_MESSAGE != mapiEvent.ItemType)
            {
                return(false);
            }
            if (((MapiEventTypeFlags.ObjectCreated | MapiEventTypeFlags.ObjectModified | MapiEventTypeFlags.ObjectMoved | MapiEventTypeFlags.ObjectCopied) & mapiEvent.EventMask) == (MapiEventTypeFlags)0)
            {
                return(false);
            }
            if (!ObjectClass.IsSmsMessage(mapiEvent.ObjectClass))
            {
                return(false);
            }
            MailboxData fromCache = MailboxData.GetFromCache(mapiEvent.MailboxGuid);

            if (fromCache == null)
            {
                return(true);
            }
            StoreObjectId storeObjectId = null;

            using (fromCache.CreateReadLock())
            {
                storeObjectId = fromCache.DefaultOutboxFolderId;
            }
            if (storeObjectId == null)
            {
                return(false);
            }
            StoreObjectId objB  = (mapiEvent.ParentEntryId == null || mapiEvent.ParentEntryId.Length == 0) ? null : StoreObjectId.FromProviderSpecificId(mapiEvent.ParentEntryId);
            StoreObjectId objB2 = (mapiEvent.OldParentEntryId == null || mapiEvent.OldParentEntryId.Length == 0) ? null : StoreObjectId.FromProviderSpecificId(mapiEvent.OldParentEntryId);

            return((((MapiEventTypeFlags.ObjectCreated | MapiEventTypeFlags.ObjectModified | MapiEventTypeFlags.ObjectCopied) & mapiEvent.EventMask) == (MapiEventTypeFlags)0 || object.Equals(storeObjectId, objB)) && ((MapiEventTypeFlags.ObjectMoved & mapiEvent.EventMask) == (MapiEventTypeFlags)0 || object.Equals(storeObjectId, objB2) || object.Equals(storeObjectId, objB)));
        }
        // Token: 0x060008BE RID: 2238 RVA: 0x0003BF70 File Offset: 0x0003A170
        private IList <SynchronizableFolderType> GetFolderTypesToProcess(MapiEvent mapiEvent, MailboxSession mailboxSession, StoreObject item)
        {
            if (mapiEvent.EventMask.Contains(MapiEventTypeFlags.ObjectDeleted))
            {
                return(SynchronizableFolderType.All);
            }
            if (mapiEvent.EventMask.Contains(MapiEventTypeFlags.ObjectCreated))
            {
                if (item != null)
                {
                    SynchronizableFolderType synchronizableFolderType = SynchronizableFolderType.FromBinding(item);
                    if (synchronizableFolderType != null)
                    {
                        return(synchronizableFolderType.ToList());
                    }
                }
                return(new List <SynchronizableFolderType>(0));
            }
            StoreObjectId storeObjectId = StoreObjectId.FromProviderSpecificId(mapiEvent.ItemEntryId, StoreObjectType.Folder);

            try
            {
                using (Folder folder = Folder.Bind(mailboxSession, storeObjectId))
                {
                    SynchronizableFolderType         synchronizableFolderType2 = SynchronizableFolderType.FromFolder(folder);
                    IList <SynchronizableFolderType> list = (synchronizableFolderType2 != null) ? synchronizableFolderType2.ToList() : null;
                    if (list != null)
                    {
                        if (list.Count == 1)
                        {
                            StoreObjectId folderId = StoreObjectId.FromProviderSpecificId(mapiEvent.ItemEntryId, list[0].StoreObjectType);
                            if (list[0].HasSubscription(mailboxSession, folderId))
                            {
                                return(list);
                            }
                            SharingFolderAssistant.GeneralTracer.TraceDebug((long)this.GetHashCode(), "{0}: SharingFolderAssistant.GetFolderTypesToProcess: folder {1}, folder type {2}, from user {3} doesn't have a subscription.", new object[]
                            {
                                TraceContext.Get(),
                                folder.DisplayName,
                                list[0],
                                mailboxSession.DisplayName
                            });
                        }
                        else
                        {
                            SharingFolderAssistant.GeneralTracer.TraceDebug((long)this.GetHashCode(), "{0}: SharingFolderAssistant.GetFolderTypesToProcess: folder {1}, from user {2} has {3} folder types.", new object[]
                            {
                                TraceContext.Get(),
                                folder.DisplayName,
                                mailboxSession.DisplayName,
                                list.Count
                            });
                        }
                    }
                    else
                    {
                        SharingFolderAssistant.GeneralTracer.TraceDebug <object, string, string>((long)this.GetHashCode(), "{0}: SharingFolderAssistant.GetFolderTypesToProcess: folder {1} from user {2} is not a shared folder.", TraceContext.Get(), folder.DisplayName, mailboxSession.DisplayName);
                    }
                }
            }
            catch (ObjectNotFoundException)
            {
                SharingFolderAssistant.GeneralTracer.TraceDebug <object, StoreObjectId, string>((long)this.GetHashCode(), "{0}: SharingFolderAssistant.GetFolderTypesToProcess: folder {1} from user {2} couldn't be found. Skipping.", TraceContext.Get(), storeObjectId, mailboxSession.DisplayName);
            }
            return(new List <SynchronizableFolderType>(0));
        }
        // Token: 0x060008BD RID: 2237 RVA: 0x0003BF10 File Offset: 0x0003A110
        protected override void HandleEventInternal(MapiEvent mapiEvent, MailboxSession mailboxSession, StoreObject item, List <KeyValuePair <string, object> > customDataToLog)
        {
            SharingFolderAssistant.GeneralTracer.TraceDebug <object, MapiEvent>((long)this.GetHashCode(), "{0}: SharingFolderAssistant.HandleEventInternal called for event {1}.", TraceContext.Get(), mapiEvent);
            IList <SynchronizableFolderType> folderTypesToProcess = this.GetFolderTypesToProcess(mapiEvent, mailboxSession, item);

            if (folderTypesToProcess.Count > 0)
            {
                this.ProcessEventMethods[mapiEvent.EventMask](mapiEvent, mailboxSession, StoreObjectId.FromProviderSpecificId(mapiEvent.ParentEntryId), folderTypesToProcess);
            }
        }
 protected override void OnLoad(EventArgs e)
 {
     base.OnLoad(e);
     this.infobar = new Infobar();
     using (UMClientCommon umclientCommon = new UMClientCommon(base.UserContext.ExchangePrincipal))
     {
         if (!umclientCommon.IsUMEnabled())
         {
             throw new OwaInvalidRequestException("User is not UM enabled");
         }
         this.isPlayOnPhoneEnabled             = umclientCommon.IsPlayOnPhoneEnabled();
         this.enabledForPinlessVoicemail       = umclientCommon.UMPolicy.AllowPinlessVoiceMailAccess;
         this.enabledForSMSNotification        = umclientCommon.IsSmsNotificationsEnabled();
         this.enabledForVoicemailPreview       = umclientCommon.UMPolicy.AllowVoiceMailPreview;
         this.enabledForMissedCallNotification = umclientCommon.UMPolicy.AllowMissedCallNotifications;
         this.isDialPlanEnterprise             = (umclientCommon.DialPlan.SubscriberType == UMSubscriberType.Enterprise);
         UMPropertiesEx umproperties = umclientCommon.GetUMProperties();
         this.isOutOfOffice             = umproperties.OofStatus;
         this.isFIFOOrder               = umproperties.ReadUnreadVoicemailInFIFOOrder;
         this.isMissedCallNotification  = umproperties.MissedCallNotificationEnabled;
         this.dialOnPhoneNumber         = umproperties.PlayOnPhoneDialString;
         this.telephoneAccessNumbers    = umproperties.TelephoneAccessNumbers;
         this.isPinlessVoicemail        = umproperties.PinlessAccessToVoicemail;
         this.smsNotificationValue      = umproperties.SMSNotificationOption;
         this.isVoicemailPreviewReceive = umproperties.ReceivedVoiceMailPreviewEnabled;
         this.isVoicemailPreviewSend    = umproperties.SentVoiceMailPreviewEnabled;
         try
         {
             this.telephoneFolderId = StoreObjectId.FromProviderSpecificId(Convert.FromBase64String(umproperties.TelephoneAccessFolderEmail));
         }
         catch (CorruptDataException arg)
         {
             ExTraceGlobals.CoreCallTracer.TraceDebug <string, CorruptDataException>(0L, "Invalid format for Folder ID string: {0}. Exception: {1}", umproperties.TelephoneAccessFolderEmail, arg);
         }
         catch (FormatException arg2)
         {
             ExTraceGlobals.CoreCallTracer.TraceDebug <string, FormatException>(0L, "Invalid format for Folder ID string: {0}. Exception: {1}", umproperties.TelephoneAccessFolderEmail, arg2);
         }
     }
     if (this.telephoneFolderId == null)
     {
         this.telephoneFolderId = base.UserContext.InboxFolderId;
     }
     try
     {
         using (Folder folder = Folder.Bind(base.UserContext.MailboxSession, this.telephoneFolderId, new PropertyDefinition[]
         {
             FolderSchema.DisplayName
         }))
         {
             this.TelephoneFolderName = folder.DisplayName;
         }
     }
     catch (ObjectNotFoundException)
     {
         ExTraceGlobals.CoreCallTracer.TraceDebug <StoreObjectId>(0L, "The folder doesn't exist. Folder Id: {0}", this.telephoneFolderId);
         this.telephoneFolderId = base.UserContext.InboxFolderId;
         using (Folder folder2 = Folder.Bind(base.UserContext.MailboxSession, this.telephoneFolderId, new PropertyDefinition[]
         {
             FolderSchema.DisplayName
         }))
         {
             this.TelephoneFolderName = folder2.DisplayName;
         }
     }
     using (IPAAStore ipaastore = PAAStore.Create(base.UserContext.ExchangePrincipal))
     {
         ipaastore.GetUserPermissions(out this.enabledForPersonalAutoAttendant, out this.enabledForOutdialing);
         if (this.enabledForPersonalAutoAttendant)
         {
             this.personalAutoAttendantToolbar = new PersonalAutoAttendantListToolbar();
         }
     }
 }
Exemple #29
0
 public virtual void SetFrom(CalendarItemBase calendarItemBase)
 {
     if (this.attachmentIds == null)
     {
         this.attachmentIds = new List <AttachmentId>();
     }
     else
     {
         this.attachmentIds.Clear();
     }
     if (this.attendees == null)
     {
         this.attendees = new List <AttendeeData>();
     }
     else
     {
         this.attendees.Clear();
     }
     if (calendarItemBase.AttachmentCollection != null)
     {
         foreach (AttachmentHandle handle in calendarItemBase.AttachmentCollection)
         {
             using (Attachment attachment = calendarItemBase.AttachmentCollection.Open(handle))
             {
                 if (attachment.Id == null)
                 {
                     throw new ArgumentNullException("attachment.Id");
                 }
                 this.attachmentIds.Add(attachment.Id);
             }
         }
     }
     if (calendarItemBase.Body != null)
     {
         this.bodyText   = ItemUtility.GetItemBody(calendarItemBase, BodyFormat.TextPlain);
         this.bodyFormat = BodyFormat.TextPlain;
     }
     this.calendarItemType = calendarItemBase.CalendarItemType;
     this.endTime          = calendarItemBase.EndTime;
     this.freeBusyStatus   = calendarItemBase.FreeBusyStatus;
     try
     {
         if (calendarItemBase.ParentId != null)
         {
             this.folderId = StoreObjectId.Deserialize(calendarItemBase.ParentId.GetBytes());
         }
         else
         {
             this.folderId = null;
         }
         if (calendarItemBase.Id != null && calendarItemBase.Id.ObjectId != null)
         {
             this.id = StoreObjectId.Deserialize(calendarItemBase.Id.ObjectId.GetBytes());
         }
         else
         {
             this.id = null;
         }
     }
     catch (ArgumentException)
     {
         throw new OwaInvalidRequestException("Invalid store object id");
     }
     catch (FormatException)
     {
         throw new OwaInvalidRequestException("Invalid store object id");
     }
     if (calendarItemBase.Id != null)
     {
         this.changeKey = calendarItemBase.Id.ChangeKeyAsBase64String();
     }
     else
     {
         this.changeKey = null;
     }
     this.importance            = calendarItemBase.Importance;
     this.isAllDayEvent         = calendarItemBase.IsAllDayEvent;
     this.isMeeting             = calendarItemBase.IsMeeting;
     this.isOrganizer           = calendarItemBase.IsOrganizer();
     this.isResponseRequested   = CalendarItemBaseData.GetIsResponseRequested(calendarItemBase);
     this.location              = calendarItemBase.Location;
     this.meetingRequestWasSent = calendarItemBase.MeetingRequestWasSent;
     this.organizer             = AttendeeData.CloneParticipant(calendarItemBase.Organizer);
     if (calendarItemBase.ParentId != null)
     {
         this.parentId = StoreObjectId.FromProviderSpecificId(calendarItemBase.ParentId.ProviderLevelItemId);
     }
     if (calendarItemBase.AttendeeCollection != null)
     {
         foreach (Attendee attendee in calendarItemBase.AttendeeCollection)
         {
             this.attendees.Add(new AttendeeData(attendee));
         }
     }
     this.sensitivity = calendarItemBase.Sensitivity;
     this.startTime   = calendarItemBase.StartTime;
     this.subject     = calendarItemBase.Subject;
 }
Exemple #30
0
 internal MdbCompositeItemIdentity(Guid mdbGuid, MapiEvent mapiEvent)
 {
     Util.ThrowOnNullArgument(mapiEvent, "mapiEvent");
     this.Initialize(mdbGuid, mapiEvent.MailboxGuid, mapiEvent.MailboxNumber, StoreObjectId.FromProviderSpecificId(mapiEvent.ItemEntryId, ObjectClass.GetObjectType(mapiEvent.ObjectClass)), mapiEvent.DocumentId);
 }