Esempio n. 1
0
 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");
     }
 }
Esempio n. 2
0
 public Form1()
 {
     InitializeComponent();
     lineDoc             = new LineDoc();
     undo                = new Stack <Line>();
     this.DoubleBuffered = true;
     mousePosition       = new Point(0, 0);
 }
Esempio n. 3
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);
 }
Esempio n. 4
0
 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();
 }
Esempio n. 5
0
 private void newToolStripMenuItem_Click(object sender, EventArgs e)
 {
     lineDoc = new LineDoc();
     undo.Clear();
 }