public override void SaveFile(string sNewPath) { try { DebugUtil.Log(1, "Saving scene to path " + sNewPath); SceneGraphConfig.LastFileOpenPath = ListView.FolderPath; if (!sNewPath.EndsWith(".xml", StringComparison.InvariantCultureIgnoreCase)) { sNewPath += ".xml"; } XMLOutputStream stream = new XMLOutputStream(XmlTextWriter.Create(sNewPath, new XmlWriterSettings() { Indent = true, NewLineOnAttributes = true })); stream.Writer.WriteStartDocument(); SceneSerializer serializer = new SceneSerializer(); serializer.TargetFilePath = sNewPath; serializer.Store(stream, ActiveCockpit.Scene); stream.Writer.WriteEndDocument(); stream.Writer.Close(); ActiveCockpit.Context.PopCockpit(true); } catch (Exception e) { Debug.Log("[SaveScene] save of " + sNewPath + " failed: " + e.Message); HUDUtil.ShowCenteredPopupMessage("Save Failed", "Sorry, could not save to path " + sNewPath, ActiveCockpit); } }