/// <summary> /// Backups the XML file, if the ServiceApps are different /// </summary> /// <param name="compare1">The compare1.</param> /// <param name="compare2">The compare2.</param> /// <returns></returns> private bool TryBackupXmlFile(ServiceApp compare1, ServiceApp compare2) { if (compare1 == null || compare2 == null || !compare1.Equals(compare2)) { // if different, create backup of xml file if (this._isLoadFromFile) { string original = Path.GetFullPath(ApplicationSettings.Current.AppListLocation); string backupFile = string.Format( "{0} {1}{2}", Path.Combine(Path.GetDirectoryName(original), Path.GetFileNameWithoutExtension(original)), DateTime.Now.ToString("yyyyMMdd HHmm"), Path.GetExtension(original)); this.AppListDoc.Save(Path.GetFullPath(backupFile)); } return(true); } return(false); }