/// <summary> Build the attribuite list from an LdapEntry. /// /// </summary> /// <param name="entry">The LdapEntry associated with this add request. /// </param> private static RfcAttributeList makeRfcAttrList(LdapEntry entry) { // convert Java-API LdapEntry to RFC2251 AttributeList LdapAttributeSet attrSet = entry.getAttributeSet(); RfcAttributeList attrList = new RfcAttributeList(attrSet.Count); IEnumerator itr = attrSet.GetEnumerator(); while (itr.MoveNext()) { LdapAttribute attr = (LdapAttribute)itr.Current; Asn1SetOf vals = new Asn1SetOf(attr.size()); IEnumerator attrEnum = attr.ByteValues; while (attrEnum.MoveNext()) { vals.add(new RfcAttributeValue((sbyte[])attrEnum.Current)); } attrList.add(new RfcAttributeTypeAndValues(new RfcAttributeDescription(attr.Name), vals)); } return(attrList); }
/// <summary> /// Build the attribuite list from an LdapEntry. /// </summary> /// <param name="entry"> /// The LdapEntry associated with this add request. /// </param> private static RfcAttributeList MakeRfcAttrList(LdapEntry entry) { // convert Java-API LdapEntry to RFC2251 AttributeList var attrSet = entry.GetAttributeSet(); var attrList = new RfcAttributeList(attrSet.Count); var itr = attrSet.GetEnumerator(); while (itr.MoveNext()) { var attr = itr.Current; var vals = new Asn1SetOf(attr.Size()); var attrEnum = attr.ByteValues; while (attrEnum.MoveNext()) { vals.Add(new RfcAttributeValue(attrEnum.Current)); } attrList.Add(new RfcAttributeTypeAndValues(new RfcAttributeDescription(attr.Name), vals)); } return(attrList); }