public static void Write(string filename, CameraPlan plan) { using (FileStream fs = new FileStream(filename, FileMode.Create)) { xs.Serialize(fs, plan); } }
public static string WriteToXml(this CameraPlan plan) { using (StringWriter stream = new StringWriter()) { xs.Serialize(stream, plan); stream.Flush(); return(stream.ToString()); } }
public static CameraPlan Parse(string filename) { CameraPlan plan = null; using (FileStream fs = new FileStream(filename, FileMode.Open)) { plan = (CameraPlan)xs.Deserialize(fs); } return(plan); }
public static void Write(this CameraPlan plan, string filePath) { Write(filePath, plan); }
public static void Write(this CameraPlan plan, Stream stream) { xs.Serialize(stream, plan); }