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