internal static object DescriptionGetter(IPropertyBag propertyBag) { string text = (string)propertyBag[ExchangeRoleSchema.RawDescription]; if (ExchangeRoleSchema.RawDescription.DefaultValue.Equals(text)) { RoleType roleType = (RoleType)propertyBag[ExchangeRoleSchema.RoleType]; if (Enum.IsDefined(typeof(RoleType), roleType)) { try { if ((bool)ExchangeRole.IsRootRoleGetter(propertyBag)) { text = ExchangeRole.resourceManager.GetString("RoleTypeDescription_" + roleType.ToString()); } else { ADObjectId adobjectId = (ADObjectId)propertyBag[ADObjectSchema.Id]; int num = adobjectId.Name.IndexOf("_"); string str = (num == -1) ? adobjectId.Name : adobjectId.Name.Substring(0, num); string @string = ExchangeRole.resourceManager.GetString("CustomRoleDescription_" + str); if (!string.IsNullOrEmpty(@string)) { text = @string; } } } catch (MissingManifestResourceException) { } } } return(text); }
internal static object ParentGetter(IPropertyBag propertyBag) { if ((bool)ExchangeRole.IsRootRoleGetter(propertyBag)) { return(null); } return(((ADObjectId)propertyBag[ADObjectSchema.Id]).Parent); }
internal void ApplyChangesToDownlevelData(ExchangeRole parentRole) { if (parentRole == null) { throw new ArgumentNullException("parentRole"); } if (!this.HasDownlevelData) { return; } MultiValuedProperty <RoleEntry> multiValuedProperty = (MultiValuedProperty <RoleEntry>) this[ExchangeRoleSchema.InternalDownlevelRoleEntries]; object[] removed = this.RoleEntries.Removed; for (int i = 0; i < removed.Length; i++) { RoleEntry roleEntry = (RoleEntry)removed[i]; RoleEntry downlevelEntryToFind = roleEntry.MapToPreviousVersion(); RoleEntry roleEntry2 = multiValuedProperty.Find((RoleEntry dre) => 0 == RoleEntry.CompareRoleEntriesByName(dre, downlevelEntryToFind)); if (roleEntry2 != null) { multiValuedProperty.Remove(roleEntry2); } } object[] added = this.RoleEntries.Added; for (int j = 0; j < added.Length; j++) { RoleEntry roleEntry3 = (RoleEntry)added[j]; RoleEntry downlevelEntryToFind = roleEntry3.MapToPreviousVersion(); MultiValuedProperty <RoleEntry> multiValuedProperty2 = (MultiValuedProperty <RoleEntry>)parentRole[ExchangeRoleSchema.InternalDownlevelRoleEntries]; RoleEntry roleEntry4 = multiValuedProperty2.Find((RoleEntry dre) => 0 == RoleEntry.CompareRoleEntriesByName(dre, downlevelEntryToFind)); if (!(roleEntry4 == null)) { List <string> list = new List <string>(); foreach (string newParameter in roleEntry3.Parameters) { string text = roleEntry3.MapParameterToPreviousVersion(newParameter); if (roleEntry4.ContainsParameter(text)) { list.Add(text); } } RoleEntry item = downlevelEntryToFind.Clone(list); multiValuedProperty.Add(item); } } }
internal static object MailboxPlanIndexGetter(IPropertyBag propertyBag) { string text = (string)propertyBag[ExchangeRoleSchema.RawMailboxPlanIndex]; RoleType roleType = (RoleType)propertyBag[ExchangeRoleSchema.RoleType]; string name = ((ADObjectId)propertyBag[ADObjectSchema.Id]).Name; if (!ExchangeRoleSchema.RawMailboxPlanIndex.DefaultValue.Equals(text)) { return(text); } if (propertyBag[ADObjectSchema.ConfigurationUnit] != null && Array.BinarySearch <RoleType>(ExchangeRole.EndUserRoleTypes, roleType) >= 0 && (bool)ExchangeRole.IsRootRoleGetter(propertyBag) && !name.Equals(roleType.ToString(), StringComparison.OrdinalIgnoreCase) && !name.Replace(" ", string.Empty).Equals(roleType.ToString(), StringComparison.OrdinalIgnoreCase)) { return("0"); } return(ExchangeRoleSchema.RawMailboxPlanIndex.DefaultValue); }
internal static object IsRootRoleGetter(IPropertyBag propertyBag) { ADObjectId roleId = (ADObjectId)propertyBag[ADObjectSchema.Id]; return(ExchangeRole.IsRootRoleInternal(roleId)); }