예제 #1
0
 internal QueryResult(NetworkOperations.StringItem item, NetworkStream inputStream, NetworkStream outputStream)
 {
     this.inputStream  = inputStream;
     this.outputStream = outputStream;
     text        = item.Item;
     hasNextItem = item.HasNextItem;
 }
예제 #2
0
        /// <summary>
        /// Retrieves the next part of the result.
        /// </summary>
        /// <returns></returns>
        public string Next()
        {
            if (!hasNextItem)
            {
                return(null);
            }

            NetworkOperations.Message msg = new NetworkOperations.Message();
            msg.Instruction = InstructionCode.GetNextItem;
            NetworkOperations.WriteMessage(msg, outputStream);

            NetworkOperations.StringItem item = NetworkOperations.ReadStringItem(inputStream);
            if (item.Item == null)
            {
                hasNextItem = false;
                return(null);
            }
            else
            {
                text += item.Item;
                return(item.Item);
            }
        }