public void Write <TT>(TT value) { TypeBinaryDict writers = Utils.InitTypes(); writers.AddRange(BinaryRuntime.Gets()); foreach (IBinary reader in writers) { if (reader.OutputType == typeof(TT)) { var b = reader as Binary <TT>; b.OnWrite(this, value); } } }
//[DebuggerStepThrough] public TT Read <TT>() { TypeBinaryDict readers = Utils.InitTypes(); readers.AddRange(BinaryRuntime.Gets()); foreach (IBinary reader in readers) { if (reader.OutputType == typeof(TT)) { var r = reader as Binary <TT>; return(r.OnRead(this)); } } return(default(TT)); }