protected override IConfigurable ConvertDataObjectToPresentationObject(IConfigurable dataObject) { if (dataObject == null) { return(null); } ADUser dataObject2 = (ADUser)dataObject; SyncMailbox syncMailbox = new SyncMailbox(dataObject2); syncMailbox.propertyBag.SetField(ADRecipientSchema.AcceptMessagesOnlyFrom, SyncTaskHelper.RetrieveFullADObjectId(base.TenantGlobalCatalogSession, syncMailbox.AcceptMessagesOnlyFrom)); syncMailbox.propertyBag.SetField(ADRecipientSchema.AcceptMessagesOnlyFromDLMembers, SyncTaskHelper.RetrieveFullADObjectId(base.TenantGlobalCatalogSession, syncMailbox.AcceptMessagesOnlyFromDLMembers)); syncMailbox.propertyBag.SetField(ADRecipientSchema.RejectMessagesFrom, SyncTaskHelper.RetrieveFullADObjectId(base.TenantGlobalCatalogSession, syncMailbox.RejectMessagesFrom)); syncMailbox.propertyBag.SetField(ADRecipientSchema.RejectMessagesFromDLMembers, SyncTaskHelper.RetrieveFullADObjectId(base.TenantGlobalCatalogSession, syncMailbox.RejectMessagesFromDLMembers)); if (syncMailbox.MailboxPlan != null) { ADUser aduser = base.ProvisioningCache.TryAddAndGetOrganizationDictionaryValue <ADUser, ADObjectId>(CannedProvisioningCacheKeys.CacheKeyMailboxPlanId, base.CurrentOrganizationId, syncMailbox.MailboxPlan, () => (ADUser)this.GetDataObject <ADUser>(new MailboxPlanIdParameter(syncMailbox.MailboxPlan), this.TenantGlobalCatalogSession, null, new LocalizedString?(Strings.ErrorMailboxPlanNotFound(syncMailbox.MailboxPlan.ToString())), new LocalizedString?(Strings.ErrorMailboxPlanNotUnique(syncMailbox.MailboxPlan.ToString())))); syncMailbox.propertyBag.SetField(SyncMailboxSchema.MailboxPlanName, aduser.DisplayName); } if (this.outputCookie != null) { syncMailbox.propertyBag.SetField(SyncMailboxSchema.Cookie, this.outputCookie.ToBytes()); if (this.outputCookie.HighWatermark == 0L) { syncMailbox.propertyBag.SetField(SyncMailboxSchema.EndOfList, true); } } syncMailbox.ResetChangeTracking(); return(syncMailbox); }
protected override IConfigurable ConvertDataObjectToPresentationObject(IConfigurable dataObject) { if (dataObject == null) { return(null); } ADContact dataObject2 = (ADContact)dataObject; SyncMailContact syncMailContact = new SyncMailContact(dataObject2); syncMailContact.propertyBag.SetField(ADRecipientSchema.AcceptMessagesOnlyFrom, SyncTaskHelper.RetrieveFullADObjectId(base.TenantGlobalCatalogSession, syncMailContact.AcceptMessagesOnlyFrom)); syncMailContact.propertyBag.SetField(ADRecipientSchema.AcceptMessagesOnlyFromDLMembers, SyncTaskHelper.RetrieveFullADObjectId(base.TenantGlobalCatalogSession, syncMailContact.AcceptMessagesOnlyFromDLMembers)); syncMailContact.propertyBag.SetField(ADRecipientSchema.RejectMessagesFrom, SyncTaskHelper.RetrieveFullADObjectId(base.TenantGlobalCatalogSession, syncMailContact.RejectMessagesFrom)); syncMailContact.propertyBag.SetField(ADRecipientSchema.RejectMessagesFromDLMembers, SyncTaskHelper.RetrieveFullADObjectId(base.TenantGlobalCatalogSession, syncMailContact.RejectMessagesFromDLMembers)); if (this.outputCookie != null) { syncMailContact.propertyBag.SetField(SyncMailContactSchema.Cookie, this.outputCookie.ToBytes()); if (this.outputCookie.HighWatermark == 0L) { syncMailContact.propertyBag.SetField(SyncMailContactSchema.EndOfList, true); } } return(syncMailContact); }