示例#1
0
        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);
        }
示例#2
0
        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);
            }
        }