Exemplo n.º 1
0
 public Form1()
 {
     InitializeComponent();
     doc = new HalfCircleDoc();
     //timer1.Start();
     Start          = false;
     DoubleBuffered = true;
 }
Exemplo n.º 2
0
        private void openToolStripMenuItem_Click(object sender, EventArgs e)
        {
            OpenFileDialog dialog = new OpenFileDialog();

            dialog.Filter = "Open your file *.hcc | *.hcc";
            dialog.Title  = "Open your file";

            if (dialog.ShowDialog() == DialogResult.OK)
            {
                FileName = dialog.FileName;

                try
                {
                    FileStream fs = new FileStream(FileName, FileMode.Open);
                    IFormatter fi = new BinaryFormatter();
                    doc = (HalfCircleDoc)fi.Deserialize(fs);
                }
                catch
                {
                    throw new Exception("Invalid");
                }
            }
        }