private void openFile() { OpenFileDialog openFileDialog = new OpenFileDialog(); openFileDialog.Filter = "Lines doc file (*.lin)|*.lin"; openFileDialog.Title = "Open lines file"; if (openFileDialog.ShowDialog() == DialogResult.OK) { FileName = openFileDialog.FileName; try { using (FileStream fileStream = new FileStream(FileName, FileMode.Open)) { IFormatter formater = new BinaryFormatter(); linesDoc = (LinesDoc)formater.Deserialize(fileStream); } } catch (Exception ex) { MessageBox.Show("Could not read file: " + FileName); FileName = null; return; } Invalidate(true); } }
public Form1() { InitializeComponent(); currentPoint = new Point(); dashedPen = new Pen(Color.Black, 1); dashedPen.DashStyle = System.Drawing.Drawing2D.DashStyle.Dot; solidPen = new Pen(Color.Black, 3); DoubleBuffered = true; hasPosioner = true; linesDoc = new LinesDoc(); width = 3; }
public Form1() { InitializeComponent(); currentPoint = new Point(); dashedPen = new Pen(Color.Black, 1); dashedPen.DashStyle = System.Drawing.Drawing2D.DashStyle.Dash; solidPen = new Pen(Color.Black, 3); DoubleBuffered = true; hasPosioner = true; linesDoc = new LinesDoc(); width = 3; }
private void newToolStripButton_Click(object sender, EventArgs e) { linesDoc = new LinesDoc(); Invalidate(true); }
private void newToolStripMenuItem_Click(object sender, EventArgs e) { linesDoc = new LinesDoc(); Invalidate(true); }