Ejemplo n.º 1
0
 // Logic and events for the main application.
 //
 // Runs when the application first starts up.
 private void MainApp_Load(object sender, EventArgs e)
 {
     // Whitelisted extensions has one asterix, Blacklisted has two, list can be continued with a semicolon.
     // | for seperating lists and group names
     loadMapDialog.Filter  = "Image Extensions|*.jpg;*.png;*.jpeg;*.bmp;|Everything Else|*.*";
     loadMeshDialog.Filter = "File Extensions|*.xml|Everything Else|*.*";
     saveMeshDialog.Filter = "XML|*.xml";
     navMesh = new NavMeshIO();
 }
Ejemplo n.º 2
0
        /// <summary>
        /// Deserliases the xml file of the given filename.
        /// </summary>
        /// <param name="fileName"></param>
        private void Deserialise(string filePath)
        {
            navMesh.ClearSelected();

            Stream        stream     = File.Open(filePath, FileMode.Open);
            XmlSerializer serializer = new XmlSerializer(typeof(NavMeshIO));

            navMesh = (NavMeshIO)serializer.Deserialize(stream);
            stream.Close();

            this.Text = Path.GetFileName(filePath);
            MeshDirectoryText.Text = filePath;
        }