Пример #1
0
        // Token: 0x06000E75 RID: 3701 RVA: 0x000452F0 File Offset: 0x000434F0
        private static PropTag[] PropTagsFromProperties(IEnumerable <MbxPropertyDefinition> properties)
        {
            Dictionary <MbxPropertyDefinition, PropTag> dictionary = new Dictionary <MbxPropertyDefinition, PropTag>();

            if (properties != null)
            {
                foreach (MbxPropertyDefinition mbxPropertyDefinition in properties)
                {
                    if (mbxPropertyDefinition.IsCalculated)
                    {
                        using (ReadOnlyCollection <ProviderPropertyDefinition> .Enumerator enumerator2 = mbxPropertyDefinition.SupportingProperties.GetEnumerator())
                        {
                            while (enumerator2.MoveNext())
                            {
                                ProviderPropertyDefinition providerPropertyDefinition = enumerator2.Current;
                                MbxPropertyDefinition      mbxPropertyDefinition2     = (MbxPropertyDefinition)providerPropertyDefinition;
                                dictionary[mbxPropertyDefinition2] = mbxPropertyDefinition2.PropTag;
                            }
                            continue;
                        }
                    }
                    dictionary[mbxPropertyDefinition] = mbxPropertyDefinition.PropTag;
                }
            }
            return(dictionary.Values.ToArray <PropTag>());
        }
Пример #2
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);
        }
Пример #3
0
        // Token: 0x06000E76 RID: 3702 RVA: 0x000453A8 File Offset: 0x000435A8
        private static PropValue[] PropValuesFromADPropertyBag(ADPropertyBag properties)
        {
            List <PropValue> list = new List <PropValue>();

            foreach (object obj in properties.Keys)
            {
                SimpleProviderPropertyDefinition simpleProviderPropertyDefinition = (SimpleProviderPropertyDefinition)obj;
                MbxPropertyDefinition            mbxPropertyDefinition            = simpleProviderPropertyDefinition as MbxPropertyDefinition;
                if (properties.IsChanged(simpleProviderPropertyDefinition) && mbxPropertyDefinition != null && mbxPropertyDefinition.PropTag != PropTag.Null)
                {
                    object value = SimpleStoreValueConverter.ConvertValueToStore(properties[mbxPropertyDefinition]);
                    list.Add(new PropValue(mbxPropertyDefinition.PropTag, value));
                }
            }
            return(list.ToArray());
        }