コード例 #1
0
        // Token: 0x06000E78 RID: 3704 RVA: 0x00045564 File Offset: 0x00043764
        private static ADRawEntry ADRawEntryFromPropValues(ADObjectId id, bool createReadOnly, PropValue[] propValues, IEnumerable <MbxPropertyDefinition> properties, List <ValidationError> errors)
        {
            string        fqdn          = LocalServerCache.LocalServer.Fqdn;
            ADPropertyBag adpropertyBag = new ADPropertyBag(createReadOnly, 16);

            adpropertyBag.SetField(ADObjectSchema.Id, id);
            foreach (PropValue propValue in propValues)
            {
                if (!propValue.IsError())
                {
                    MbxPropertyDefinition   mbxPropertyDefinition   = ObjectSchema.GetInstance <MbxRecipientSchema>().FindPropertyDefinitionByPropTag(propValue.PropTag);
                    PropertyValidationError propertyValidationError = mbxPropertyDefinition.ValidateValue(propValue.Value, true);
                    if (propertyValidationError != null)
                    {
                        errors.Add(propertyValidationError);
                    }
                    adpropertyBag.SetField(mbxPropertyDefinition, SimpleStoreValueConverter.ConvertValueFromStore(mbxPropertyDefinition, propValue.Value));
                }
            }
            MbxRecipientSession.PopulateCustomizedCalculatedProperties(adpropertyBag, properties);
            ADRawEntry adrawEntry = new ADRawEntry(adpropertyBag);

            adrawEntry.OriginatingServer = fqdn;
            adrawEntry.WhenReadUTC       = new DateTime?(DateTime.UtcNow);
            adrawEntry.ResetChangeTracking(true);
            return(adrawEntry);
        }
コード例 #2
0
        // Token: 0x06000E74 RID: 3700 RVA: 0x000452C4 File Offset: 0x000434C4
        public static ADRawEntry FindADRawEntryByPuid(ulong puid, Guid mdbGuid, bool readOnly, IEnumerable <MbxPropertyDefinition> properties)
        {
            Guid                   exchangeGuidFromPuid = ConsumerIdentityHelper.GetExchangeGuidFromPuid(puid);
            ADObjectId             adobjectIdFromPuid   = ConsumerIdentityHelper.GetADObjectIdFromPuid(puid);
            List <ValidationError> errors = new List <ValidationError>();

            return(MbxRecipientSession.ReadUserInformationRecord(adobjectIdFromPuid, mdbGuid, exchangeGuidFromPuid, readOnly, properties, errors));
        }
コード例 #3
0
        public static ADRawEntry PerformMbxLookupByPuid(ADObjectId resultId, Guid mdbGuid, bool isReadOnly, List <MbxPropertyDefinition> properties)
        {
            ulong puid;

            if (ConsumerIdentityHelper.TryGetPuidFromGuid(resultId.ObjectGuid, out puid))
            {
                return(MbxRecipientSession.FindADRawEntryByPuid(puid, mdbGuid, isReadOnly, properties));
            }
            throw new ArgumentException("resultId");
        }
コード例 #4
0
 // Token: 0x06000E77 RID: 3703 RVA: 0x00045448 File Offset: 0x00043648
 public static ADRawEntry ReadUserInformationRecord(ADObjectId id, Guid mdbGuid, Guid mbxGuid, bool createReadOnly, IEnumerable <MbxPropertyDefinition> properties, List <ValidationError> errors)
 {
     PropTag[]   array = MbxRecipientSession.PropTagsFromProperties(properties);
     PropValue[] array4;
     try
     {
         if (MbxRecipientSession.storeUserInformationReader != null)
         {
             uint[]   array2 = array.Cast <uint>().ToArray <uint>();
             object[] array3 = MbxRecipientSession.storeUserInformationReader.ReadUserInformation(mdbGuid, mbxGuid, array2);
             if (array3.Length != array2.Length)
             {
                 throw new ArgumentException("Number of returned property values doesn't match number of requested properties");
             }
             array4 = new PropValue[array2.Length];
             for (int i = 0; i < array4.Length; i++)
             {
                 if (array3[i] != null)
                 {
                     array4[i] = new PropValue((PropTag)array2[i], array3[i]);
                 }
                 else
                 {
                     array4[i] = new PropValue(PropTagHelper.ConvertToError((PropTag)array2[i]), -2147221233);
                 }
             }
         }
         else
         {
             using (ExRpcAdmin exRpcAdminInstance = MbxRecipientSession.GetExRpcAdminInstance())
             {
                 array4 = exRpcAdminInstance.ReadUserInfo(mdbGuid, mbxGuid, 0U, array);
             }
         }
     }
     catch (MapiPermanentException innerException)
     {
         throw new ADDriverStoreAccessPermanentException(innerException);
     }
     catch (MapiRetryableException innerException2)
     {
         throw new ADDriverStoreAccessTransientException(innerException2);
     }
     return(MbxRecipientSession.ADRawEntryFromPropValues(id, createReadOnly, array4, properties, errors));
 }
