private void SphereToolStripMenuItem_Click(object sender, EventArgs e) { Cursor.Current = Cursors.WaitCursor; using (PleaseWaitForm pwf = new PleaseWaitForm()) { pwf.Location = new Point(this.Location.X + this.Width / 2 - pwf.Width / 2, this.Location.Y + this.Height / 2 - pwf.Height / 2); pwf.Show(); pwf.Update(); modelViewerControl.AddNewSceneEntity(new Sphere()); } Cursor.Current = Cursors.Default; }
private void LoadScene() { Cursor.Current = Cursors.WaitCursor; using (PleaseWaitForm pwf = new PleaseWaitForm()) { pwf.Location = new Point(this.Location.X + this.Width / 2 - pwf.Width / 2, this.Location.Y + this.Height / 2 - pwf.Height / 2); pwf.Show(); pwf.Update(); Stream stream = File.Open(Engine.AssociatedFile, FileMode.Open); BinaryFormatter bFormatter = new BinaryFormatter(); Engine.SceneEntities = (List<SceneEntity>)bFormatter.Deserialize(stream); stream.Close(); Engine.IsChangesUnsaved = false; } Cursor.Current = Cursors.Default; }