public void ToCxml(string filePath) { using (StreamWriter writer = File.CreateText(filePath)) { CxmlSerializer.Serialize(writer.BaseStream, this); } }
/// <summary> /// Write a collection object as CXML into the given stream. /// </summary> /// <param name="outputStream">The output stream.</param> /// <param name="collection">The collection.</param> public static void Serialize(Stream outputStream, Collection collection) { CxmlSerializer s = new CxmlSerializer(collection); using (XmlWriter writer = XmlWriter.Create(outputStream)) { s.Write(writer); } }
public void ProcessRequest(HttpContext context) { string src = context.Request.QueryString["src"]; //Build the collection in response to any query parameters. //Collection collection = FileExplorerCollection.MakeCollection(src); Collection collection = ODataCollectionSource.MakeOdataCollection(src); string cacheKey = Guid.NewGuid().ToString("N") + ".dzc"; collection.ImgBaseName = cacheKey; context.Cache[cacheKey] = collection; context.Cache.Add(cacheKey, collection, null, DateTime.MaxValue, new TimeSpan(1, 0, 0), CacheItemPriority.High, null); context.Response.ContentType = "text/xml"; CxmlSerializer.Serialize(context.Response.Output, collection); }
/// <summary> /// Write a collection object as CXML into an XmlWriter. /// </summary> /// <param name="outputWriter">The output writer.</param> /// <param name="collection">The collection.</param> public static void Serialize(XmlWriter outputWriter, Collection collection) { CxmlSerializer s = new CxmlSerializer(collection); s.Write(outputWriter); }
public void ToCxml(TextWriter textWriter) { CxmlSerializer.Serialize(textWriter, this); }
public string ToCxml() { return(CxmlSerializer.Serialize(this)); }