コード例 #5
0
 public static void PerformMbxModification(Guid mdbGuid, Guid mbxGuid, ADPropertyBag properties, bool isNew)
 {
     if (isNew)
     {
         MbxRecipientSession.CreateUserInformationRecord(mdbGuid, mbxGuid, properties);
         return;
     }
     try
     {
         MbxRecipientSession.UpdateUserInformationRecord(mdbGuid, mbxGuid, properties, null);
     }
     catch (ADDriverStoreAccessPermanentException ex)
     {
         if (ex.InnerException == null || !(ex.InnerException is MapiExceptionUserInformationNotFound))
         {
             throw;
         }
         MbxRecipientSession.CreateUserInformationRecord(mdbGuid, mbxGuid, properties);
     }
 }
コード例 #6
0
 // Token: 0x06000E7B RID: 3707 RVA: 0x0004576C File Offset: 0x0004396C
 public static void UpdateUserInformationRecord(Guid mdbGuid, Guid mbxGuid, ADPropertyBag propertiesToUpdate, IEnumerable <MbxPropertyDefinition> propertiesToRemove)
 {
     PropValue[] properties    = MbxRecipientSession.PropValuesFromADPropertyBag(propertiesToUpdate);
     PropTag[]   deletePropTag = MbxRecipientSession.PropTagsFromProperties(propertiesToRemove);
     try
     {
         using (ExRpcAdmin exRpcAdminInstance = MbxRecipientSession.GetExRpcAdminInstance())
         {
             exRpcAdminInstance.UpdateUserInfo(mdbGuid, mbxGuid, 0U, properties, deletePropTag);
         }
     }
     catch (MapiPermanentException innerException)
     {
         throw new ADDriverStoreAccessPermanentException(innerException);
     }
     catch (MapiRetryableException innerException2)
     {
         throw new ADDriverStoreAccessTransientException(innerException2);
     }
 }
コード例 #7
0
 // Token: 0x06000E7C RID: 3708 RVA: 0x000457E0 File Offset: 0x000439E0
 public static void RemoveUserInformationRecord(Guid mdbGuid, Guid mbxGuid)
 {
     try
     {
         using (ExRpcAdmin exRpcAdminInstance = MbxRecipientSession.GetExRpcAdminInstance())
         {
             exRpcAdminInstance.DeleteUserInfo(mdbGuid, mbxGuid, 0U);
         }
     }
     catch (MapiExceptionNoSupport innerException)
     {
         throw new RemovalAPINotSupportedException(innerException);
     }
     catch (MapiPermanentException innerException2)
     {
         throw new ADDriverStoreAccessPermanentException(innerException2);
     }
     catch (MapiRetryableException innerException3)
     {
         throw new ADDriverStoreAccessTransientException(innerException3);
     }
 }
コード例 #8
0
 // Token: 0x06000E7A RID: 3706 RVA: 0x000456E0 File Offset: 0x000438E0
 public static void CreateUserInformationRecord(Guid mdbGuid, Guid mbxGuid, ADPropertyBag properties)
 {
     PropValue[] properties2 = MbxRecipientSession.PropValuesFromADPropertyBag(properties);
     try
     {
         using (ExRpcAdmin exRpcAdminInstance = MbxRecipientSession.GetExRpcAdminInstance())
         {
             exRpcAdminInstance.CreateUserInfo(mdbGuid, mbxGuid, 0U, properties2);
         }
     }
     catch (MapiExceptionUserInformationAlreadyExists mapiExceptionUserInformationAlreadyExists)
     {
         throw new ADObjectAlreadyExistsException(new LocalizedString(mapiExceptionUserInformationAlreadyExists.Message), mapiExceptionUserInformationAlreadyExists);
     }
     catch (MapiPermanentException innerException)
     {
         throw new ADDriverStoreAccessPermanentException(innerException);
     }
     catch (MapiRetryableException innerException2)
     {
         throw new ADDriverStoreAccessTransientException(innerException2);
     }
 }