System.ZXParser.Write C# (CSharp) Method

Write() public static method

public static Write ( StreamWriter writer, object o, ZXPProxy zpp, int spaces ) : void
writer System.IO.StreamWriter
o object
zpp ZXPProxy
spaces int
return void
        public static void Write(StreamWriter writer, object o, ZXPProxy zpp, int spaces = 0)
        {
            foreach(var f in zpp.Data) {
                object value = f.GetValue(o);
                if(f.Converter == null) {
                    if(value == null) writer.WriteLine("{2}{0} <{1}> {{ NULL }}", f.Key, f.Type.FullName, new string(' ', spaces));
                    else {
                        Type vType = value.GetType();
                        writer.WriteLine("{2}{0} <{1}> {{", f.Key, vType.FullName, new string(' ', spaces));
                        Write(writer, value, ZXPProxy.GetProxy(vType), spaces + 4);
                        writer.WriteLine("{0}", new string(' ', spaces) + "}");
                    }
                }
                else writer.WriteLine("{2}{0} [{1}]", f.Key, f.Converter.Convert(value), new string(' ', spaces));
            }
        }

Same methods

ZXParser::Write ( Stream s, object o ) : void
ZXParser::Write ( Stream s, object o, ZXPProxy zpp, int spaces ) : void
ZXParser::Write ( StreamWriter writer, object o ) : void