public static NavigatorPlace Load(string filename) { NavigatorPlace place = null; using (Stream fileStream = File.Open(filename, FileMode.Open, FileAccess.Read, FileShare.ReadWrite)) { BinaryFormatter bf = new BinaryFormatter(); place = (NavigatorPlace)bf.Deserialize(fileStream); } return(place); }
private void btnLoadProject_Click(object sender, EventArgs e) { OpenFileDialog dlg = new OpenFileDialog(); if (dlg.ShowDialog() == DialogResult.OK) { currentPlace = LoadSave.Load(dlg.FileName); imagePath = Path.GetDirectoryName(dlg.FileName) + "\\images"; currentPath = currentPlace.Paths[0]; currentPoint = currentPath.Points[0]; currentAngle = 0; LoadImage(); } }