Exemple #1
0
 public Aircraft(string initial_file) : this()
 {
     Initial_File_Path = initial_file;
     if (m_work_File.ReadFile(Initial_File_Path))
     {
         SaveBackup(m_work_File);
         //tell everyone who cares that we have loaded a file
         OnUpdate(this, new AircraftUpdateEventArgs(AircraftUpdateEventArgs.Update_Type.File_Load, initial_file));
         Spawn_Instance(Initial_File_Path, "Primary Instance");
         PrimaryInstance.GenerateGeomImage();
     }
 }
Exemple #2
0
        /// <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));
        }