private void SaveBackup(AVL_File afile) { FileInfo finfo = new FileInfo(Initial_File_Path); if (finfo.Exists) { string fileName = finfo.Name; m_backup_location = finfo.DirectoryName + "\\" + fileName + ".bak"; afile.WriteFile(m_backup_location); } }
/// <summary> /// Save the AVL file that represents this aircraft to the specified filepath. This will create a new file /// if one does not exist with the specified name, otherwise overwrites. The newly saved file then becomes the /// primary file for this Aircraft. /// </summary> /// <param name="filepath"></param> public void SaveFile(string filepath) { foreach (AVL_Instance inst in this.instances) { inst.Close(); } this.instances.Clear(); m_work_File.WriteFile(filepath); this.Initial_File_Path = filepath; Spawn_Instance(filepath, "Primary Instance"); PrimaryInstance.GenerateGeomImage(); OnUpdate(this, new AircraftUpdateEventArgs(AircraftUpdateEventArgs.Update_Type.File_Save, null)); }