// Token: 0x060050C4 RID: 20676 RVA: 0x0012B7A4 File Offset: 0x001299A4 public static object[] MarshalWholeObject(ADObject recipient, IRecipientSession session, string[] allAttributes) { PropertyDefinition[] array = null; PropertyDefinition[] propDefs = RUSMarshal.LdapAttributesToPropertyDefinitions(allAttributes, recipient, out array); if (recipient.ObjectState == ObjectState.New) { recipient.StampPersistableDefaultValues(); } object[] array2 = RUSMarshal.MarshalObject(propDefs, recipient); if (array.Length > 0 && recipient.ObjectState != ObjectState.New && recipient.ObjectState != ObjectState.Deleted) { bool useGlobalCatalog = session.UseGlobalCatalog; bool useConfigNC = session.UseConfigNC; session.UseConfigNC = false; if (string.Equals(recipient.Id.DescendantDN(1).Rdn.UnescapedName, "Configuration", StringComparison.OrdinalIgnoreCase)) { ADObjectId configurationNamingContext = ADSession.GetConfigurationNamingContext(session.DomainController ?? recipient.OriginatingServer, session.NetworkCredential); if (recipient.DistinguishedName.EndsWith(configurationNamingContext.DistinguishedName, StringComparison.OrdinalIgnoreCase)) { session.UseConfigNC = true; } } session.UseGlobalCatalog = false; ADRawEntry adrawEntry = null; try { adrawEntry = session.ReadADRawEntry((ADObjectId)recipient.Identity, array); if (adrawEntry == null) { throw new RusOperationException(DirectoryStrings.ExceptionObjectNotFound); } } finally { session.UseGlobalCatalog = useGlobalCatalog; session.UseConfigNC = useConfigNC; } object[] array3 = RUSMarshal.MarshalObject(array, adrawEntry); if (array3.Length > 0) { int num = array2.Length; Array.Resize <object>(ref array2, num + array3.Length); array3.CopyTo(array2, num); } } return(array2); }
// Token: 0x060050CC RID: 20684 RVA: 0x0012BEC2 File Offset: 0x0012A0C2 internal static PropertyDefinition[] LdapAttributesToPropertyDefinitions(string[] attributes, ADObject recipient, out PropertyDefinition[] nonADRecipientPropDefs) { return(RUSMarshal.LdapAttributesToPropertyDefinitions(RUSMarshal.SchemaInstance, attributes, recipient, out nonADRecipientPropDefs)); }
// Token: 0x060050C9 RID: 20681 RVA: 0x0012BB94 File Offset: 0x00129D94 internal static ADRecipient UnMarshalObject(object rusResult, ADObject originalRecipient) { if (rusResult == null || !(rusResult is object[])) { return(null); } SortedList sortedList = new SortedList(new CaseInsensitiveComparer(CultureInfo.InvariantCulture)); foreach (object[] array2 in (object[])rusResult) { string[] array3 = new string[array2.Length - 1]; Array.Copy(array2, 1, array3, 0, array2.Length - 1); sortedList.Add(array2[0], array3); } string[] array4 = new string[sortedList.Count]; sortedList.Keys.CopyTo(array4, 0); ADRecipient adrecipient = new ADRecipient(); List <ADPropertyDefinition> list = new List <ADPropertyDefinition>((ADPropertyDefinition[])RUSMarshal.LdapAttributesToPropertyDefinitions(RUSMarshal.SchemaInstance, array4)); List <object> list2 = new List <object>(list.Count); for (int j = 0; j < list.Count; j++) { list2.Add(RUSMarshal.UnMarshalAttribute(list[j], (object[])sortedList[list[j].LdapDisplayName])); } int k = list.Count - 1; while (k >= 0) { if (list[k] != ADRecipientSchema.WindowsEmailAddress) { goto IL_171; } SmtpAddress smtpAddress = (SmtpAddress)list2[k]; if (((SmtpAddress)list2[k]).Length <= 256) { goto IL_171; } list.RemoveAt(k); list2.RemoveAt(k); ExTraceGlobals.RecipientUpdateServiceTracer.TraceDebug <string>((long)adrecipient.GetHashCode(), "RecipientUpdateService:: A Windows Email Address exceeding 256 characters for recipient \"{0}\" is generated and discarded", adrecipient.ToString()); IL_286: k--; continue; IL_171: if (!list[k].IsMultivalued) { goto IL_286; } int num = (list2[k] == null) ? 0 : ((MultiValuedPropertyBase)list2[k]).Count; int num2 = (originalRecipient[list[k]] == null) ? 0 : ((MultiValuedPropertyBase)originalRecipient[list[k]]).Count; bool flag = num != num2; if (!flag && num != 0) { object[] array5 = (object[])RUSMarshal.MarshalAttribute(list[k], list2[k]); object[] array6 = (object[])RUSMarshal.MarshalAttribute(list[k], originalRecipient[list[k]]); for (int l = 1; l < array6.Length; l++) { if (-1 == Array.IndexOf <object>(array5, array6[l])) { flag = true; break; } } } if (!flag) { list.RemoveAt(k); list2.RemoveAt(k); ExTraceGlobals.RecipientUpdateServiceTracer.TraceDebug <string>((long)adrecipient.GetHashCode(), "RecipientUpdateService:: the value of 'msExchPoliciesIncluded' property of recipient \"{0}\" does NOT change at all.", adrecipient.ToString()); goto IL_286; } goto IL_286; } adrecipient.SetProperties(list.ToArray(), list2.ToArray()); return(adrecipient); }