public static void Save(object obj, XamlDesignerSerializationManager manager) { SecurityHelper.DemandUnmanagedCode(); if (obj == null) { throw new ArgumentNullException("obj"); } if (manager == null) { throw new ArgumentNullException("manager"); } MarkupWriter.SaveAsXml(manager.XmlWriter, obj, manager); }
/// <summary> /// Save writes the xml respresentation /// for the given object instance using the /// given XmlTextWriter embedded in the manager. /// </summary> /// <param name="obj"> /// Object instance /// </param> /// <param name="manager"> /// Serialization Manager /// </param> /// <remarks> /// This API requires unmanaged code permission /// </remarks> public static void Save(object obj, XamlDesignerSerializationManager manager) { // Validate input arguments if (obj == null) { throw new ArgumentNullException("obj"); } if (manager == null) { throw new ArgumentNullException("manager"); } MarkupWriter.SaveAsXml(manager.XmlWriter, obj, manager); }
public static void Save(object obj, Stream stream) { SecurityHelper.DemandUnmanagedCode(); if (obj == null) { throw new ArgumentNullException("obj"); } if (stream == null) { throw new ArgumentNullException("stream"); } XmlTextWriter writer = new XmlTextWriter(stream, null); MarkupWriter.SaveAsXml(writer, obj); }
public static void Save(object obj, TextWriter writer) { SecurityHelper.DemandUnmanagedCode(); if (obj == null) { throw new ArgumentNullException("obj"); } if (writer == null) { throw new ArgumentNullException("writer"); } XmlTextWriter writer2 = new XmlTextWriter(writer); MarkupWriter.SaveAsXml(writer2, obj); }
/// <summary> /// Save writes the xml respresentation /// for the given object instance using the given writer /// </summary> /// <param name="obj"> /// Object instance /// </param> /// <param name="writer"> /// Text Writer /// </param> /// <remarks> /// This API requires unmanaged code permission /// </remarks> public static void Save(object obj, TextWriter writer) { // Validate input arguments if (obj == null) { throw new ArgumentNullException("obj"); } if (writer == null) { throw new ArgumentNullException("writer"); } // Create XmlTextWriter XmlTextWriter xmlWriter = new XmlTextWriter(writer); MarkupWriter.SaveAsXml(xmlWriter, obj); }
/// <summary> /// Save writes the xml respresentation /// for the given object instance to the given stream /// </summary> /// <param name="obj"> /// Object instance /// </param> /// <param name="stream"> /// Stream /// </param> /// <remarks> /// This API requires unmanaged code permission /// </remarks> public static void Save(object obj, Stream stream) { // Validate input arguments if (obj == null) { throw new ArgumentNullException("obj"); } if (stream == null) { throw new ArgumentNullException("stream"); } // Create XmlTextWriter XmlTextWriter xmlWriter = new XmlTextWriter(stream, null); MarkupWriter.SaveAsXml(xmlWriter, obj); }
/// <summary> /// Save writes the xml respresentation /// for the given object instance using the given writer /// </summary> /// <param name="obj"> /// Object instance /// </param> /// <param name="writer"> /// Text Writer /// </param> /// <remarks> /// This API requires unmanaged code permission /// </remarks> public static void Save(object obj, TextWriter writer) { // Must be in full trust SecurityHelper.DemandUnmanagedCode(); // Validate input arguments if (obj == null) { throw new ArgumentNullException("obj"); } if (writer == null) { throw new ArgumentNullException("writer"); } // Create XmlTextWriter XmlTextWriter xmlWriter = new XmlTextWriter(writer); MarkupWriter.SaveAsXml(xmlWriter, obj); }
public static void Save(object obj, XmlWriter xmlWriter) { SecurityHelper.DemandUnmanagedCode(); if (obj == null) { throw new ArgumentNullException("obj"); } if (xmlWriter == null) { throw new ArgumentNullException("xmlWriter"); } try { MarkupWriter.SaveAsXml(xmlWriter, obj); } finally { xmlWriter.Flush(); } }
/// <summary> /// Save writes the xml respresentation /// for the given object instance using the given /// writer. In addition it also allows the designer /// to participate in this conversion. /// </summary> /// <param name="obj"> /// Object instance /// </param> /// <param name="xmlWriter"> /// XmlWriter /// </param> /// <remarks> /// This API requires unmanaged code permission /// </remarks> public static void Save(object obj, XmlWriter xmlWriter) { // Validate input arguments if (obj == null) { throw new ArgumentNullException("obj"); } if (xmlWriter == null) { throw new ArgumentNullException("xmlWriter"); } try { MarkupWriter.SaveAsXml(xmlWriter, obj); } finally { xmlWriter.Flush(); } }