internal QueryResult(NetworkOperations.StringItem item, NetworkStream inputStream, NetworkStream outputStream) { this.inputStream = inputStream; this.outputStream = outputStream; text = item.Item; hasNextItem = item.HasNextItem; }
/// <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); } }