示例#1
0
 internal void Serialize(object source)
 {
     if (this.firstCall)
     {
         this.firstCall = false;
         this.Start();
     }
     this._serializer = new CustomInternalSerializer(this._writer, this._notypeinformation, true);
     this._serializer.WriteOneObject(source, null, this._depth);
     this._serializer = null;
 }
示例#2
0
 /// <summary>
 /// Constructor
 /// </summary>
 /// <param name="writer">
 /// writer to be used for serialization.
 /// </param>
 /// <param name="notypeinformation">
 /// should the type information to be shown.
 /// </param>
 /// <param name="depth">
 /// depth to be used for serialization. If this value is specified, 
 /// depth from types.xml is not used.
 /// </param>
 internal CustomSerialization(XmlWriter writer, bool notypeinformation, int depth)
 {
     if (writer == null)
     {
         throw PSTraceSource.NewArgumentException("writer");
     }
     if (depth < 1)
     {
         throw PSTraceSource.NewArgumentException("writer", Serialization.DepthOfOneRequired);
     }
     _depth = depth;
     _writer = writer;
     _notypeinformation = notypeinformation;
     _serializer = null;
 }
示例#3
0
 internal CustomSerialization(XmlWriter writer, bool notypeinformation, int depth)
 {
     this.firstCall = true;
     if (writer == null)
     {
         throw PSTraceSource.NewArgumentException("writer");
     }
     if (depth < 1)
     {
         throw PSTraceSource.NewArgumentException("writer", "serialization", "DepthOfOneRequired", new object[0]);
     }
     this._depth = depth;
     this._writer = writer;
     this._notypeinformation = notypeinformation;
     this._serializer = null;
 }
示例#4
0
 internal void SerializeAsStream(object source)
 {
     this._serializer = new CustomInternalSerializer(this._writer, this._notypeinformation, true);
     this._serializer.WriteOneObject(source, null, this._depth);
     this._serializer = null;
 }
示例#5
0
        /// <summary>
        /// Serializes passed in object
        /// </summary>
        /// <param name="source">
        /// object to be serialized
        /// </param>
        internal void Serialize(object source)
        {
            //Write the root element tag before writing first object.
            if (_firstCall)
            {
                _firstCall = false;
                Start();
            }

            _serializer = new CustomInternalSerializer
                               (
                                   _writer,
                                   _notypeinformation,
                                   true
                                );
            _serializer.WriteOneObject(source, null, _depth);
            _serializer = null;
        }