public void SaveToXml(bool forExport) { string outFile; if (!Directory.Exists(Properties.Settings.Default.CahceDirectory + @"Temp\")) { Directory.CreateDirectory(Properties.Settings.Default.CahceDirectory + @"Temp\"); } if (!forExport) { // Try with title first cleaned for filename if (String.IsNullOrEmpty(filename) && UiTools.CleanFileName(title) != null) { filename = Properties.Settings.Default.CahceDirectory + @"Temp\" + UiTools.CleanFileName(this.title) + ".wwtxml"; } //Use a guid if the Title is only non-legal characters or is empty if (String.IsNullOrEmpty(filename)) { filename = Properties.Settings.Default.CahceDirectory + @"Temp\" + id.ToString() + ".wwtxml"; } outFile = filename; } else { outFile = TempFilename; } WriteTourXML(outFile); if (authorImage != null) { UiTools.SaveBitmap(authorImage, AuthorThumbnailFilename, System.Drawing.Imaging.ImageFormat.Png); } }