protected virtual void ReadResponse(LdapStreamReader reader, ProtocolOperation protocol) { if (reader.NextElementIs(0x30)) { int messageLength = reader.ReadElementLength(); MessageId = reader.ReadIntElement(); if (reader.NextElementIs((int)protocol)) { int contentLength = reader.ReadElementLength(); ReadResponseBody(reader); } } }
public SearchResult(LdapStreamReader reader) : base("") { int contentLength = reader.ReadElementLength(); ObjectName = reader.ReadStringElement(); Attributes = ReadAttributes(reader.GetElementReader(0x30)); }
protected override void ReadResponse(LdapStreamReader reader, ProtocolOperation protocol) { Results = new List <SearchResult> (); while (true) { if (reader.NextElementIs(0x30)) { int messageLength = reader.ReadElementLength(); MessageId = reader.ReadIntElement(); int operation = reader.ReadByte(); if (operation == (int)ProtocolOperation.SearchResultEntry) { Results.Add(new SearchResult(reader)); } else if (operation == (int)ProtocolOperation.SearchResultDone) { int contentLength = reader.ReadElementLength(); ReadResponseBody(reader); break; } } } }