public void newFile() { circles = new CircleDoc(Color.Green); fileName = null; toSave = true; currentCircle = null; onFirstClick = true; }
private void newToolStripMenuItem_Click(object sender, EventArgs e) { circles = new CircleDoc(Color.Green); currentCircle = null; onFirstClick = true; toSave = true; Invalidate(true); }
public void openFile() { OpenFileDialog openFileDialog = new OpenFileDialog(); openFileDialog.Title = "Opening circles..."; openFileDialog.Filter = "Circle file(*.cir)|*.cir"; if (openFileDialog.ShowDialog() == DialogResult.OK) { fileName = openFileDialog.FileName; IFormatter formatter = new BinaryFormatter(); FileStream fileStream = new FileStream(fileName, FileMode.Open, FileAccess.ReadWrite, FileShare.None); circles = (CircleDoc)formatter.Deserialize(fileStream); fileStream.Close(); } }