示例#1
0
        public async Task <T> ReadMessageContents <T>(LDAPReader messageReader, int messageId)
            where T : LDAPResponse, new()
        {
            var op = new T()
            {
                MessageId = messageId
            };
            await op.ReadContentsAsync(messageReader);

            return(op);
        }
示例#2
0
        /// <summary>
        /// Reads the individual PartialAttribute off the stream
        /// </summary>
        /// <param name="reader">The reader to read from</param>
        /// <returns>The LDAPAttribute value</returns>
        async Task <LDAPAttribute> ReadPartialAsync(LDAPReader reader)
        {
            var attr = new LDAPAttribute();

            // Read the description
            attr.Description = await reader.ReadAsStringAsync();

            attr.Values = new List <string>();

            // Read the values
            await reader.GuardAsync((int)EncodingType.SET);

            var valReader = reader.CreateReader();

            while (await valReader.ReadAsync())
            {
                attr.Values.Add(await valReader.ReadAsStringAsync());
            }

            return(attr);
        }