public void ShouldRetrieveCurrentFeedBasedOnStoreId() { IStoreId id = new StoreId<string>("current.atom"); IStore store = new FileStore(FileSystemConfiguration); IRepresentation representation = store.GetCurrentFeed(id); Output output = Output.For(representation); Assert.AreEqual("http://restbucks.com/product-catalog/notifications/recent", GetSelfLinkValue(output.EntityBody)); }
public void ShouldExhibitValueTypeEquality() { StoreId<string> storeId1 = new StoreId<string>("A"); StoreId<string> storeId2 = new StoreId<string>("A"); StoreId<string> storeId3 = new StoreId<string>("B"); Assert.True(storeId1.Equals(storeId2)); Assert.False(storeId1.Equals(storeId3)); Assert.True(storeId1.Equals(storeId1)); Assert.False(storeId1.Equals(new object())); Assert.False(storeId1.Equals(null)); Assert.True(storeId1.GetHashCode().Equals(storeId2.GetHashCode())); Assert.False(storeId1.GetHashCode().Equals(storeId3.GetHashCode())); Assert.True(storeId1.GetHashCode().Equals(storeId1.GetHashCode())); Assert.False(storeId1.GetHashCode().Equals(new object().GetHashCode())); }
private SortedResultPage ConvertToPreviewItems(SearchPreviewItem[] ewsPreviewItems) { if (ewsPreviewItems == null) { return(new SortedResultPage(new PreviewItem[0], base.PagingInfo)); } List <PreviewItem> list = new List <PreviewItem>(ewsPreviewItems.Length); foreach (SearchPreviewItem searchPreviewItem in ewsPreviewItems) { try { MailboxId mailboxId; VersionedId value = WebServiceMailboxSearchGroup.EwsIdToVersionedId(searchPreviewItem.Id.UniqueId, searchPreviewItem.Id.ChangeKey, out mailboxId); MailboxInfo mailboxInfo = this.FindMailboxInfoByAnyIdentifier(searchPreviewItem, searchPreviewItem.Mailbox.MailboxId, mailboxId.MailboxGuid, null); if (mailboxInfo == null) { throw new WebServiceProxyInvalidResponseException(Strings.InvalidUnknownMailboxInPreviewResult(this.Uri.AbsoluteUri, searchPreviewItem.Mailbox.MailboxId, mailboxId.MailboxGuid)); } Dictionary <PropertyDefinition, object> dictionary = new Dictionary <PropertyDefinition, object>(); dictionary.Add(ItemSchema.Id, value); dictionary.Add(StoreObjectSchema.ParentItemId, StoreId.EwsIdToStoreObjectId(searchPreviewItem.ParentId.UniqueId)); dictionary.Add(StoreObjectSchema.ItemClass, searchPreviewItem.ItemClass); dictionary.Add(MessageItemSchema.SenderDisplayName, searchPreviewItem.Sender); dictionary.Add(ItemSchema.DisplayTo, this.GetSemicolonSeparated(searchPreviewItem.ToRecipients)); dictionary.Add(ItemSchema.DisplayCc, this.GetSemicolonSeparated(searchPreviewItem.CcRecipients)); dictionary.Add(ItemSchema.DisplayBcc, this.GetSemicolonSeparated(searchPreviewItem.BccRecipients)); dictionary.Add(StoreObjectSchema.CreationTime, WebServiceMailboxSearchGroup.CreateExDateTime(base.PagingInfo.TimeZone, searchPreviewItem.CreatedTime, this)); dictionary.Add(ItemSchema.ReceivedTime, WebServiceMailboxSearchGroup.CreateExDateTime(base.PagingInfo.TimeZone, searchPreviewItem.ReceivedTime, this)); dictionary.Add(ItemSchema.SentTime, WebServiceMailboxSearchGroup.CreateExDateTime(base.PagingInfo.TimeZone, searchPreviewItem.SentTime, this)); dictionary.Add(ItemSchema.Subject, searchPreviewItem.Subject); dictionary.Add(ItemSchema.Size, (int)searchPreviewItem.Size); dictionary.Add(ItemSchema.Importance, searchPreviewItem.Importance.ToString()); dictionary.Add(MessageItemSchema.IsRead, searchPreviewItem.Read); dictionary.Add(ItemSchema.HasAttachment, searchPreviewItem.HasAttachment); if (searchPreviewItem.OwaLink == null) { Factory.Current.GeneralTracer.TraceError <Guid, string, string>((long)this.GetHashCode(), "Correlation Id:{0}. Null OWA URI in item with Id {1} in mailbox {2}", base.ExecutingUser.QueryCorrelationId, searchPreviewItem.Id.UniqueId, searchPreviewItem.Mailbox.PrimarySmtpAddress); throw new WebServiceProxyInvalidResponseException(Strings.InvalidOwaUrlInPreviewResult(string.Format("EDiscoveryError:E002::Mailbox:{0}::Item:{1}::", searchPreviewItem.Mailbox.PrimarySmtpAddress, searchPreviewItem.Subject), this.Uri.AbsoluteUri)); } PreviewItem item = new PreviewItem(dictionary, mailboxInfo.MailboxGuid.Equals(Guid.Empty) ? Guid.Parse(mailboxId.MailboxGuid) : mailboxInfo.MailboxGuid, new Uri(searchPreviewItem.OwaLink), this.GetReferenceItem(searchPreviewItem.SortValue), this.GetUniqueItemHash(searchPreviewItem.UniqueHash)) { MailboxInfo = mailboxInfo }; list.Add(item); } catch (InvalidIdMalformedException ex) { Factory.Current.GeneralTracer.TraceError((long)this.GetHashCode(), "Correlation Id:{0}. Error processing item with Id {1} in mailbox {2}: {3}", new object[] { base.ExecutingUser.QueryCorrelationId, searchPreviewItem.Id.UniqueId, searchPreviewItem.Mailbox.PrimarySmtpAddress, ex.ToString() }); throw new WebServiceProxyInvalidResponseException(Strings.InvalidIdInPreviewResult(this.Uri.AbsoluteUri), ex); } catch (UriFormatException ex2) { Factory.Current.GeneralTracer.TraceError((long)this.GetHashCode(), "Correlation Id:{0}. Invalid OWA URI in item with Id {1} in mailbox {2}: {3}", new object[] { base.ExecutingUser.QueryCorrelationId, searchPreviewItem.Id.UniqueId, searchPreviewItem.Mailbox.PrimarySmtpAddress, ex2.ToString() }); throw new WebServiceProxyInvalidResponseException(Strings.InvalidOwaUrlInPreviewResult(string.Format("EDiscoveryError:E002::Mailbox:{0}::Item:{1}::", searchPreviewItem.Mailbox.PrimarySmtpAddress, searchPreviewItem.Subject), this.Uri.AbsoluteUri), ex2); } } return(new SortedResultPage(list.ToArray(), base.PagingInfo)); }
public EventAttachmentDataProvider(EventReference scope, StoreId parentItemId) : base(scope, parentItemId) { }
public virtual TStoreObject BindToWrite(StoreId id, string changeKey) { return(this.Bind(id)); }
internal abstract void RemoveBuddy(IMailboxSession mailboxsession, InstantMessageBuddy buddy, StoreId contactId);
protected override Item Bind(MailboxSession mailboxSession, StoreId storeId) { return(Contact.Bind(mailboxSession, storeId, new PropertyDefinition[0])); }
public CreateResendDraft(CallContext callContext, string ndrMessageId, string draftsFolderId) : base(callContext) { this.ndrMessageId = StoreId.EwsIdToStoreObjectId(ndrMessageId); this.draftFolderId = StoreId.EwsIdToFolderStoreObjectId(draftsFolderId); }
private ItemType GetMessageItemFromNotification(QueryNotification notification) { ExTraceGlobals.NotificationsCallTracer.TraceDebug <string>((long)this.GetHashCode(), "[MessageItemRowNotificationHandler.GetMessageItemFromNotification] Start. SubscriptionId: {0}", base.SubscriptionId); ItemType itemType; if (notification.EventType == QueryNotificationType.RowDeleted) { itemType = new MessageType { InstanceKey = notification.Index }; } else { StoreId itemProperty = RowNotificationHandler.GetItemProperty <StoreId>(notification, Array.IndexOf <PropertyDefinition>(this.subscriptionProperties, ItemSchema.Id)); StoreObjectId storeObjectId = StoreId.GetStoreObjectId(itemProperty); itemType = ItemType.CreateFromStoreObjectType(storeObjectId.ObjectType); itemType.InstanceKey = notification.Index; itemType.ItemId = this.StoreIdToEwsItemId(itemProperty); itemType.ParentFolderId = new FolderId(base.GetEwsId(RowNotificationHandler.GetItemProperty <StoreId>(notification, Array.IndexOf <PropertyDefinition>(this.subscriptionProperties, StoreObjectSchema.ParentItemId))), null); itemType.ConversationId = new ItemId(IdConverter.ConversationIdToEwsId(base.MailboxGuid, RowNotificationHandler.GetItemProperty <ConversationId>(notification, Array.IndexOf <PropertyDefinition>(this.subscriptionProperties, ItemSchema.ConversationId))), null); itemType.Subject = RowNotificationHandler.GetItemProperty <string>(notification, Array.IndexOf <PropertyDefinition>(this.subscriptionProperties, ItemSchema.Subject)); itemType.ImportanceString = RowNotificationHandler.GetItemProperty <Importance>(notification, Array.IndexOf <PropertyDefinition>(this.subscriptionProperties, ItemSchema.Importance), Importance.Normal).ToString(); itemType.SensitivityString = RowNotificationHandler.GetItemProperty <Sensitivity>(notification, Array.IndexOf <PropertyDefinition>(this.subscriptionProperties, ItemSchema.Sensitivity), Sensitivity.Normal).ToString(); if (RowNotificationHandler.IsPropertyDefined(notification, Array.IndexOf <PropertyDefinition>(this.subscriptionProperties, ItemSchema.ReceivedTime))) { itemType.DateTimeReceived = base.GetDateTimeProperty(notification, Array.IndexOf <PropertyDefinition>(this.subscriptionProperties, ItemSchema.ReceivedTime)); } itemType.HasAttachments = new bool?(RowNotificationHandler.GetItemProperty <bool>(notification, Array.IndexOf <PropertyDefinition>(this.subscriptionProperties, ItemSchema.HasAttachment))); itemType.IsDraft = new bool?(RowNotificationHandler.GetItemProperty <bool>(notification, Array.IndexOf <PropertyDefinition>(this.subscriptionProperties, MessageItemSchema.IsDraft))); itemType.ItemClass = RowNotificationHandler.GetItemProperty <string>(notification, Array.IndexOf <PropertyDefinition>(this.subscriptionProperties, StoreObjectSchema.ItemClass)); MessageType messageType = itemType as MessageType; if (messageType != null) { if (RowNotificationHandler.IsPropertyDefined(notification, Array.IndexOf <PropertyDefinition>(this.subscriptionProperties, ItemSchema.From))) { messageType.From = RowNotificationHandler.CreateRecipientFromParticipant((Participant)notification.Row[Array.IndexOf <PropertyDefinition>(this.subscriptionProperties, ItemSchema.From)]); } if (RowNotificationHandler.IsPropertyDefined(notification, Array.IndexOf <PropertyDefinition>(this.subscriptionProperties, ItemSchema.Sender))) { messageType.Sender = RowNotificationHandler.CreateRecipientFromParticipant((Participant)notification.Row[Array.IndexOf <PropertyDefinition>(this.subscriptionProperties, ItemSchema.Sender)]); } messageType.IsRead = new bool?(RowNotificationHandler.GetItemProperty <bool>(notification, Array.IndexOf <PropertyDefinition>(this.subscriptionProperties, MessageItemSchema.IsRead))); } FlagType flagType = new FlagType(); if (RowNotificationHandler.IsPropertyDefined(notification, Array.IndexOf <PropertyDefinition>(this.subscriptionProperties, ItemSchema.CompleteDate))) { flagType.CompleteDate = base.GetDateTimeProperty(notification, Array.IndexOf <PropertyDefinition>(this.subscriptionProperties, ItemSchema.CompleteDate)); } if (RowNotificationHandler.IsPropertyDefined(notification, Array.IndexOf <PropertyDefinition>(this.subscriptionProperties, ItemSchema.FlagStatus))) { flagType.FlagStatus = RowNotificationHandler.GetItemProperty <FlagStatus>(notification, Array.IndexOf <PropertyDefinition>(this.subscriptionProperties, ItemSchema.FlagStatus), FlagStatus.NotFlagged); } if (RowNotificationHandler.IsPropertyDefined(notification, Array.IndexOf <PropertyDefinition>(this.subscriptionProperties, TaskSchema.StartDate))) { flagType.StartDate = base.GetDateTimeProperty(notification, Array.IndexOf <PropertyDefinition>(this.subscriptionProperties, TaskSchema.StartDate)); } if (RowNotificationHandler.IsPropertyDefined(notification, Array.IndexOf <PropertyDefinition>(this.subscriptionProperties, TaskSchema.DueDate))) { flagType.DueDate = base.GetDateTimeProperty(notification, Array.IndexOf <PropertyDefinition>(this.subscriptionProperties, TaskSchema.DueDate)); } itemType.Flag = flagType; if (RowNotificationHandler.IsPropertyDefined(notification, Array.IndexOf <PropertyDefinition>(this.subscriptionProperties, StoreObjectSchema.CreationTime))) { itemType.DateTimeCreated = base.GetDateTimeProperty(notification, Array.IndexOf <PropertyDefinition>(this.subscriptionProperties, StoreObjectSchema.CreationTime)); } if (RowNotificationHandler.IsPropertyDefined(notification, Array.IndexOf <PropertyDefinition>(this.subscriptionProperties, StoreObjectSchema.LastModifiedTime))) { itemType.LastModifiedTime = base.GetDateTimeProperty(notification, Array.IndexOf <PropertyDefinition>(this.subscriptionProperties, StoreObjectSchema.LastModifiedTime)); } if (RowNotificationHandler.IsPropertyDefined(notification, Array.IndexOf <PropertyDefinition>(this.subscriptionProperties, ItemSchema.ReceivedOrRenewTime))) { itemType.ReceivedOrRenewTime = base.GetDateTimeProperty(notification, Array.IndexOf <PropertyDefinition>(this.subscriptionProperties, ItemSchema.ReceivedOrRenewTime)); } itemType.Categories = RowNotificationHandler.GetItemProperty <string[]>(notification, Array.IndexOf <PropertyDefinition>(this.subscriptionProperties, ItemSchema.Categories)); itemType.Preview = RowNotificationHandler.GetItemProperty <string>(notification, Array.IndexOf <PropertyDefinition>(this.subscriptionProperties, ItemSchema.Preview), null); itemType.Size = RowNotificationHandler.GetItemProperty <int?>(notification, Array.IndexOf <PropertyDefinition>(this.subscriptionProperties, ItemSchema.Size), null); itemType.AddExtendedPropertyValue(new ExtendedPropertyType(WellKnownProperties.NormalizedSubject, RowNotificationHandler.GetItemProperty <string>(notification, Array.IndexOf <PropertyDefinition>(this.subscriptionProperties, MessageItemRowNotificationHandler.normalizedSubjectPropertyDefinition), null))); itemType.DisplayTo = RowNotificationHandler.GetItemProperty <string>(notification, Array.IndexOf <PropertyDefinition>(this.subscriptionProperties, ItemSchema.DisplayTo), null); if (RowNotificationHandler.IsPropertyDefined(notification, Array.IndexOf <PropertyDefinition>(this.subscriptionProperties, ItemSchema.IconIndex))) { IconIndex itemProperty2 = (IconIndex)RowNotificationHandler.GetItemProperty <int>(notification, Array.IndexOf <PropertyDefinition>(this.subscriptionProperties, ItemSchema.IconIndex)); if (itemProperty2 > (IconIndex)0) { itemType.IconIndexString = itemProperty2.ToString(); } } if (RowNotificationHandler.IsPropertyDefined(notification, Array.IndexOf <PropertyDefinition>(this.subscriptionProperties, ItemSchema.SentTime))) { itemType.DateTimeSent = base.GetDateTimeProperty(notification, Array.IndexOf <PropertyDefinition>(this.subscriptionProperties, ItemSchema.SentTime)); } if (RowNotificationHandler.IsPropertyDefined(notification, Array.IndexOf <PropertyDefinition>(this.subscriptionProperties, MessageItemRowNotificationHandler.lastVerbExecutedPropertyDefinition))) { itemType.AddExtendedPropertyValue(new ExtendedPropertyType(WellKnownProperties.LastVerbExecuted, RowNotificationHandler.GetItemProperty <int>(notification, Array.IndexOf <PropertyDefinition>(this.subscriptionProperties, MessageItemRowNotificationHandler.lastVerbExecutedPropertyDefinition)).ToString())); } if (RowNotificationHandler.IsPropertyDefined(notification, Array.IndexOf <PropertyDefinition>(this.subscriptionProperties, MessageItemRowNotificationHandler.lastVerbExecutionTimePropertyDefinition))) { itemType.AddExtendedPropertyValue(new ExtendedPropertyType(WellKnownProperties.LastVerbExecutionTime, base.GetDateTimeProperty(notification, Array.IndexOf <PropertyDefinition>(this.subscriptionProperties, MessageItemRowNotificationHandler.lastVerbExecutionTimePropertyDefinition)))); } ExTraceGlobals.NotificationsCallTracer.TraceDebug <string>((long)this.GetHashCode(), "[MessageItemRowNotificationHandler.GetMessageItemFromNotification] End. SubscriptionId: {0}", base.SubscriptionId); } return(itemType); }
internal StreamLogItem(Referenced <MailboxSession> mailboxSession, StoreId messageId, StoreId folderId, string subject, string attachmentName) { if (mailboxSession == null || mailboxSession.Value == null) { throw new ArgumentNullException("mailboxSession"); } if (folderId == null) { throw new ArgumentNullException("folderId"); } if (messageId == null) { this.messageItem = MessageItem.Create(mailboxSession, folderId); this.messageItem.IsDraft = false; } else { this.messageItem = MessageItem.Bind(mailboxSession, messageId, null); } this.messageItem.Subject = subject; this.messageItem.ClassName = "IPM.Note.Microsoft.Exchange.Search.Log"; this.attachmentName = attachmentName; this.mailboxSession = mailboxSession.Reacquire(); }
private GetGroupResponse GetPDLData() { GetGroupResponse getGroupResponse = new GetGroupResponse(); MailboxSession mailboxIdentityMailboxSession = base.CallContext.SessionCache.GetMailboxIdentityMailboxSession(); ItemId sourceId = this.itemId; IdAndSession idAndSession = null; if (this.parentFolderid != null && this.parentFolderid.BaseFolderId != null) { IdAndSession idAndSession2 = base.GetIdAndSession(this.parentFolderid.BaseFolderId); if (idAndSession2 != null && idAndSession2.Session.IsPublicFolderSession) { idAndSession = idAndSession2; } } if (IdConverter.EwsIdIsConversationId(this.itemId.Id)) { try { Persona persona; if (idAndSession != null) { persona = Persona.LoadFromPersonaId(idAndSession.Session, null, this.itemId, Persona.FullPersonaShape, null, idAndSession.Id); } else { persona = Persona.LoadFromPersonIdWithGalAggregation(mailboxIdentityMailboxSession, IdConverter.EwsIdToPersonId(this.itemId.Id), Persona.FullPersonaShape, null); } if (persona.Attributions.Length > 0) { sourceId = persona.Attributions[0].SourceId; for (int i = 1; i < persona.Attributions.Length; i++) { StoreId storeId = IdConverter.EwsIdToMessageStoreObjectId(persona.Attributions[i].SourceId.Id); using (Item item = Item.Bind(mailboxIdentityMailboxSession, storeId, new PropertyDefinition[] { ContactSchema.PersonId })) { item.OpenAsReadWrite(); item[ContactSchema.PersonId] = PersonId.CreateNew(); item.Save(SaveMode.NoConflictResolution); } } RequestDetailsLoggerBase <RequestDetailsLogger> .SafeAppendGenericInfo(RequestDetailsLogger.Current, "UnlinkDupedPDLs", "Success"); } else { ExTraceGlobals.GetGroupTracer.TraceError((long)this.hashCode, "ItemId is PersonaId but Persona has no linked contacts (attributions array is empty)."); RequestDetailsLoggerBase <RequestDetailsLogger> .SafeAppendGenericInfo(RequestDetailsLogger.Current, "UnlinkDupedPDLs", "Skipped"); } } catch (LocalizedException arg) { ExTraceGlobals.GetGroupTracer.TraceError <LocalizedException>((long)this.hashCode, "Failed to unlink PDLs: {0}", arg); RequestDetailsLoggerBase <RequestDetailsLogger> .SafeAppendGenericInfo(RequestDetailsLogger.Current, "UnlinkDupedPDLs", "Failed"); } } IdAndSession idAndSession3 = base.IdConverter.ConvertItemIdToIdAndSessionReadOnly(sourceId); StoreSession storeSession; if (idAndSession != null) { storeSession = idAndSession.Session; } else { storeSession = ((idAndSession3.Session as MailboxSession) ?? base.CallContext.SessionCache.GetMailboxIdentityMailboxSession()); } using (DistributionList distributionList = DistributionList.Bind(storeSession, idAndSession3.Id)) { if (distributionList == null) { this.WriteDebugTrace("No PDL was found"); return(getGroupResponse); } PersonId personId = (PersonId)distributionList[ContactSchema.PersonId]; getGroupResponse.PersonaId = IdConverter.PersonaIdFromPersonId(storeSession.MailboxGuid, personId); if (!distributionList.GetValueOrDefault <bool>(ItemSchema.ConversationIndexTracking, false)) { try { distributionList.OpenAsReadWrite(); distributionList[ItemSchema.ConversationIndexTracking] = true; distributionList.Save(SaveMode.NoConflictResolution); RequestDetailsLoggerBase <RequestDetailsLogger> .SafeAppendGenericInfo(RequestDetailsLogger.Current, "SetConversationIndexTracking", "Success"); } catch (LocalizedException arg2) { ExTraceGlobals.GetGroupTracer.TraceError <LocalizedException>((long)this.hashCode, "Failed to set ConversationIndexTracking on PDL: {0}", arg2); RequestDetailsLoggerBase <RequestDetailsLogger> .SafeAppendGenericInfo(RequestDetailsLogger.Current, "SetConversationIndexTracking", "Failed"); } } if (!this.IsMembersInResultSet) { return(getGroupResponse); } int count = distributionList.Count; getGroupResponse.MembersCount = count; this.WriteDebugTrace("Total PDL members count is " + count); if (this.paging.Offset < 0 || count <= this.paging.Offset) { this.WriteDebugTrace(string.Format("Provided offset is out of range - members count is {0}, offset is {1}.", count, this.paging.Offset)); return(getGroupResponse); } distributionList.Sort(this.PDlMembersComparer); List <Persona> list = new List <Persona>(); List <string> list2 = new List <string>(); Dictionary <string, int> dictionary = new Dictionary <string, int>(); int num = Math.Min(count, this.paging.Offset + this.paging.MaxRows); for (int j = this.paging.Offset; j < num; j++) { DistributionListMember distributionListMember = distributionList[j]; if (distributionListMember.Participant == null) { if (num < count) { num++; } getGroupResponse.MembersCount--; } else { bool flag = false; Persona persona2 = GetGroupCommand.CreatePersonaFromDistributionListMember(mailboxIdentityMailboxSession, distributionListMember, out flag); if (flag) { list2.Add(persona2.EmailAddress.EmailAddress); dictionary.Add(persona2.EmailAddress.EmailAddress, list.Count); } list.Add(persona2); } } if (list2.Count > 0) { IRecipientSession galscopedADRecipientSession = base.CallContext.ADRecipientSessionContext.GetGALScopedADRecipientSession(base.CallContext.EffectiveCaller.ClientSecurityContext); Result <ADRawEntry>[] array = galscopedADRecipientSession.FindByLegacyExchangeDNs(list2.ToArray(), new PropertyDefinition[] { ADObjectSchema.Id, ADRecipientSchema.DisplayName, ADRecipientSchema.PrimarySmtpAddress, ADRecipientSchema.RecipientType, ADRecipientSchema.RecipientTypeDetails, ADRecipientSchema.LegacyExchangeDN }); foreach (Result <ADRawEntry> result in array) { if (result.Data != null) { Persona personaFromADObject = GetGroupCommand.GetPersonaFromADObject(result.Data); string key = result.Data[ADRecipientSchema.LegacyExchangeDN] as string; int num2; if (dictionary.ContainsKey(key) && dictionary.TryGetValue(key, out num2) && num2 >= 0) { list[num2] = personaFromADObject; } } } } list.Sort(this.PersonaComparer); Persona[] array3 = new Persona[list.Count]; list.CopyTo(0, array3, 0, list.Count); getGroupResponse.Members = array3; this.WriteDebugTrace("PDL members count loaded in the response is " + getGroupResponse.Members.Length); } return(getGroupResponse); }
// Token: 0x06000113 RID: 275 RVA: 0x00006C64 File Offset: 0x00004E64 internal static void HandleEventInternal(MapiEvent mapiEvent, MailboxSession session, StoreObject storeItem, MailboxData mailboxData) { SentItemsProcessor.Tracer.TraceDebug(0L, "{0}: Calling SentItemsProcessor.HandleEventInternal", new object[] { TraceContext.Get() }); Item item = (Item)storeItem; if (item == null) { SentItemsProcessor.Tracer.TraceError(0L, "{0}: HandleEventInternal received null item", new object[] { TraceContext.Get() }); return; } if (ObjectClass.IsSmsMessage(item.ClassName)) { try { ConversationIndexTrackingEx conversationIndexTrackingEx = ConversationIndexTrackingEx.Create(); SentItemsProcessor.HandleSmsMessage(session, item, mailboxData, conversationIndexTrackingEx); SentItemsProcessor.Tracer.TraceDebug <object, ConversationIndexTrackingEx>(0L, "{0}: ChunkSmsConversation traces: {1}", TraceContext.Get(), conversationIndexTrackingEx); } catch (ObjectNotFoundException) { SentItemsProcessor.Tracer.TraceDebug(0L, "{0}: ObjectNotFoundException thrown while processing SMS item in Sent Items folder", new object[] { TraceContext.Get() }); } return; } try { ConversationId valueOrDefault = item.GetValueOrDefault <ConversationId>(ItemSchema.ConversationId); if (valueOrDefault == null) { SentItemsProcessor.Tracer.TraceError(0L, "{0}: Found item without conversation id", new object[] { TraceContext.Get() }); } else { int totalActionItemCount; IList <StoreId> list = ConversationActionItem.QueryConversationActionsFolder(session, valueOrDefault, 1, out totalActionItemCount); StoreId storeId = (list != null) ? list[0] : null; mailboxData.UpdateConversationActionsEnabledStatus(totalActionItemCount); if (storeId == null) { SentItemsProcessor.Tracer.TraceDebug <object, ConversationId>(0L, "{0}: No action item associated found for message with conversation Id = {1}", TraceContext.Get(), valueOrDefault); } else { using (ConversationActionItem conversationActionItem = ConversationActionItem.Bind(session, storeId)) { if (conversationActionItem.IsCorrectVersion()) { if (conversationActionItem.AlwaysCategorizeValue != null) { List <string> categoriesForItem = conversationActionItem.GetCategoriesForItem(item.TryGetProperty(ItemSchema.Categories) as string[]); if (categoriesForItem != null) { SentItemsProcessor.Tracer.TraceDebug(0L, "{0}: Processed categories on item", new object[] { TraceContext.Get() }); item.SafeSetProperty(ItemSchema.Categories, categoriesForItem.ToArray()); item.Save(SaveMode.ResolveConflicts); item.Load(); } } conversationActionItem.Save(SaveMode.ResolveConflicts); } } } } } catch (ObjectNotFoundException) { SentItemsProcessor.Tracer.TraceDebug(0L, "{0}: ObjectNotFoundException thrown while processing action item", new object[] { TraceContext.Get() }); } }
public AttachmentDataProvider(IStorageEntitySetScope <IStoreSession> scope, StoreId parentItemId) : base(scope, ExTraceGlobals.AttachmentDataProviderTracer) { this.parentItemId = parentItemId; }
// Token: 0x06001729 RID: 5929 RVA: 0x0008A708 File Offset: 0x00088908 public static string GetKey(Guid mailboxGuid, StoreId itemId) { return(StoreId.StoreIdToEwsId(mailboxGuid, itemId)); }
//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in C#: //ORIGINAL LINE: private void copyIndexSnapshotIndividually(PrepareStoreCopyResponse prepareStoreCopyResponse, org.neo4j.causalclustering.identity.StoreId expectedStoreId, org.neo4j.causalclustering.catchup.CatchupAddressProvider addressProvider, StoreFileStreamProvider storeFileStream, System.Func<TerminationCondition> terminationConditions) throws StoreCopyFailedException private void CopyIndexSnapshotIndividually(PrepareStoreCopyResponse prepareStoreCopyResponse, StoreId expectedStoreId, CatchupAddressProvider addressProvider, StoreFileStreamProvider storeFileStream, System.Func <TerminationCondition> terminationConditions) { StoreCopyClientMonitor storeCopyClientMonitor = _monitors.newMonitor(typeof(StoreCopyClientMonitor)); long lastTransactionId = prepareStoreCopyResponse.LastTransactionId(); LongIterator indexIds = prepareStoreCopyResponse.IndexIds.longIterator(); storeCopyClientMonitor.StartReceivingIndexSnapshots(); while (indexIds.hasNext()) { long indexId = indexIds.next(); storeCopyClientMonitor.StartReceivingIndexSnapshot(indexId); PersistentCallToSecondary(new GetIndexFilesRequest(expectedStoreId, indexId, lastTransactionId), filesCopyAdaptor(storeFileStream, _log), addressProvider, terminationConditions()); storeCopyClientMonitor.FinishReceivingIndexSnapshot(indexId); } storeCopyClientMonitor.FinishReceivingIndexSnapshots(); }
//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in C#: //ORIGINAL LINE: private void copyFilesIndividually(PrepareStoreCopyResponse prepareStoreCopyResponse, org.neo4j.causalclustering.identity.StoreId expectedStoreId, org.neo4j.causalclustering.catchup.CatchupAddressProvider addressProvider, StoreFileStreamProvider storeFileStream, System.Func<TerminationCondition> terminationConditions, java.io.File destDir) throws StoreCopyFailedException private void CopyFilesIndividually(PrepareStoreCopyResponse prepareStoreCopyResponse, StoreId expectedStoreId, CatchupAddressProvider addressProvider, StoreFileStreamProvider storeFileStream, System.Func <TerminationCondition> terminationConditions, File destDir) { StoreCopyClientMonitor storeCopyClientMonitor = _monitors.newMonitor(typeof(StoreCopyClientMonitor)); storeCopyClientMonitor.StartReceivingStoreFiles(); long lastTransactionId = prepareStoreCopyResponse.LastTransactionId(); foreach (File file in prepareStoreCopyResponse.Files) { storeCopyClientMonitor.StartReceivingStoreFile(Paths.get(destDir.ToString(), file.Name).ToString()); PersistentCallToSecondary(new GetStoreFileRequest(expectedStoreId, file, lastTransactionId), filesCopyAdaptor(storeFileStream, _log), addressProvider, terminationConditions()); storeCopyClientMonitor.FinishReceivingStoreFile(Paths.get(destDir.ToString(), file.Name).ToString()); } storeCopyClientMonitor.FinishReceivingStoreFiles(); }
private ItemId StoreIdToEwsItemId(StoreId storeId) { ConcatenatedIdAndChangeKey concatenatedId = IdConverter.GetConcatenatedId(storeId, this.mailboxId, null); return(new ItemId(concatenatedId.Id, concatenatedId.ChangeKey)); }
// Token: 0x06000767 RID: 1895 RVA: 0x00029340 File Offset: 0x00027540 protected override int InternalExecute(int count) { string[] array = HttpUtility.UrlDecode(base.FileReference).Split(new char[] { ':' }); if (array.Length != 2) { throw new AirSyncPermanentException(StatusCode.Sync_TooManyFolders, false) { ErrorStringForProtocolLogger = "InvalidEntityAttachemtnId" }; } StoreObjectId itemId = StoreId.EwsIdToStoreObjectId(array[0]); IEvents events = EntitySyncItem.GetEvents(this.CalendaringContainer, base.Session, itemId); if (events == null) { throw new AirSyncPermanentException(StatusCode.Sync_ClientServerConversion, false) { ErrorStringForProtocolLogger = "EventsNotFound" }; } IAttachments attachments = events[array[0]].Attachments; if (attachments == null) { throw new AirSyncPermanentException(StatusCode.Sync_ClientServerConversion, false) { ErrorStringForProtocolLogger = "EntityNotFound" }; } IAttachment attachment = attachments.Read(array[1], null); if (attachment == null) { throw new AirSyncPermanentException(StatusCode.Sync_ClientServerConversion, false) { ErrorStringForProtocolLogger = "EntityAttachementNotFound" }; } base.ContentType = attachment.ContentType; FileAttachment fileAttachment = attachment as FileAttachment; ItemAttachment itemAttachment = attachment as ItemAttachment; if (fileAttachment != null) { if (!base.MaxAttachmentSize.IsUnlimited && fileAttachment.Content.Length > (int)base.MaxAttachmentSize.Value.ToBytes()) { throw new DataTooLargeException(StatusCode.AttachmentIsTooLarge); } count = ((count == -1) ? fileAttachment.Content.Length : Math.Min(count, fileAttachment.Content.Length - base.MinRange)); base.OutStream.Write(fileAttachment.Content, base.MinRange, count); return(count); } else { if (itemAttachment != null) { int result; AttachmentHelper.GetAttachment(base.Session, itemId, attachment.Id, base.OutStream, base.MinRange, count, base.MaxAttachmentSize, base.RightsManagementSupport, out result); return(result); } throw new AirSyncPermanentException(StatusCode.Sync_InvalidWaitTime, new LocalizedString(string.Format("Attachment type \"{0}\" is not supported.", attachment.GetType().FullName)), false) { ErrorStringForProtocolLogger = "UnsupportedEntityAttachementType" }; } }
public void UpdateFilterState(SyncOperation syncOperation) { if (syncOperation == null) { throw new ArgumentNullException("syncOperation"); } if (this.prepopulate) { return; } if (this.CustomFilterState == null) { this.CustomFilterState = new Dictionary <ISyncItemId, DateTimeCustomSyncFilter.FilterState>(); } switch (syncOperation.ChangeType) { case ChangeType.Add: case ChangeType.Change: case ChangeType.ReadFlagChange: { CalendarItem calendarItem = null; try { calendarItem = (syncOperation.GetItem(new PropertyDefinition[0]).NativeItem as CalendarItem); if (calendarItem == null) { this.UpdateFilterStateWithAddOrChange(syncOperation.Id, false, false, ExDateTime.MinValue); } else if (calendarItem.Recurrence == null) { this.UpdateFilterStateWithAddOrChange(syncOperation.Id, true, false, calendarItem.EndTime); } else if (calendarItem.Recurrence.Range is NoEndRecurrenceRange) { this.UpdateFilterStateWithAddOrChange(syncOperation.Id, true, true, ExDateTime.MinValue); } else { this.UpdateFilterStateWithAddOrChange(syncOperation.Id, true, true, calendarItem.Recurrence.GetLastOccurrence().EndTime); } } catch (Exception ex) { if (ex is ObjectNotFoundException) { if (this.CustomFilterState.ContainsKey(syncOperation.Id)) { this.CustomFilterState.Remove(syncOperation.Id); } } else { if (!SyncCommand.IsItemSyncTolerableException(ex)) { throw; } StoreId storeId = null; string text = "Unknown"; ExDateTime exDateTime = ExDateTime.MinValue; try { if (calendarItem != null) { storeId = calendarItem.Id; text = calendarItem.Subject; exDateTime = calendarItem.StartTime; } } catch { } AirSyncUtility.ExceptionToStringHelper exceptionToStringHelper = new AirSyncUtility.ExceptionToStringHelper(ex); AirSyncDiagnostics.TraceDebug(ExTraceGlobals.RequestsTracer, this, "Exception was caught in UpdateFilterState. Item id=\"{0}\", subject=\"{1}\", meetingTime={2}\r\n{3}\r\nIgnoring exception and proceeding to next item.", new object[] { (storeId != null) ? storeId : "null", text, exDateTime, exceptionToStringHelper }); } } break; } case (ChangeType)3: break; case ChangeType.Delete: this.CustomFilterState.Remove(syncOperation.Id); return; default: return; } }
// Token: 0x06001ACF RID: 6863 RVA: 0x0006569C File Offset: 0x0006389C public static WacAttachmentType Execute(CallContext callContext, IStoreSession originalAttachmentSession, IItem originalAttachmentItem, IAttachment originalAttachment, string draftId, string ewsAttachmentId, bool isEdit) { MdbCache.GetInstance().BeginAsyncUpdate(); UserContext userContext = UserContextManager.GetUserContext(callContext.HttpContext, callContext.EffectiveCaller, true); if (userContext == null) { throw new OwaInvalidRequestException("Unable to determine user context."); } if (!userContext.IsWacEditingEnabled) { isEdit = false; } ConfigurationContext configurationContext = new ConfigurationContext(userContext); AttachmentPolicy attachmentPolicy = configurationContext.AttachmentPolicy; bool isPublicLogon = userContext.IsPublicLogon; if (!attachmentPolicy.GetWacViewingEnabled(isPublicLogon)) { throw new OwaOperationNotSupportedException("WAC viewing not enabled for the current user"); } MailboxSession mailboxSession = null; StoreObjectId draftObjectId = null; if (draftId != null) { IdAndSession idAndSession = GetWacAttachmentInfo.GetIdAndSession(callContext, draftId, false); mailboxSession = (idAndSession.Session as MailboxSession); draftObjectId = StoreId.EwsIdToStoreObjectId(draftId); if (mailboxSession == null) { throw new OwaOperationNotSupportedException("We need a MailboxSession to create the draft, but this a " + idAndSession.Session.GetType().Name); } } string text = originalAttachmentSession.MailboxOwner.MailboxInfo.PrimarySmtpAddress.ToString(); string primarySmtpAddress = callContext.EffectiveCaller.PrimarySmtpAddress; RequestDetailsLogger protocolLog = callContext.ProtocolLog; protocolLog.Set(GetWacAttachmentInfoMetadata.LogonSmtpAddress, primarySmtpAddress); protocolLog.Set(GetWacAttachmentInfoMetadata.MailboxSmtpAddress, text); protocolLog.Set(GetWacAttachmentInfoMetadata.Edit, isEdit); protocolLog.Set(GetWacAttachmentInfoMetadata.Extension, originalAttachment.FileExtension); protocolLog.Set(GetWacAttachmentInfoMetadata.DraftProvided, draftId != null); string displayName = callContext.AccessingPrincipal.MailboxInfo.DisplayName; XSOFactory factory = new XSOFactory(); AttachmentDataProvider defaultUploadDataProvider = new AttachmentDataProviderManager().GetDefaultUploadDataProvider(callContext); IReferenceAttachment referenceAttachment = originalAttachment as IReferenceAttachment; if (referenceAttachment != null) { GetWacAttachmentInfo.LogReferenceAttachmentProperties(protocolLog, referenceAttachment.ProviderEndpointUrl, GetWacAttachmentInfoMetadata.OriginalReferenceAttachmentServiceUrl, referenceAttachment.AttachLongPathName, GetWacAttachmentInfoMetadata.OriginalReferenceAttachmentUrl); } if (defaultUploadDataProvider != null) { protocolLog.Set(GetWacAttachmentInfoMetadata.AttachmentDataProvider, defaultUploadDataProvider.ToString()); } WacAttachmentType wacAttachmentType; try { using (GetWacAttachmentInfo.Implementation implementation = new GetWacAttachmentInfo.Implementation(defaultUploadDataProvider, factory, originalAttachmentSession, originalAttachmentSession.MailboxOwner.ModernGroupType, originalAttachmentItem, originalAttachment, ewsAttachmentId, mailboxSession, draftObjectId, isEdit, displayName, (IStoreSession session, StoreId itemId, AttachmentId attachmentId) => new IdAndSession(itemId, (StoreSession)session) { AttachmentIds = { attachmentId } }.GetConcatenatedId().Id)) { implementation.Execute(); protocolLog.Set(GetWacAttachmentInfoMetadata.OriginalAttachmentType, implementation.OriginalAttachmentType); protocolLog.Set(GetWacAttachmentInfoMetadata.ResultAttachmentType, implementation.ResultAttachmentType); protocolLog.Set(GetWacAttachmentInfoMetadata.ResultAttachmentCreation, implementation.ResultAttachmentCreation); if (implementation.ResultAttachmentType == AttachmentType.Reference) { IMailboxInfo mailboxInfo = originalAttachmentSession.MailboxOwner.MailboxInfo; string mailboxAddress = mailboxInfo.PrimarySmtpAddress.ToString(); StoreId id = originalAttachmentItem.Id; BaseItemId itemIdFromStoreId = IdConverter.GetItemIdFromStoreId(id, new MailboxId(mailboxInfo.MailboxGuid)); string exchangeSessionId = WacUtilities.GetExchangeSessionId(default(Guid).ToString()); protocolLog.Set(GetWacAttachmentInfoMetadata.ExchangeSessionId, exchangeSessionId); wacAttachmentType = GetWacAttachmentInfo.GetResultForReferenceAttachment(callContext, userContext, implementation, defaultUploadDataProvider, mailboxAddress, itemIdFromStoreId, originalAttachment.FileName, isEdit, displayName, exchangeSessionId, protocolLog); } else { if (implementation.ResultAttachmentType != AttachmentType.Stream) { throw new OwaNotSupportedException("Unsupported attachment type " + implementation.ResultAttachmentType); } AttachmentIdType ewsAttachmentIdType = GetWacAttachmentInfo.GetEwsAttachmentIdType(callContext, implementation.ResultItemId, implementation.ResultAttachmentId); wacAttachmentType = GetWacAttachmentInfo.GetResultForStreamAttachment(callContext, userContext, configurationContext, attachmentPolicy, isPublicLogon, Thread.CurrentThread.CurrentCulture.Name, isEdit, (IStreamAttachment)implementation.ResultAttachment, implementation.ResultAttachmentExtension, ewsAttachmentIdType, implementation.ResultIsInDraft, implementation.ResultStoreSession, text, originalAttachmentSession.MailboxOwner.MailboxInfo.IsArchive); } } } catch (ServerException exception) { wacAttachmentType = GetWacAttachmentInfo.HandleException(protocolLog, isEdit, exception, WacAttachmentStatus.UploadFailed); } catch (GetWacAttachmentInfo.AttachmentUploadException exception2) { wacAttachmentType = GetWacAttachmentInfo.HandleException(protocolLog, isEdit, exception2, WacAttachmentStatus.UploadFailed); } catch (RightsManagementPermanentException exception3) { wacAttachmentType = GetWacAttachmentInfo.HandleException(protocolLog, isEdit, exception3, WacAttachmentStatus.ProtectedByUnsupportedIrm); } catch (AttachmentProtectionException exception4) { wacAttachmentType = GetWacAttachmentInfo.HandleException(protocolLog, isEdit, exception4, WacAttachmentStatus.ProtectedByUnsupportedIrm); } catch (ObjectNotFoundException exception5) { wacAttachmentType = GetWacAttachmentInfo.HandleException(protocolLog, isEdit, exception5, WacAttachmentStatus.NotFound); } catch (OwaInvalidRequestException exception6) { wacAttachmentType = GetWacAttachmentInfo.HandleException(protocolLog, isEdit, exception6, WacAttachmentStatus.InvalidRequest); } catch (WacDiscoveryFailureException exception7) { wacAttachmentType = GetWacAttachmentInfo.HandleException(protocolLog, isEdit, exception7, WacAttachmentStatus.WacDiscoveryFailed); } catch (WebException exception8) { wacAttachmentType = GetWacAttachmentInfo.HandleException(protocolLog, isEdit, exception8, WacAttachmentStatus.AttachmentDataProviderError); } if (wacAttachmentType == null) { throw new OwaInvalidOperationException("There is no reason known for code to reach here without throwing an unhandled exception elsewhere"); } protocolLog.Set(GetWacAttachmentInfoMetadata.Status, wacAttachmentType.Status.ToString()); return(wacAttachmentType); }
public void CopyAttachmentToSentItemsFolder(MessageItem attachedMessageItem) { StoreId destinationSentItemsFolderId = this.CreateOrGetSentItemsFolderId(); this.CopyAttachmentToDestinationFolder(destinationSentItemsFolderId, attachedMessageItem); }
// Token: 0x06000F58 RID: 3928 RVA: 0x0003B52C File Offset: 0x0003972C protected static ItemId StoreIdToEwsItemId(StoreId storeId, MailboxId mailboxId) { ConcatenatedIdAndChangeKey concatenatedId = IdConverter.GetConcatenatedId(storeId, mailboxId, null); return(new ItemId(concatenatedId.Id, concatenatedId.ChangeKey)); }
public EmployeePresenter(StoresEmployees storesEmployees, IStoreDataStore storeDataStore) { this.Id = storesEmployees.Id; this.UserEmployeeId = storesEmployees.UserEmployeeId; this.StoreId = storesEmployees.StoreId; this.IsAlive = storesEmployees.IsAlive; this.EmployeeWork = storesEmployees.EmployeeWork; this.FullName = storesEmployees.FullName; //this.EmployeeStatus = storesEmployees.EmployeeStatus; this.EmployeePosition = storesEmployees.EmployeePosition; StoreDataStore = storeDataStore; DeleteCommand = new Command(() => { var result = storeDataStore.RemoveEmployee(UserEmployeeId.ToString(), StoreId.ToString()); if (result) { MessagingCenter.Send <EmployeePresenter, EmployeePresenter>(this, "ToRemove", this); } }); EditCommand = new Command(async() => { await Shell.Current.GoToAsync($"{ConfigureEmployeePage.Route}?" + $"employeeID={UserEmployeeId.ToString()}"); }); DetailCommand = new Command(async() => { var work_hour_data = StoreDataStore.GetEmployeeWorkHoursOfStore(UserEmployeeId.ToString(), StoreId.ToString()); EmployeeWork = new List <EmployeeWorkHour>(work_hour_data); MessagingCenter.Send <EmployeePresenter, EmployeePresenter>(this, "Detail", this); await Shell.Current.GoToAsync($"{EmployeeDetailView.Route}"); }); }
public Versions(DatabaseInfo databaseInfo, StoreId storeId) { this.DatabaseInfo = databaseInfo; this.StoreId = storeId; }
protected internal abstract TStoreObject BindToStoreObject(StoreId id);
public async Task <IEnumerable <IStoreItem> > FindActiveByAsync(string searchInput, StoreId storeId, CancellationToken cancellationToken) { if (storeId == null) { throw new ArgumentNullException(nameof(storeId)); } var entities = await GetItemQuery() .Where(item => item.Name.Contains(searchInput) && !item.Deleted && !item.IsTemporary && item.AvailableAt.FirstOrDefault(map => map.StoreId == storeId.Value) != null) .ToListAsync(); cancellationToken.ThrowIfCancellationRequested(); foreach (var item in entities) { item.Predecessor = await LoadPredecessorsAsync(item); } return(toModelConverter.ToDomain(entities)); }
protected override Item Bind(MailboxSession mailboxSession, StoreId storeId) { return(CalendarItem.Bind(mailboxSession, storeId)); }
// Token: 0x06000D64 RID: 3428 RVA: 0x00032724 File Offset: 0x00030924 private ConversationType GetConversationFromNotification(QueryNotification notification) { ExTraceGlobals.NotificationsCallTracer.TraceDebug <string>((long)this.GetHashCode(), "[ConversationRowNotificationHandler.GetConversationFromNotification] Start. SubscriptionId: {0}", base.SubscriptionId); ConversationType conv = new ConversationType(); conv.InstanceKey = notification.Index; if (notification.EventType != QueryNotificationType.RowDeleted) { conv.ConversationId = new ItemId(IdConverter.ConversationIdToEwsId(base.MailboxGuid, RowNotificationHandler.GetItemProperty <ConversationId>(notification, Array.IndexOf <PropertyDefinition>(this.conversationViewQuerySubscriptionProperties, ConversationItemSchema.ConversationId))), null); conv.ConversationTopic = RowNotificationHandler.GetItemProperty <string>(notification, Array.IndexOf <PropertyDefinition>(this.conversationViewQuerySubscriptionProperties, ConversationItemSchema.ConversationTopic)); conv.UniqueRecipients = RowNotificationHandler.GetItemProperty <string[]>(notification, Array.IndexOf <PropertyDefinition>(this.conversationViewQuerySubscriptionProperties, ConversationItemSchema.ConversationMVTo)); conv.UniqueSenders = RowNotificationHandler.GetItemProperty <string[]>(notification, Array.IndexOf <PropertyDefinition>(this.conversationViewQuerySubscriptionProperties, ConversationItemSchema.ConversationMVFrom)); conv.LastDeliveryTime = base.GetDateTimeProperty(notification, Array.IndexOf <PropertyDefinition>(this.conversationViewQuerySubscriptionProperties, ConversationItemSchema.ConversationLastDeliveryTime)); conv.LastDeliveryOrRenewTime = base.GetDateTimeProperty(notification, Array.IndexOf <PropertyDefinition>(this.conversationViewQuerySubscriptionProperties, ConversationItemSchema.ConversationLastDeliveryOrRenewTime)); conv.Categories = RowNotificationHandler.GetItemProperty <string[]>(notification, Array.IndexOf <PropertyDefinition>(this.conversationViewQuerySubscriptionProperties, ConversationItemSchema.ConversationCategories)); FlagType flagType = new FlagType(); if (RowNotificationHandler.IsPropertyDefined(notification, Array.IndexOf <PropertyDefinition>(this.conversationViewQuerySubscriptionProperties, ConversationItemSchema.ConversationFlagStatus))) { flagType.FlagStatus = (FlagStatus)RowNotificationHandler.GetItemProperty <int>(notification, Array.IndexOf <PropertyDefinition>(this.conversationViewQuerySubscriptionProperties, ConversationItemSchema.ConversationFlagStatus), 0); } conv.FlagStatus = flagType.FlagStatus; conv.HasAttachments = new bool?(RowNotificationHandler.GetItemProperty <bool>(notification, Array.IndexOf <PropertyDefinition>(this.conversationViewQuerySubscriptionProperties, ConversationItemSchema.ConversationHasAttach))); conv.HasIrm = new bool?(RowNotificationHandler.GetItemProperty <bool>(notification, Array.IndexOf <PropertyDefinition>(this.conversationViewQuerySubscriptionProperties, ConversationItemSchema.ConversationHasIrm))); conv.MessageCount = new int?(RowNotificationHandler.GetItemProperty <int>(notification, Array.IndexOf <PropertyDefinition>(this.conversationViewQuerySubscriptionProperties, ConversationItemSchema.ConversationMessageCount))); conv.GlobalMessageCount = new int?(RowNotificationHandler.GetItemProperty <int>(notification, Array.IndexOf <PropertyDefinition>(this.conversationViewQuerySubscriptionProperties, ConversationItemSchema.ConversationGlobalMessageCount))); conv.UnreadCount = new int?(RowNotificationHandler.GetItemProperty <int>(notification, Array.IndexOf <PropertyDefinition>(this.conversationViewQuerySubscriptionProperties, ConversationItemSchema.ConversationUnreadMessageCount))); conv.GlobalUnreadCount = new int?(RowNotificationHandler.GetItemProperty <int>(notification, Array.IndexOf <PropertyDefinition>(this.conversationViewQuerySubscriptionProperties, ConversationItemSchema.ConversationGlobalUnreadMessageCount))); conv.Size = new int?(RowNotificationHandler.GetItemProperty <int>(notification, Array.IndexOf <PropertyDefinition>(this.conversationViewQuerySubscriptionProperties, ConversationItemSchema.ConversationMessageSize))); conv.ItemClasses = RowNotificationHandler.GetItemProperty <string[]>(notification, Array.IndexOf <PropertyDefinition>(this.conversationViewQuerySubscriptionProperties, ConversationItemSchema.ConversationMessageClasses)); conv.ImportanceString = ((ImportanceType)RowNotificationHandler.GetItemProperty <int>(notification, Array.IndexOf <PropertyDefinition>(this.conversationViewQuerySubscriptionProperties, ConversationItemSchema.ConversationImportance), 1)).ToString(); StoreId[] itemProperty = RowNotificationHandler.GetItemProperty <StoreId[]>(notification, Array.IndexOf <PropertyDefinition>(this.conversationViewQuerySubscriptionProperties, ConversationItemSchema.ConversationItemIds), new StoreId[0]); conv.ItemIds = Array.ConvertAll <StoreId, ItemId>(itemProperty, (StoreId s) => new ItemId(base.GetEwsId(s), null)); StoreId[] itemProperty2 = RowNotificationHandler.GetItemProperty <StoreId[]>(notification, Array.IndexOf <PropertyDefinition>(this.conversationViewQuerySubscriptionProperties, ConversationItemSchema.ConversationGlobalItemIds), new StoreId[0]); conv.GlobalItemIds = Array.ConvertAll <StoreId, ItemId>(itemProperty2, (StoreId s) => new ItemId(base.GetEwsId(s), null)); conv.DraftStoreIds = from storeId in itemProperty2 where DraftItemIdsProperty.IsItemInDraftsFolder(storeId, this.draftFolderId) select StoreId.GetStoreObjectId(storeId); if (conv.DraftStoreIds.FirstOrDefault <StoreId>() != null) { SimulatedWebRequestContext.Execute(base.UserContext, "ConversationNotificationDraftItemIds", delegate(MailboxSession mailboxSession, IRecipientSession adSession, RequestDetailsLogger logger) { NormalQueryView.PrepareDraftItemIds(mailboxSession, new ConversationType[] { conv }); }); } conv.LastModifiedTime = base.GetDateTimeProperty(notification, Array.IndexOf <PropertyDefinition>(this.conversationViewQuerySubscriptionProperties, StoreObjectSchema.LastModifiedTime)); conv.Preview = RowNotificationHandler.GetItemProperty <string>(notification, Array.IndexOf <PropertyDefinition>(this.conversationViewQuerySubscriptionProperties, ConversationItemSchema.ConversationPreview)); conv.MailboxScopeString = MailboxSearchLocation.PrimaryOnly.ToString(); IconIndex itemProperty3 = (IconIndex)RowNotificationHandler.GetItemProperty <int>(notification, Array.IndexOf <PropertyDefinition>(this.conversationViewQuerySubscriptionProperties, ConversationItemSchema.ConversationReplyForwardState)); if (itemProperty3 > (IconIndex)0) { conv.IconIndexString = itemProperty3.ToString(); } itemProperty3 = (IconIndex)RowNotificationHandler.GetItemProperty <int>(notification, Array.IndexOf <PropertyDefinition>(this.conversationViewQuerySubscriptionProperties, ConversationItemSchema.ConversationGlobalReplyForwardState)); if (itemProperty3 > (IconIndex)0) { conv.GlobalIconIndexString = itemProperty3.ToString(); } this.LoadConversationFeedPropertiesIfRequested(notification, conv); ExTraceGlobals.NotificationsCallTracer.TraceDebug <string>((long)this.GetHashCode(), "[ConversationRowNotificationHandler.GetConversationFromNotification] End. SubscriptionId: {0}", base.SubscriptionId); } return(conv); }
public CannotDeleteSpecialCalendarGroupException(StoreId groupId, Guid groupClassId, string groupName, Exception innerException) : base(CalendaringStrings.CannotDeleteWellKnownCalendarGroup(groupId, groupClassId, groupName), innerException) { this.groupId = groupId; this.groupClassId = groupClassId; this.groupName = groupName; }
public BirthdayCalendarReference(IBirthdayCalendars entitySet, StoreId entityStoreId) : base(entitySet, entityStoreId) { }
// Token: 0x06000D28 RID: 3368 RVA: 0x0003165C File Offset: 0x0002F85C protected override NotificationPayloadBase GetPayloadFromNotification(StoreObjectId folderId, QueryNotification notification) { CalendarItemNotificationPayload calendarItemNotificationPayload = new CalendarItemNotificationPayload(); calendarItemNotificationPayload.FolderId = StoreId.StoreIdToEwsId(base.MailboxGuid, folderId); calendarItemNotificationPayload.SubscriptionId = base.SubscriptionId; calendarItemNotificationPayload.EventType = notification.EventType; calendarItemNotificationPayload.Source = new MailboxLocation(base.MailboxGuid); EwsCalendarItemType ewsCalendarItemType = new EwsCalendarItemType(); ewsCalendarItemType.InstanceKey = notification.Index; calendarItemNotificationPayload.Item = ewsCalendarItemType; if (notification.EventType != QueryNotificationType.RowDeleted) { VersionedId itemProperty = RowNotificationHandler.GetItemProperty <VersionedId>(notification, 0); if (itemProperty == null) { ExTraceGlobals.NotificationsCallTracer.TraceDebug((long)this.GetHashCode(), "Invalid StoreId for calendar item notification."); calendarItemNotificationPayload.Reload = true; return(calendarItemNotificationPayload); } ConcatenatedIdAndChangeKey concatenatedId = IdConverter.GetConcatenatedId(itemProperty, new MailboxId(base.MailboxGuid), null); ewsCalendarItemType.ItemId = new ItemId(concatenatedId.Id, concatenatedId.ChangeKey); ewsCalendarItemType.Start = base.GetDateTimeProperty(notification, 2); ewsCalendarItemType.End = base.GetDateTimeProperty(notification, 3); ewsCalendarItemType.Subject = RowNotificationHandler.GetItemProperty <string>(notification, 4); ewsCalendarItemType.LegacyFreeBusyStatusString = BusyTypeConverter.ToString((BusyType)RowNotificationHandler.GetItemProperty <int>(notification, 5)); ewsCalendarItemType.IsAllDayEvent = RowNotificationHandler.GetItemProperty <bool?>(notification, 6); ewsCalendarItemType.IsRecurring = new bool?(RowNotificationHandler.GetItemProperty <byte[]>(notification, 7) != null); if (RowNotificationHandler.IsPropertyDefined(notification, 8)) { ewsCalendarItemType.Organizer = RowNotificationHandler.CreateRecipientFromParticipant((Participant)notification.Row[8]); } ewsCalendarItemType.IsMeeting = RowNotificationHandler.GetItemProperty <bool?>(notification, 9); ewsCalendarItemType.MyResponseTypeString = ResponseTypeConverter.ToString((ResponseType)RowNotificationHandler.GetItemProperty <int>(notification, 10)); ewsCalendarItemType.SensitivityString = SensitivityConverter.ToString(RowNotificationHandler.GetItemProperty <Sensitivity>(notification, 11)); ewsCalendarItemType.HasAttachments = RowNotificationHandler.GetItemProperty <bool?>(notification, 12); LocationSourceType itemProperty2 = (LocationSourceType)RowNotificationHandler.GetItemProperty <int>(notification, 26); ewsCalendarItemType.EnhancedLocation = ((itemProperty2 == LocationSourceType.None) ? new EnhancedLocationType { DisplayName = RowNotificationHandler.GetItemProperty <string>(notification, 13), PostalAddress = new Microsoft.Exchange.Services.Core.Types.PostalAddress() } : new EnhancedLocationType { DisplayName = RowNotificationHandler.GetItemProperty <string>(notification, 24), Annotation = RowNotificationHandler.GetItemProperty <string>(notification, 25), PostalAddress = new Microsoft.Exchange.Services.Core.Types.PostalAddress { LocationSource = itemProperty2, LocationUri = RowNotificationHandler.GetItemProperty <string>(notification, 27), Latitude = this.GetLocationPropertyValue(notification, 28), Longitude = this.GetLocationPropertyValue(notification, 29), Accuracy = this.GetLocationPropertyValue(notification, 30), Altitude = this.GetLocationPropertyValue(notification, 31), AltitudeAccuracy = this.GetLocationPropertyValue(notification, 32), Street = RowNotificationHandler.GetItemProperty <string>(notification, 33), City = RowNotificationHandler.GetItemProperty <string>(notification, 34), State = RowNotificationHandler.GetItemProperty <string>(notification, 35), Country = RowNotificationHandler.GetItemProperty <string>(notification, 36), PostalCode = RowNotificationHandler.GetItemProperty <string>(notification, 37) } }); StoreId itemProperty3 = RowNotificationHandler.GetItemProperty <StoreId>(notification, 14); ewsCalendarItemType.ParentFolderId = IdConverter.GetFolderIdFromStoreId(itemProperty3, new MailboxId(base.MailboxGuid)); byte[] itemProperty4 = RowNotificationHandler.GetItemProperty <byte[]>(notification, 15); if (itemProperty4 != null) { try { GlobalObjectId globalObjectId = new GlobalObjectId(itemProperty4); ewsCalendarItemType.UID = globalObjectId.Uid; } catch (CorruptDataException ex) { ExTraceGlobals.NotificationsCallTracer.TraceError <string>((long)this.GetHashCode(), "Exception setting the UID in CalendarItemNotificationHandler:GetPayloadFromNotification. Exception: {1}", ex.Message); } } ewsCalendarItemType.AppointmentState = new int?(RowNotificationHandler.GetItemProperty <int>(notification, 16)); ewsCalendarItemType.IsCancelled = new bool?((ewsCalendarItemType.AppointmentState.Value & 4) == 4); ewsCalendarItemType.CalendarItemTypeString = CalendarItemTypeConverter.ToString(RowNotificationHandler.GetItemProperty <CalendarItemType>(notification, 17)); ewsCalendarItemType.AppointmentReplyTime = base.GetDateTimeProperty(notification, 18); if (RowNotificationHandler.IsPropertyDefined(notification, 19)) { ewsCalendarItemType.JoinOnlineMeetingUrl = RowNotificationHandler.GetItemProperty <string>(notification, 19); } ewsCalendarItemType.Categories = RowNotificationHandler.GetItemProperty <string[]>(notification, 20); ewsCalendarItemType.IsOrganizer = new bool?(RowNotificationHandler.GetItemProperty <bool>(notification, 23)); ConversationId itemProperty5 = RowNotificationHandler.GetItemProperty <ConversationId>(notification, 21); string id = IdConverter.ConversationIdToEwsId(base.MailboxGuid, itemProperty5); ewsCalendarItemType.ConversationId = new ItemId(id, null); ewsCalendarItemType.IsResponseRequested = new bool?(RowNotificationHandler.GetItemProperty <bool>(notification, 22)); try { base.UserContext.LockAndReconnectMailboxSession(3000); ewsCalendarItemType.EffectiveRights = EffectiveRightsProperty.GetFromEffectiveRights(EffectiveRights.Modify | EffectiveRights.Read | EffectiveRights.Delete, base.UserContext.MailboxSession); } finally { if (base.UserContext.MailboxSessionLockedByCurrentThread()) { base.UserContext.UnlockAndDisconnectMailboxSession(); } } } return(calendarItemNotificationPayload); }
async Task GoStoreHome() { await Shell.Current.GoToAsync($"StoreHomeRoute?Id={StoreId.ToString()}", animate : true); //await Shell.Current.GoToAsync("StoreHomeRoute"); }