private void open() { if (unsaved) { if (MessageBox.Show("Unsaved changes will be lost.\n\n" + "Do you want to save these changes?", "Unsaved Changes", MessageBoxButtons.YesNo, MessageBoxIcon.Warning) == DialogResult.Yes) save(); } if (openDialog.ShowDialog() == DialogResult.OK) { currentFile = openDialog.FileName; AnimationXMLSerializer aniXML = new AnimationXMLSerializer( modelView.Scene.Model, null); aniXML.Deserialize(File.ReadAllText(openDialog.FileName)); string animationName = Path.GetFileName(currentFile); this.Text = title + " - " + animationName; //Update the modelTreeView this.modelTreeView.Model = this.modelView.Scene.Model; //Update properties this.propsControl.Model = this.modelView.Scene.Model; //Update timeline this.timeline.Model = this.modelView.Scene.Model; modelView.Invalidate(); } }