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 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); }