private void buttonSave_Click(object sender, System.EventArgs e) { // Create a persistence engine. SharpGL.Persistence.PersistenceEngine engine = new SharpGL.Persistence.PersistenceEngine(); // Save the polygon. engine.UserSave(BuildingPolygon); }
private void buttonLoad_Click_1(object sender, EventArgs e) { // Create a Persistence Engine. SharpGL.Persistence.PersistenceEngine engine = new SharpGL.Persistence.PersistenceEngine(); // Create a a set of polygons. PolygonCollection loaded = (PolygonCollection)engine.UserLoad(typeof(PolygonCollection)); // If we successfully loaded, set the collection. if (loaded != null) { polygons = loaded; foreach(Polygon polygon in loaded) polygon.Attributes.PolygonDrawMode = SharpGL.SceneGraph.Attributes.Polygon.PolygonMode.Lines; } }
private void buttonLoad_Click_1(object sender, EventArgs e) { // Create a Persistence Engine. SharpGL.Persistence.PersistenceEngine engine = new SharpGL.Persistence.PersistenceEngine(); // Create a a set of polygons. PolygonCollection loaded = (PolygonCollection)engine.UserLoad(typeof(PolygonCollection)); // If we successfully loaded, set the collection. if (loaded != null) { polygons = loaded; foreach (Polygon polygon in loaded) { polygon.Attributes.PolygonDrawMode = SharpGL.SceneGraph.Attributes.Polygon.PolygonMode.Lines; } } }
private void buttonLoad_Click(object sender, System.EventArgs e) { // Create a persistence engine. SharpGL.Persistence.PersistenceEngine engine = new SharpGL.Persistence.PersistenceEngine(); // Load the polygon. object data = engine.UserLoad(typeof(Polygon)); if (data != null) { // Set the new polygon. BuildingPolygon = (Polygon)data; // Remove the old one. openGLCtrlPolybuild.Scene.Polygons.Clear(); openGLCtrlPolybuild.Scene.Polygons.Add(polygon); // Update the controls. PopulateControls(); } }
private void buttonLoad_Click(object sender, System.EventArgs e) { // Create a persistence engine. SharpGL.Persistence.PersistenceEngine engine = new SharpGL.Persistence.PersistenceEngine(); // Load the polygon. object data = engine.UserLoad(typeof(Polygon)); if(data != null) { // Set the new polygon. BuildingPolygon = (Polygon)data; // Remove the old one. openGLCtrlPolybuild.Scene.Polygons.Clear(); openGLCtrlPolybuild.Scene.Polygons.Add(polygon); // Update the controls. PopulateControls(); } }