private void openFile()
        {
            OpenFileDialog openFileDialog = new OpenFileDialog();

            openFileDialog.Filter = "Circles doc file (*.plc)|*.plc";
            openFileDialog.Title  = "Open circles doc file";
            if (openFileDialog.ShowDialog() == DialogResult.OK)
            {
                FileName = openFileDialog.FileName;
                try
                {
                    using (FileStream fileStream = new FileStream(FileName, FileMode.Open))
                    {
                        IFormatter formater = new BinaryFormatter();
                        CircleDoc = (CircleDoc)formater.Deserialize(fileStream);
                    }
                }
                catch (Exception ex)
                {
                    MessageBox.Show("Could not read file: " + FileName);
                    FileName = null;
                    return;
                }
                Invalidate(true);
            }
        }
Beispiel #2
0
 public Form1()
 {
     InitializeComponent();
     CircleDoc = new CircleDoc();
     Color = Color.Red;
     DoubleBuffered = true;
     timer = new Timer();
     timer.Interval = 100;
     timer.Tick += new EventHandler(timer_Tick);
     isStarted = false;
 }
 public Form1()
 {
     InitializeComponent();
     CircleDoc      = new CircleDoc();
     Color          = Color.Red;
     DoubleBuffered = true;
     timer          = new Timer();
     timer.Interval = 500;
     timer.Tick    += new EventHandler(timer_Tick);
     isStarted      = false;
 }
 private void newToolStripButton_Click(object sender, EventArgs e)
 {
     CircleDoc = new CircleDoc();
 }
 private void newToolStripMenuItem_Click(object sender, EventArgs e)
 {
     CircleDoc = new CircleDoc();
 }
Beispiel #6
0
 private void openFile()
 {
     OpenFileDialog openFileDialog = new OpenFileDialog();
     openFileDialog.Filter = "Circles doc file (*.plc)|*.plc";
     openFileDialog.Title = "Open circles doc file";
     if (openFileDialog.ShowDialog() == DialogResult.OK)
     {
         FileName = openFileDialog.FileName;
         try
         {
             using (FileStream fileStream = new FileStream(FileName, FileMode.Open))
             {
                 IFormatter formater = new BinaryFormatter();
                 CircleDoc = (CircleDoc)formater.Deserialize(fileStream);
             }
         }
         catch (Exception ex)
         {
             MessageBox.Show("Could not read file: " + FileName);
             FileName = null;
             return;
         }
         Invalidate(true);
     }
 }
Beispiel #7
0
 private void newToolStripMenuItem_Click(object sender, EventArgs e)
 {
     CircleDoc = new CircleDoc();
 }
Beispiel #8
0
 private void newToolStripButton_Click(object sender, EventArgs e)
 {
     CircleDoc = new CircleDoc();
 }