Example #1
0
 public Form1(RedCircles _redCircles, ControllerForm ctrl)
 {
     InitializeComponent();
     circleDoc  = _redCircles;
     Controller = ctrl;
     FileName   = null;
     isChanged  = true;
 }
Example #2
0
        private void openToolStripMenuItem_Click(object sender, EventArgs e)
        {
            OpenFileDialog openFileDialog1 = new OpenFileDialog();

            openFileDialog1.Filter = "Red Circles file (*.rcrls)|*.rcrls";
            openFileDialog1.Title  = "Open a Red Circle File";
            if (openFileDialog1.ShowDialog() == DialogResult.OK)
            {
                FileName = openFileDialog1.FileName;
                System.Runtime.Serialization.IFormatter fmt = new
                                                              System.Runtime.Serialization.Formatters.Binary.BinaryFormatter();
                FileStream strm = new FileStream(FileName, FileMode.Open,
                                                 FileAccess.Read, FileShare.None);
                circleDoc = (RedCircles)fmt.Deserialize(strm);
                strm.Close();
            }
            Invalidate(true);
            isChanged = false;
        }
Example #3
0
 private void newToolStripMenuItem_Click(object sender, EventArgs e)
 {
     circleDoc = new RedCircles(this);
     isChanged = true;
 }
 public ControllerForm()
 {
     InitializeComponent();
     circlesDoc = new RedCircles(this);
 }