Пример #1
0
        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);
        }
Пример #2
0
        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();
            }
        }