private void openToolStripMenuItem_Click(object sender, EventArgs e) { if (FileName == null) { OpenFileDialog sfd = new OpenFileDialog(); sfd.Title = "Open your file"; sfd.Filter = "Lines document | *.ld"; if (sfd.ShowDialog() == DialogResult.OK) { FileName = sfd.FileName; } } try { using (FileStream stream = new FileStream(FileName, FileMode.Open)) { var formater = new BinaryFormatter(); lineDoc = (LineDoc)formater.Deserialize(stream); FileName = null; } } catch (Exception ex) { MessageBox.Show("error saving"); } }
public Form1() { InitializeComponent(); lineDoc = new LineDoc(); undo = new Stack <Line>(); this.DoubleBuffered = true; mousePosition = new Point(0, 0); }
public Form1() { InitializeComponent(); lines = new LineDoc(); // prva = new Point(); //vtora = new Point(); kliknanaPrva = false; this.DoubleBuffered = true; ks = new KordinatenSistem(this.Width, this.Height); }
public Form1() { undoStack = new Stack <Line>(); redoStack = new Stack <Line>(); hasPosionate = true; width = MEDIUM; lineDoc = new LineDoc(); InitializeComponent(); DoubleBuffered = true; dashPen = new Pen(Color.Gray, 1); lastPointed = new Point(); }
private void newToolStripMenuItem_Click(object sender, EventArgs e) { lineDoc = new LineDoc(); undo.Clear(); }