public override void Save(StreamContext outputTarget, object value) { if (value == null) { throw new ArgumentNullException("value"); } string text = value.ToString(); TextWriter writer = outputTarget.AppendText(); writer.Write(text); }
public override void Save(StreamContext outputTarget, object value) { if (outputTarget == null) { throw new ArgumentNullException("outputTarget"); } if (value == null) { throw new ArgumentNullException("value"); } using (StreamWriter sw = outputTarget.AppendText(Encoding)) { Save(sw, value); } }