Exemplo n.º 1
0
 /// <summary>
 /// Saves XML document as XML file to specified location.
 /// </summary>
 /// <param name="snapshotXmlDoc">XML snapshot document.</param>
 /// <param name="path">Save path.</param>
 public static void SaveSnapshotsDocWithSpecificLocation(SerializeSnapshot snapshotXmlDoc, string path)
 {
     if (snapshotXmlDoc == null)
     {
         throw new ArgumentNullException("Parameter 'snapshotXmlDoc' may not be null.");
     }
     snapshotXmlDoc.SaveXmlFile(path);
 }
Exemplo n.º 2
0
        /// <summary>
        /// Saves XML document as XML file.
        /// </summary>
        /// <returns>Path to the saved Snapshot</returns>
        public static string SaveSnapshotsDoc(SerializeSnapshot snapshotXmlDoc, bool toTempFile = true)
        {
            if (snapshotXmlDoc == null)
            {
                throw new ArgumentNullException("Parameter 'snapshotXmlDoc' may not be null.");
            }

            string snapShotFilePath;

            if (toTempFile)
            {
                snapShotFilePath = "./snapshots/TemporarySnapshot.xml";
            }
            else
            {
                snapShotFilePath = string.Format("./snapshots/SnapshotFile-{0}.xml", DateTime.Now.ToString("yyyyMMdd-HHmmssffff"));
            }
            snapshotXmlDoc.SaveXmlFile(snapShotFilePath);
            return(snapShotFilePath);
        }