/// <summary> /// Creates a SearchResultReference. For LDAP v3 only. /// </summary> /// <param name="context">The user context which contains message ID.</param> /// <param name="referenceUrls">The referenced URL.</param> /// <returns>The packet that contains the response.</returns> internal override AdtsSearchResultReferencePacket CreateSearchResultReference( AdtsLdapContext context, string[] referenceUrls) { int length = (referenceUrls != null) ? referenceUrls.Length : 0; LDAPURL[] ldapUrlArray = new LDAPURL[length]; for (int i = 0; i < length; i++) { ldapUrlArray[i] = new LDAPURL(referenceUrls[i]); } SearchResultReference reference = new SearchResultReference(ldapUrlArray); LDAPMessage_protocolOp operation = new LDAPMessage_protocolOp(); operation.SetData(LDAPMessage_protocolOp.searchResRef, reference); LDAPMessage message = new LDAPMessage(new MessageID(context.MessageId), operation, null); AdtsSearchResultReferencePacket packet = new AdtsSearchResultReferencePacket(); packet.ldapMessagev3 = message; packet.messageId = context.MessageId; return packet; }
private SearchResultReferenceCollection ReferenceHelper() { SearchResultReferenceCollection searchResultReferenceCollection = new SearchResultReferenceCollection(); XmlNodeList xmlNodeLists = this.dsmlNode.SelectNodes("dsml:searchResultReference", this.dsmlNS); if (xmlNodeLists.Count != 0) { foreach (XmlNode xmlNodes in xmlNodeLists) { SearchResultReference searchResultReference = new SearchResultReference((XmlElement)xmlNodes); searchResultReferenceCollection.Add(searchResultReference); } } return(searchResultReferenceCollection); }
private SearchResultReferenceCollection ReferenceHelper() { SearchResultReferenceCollection references = new SearchResultReferenceCollection(); XmlNodeList list = base.dsmlNode.SelectNodes("dsml:searchResultReference", base.dsmlNS); if (list.Count != 0) { foreach (XmlNode node in list) { SearchResultReference reference = new SearchResultReference((XmlElement)node); references.Add(reference); } } return(references); }
private SearchResultReferenceCollection ReferenceHelper() { SearchResultReferenceCollection refCollection = new SearchResultReferenceCollection(); // Get the set of control nodes XmlNodeList nodeList = dsmlNode.SelectNodes("dsml:searchResultReference", dsmlNS); if (nodeList.Count != 0) { foreach (XmlNode node in nodeList) { Debug.Assert(node is XmlElement); SearchResultReference attribute = new SearchResultReference((XmlElement)node); refCollection.Add(attribute); } } return(refCollection); }
public bool Contains(SearchResultReference value) { return(InnerList.Contains(value)); }
internal int Add(SearchResultReference reference) { return(InnerList.Add(reference)); }
public int IndexOf(SearchResultReference value) { return base.InnerList.IndexOf(value); }
public void CopyTo(SearchResultReference[] values, int index) { base.InnerList.CopyTo(values, index); }
public bool Contains(SearchResultReference value) { return base.InnerList.Contains(value); }
internal int Add(SearchResultReference reference) { return base.InnerList.Add(reference); }
private SearchResultReferenceCollection ReferenceHelper() { SearchResultReferenceCollection refCollection = new SearchResultReferenceCollection(); // Get the set of control nodes XmlNodeList nodeList = dsmlNode.SelectNodes("dsml:searchResultReference", dsmlNS); if (nodeList.Count != 0) { foreach (XmlNode node in nodeList) { Debug.Assert(node is XmlElement); SearchResultReference attribute = new SearchResultReference((XmlElement)node); refCollection.Add(attribute); } } return refCollection; }
public void CopyTo (SearchResultReference [] values, int index) { list.CopyTo (values, index); }
public bool Contains (SearchResultReference value) { return list.Contains (value); }
internal SearchResultReference ConstructReference(IntPtr referenceMessage) { SearchResultReference searchResultReference = null; ArrayList arrayLists = new ArrayList(); IntPtr intPtr = (IntPtr)0; int num = Wldap32.ldap_parse_reference(this.ldapHandle, referenceMessage, ref intPtr); try { if (num == 0) { int num1 = 0; if (intPtr != (IntPtr)0) { for (IntPtr i = Marshal.ReadIntPtr(intPtr, Marshal.SizeOf(typeof(IntPtr)) * num1); i != (IntPtr)0; i = Marshal.ReadIntPtr(intPtr, Marshal.SizeOf(typeof(IntPtr)) * num1)) { string stringUni = Marshal.PtrToStringUni(i); arrayLists.Add(stringUni); num1++; } Wldap32.ldap_value_free(intPtr); intPtr = (IntPtr)0; } if (arrayLists.Count > 0) { Uri[] uri = new Uri[arrayLists.Count]; for (int j = 0; j < arrayLists.Count; j++) { uri[j] = new Uri((string)arrayLists[j]); } searchResultReference = new SearchResultReference(uri); } } } finally { if (intPtr != (IntPtr)0) { Wldap32.ldap_value_free(intPtr); } } return searchResultReference; }
private SearchResultReferenceCollection ReferenceHelper() { SearchResultReferenceCollection searchResultReferenceCollection = new SearchResultReferenceCollection(); XmlNodeList xmlNodeLists = this.dsmlNode.SelectNodes("dsml:searchResultReference", this.dsmlNS); if (xmlNodeLists.Count != 0) { foreach (XmlNode xmlNodes in xmlNodeLists) { SearchResultReference searchResultReference = new SearchResultReference((XmlElement)xmlNodes); searchResultReferenceCollection.Add(searchResultReference); } } return searchResultReferenceCollection; }
public int IndexOf(SearchResultReference value) { return(InnerList.IndexOf(value)); }
internal SearchResultReference ConstructReference(IntPtr referenceMessage) { SearchResultReference reference = null; ArrayList referralList = new ArrayList(); Uri[] uris = null; IntPtr referenceArray = (IntPtr)0; int error = Wldap32.ldap_parse_reference(ldapHandle, referenceMessage, ref referenceArray); try { if (error == 0) { IntPtr tempPtr = (IntPtr)0; int count = 0; if (referenceArray != (IntPtr)0) { tempPtr = Marshal.ReadIntPtr(referenceArray, Marshal.SizeOf(typeof(IntPtr)) * count); while (tempPtr != (IntPtr)0) { string s = Marshal.PtrToStringUni(tempPtr); referralList.Add(s); count++; tempPtr = Marshal.ReadIntPtr(referenceArray, Marshal.SizeOf(typeof(IntPtr)) * count); } Wldap32.ldap_value_free(referenceArray); referenceArray = (IntPtr)0; } if (referralList.Count > 0) { uris = new Uri[referralList.Count]; for (int i = 0; i < referralList.Count; i++) { uris[i] = new Uri((string)referralList[i]); } reference = new SearchResultReference(uris); } } } finally { if (referenceArray != (IntPtr)0) Wldap32.ldap_value_free(referenceArray); } return reference; }
public int IndexOf (SearchResultReference value) { return list.IndexOf (value); }
internal SearchResultReference ConstructReference(IntPtr referenceMessage) { SearchResultReference reference = null; ArrayList list = new ArrayList(); Uri[] uris = null; IntPtr zero = IntPtr.Zero; int num = Wldap32.ldap_parse_reference(this.ldapHandle, referenceMessage, ref zero); try { if (num != 0) { return reference; } IntPtr ptr = IntPtr.Zero; int num2 = 0; if (zero != IntPtr.Zero) { for (ptr = Marshal.ReadIntPtr(zero, Marshal.SizeOf(typeof(IntPtr)) * num2); ptr != IntPtr.Zero; ptr = Marshal.ReadIntPtr(zero, Marshal.SizeOf(typeof(IntPtr)) * num2)) { string str = Marshal.PtrToStringUni(ptr); list.Add(str); num2++; } Wldap32.ldap_value_free(zero); zero = IntPtr.Zero; } if (list.Count <= 0) { return reference; } uris = new Uri[list.Count]; for (int i = 0; i < list.Count; i++) { uris[i] = new Uri((string) list[i]); } reference = new SearchResultReference(uris); } finally { if (zero != IntPtr.Zero) { Wldap32.ldap_value_free(zero); } } return reference; }