protected override SharingSubscriptionData CreateDataObjectFromItem(object[] properties) { VersionedId versionedId = SharingItemManagerBase <SharingSubscriptionData> .TryGetPropertyRef <VersionedId>(properties, 1); if (versionedId == null) { ExTraceGlobals.SharingTracer.TraceError <IExchangePrincipal>((long)this.GetHashCode(), "{0}: subscription is missing ID", base.MailboxSession.MailboxOwner); return(null); } string text = SharingItemManagerBase <SharingSubscriptionData> .TryGetPropertyRef <string>(properties, 4); if (string.IsNullOrEmpty(text)) { ExTraceGlobals.SharingTracer.TraceError <IExchangePrincipal, VersionedId>((long)this.GetHashCode(), "{0}: subscription {1} is missing ExternalSharingDataType", base.MailboxSession.MailboxOwner, versionedId); return(null); } string text2 = SharingItemManagerBase <SharingSubscriptionData> .TryGetPropertyRef <string>(properties, 5); if (string.IsNullOrEmpty(text2)) { ExTraceGlobals.SharingTracer.TraceError <IExchangePrincipal, VersionedId>((long)this.GetHashCode(), "{0}: subscription {1} is missing ExternalSharingSharerIdentity", base.MailboxSession.MailboxOwner, versionedId); return(null); } string text3 = SharingItemManagerBase <SharingSubscriptionData> .TryGetPropertyRef <string>(properties, 6); if (string.IsNullOrEmpty(text3)) { ExTraceGlobals.SharingTracer.TraceError <IExchangePrincipal, VersionedId>((long)this.GetHashCode(), "{0}: subscription {1} is missing ExternalSharingSharerName", base.MailboxSession.MailboxOwner, versionedId); return(null); } string text4 = SharingItemManagerBase <SharingSubscriptionData> .TryGetPropertyRef <string>(properties, 7); if (string.IsNullOrEmpty(text4)) { ExTraceGlobals.SharingTracer.TraceError <IExchangePrincipal, VersionedId>((long)this.GetHashCode(), "{0}: subscription {1} is missing ExternalSharingRemoteFolderId", base.MailboxSession.MailboxOwner, versionedId); return(null); } string text5 = SharingItemManagerBase <SharingSubscriptionData> .TryGetPropertyRef <string>(properties, 8); if (string.IsNullOrEmpty(text5)) { ExTraceGlobals.SharingTracer.TraceError <IExchangePrincipal, VersionedId>((long)this.GetHashCode(), "{0}: subscription {1} is missing ExternalSharingRemoteFolderName", base.MailboxSession.MailboxOwner, versionedId); return(null); } bool?flag = SharingItemManagerBase <SharingSubscriptionData> .TryGetPropertyVal <bool>(properties, 9); if (flag == null) { ExTraceGlobals.SharingTracer.TraceError <IExchangePrincipal, VersionedId>((long)this.GetHashCode(), "{0}: subscription {1} is missing ExternalSharingIsPrimary", base.MailboxSession.MailboxOwner, versionedId); return(null); } bool value = flag.Value; string text6 = SharingItemManagerBase <SharingSubscriptionData> .TryGetPropertyRef <string>(properties, 10); if (string.IsNullOrEmpty(text6)) { ExTraceGlobals.SharingTracer.TraceError <IExchangePrincipal, VersionedId>((long)this.GetHashCode(), "{0}: subscription {1} is missing ExternalSharingSharerIdentityFederationUri", base.MailboxSession.MailboxOwner, versionedId); return(null); } if (!Uri.IsWellFormedUriString(text6, UriKind.Absolute)) { ExTraceGlobals.SharingTracer.TraceError <IExchangePrincipal, VersionedId, string>((long)this.GetHashCode(), "{0}: subscription {1} has invalid ExternalSharingSharerIdentityFederationUri: {2}", base.MailboxSession.MailboxOwner, versionedId, text6); return(null); } string text7 = SharingItemManagerBase <SharingSubscriptionData> .TryGetPropertyRef <string>(properties, 11); if (string.IsNullOrEmpty(text7)) { ExTraceGlobals.SharingTracer.TraceError <IExchangePrincipal, VersionedId>((long)this.GetHashCode(), "{0}: subscription {1} is missing ExternalSharingUrl", base.MailboxSession.MailboxOwner, versionedId); return(null); } if (!Uri.IsWellFormedUriString(text7, UriKind.Absolute)) { ExTraceGlobals.SharingTracer.TraceError <IExchangePrincipal, VersionedId, string>((long)this.GetHashCode(), "{0}: subscription {1} has invalid ExternalSharingUrl: {2}", base.MailboxSession.MailboxOwner, versionedId, text7); return(null); } byte[] array = SharingItemManagerBase <SharingSubscriptionData> .TryGetPropertyRef <byte[]>(properties, 2); if (array == null || array.Length == 0) { ExTraceGlobals.SharingTracer.TraceError <IExchangePrincipal, VersionedId>((long)this.GetHashCode(), "{0}: subscription {1} is missing ExternalSharingLocalFolderId", base.MailboxSession.MailboxOwner, versionedId); return(null); } string text8 = SharingItemManagerBase <SharingSubscriptionData> .TryGetPropertyRef <string>(properties, 12); if (string.IsNullOrEmpty(text8)) { ExTraceGlobals.SharingTracer.TraceError <IExchangePrincipal, VersionedId>((long)this.GetHashCode(), "{0}: subscription {1} is missing ExternalSharingSharingKey", base.MailboxSession.MailboxOwner, versionedId); return(null); } string text9 = SharingItemManagerBase <SharingSubscriptionData> .TryGetPropertyRef <string>(properties, 13); if (string.IsNullOrEmpty(text9)) { ExTraceGlobals.SharingTracer.TraceError <IExchangePrincipal, VersionedId>((long)this.GetHashCode(), "{0}: subscription {1} is missing ExternalSharingSubscriberIdentity", base.MailboxSession.MailboxOwner, versionedId); return(null); } return(new SharingSubscriptionData(versionedId, text, text2, text3, text4, text5, value, new Uri(text6), new Uri(text7), StoreObjectId.Deserialize(array), text8, text9)); }
protected override SharingBindingData CreateDataObjectFromItem(object[] properties) { VersionedId versionedId = SharingItemManagerBase <SharingBindingData> .TryGetPropertyRef <VersionedId>(properties, 1); if (versionedId == null) { ExTraceGlobals.SharingTracer.TraceError <IExchangePrincipal>((long)this.GetHashCode(), "{0}: Binding is missing ID", this.mailboxSession.MailboxOwner); return(null); } string text = SharingItemManagerBase <SharingBindingData> .TryGetPropertyRef <string>(properties, 12); if (text == null) { ExTraceGlobals.SharingTracer.TraceError <IExchangePrincipal, VersionedId>((long)this.GetHashCode(), "{0}: Binding {1} is missing sharingLocalType", this.mailboxSession.MailboxOwner, versionedId); return(null); } SharingDataType sharingDataType = SharingDataType.FromContainerClass(text); if (sharingDataType == null) { ExTraceGlobals.SharingTracer.TraceError <IExchangePrincipal, VersionedId, string>((long)this.GetHashCode(), "{0}: Binding {1} has invalid sharingLocalType: {2}", this.mailboxSession.MailboxOwner, versionedId, text); return(null); } string text2 = SharingItemManagerBase <SharingBindingData> .TryGetPropertyRef <string>(properties, 8); if (text2 == null) { ExTraceGlobals.SharingTracer.TraceError <IExchangePrincipal, VersionedId>((long)this.GetHashCode(), "{0}: Binding {1} is missing initiatorName", this.mailboxSession.MailboxOwner, versionedId); return(null); } string text3 = SharingItemManagerBase <SharingBindingData> .TryGetPropertyRef <string>(properties, 9); if (text3 == null) { ExTraceGlobals.SharingTracer.TraceError <IExchangePrincipal, VersionedId>((long)this.GetHashCode(), "{0}: Binding {1} is missing initiatorSmtpAddress", this.mailboxSession.MailboxOwner, versionedId); return(null); } string text4 = SharingItemManagerBase <SharingBindingData> .TryGetPropertyRef <string>(properties, 7); if (text4 == null) { ExTraceGlobals.SharingTracer.TraceError <IExchangePrincipal, VersionedId>((long)this.GetHashCode(), "{0}: Binding {1} is missing remoteFolderName", this.mailboxSession.MailboxOwner, versionedId); return(null); } string text5 = SharingItemManagerBase <SharingBindingData> .TryGetPropertyRef <string>(properties, 18); if (text5 == null) { ExTraceGlobals.SharingTracer.TraceError <IExchangePrincipal, VersionedId>((long)this.GetHashCode(), "{0}: Binding {1} is missing remoteFolderId", this.mailboxSession.MailboxOwner, versionedId); return(null); } string text6 = SharingItemManagerBase <SharingBindingData> .TryGetPropertyRef <string>(properties, 10); if (text6 == null) { ExTraceGlobals.SharingTracer.TraceError <IExchangePrincipal, VersionedId>((long)this.GetHashCode(), "{0}: Binding {1} is missing localFolderName", this.mailboxSession.MailboxOwner, versionedId); return(null); } string text7 = SharingItemManagerBase <SharingBindingData> .TryGetPropertyRef <string>(properties, 11); if (text7 == null) { ExTraceGlobals.SharingTracer.TraceError <IExchangePrincipal, VersionedId>((long)this.GetHashCode(), "{0}: Binding {1} is missing localFolderUid", this.mailboxSession.MailboxOwner, versionedId); return(null); } StoreObjectId localFolderId; try { localFolderId = StoreObjectId.FromHexEntryId(text7, sharingDataType.StoreObjectType); } catch (CorruptDataException) { ExTraceGlobals.SharingTracer.TraceError <IExchangePrincipal, VersionedId>((long)this.GetHashCode(), "{0}: Binding {1} has invalid localFolderUid", this.mailboxSession.MailboxOwner, versionedId); return(null); } int?num = SharingItemManagerBase <SharingBindingData> .TryGetPropertyVal <int>(properties, 3); if (num == null) { ExTraceGlobals.SharingTracer.TraceError <IExchangePrincipal, VersionedId>((long)this.GetHashCode(), "{0}: Binding {1} is missing flavor", this.mailboxSession.MailboxOwner, versionedId); return(null); } bool isDefaultFolderShared = 0 != (num.Value & 131072); DateTime? lastSyncTimeUtc = null; ExDateTime?exDateTime = SharingItemManagerBase <SharingBindingData> .TryGetPropertyVal <ExDateTime>(properties, 15); if (exDateTime == null) { ExTraceGlobals.SharingTracer.TraceDebug <IExchangePrincipal, VersionedId>((long)this.GetHashCode(), "{0}: Binding {1} is missing lastSyncTime", this.mailboxSession.MailboxOwner, versionedId); } else { lastSyncTimeUtc = new DateTime?((DateTime)exDateTime.Value.ToUtc()); } return(new SharingBindingData(versionedId, sharingDataType, text2, text3, text4, text5, text6, localFolderId, isDefaultFolderShared, lastSyncTimeUtc)); }
private object[] FindPrimaryByDataType(string dataType, string sharerIdentity) { return(base.FindFirst((object[] properties) => StringComparer.OrdinalIgnoreCase.Equals(dataType, SharingItemManagerBase <SharingSubscriptionData> .TryGetPropertyRef <string>(properties, 4)) && StringComparer.OrdinalIgnoreCase.Equals(sharerIdentity, SharingItemManagerBase <SharingSubscriptionData> .TryGetPropertyRef <string>(properties, 5)) && SharingItemManagerBase <SharingSubscriptionData> .TryGetPropertyVal <bool>(properties, 9) == true)); }