Beispiel #1
0
        protected override void DoWrite(object obj, Hessian2Writer writer)
        {
            writer.WriteListStart(-1, null);
            var enumerator = (IEnumerator)obj;

            while (enumerator.MoveNext())
            {
                writer.WriteObject(enumerator.Current);
            }
            writer.WriteListEnd();
        }
        protected override void DoWrite(object obj, Hessian2Writer writer)
        {
            var hasEnd = WriteListBegin(obj, writer);
            var items  = (IEnumerable)obj;

            foreach (var item in items)
            {
                writer.WriteObject(item);
            }
            if (hasEnd)
            {
                writer.WriteListEnd();
            }
        }