// Token: 0x0600606D RID: 24685 RVA: 0x00147AD5 File Offset: 0x00145CD5 public ProvisioningPropertyTemplate(ADPropertyDefinition policyProperty, ProviderPropertyDefinition objectProperty, ValueConverterDelegate valueConverter, Type[] targetObjectTypes) : base(policyProperty, objectProperty, valueConverter, targetObjectTypes) { if (objectProperty.IsReadOnly) { throw new ArgumentException(string.Format("objectProperty '{0}' is read only.", objectProperty.Name)); } }
internal static SetterDelegate OWAFlagSetterDelegate(int mask, ProviderPropertyDefinition propertyDefinition, string description) { return(delegate(object value, IPropertyBag bag) { uint?num = (uint?)bag[propertyDefinition]; if (num == null) { num = new uint?(0U); } if (value != null) { PropertyDefinition propertyDefinition2 = propertyDefinition; uint?num5; if (!(bool)value) { uint?num2 = num; long num3 = (long)(~(long)mask); long?num4 = (num2 != null) ? new long?((long)((ulong)num2.GetValueOrDefault() & (ulong)num3)) : null; num5 = ((num4 != null) ? new uint?((uint)num4.GetValueOrDefault()) : null); } else { num5 = (num | new uint?((uint)mask)); } bag[propertyDefinition2] = num5; return; } throw new DataValidationException(new PropertyValidationError(DirectoryStrings.ExceptionOwaCannotSetPropertyOnE12VirtualDirectoryToNull(description), propertyDefinition, value), null); }); }
internal static void Apply(ICollection <PropertyUpdateXML> updates, ConfigurableObject targetObject) { if (updates == null) { return; } foreach (PropertyUpdateXML propertyUpdateXML in updates) { ProviderPropertyDefinition providerPropertyDefinition = null; foreach (PropertyDefinition propertyDefinition in targetObject.ObjectSchema.AllProperties) { if (string.Compare(propertyDefinition.Name, propertyUpdateXML.Property.PropertyName, StringComparison.InvariantCultureIgnoreCase) == 0) { providerPropertyDefinition = (propertyDefinition as ProviderPropertyDefinition); break; } } if (providerPropertyDefinition == null) { MrsTracer.Common.Warning("Ignoring property update for '{0}', no such property found in the schema.", new object[] { propertyUpdateXML.Property.PropertyName }); } else { propertyUpdateXML.Property.TryApplyChange(providerPropertyDefinition, targetObject, propertyUpdateXML.Operation); } } }
internal static bool TryCreateGenericMultiValuedProperty(ProviderPropertyDefinition propertyDefinition, bool createAsReadOnly, ICollection values, ICollection invalidValues, LocalizedString?readOnlyErrorMessage, out MultiValuedPropertyBase mvp) { mvp = null; if (propertyDefinition.Type == typeof(MigrationBatchError)) { mvp = new MultiValuedProperty <MigrationBatchError>(createAsReadOnly, propertyDefinition, values, invalidValues, readOnlyErrorMessage); } if (propertyDefinition.Type == typeof(MigrationError)) { mvp = new MultiValuedProperty <MigrationError>(createAsReadOnly, propertyDefinition, values, invalidValues, readOnlyErrorMessage); } if (propertyDefinition.Type == typeof(MigrationUserSkippedItem)) { mvp = new MultiValuedProperty <MigrationUserSkippedItem>(createAsReadOnly, propertyDefinition, values, invalidValues, readOnlyErrorMessage); } if (propertyDefinition.Type == typeof(MigrationReportSet)) { mvp = new MultiValuedProperty <MigrationReportSet>(createAsReadOnly, propertyDefinition, values, invalidValues, readOnlyErrorMessage); } if (propertyDefinition.Type == typeof(E164Number)) { mvp = new MultiValuedProperty <E164Number>(createAsReadOnly, propertyDefinition, values, invalidValues, readOnlyErrorMessage); } if (propertyDefinition.Type == typeof(ADObjectId)) { mvp = new MultiValuedProperty <ADObjectId>(createAsReadOnly, propertyDefinition, values, invalidValues, readOnlyErrorMessage); } if (propertyDefinition.Type == typeof(ADRecipientOrAddress)) { mvp = new MultiValuedProperty <ADRecipientOrAddress>(createAsReadOnly, propertyDefinition, values, invalidValues, readOnlyErrorMessage); } return(mvp != null || ValueConvertor.TryCreateGenericMultiValuedProperty(propertyDefinition, createAsReadOnly, values, invalidValues, readOnlyErrorMessage, out mvp)); }
internal override bool TryGetValue(ProviderPropertyDefinition pdef, out object result) { if (this.StrValue == null) { result = null; return(true); } ADPropertyDefinition adpropertyDefinition = pdef as ADPropertyDefinition; IFormatProvider formatProvider = (adpropertyDefinition != null) ? adpropertyDefinition.FormatProvider : null; result = null; Exception ex = null; if (!ADValueConvertor.TryConvertValueFromString(this.StrValue, pdef.Type, formatProvider, out result, out ex)) { MrsTracer.Common.Warning("Failed to convert {0} from string '{1}': {2}", new object[] { pdef.Name, this.StrValue, CommonUtils.FullExceptionMessage(ex) }); return(false); } return(true); }
private void RejectNonDefault(ProviderPropertyDefinition def) { if (this.DataObject.IsModified(def)) { base.WriteError(new InvalidOperationException(Strings.ErrorCannotChangeLocaleProperty(def.Name, this.DataObject.Name)), ErrorCategory.ObjectNotFound, this.Identity); } }
public virtual IEnumerable <T> FindPaged <T>(QueryFilter filter, ObjectId rootId, bool deepSearch, SortBy sortBy, int pageSize) where T : IConfigurable, new() { base.CheckDisposed(); if (!typeof(ConfigurableObject).GetTypeInfo().IsAssignableFrom(typeof(T).GetTypeInfo())) { throw new NotSupportedException("FindPaged: " + typeof(T).FullName); } foreach (T item in this.InternalFindPaged <T>(filter, rootId, deepSearch, sortBy, pageSize)) { ConfigurableObject userConfigurationObject = (ConfigurableObject)((object)item); foreach (PropertyDefinition propertyDefinition in userConfigurationObject.ObjectSchema.AllProperties) { ProviderPropertyDefinition providerPropertyDefinition = propertyDefinition as ProviderPropertyDefinition; if (providerPropertyDefinition != null && !providerPropertyDefinition.IsCalculated) { object obj = null; userConfigurationObject.propertyBag.TryGetField(providerPropertyDefinition, ref obj); userConfigurationObject.InstantiationErrors.AddRange(providerPropertyDefinition.ValidateProperty(obj ?? providerPropertyDefinition.DefaultValue, userConfigurationObject.propertyBag, true)); } } userConfigurationObject.ResetChangeTracking(true); yield return(item); } yield break; }
internal static PropertyXML Create(ProviderPropertyDefinition pdef, object value) { PropertyXML propertyXML = new PropertyXML(); propertyXML.PropertyName = pdef.Name; propertyXML.ClassName = pdef.Type.FullName; propertyXML.values = new List <PropertyValueBaseXML>(); propertyXML.isDefault = object.Equals(value, pdef.DefaultValue); if (pdef.IsMultivalued && value is MultiValuedPropertyBase) { MultiValuedPropertyBase multiValuedPropertyBase = (MultiValuedPropertyBase)value; using (IEnumerator enumerator = ((IEnumerable)multiValuedPropertyBase).GetEnumerator()) { while (enumerator.MoveNext()) { object value2 = enumerator.Current; PropertyValueBaseXML propertyValueBaseXML = PropertyValueBaseXML.Create(pdef, value2); if (propertyValueBaseXML != null) { propertyXML.values.Add(propertyValueBaseXML); } } return(propertyXML); } } if (value != null) { PropertyValueBaseXML propertyValueBaseXML2 = PropertyValueBaseXML.Create(pdef, value); if (propertyValueBaseXML2 != null) { propertyXML.values.Add(propertyValueBaseXML2); } } return(propertyXML); }
internal static ValidationError[] ValidateAscendingQuotas(PropertyBag propertyBag, ProviderPropertyDefinition[] ascendingQuotaDefinitions, ObjectId identity) { List <ValidationError> list = new List <ValidationError>(ascendingQuotaDefinitions.Length); ProviderPropertyDefinition providerPropertyDefinition = null; Unlimited <ByteQuantifiedSize> unlimited = default(Unlimited <ByteQuantifiedSize>); int num = 0; while (ascendingQuotaDefinitions.Length > num) { ProviderPropertyDefinition providerPropertyDefinition2 = ascendingQuotaDefinitions[num]; Unlimited <ByteQuantifiedSize> unlimited2 = (Unlimited <ByteQuantifiedSize>)propertyBag[providerPropertyDefinition2]; if (!unlimited2.IsUnlimited) { if (providerPropertyDefinition != null && 0 < unlimited.CompareTo(unlimited2)) { if (propertyBag.IsChanged(providerPropertyDefinition)) { list.Add(new ObjectValidationError(DirectoryStrings.ErrorProperty1GtProperty2(providerPropertyDefinition.Name, unlimited.ToString(), providerPropertyDefinition2.Name, unlimited2.ToString()), identity, string.Empty)); } else { list.Add(new ObjectValidationError(DirectoryStrings.ErrorProperty1LtProperty2(providerPropertyDefinition2.Name, unlimited2.ToString(), providerPropertyDefinition.Name, unlimited.ToString()), identity, string.Empty)); } } providerPropertyDefinition = providerPropertyDefinition2; unlimited = unlimited2; } num++; } return(list.ToArray()); }
// 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>()); }
private PropertySet CreatePropertySet(IEnumerable <PropertyDefinition> properties, out bool hasReturnOnBindProperty) { List <PropertyDefinition> expandedList = new List <PropertyDefinition>(properties); for (int i = 0; i < expandedList.Count; i++) { ProviderPropertyDefinition providerPropertyDefinition = expandedList[i] as ProviderPropertyDefinition; if (providerPropertyDefinition.IsCalculated) { expandedList.AddRange(from x in providerPropertyDefinition.SupportingProperties where !expandedList.Contains(x) select x); } } properties = expandedList; hasReturnOnBindProperty = properties.Any((PropertyDefinition x) => x is EwsStoreObjectPropertyDefinition && ((EwsStoreObjectPropertyDefinition)x).ReturnOnBind); PropertySet propertySet = new PropertySet(0); propertySet.AddRange(from x in properties where x is EwsStoreObjectPropertyDefinition && x != EwsStoreObjectSchema.Identity && ((EwsStoreObjectPropertyDefinition)x).StorePropertyDefinition.Version <= this.RequestedServerVersion select((EwsStoreObjectPropertyDefinition)x).StorePropertyDefinition); if (!properties.Any((PropertyDefinition x) => x == EwsStoreObjectSchema.ExchangeVersion)) { propertySet.Add(EwsStoreObjectSchema.ExchangeVersion.StorePropertyDefinition); } return(propertySet); }
protected override bool ProcessInternal(PropertyBag propertyBag) { ADObjectId id = (ADObjectId)propertyBag[ADObjectSchema.Id]; ADRawEntry properties = this.objectPropertyLookup.GetProperties(id); if (properties == null) { ExTraceGlobals.BackSyncTracer.TraceDebug((long)SyncConfiguration.TraceId, "MissingPropertyResolver:: - Skipping object {0}. Cannot read missing properties. Object was removed. Next incremantal sync will pick up deletion.", new object[] { propertyBag[ADObjectSchema.Id] }); return(false); } foreach (object obj in properties.propertyBag.Keys) { ProviderPropertyDefinition providerPropertyDefinition = (ProviderPropertyDefinition)obj; if (!propertyBag.Contains(providerPropertyDefinition)) { propertyBag.SetField(providerPropertyDefinition, properties[providerPropertyDefinition]); } } if (ProcessorHelper.IsObjectOrganizationUnit(propertyBag) && !propertyBag.Contains(SyncCompanySchema.DirSyncStatusAck) && propertyBag.Contains(ExtendedOrganizationalUnitSchema.DirSyncStatusAck) && propertyBag[ExtendedOrganizationalUnitSchema.DirSyncStatusAck] != null && ((MultiValuedProperty <string>)propertyBag[ExtendedOrganizationalUnitSchema.DirSyncStatusAck]).Count > 0) { propertyBag.SetField(SyncCompanySchema.DirSyncStatusAck, propertyBag[ExtendedOrganizationalUnitSchema.DirSyncStatusAck]); } this.LastProcessedEntry = properties; return(true); }
public virtual object this[string key] { get { foreach (PropertyDefinition propertyDefinition in this.Schema.AllProperties) { ProviderPropertyDefinition providerPropertyDefinition = (ProviderPropertyDefinition)propertyDefinition; if (providerPropertyDefinition.Name.Equals(key)) { return(this.PropertyBag[providerPropertyDefinition]); } } return(null); } set { foreach (PropertyDefinition propertyDefinition in this.Schema.AllProperties) { ProviderPropertyDefinition providerPropertyDefinition = (ProviderPropertyDefinition)propertyDefinition; if (providerPropertyDefinition.Name.Equals(key)) { this.PropertyBag[providerPropertyDefinition] = value; break; } } } }
internal static PropertyValueBaseXML Create(ProviderPropertyDefinition pdef, object value) { ADPropertyDefinition adpropertyDefinition = pdef as ADPropertyDefinition; IFormatProvider formatProvider = (adpropertyDefinition != null) ? adpropertyDefinition.FormatProvider : null; ADObjectId adobjectId = value as ADObjectId; if (adobjectId != null) { return(ADObjectIdXML.Serialize(adobjectId)); } OrganizationId organizationId = value as OrganizationId; if (organizationId != null) { return(OrganizationIdXML.Serialize(organizationId)); } RawSecurityDescriptor rawSecurityDescriptor = value as RawSecurityDescriptor; if (rawSecurityDescriptor != null) { return(new PropertyStringValueXML { StrValue = CommonUtils.GetSDDLString(rawSecurityDescriptor) }); } Exception ex; if (pdef.IsBinary) { byte[] binValue; if (ADValueConvertor.TryConvertValueToBinary(value, formatProvider, out binValue, out ex)) { return(new PropertyBinaryValueXML { BinValue = binValue }); } MrsTracer.Common.Warning("Failed to convert {0} to binary, will try string: {1}", new object[] { pdef.Name, CommonUtils.FullExceptionMessage(ex) }); } PropertyStringValueXML propertyStringValueXML = new PropertyStringValueXML(); string text; if (!ADValueConvertor.TryConvertValueToString(value, formatProvider, out text, out ex)) { text = value.ToString(); MrsTracer.Common.Warning("Failed to convert {0} to string, defaulting to '{1}': {2}", new object[] { pdef.Name, text, CommonUtils.FullExceptionMessage(ex) }); } propertyStringValueXML.StrValue = text; return(propertyStringValueXML); }
private static void FixDistinguishedNameForADObjectIDs(ADObject adObject, string tenantDistinguishedName) { string[] stdIDs = new string[] { ADObjectSchema.Id.Name, ADObjectSchema.OrganizationalUnitRoot.Name, ADObjectSchema.ConfigurationUnit.Name }; IEnumerable <PropertyDefinition> enumerable = adObject.Schema.AllProperties; enumerable = from propertyDefinition in enumerable where propertyDefinition != null select propertyDefinition; enumerable = from propertyDefinition in enumerable where propertyDefinition.Type == typeof(ADObjectId) select propertyDefinition; enumerable = from propertyDefinition in enumerable where propertyDefinition is ProviderPropertyDefinition && !((ProviderPropertyDefinition)propertyDefinition).IsReadOnly select propertyDefinition; enumerable = from propertyDefinition in enumerable where !stdIDs.Contains(propertyDefinition.Name) select propertyDefinition; foreach (PropertyDefinition propertyDefinition2 in enumerable) { ProviderPropertyDefinition providerPropertyDefinition = (ProviderPropertyDefinition)propertyDefinition2; object obj; if (adObject.TryGetValueWithoutDefault(providerPropertyDefinition, out obj) && obj != null) { if (providerPropertyDefinition.IsMultivalued) { MultiValuedProperty <ADObjectId> multiValuedProperty = obj as MultiValuedProperty <ADObjectId>; int num = 0; while (multiValuedProperty != null) { if (num >= multiValuedProperty.Count) { break; } ADObjectId adObjectId = multiValuedProperty[num]; multiValuedProperty[num] = new ADObjectId(tenantDistinguishedName, Guid.Empty); multiValuedProperty[num] = FfoDirectorySession.ReplaceTenantDistinguishedName(tenantDistinguishedName, adObjectId); num++; } } else { ADObjectId adobjectId = obj as ADObjectId; if (adobjectId != null) { adObject[providerPropertyDefinition] = FfoDirectorySession.ReplaceTenantDistinguishedName(tenantDistinguishedName, adobjectId); } } } } }
internal static SetterDelegate InvertFlagSetterDelegate(ProviderPropertyDefinition propertyDefinition, int mask) { return(delegate(object value, IPropertyBag bag) { int num = (int)bag[propertyDefinition]; bag[propertyDefinition] = (((bool)value) ? (num & ~mask) : (num | mask)); }); }
internal static GetterDelegate FlagGetterDelegate(ProviderPropertyDefinition propertyDefinition, int mask) { return(delegate(IPropertyBag bag) { int num = (int)bag[propertyDefinition]; return BoxedConstants.GetBool(0 != (mask & num)); }); }
internal static SetterDelegate LongFlagSetterDelegate(long mask, ProviderPropertyDefinition propertyDefinition) { return(delegate(object value, IPropertyBag bag) { long num = (long)bag[propertyDefinition]; bag[propertyDefinition] = (((bool)value) ? (num | mask) : (num & ~mask)); }); }
internal override MultiValuedPropertyBase CreateMultiValuedProperty(ProviderPropertyDefinition propertyDefinition, bool createAsReadOnly, ICollection values, ICollection invalidValues, LocalizedString?readOnlyErrorMessage) { if (propertyDefinition.Type == typeof(KindKeyword)) { return(new MultiValuedProperty <KindKeyword>(createAsReadOnly, propertyDefinition, values, invalidValues, readOnlyErrorMessage)); } return(ADValueConvertor.CreateGenericMultiValuedProperty(propertyDefinition, createAsReadOnly, values, invalidValues, readOnlyErrorMessage)); }
private static SetterDelegate MservFlagSetterDelegate(byte mask, ProviderPropertyDefinition propertyDefinition) { return(delegate(object value, IPropertyBag propertyBag) { MServRecipientSchema.UpdateRecordFlag((bool)value, mask, propertyBag, MServRecipientSchema.MservPrimaryRecord); MServRecipientSchema.UpdateRecordFlag((bool)value, mask, propertyBag, MServRecipientSchema.MservSecondaryRecord); }); }
internal override object DeserializeData(ProviderPropertyDefinition propertyDefinition, object input) { if (typeof(SearchObjectId) == propertyDefinition.Type) { return(input); } return(base.DeserializeData(propertyDefinition, input)); }
internal static GetterDelegate OutOfServiceGetterDelegate(ProviderPropertyDefinition propertyDefinition) { return(delegate(IPropertyBag bag) { int num = (int)bag[propertyDefinition]; return 0 != num; }); }
internal void SetPropertyInError(ProviderPropertyDefinition property) { if (this.propertiesInError == null) { this.propertiesInError = new HashSet <ProviderPropertyDefinition>(); } this.propertiesInError.Add(property); }
internal static void Add(List <PropertyUpdateXML> updates, ProviderPropertyDefinition pdef, object value, PropertyUpdateOperation op) { updates.Add(new PropertyUpdateXML { Operation = op, Property = PropertyXML.Create(pdef, value) }); }
internal static GetterDelegate InvertFlagGetterDelegate(ProviderPropertyDefinition propertyDefinition, int mask) { return(delegate(IPropertyBag bag) { int num = (int)bag[propertyDefinition]; bool value = 0 == (mask & num); return BoxedConstants.GetBool(value); }); }
internal static GetterDelegate AudioCodecGetterDelegate(ProviderPropertyDefinition propertyDef, ProviderPropertyDefinition legacyPropertyDef, AudioCodecEnum?defaultValueIfInvalid) { return(delegate(IPropertyBag bag) { AudioCodecEnum?audioCodecEnum = (AudioCodecEnum?)bag[propertyDef]; audioCodecEnum = ((audioCodecEnum != null) ? new AudioCodecEnum?(audioCodecEnum.Value) : ((AudioCodecEnum?)bag[legacyPropertyDef])); return (audioCodecEnum == null || audioCodecEnum.Value > AudioCodecEnum.Mp3) ? defaultValueIfInvalid : audioCodecEnum; }); }
// Token: 0x06000E80 RID: 3712 RVA: 0x00045B76 File Offset: 0x00043D76 internal static bool TryCreateGenericMultiValuedProperty(ProviderPropertyDefinition propertyDefinition, bool createAsReadOnly, ICollection values, ICollection invalidValues, LocalizedString?readOnlyErrorMessage, out MultiValuedPropertyBase mvp) { mvp = null; if (propertyDefinition.Type == typeof(ADObjectId)) { mvp = new MultiValuedProperty <ADObjectId>(createAsReadOnly, propertyDefinition, values, invalidValues, readOnlyErrorMessage); } return(mvp != null || ValueConvertor.TryCreateGenericMultiValuedProperty(propertyDefinition, createAsReadOnly, values, invalidValues, readOnlyErrorMessage, out mvp)); }
internal static GetterDelegate LongFlagGetterDelegate(long mask, ProviderPropertyDefinition propertyDefinition) { return(delegate(IPropertyBag bag) { long num = (long)bag[propertyDefinition]; bool value = 0L != (mask & num); return BoxedConstants.GetBool(value); }); }
// Token: 0x06000E7F RID: 3711 RVA: 0x00045B38 File Offset: 0x00043D38 internal static MultiValuedPropertyBase CreateGenericMultiValuedProperty(ProviderPropertyDefinition propertyDefinition, bool createAsReadOnly, ICollection values, ICollection invalidValues, LocalizedString?readOnlyErrorMessage) { MultiValuedPropertyBase result; if (!SimpleStoreValueConverter.TryCreateGenericMultiValuedProperty(propertyDefinition, createAsReadOnly, values, invalidValues, readOnlyErrorMessage, out result)) { throw new NotImplementedException(DataStrings.ErrorMvpNotImplemented(propertyDefinition.Type.ToString(), propertyDefinition.Name)); } return(result); }
private static int AsfSettingsGetterFunc(int slot, ProviderPropertyDefinition propertyDefinition, IPropertyBag bag) { if (bag[propertyDefinition] == null) { bag[propertyDefinition] = HostedContentFilterPolicySchema.GetDefaultAsfOptionValues(); } int num = (slot % 2 == 0) ? 0 : 4; return((bag[propertyDefinition] as byte[])[slot / 2] >> num & 15); }