コード例 #1
0
 public Form1(RedCircles _redCircles, ControllerForm ctrl)
 {
     InitializeComponent();
     circleDoc  = _redCircles;
     Controller = ctrl;
     FileName   = null;
     isChanged  = true;
 }
コード例 #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;
        }
コード例 #3
0
 private void newToolStripMenuItem_Click(object sender, EventArgs e)
 {
     circleDoc = new RedCircles(this);
     isChanged = true;
 }
コード例 #4
0
 public ControllerForm()
 {
     InitializeComponent();
     circlesDoc = new RedCircles(this);
 }