예제 #1
0
파일: Form1.cs 프로젝트: AtanasK/VP
 public Form1()
 {
     InitializeComponent();
     BallDoc = new BallDoc();
     currentColor = Color.Red;
     DoubleBuffered = true;
     timer1.Start();
 }
예제 #2
0
파일: Form1.cs 프로젝트: AtanasK/VP
 private void openFile()
 {
     OpenFileDialog openFileDialog = new OpenFileDialog();
     openFileDialog.Filter = "Balls doc file (*.bll)|*.bll";
     openFileDialog.Title = "Open balls doc file";
     if (openFileDialog.ShowDialog() == DialogResult.OK)
     {
         FileName = openFileDialog.FileName;
         try
         {
             using (FileStream fileStream = new FileStream(FileName, FileMode.Open))
             {
                 IFormatter formater = new BinaryFormatter();
                 BallDoc = (BallDoc)formater.Deserialize(fileStream);
             }
         }
         catch (Exception ex)
         {
             MessageBox.Show("Could not read file: " + FileName);
             FileName = null;
             return;
         }
         Invalidate(true);
     }
 }
예제 #3
0
파일: Form1.cs 프로젝트: AtanasK/VP
 private void newToolStripMenuItem_Click(object sender, EventArgs e)
 {
     BallDoc = new BallDoc();
     Invalidate(true);
 }