System.Xml.Serialization.XmlSerializationWriter.Init C# (CSharp) Method

Init() private method

private Init ( XmlWriter w, XmlSerializerNamespaces namespaces, string encodingStyle, string idBase ) : void
w XmlWriter
namespaces XmlSerializerNamespaces
encodingStyle string
idBase string
return void
        internal void Init(XmlWriter w, XmlSerializerNamespaces namespaces, string encodingStyle, string idBase)
        {
            _w = w;
            _namespaces = namespaces;
        }

Same methods

XmlSerializationWriter::Init ( XmlWriter w, XmlSerializerNamespaces namespaces, string encodingStyle, string idBase, TempAssembly tempAssembly ) : void

Usage Example

Example #1
0
 /// <include file='doc\XmlSerializer.uex' path='docs/doc[@for="XmlSerializer.Serialize6"]/*' />
 internal void Serialize(XmlWriter xmlWriter, object o, XmlSerializerNamespaces namespaces, string encodingStyle, string id)
 {
     try
     {
         if (_primitiveType != null)
         {
             SerializePrimitive(xmlWriter, o, namespaces);
         }
         else if (_tempAssembly == null || _typedSerializer)
         {
             XmlSerializationWriter writer = CreateWriter();
             writer.Init(xmlWriter, namespaces == null || namespaces.Count == 0 ? DefaultNamespaces : namespaces, encodingStyle, id, _tempAssembly);
             try
             {
                 Serialize(o, writer);
             }
             finally
             {
                 writer.Dispose();
             }
         }
         else
         {
             _tempAssembly.InvokeWriter(_mapping, xmlWriter, o, namespaces == null || namespaces.Count == 0 ? DefaultNamespaces : namespaces, encodingStyle, id);
         }
     }
     catch (Exception e)
     {
         if (e is TargetInvocationException)
         {
             e = e.InnerException;
         }
         throw new InvalidOperationException(SR.XmlGenError, e);
     }
     xmlWriter.Flush();
 }
All Usage Examples Of System.Xml.Serialization.XmlSerializationWriter::Init