public void ToCxml(string filePath) { using (StreamWriter writer = File.CreateText(filePath)) { CxmlSerializer.Serialize(writer.BaseStream, this); } }
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); }
public void ToCxml(TextWriter textWriter) { CxmlSerializer.Serialize(textWriter, this); }
public string ToCxml() { return(CxmlSerializer.Serialize(this)); }