예제 #1
0
        private void openFile()
        {
            OpenFileDialog openFileDialog = new OpenFileDialog();

            openFileDialog.Filter = "Lines doc file (*.lin)|*.lin";
            openFileDialog.Title  = "Open lines file";
            if (openFileDialog.ShowDialog() == DialogResult.OK)
            {
                FileName = openFileDialog.FileName;
                try
                {
                    using (FileStream fileStream = new FileStream(FileName, FileMode.Open))
                    {
                        IFormatter formater = new BinaryFormatter();
                        linesDoc = (LinesDoc)formater.Deserialize(fileStream);
                    }
                }
                catch (Exception ex)
                {
                    MessageBox.Show("Could not read file: " + FileName);
                    FileName = null;
                    return;
                }
                Invalidate(true);
            }
        }
예제 #2
0
 public Form1()
 {
     InitializeComponent();
     currentPoint        = new Point();
     dashedPen           = new Pen(Color.Black, 1);
     dashedPen.DashStyle = System.Drawing.Drawing2D.DashStyle.Dot;
     solidPen            = new Pen(Color.Black, 3);
     DoubleBuffered      = true;
     hasPosioner         = true;
     linesDoc            = new LinesDoc();
     width = 3;
 }
예제 #3
0
파일: Form1.cs 프로젝트: kicoo7/VP
 public Form1()
 {
     InitializeComponent();
     currentPoint = new Point();
     dashedPen = new Pen(Color.Black, 1);
     dashedPen.DashStyle = System.Drawing.Drawing2D.DashStyle.Dash;
     solidPen = new Pen(Color.Black, 3);
     DoubleBuffered = true;
     hasPosioner = true;
     linesDoc = new LinesDoc();
     width = 3;
 }
예제 #4
0
 private void newToolStripButton_Click(object sender, EventArgs e)
 {
     linesDoc = new LinesDoc();
     Invalidate(true);
 }
예제 #5
0
파일: Form1.cs 프로젝트: kicoo7/VP
 private void newToolStripMenuItem_Click(object sender, EventArgs e)
 {
     linesDoc = new LinesDoc();
     Invalidate(true);
 }
예제 #6
0
파일: Form1.cs 프로젝트: kicoo7/VP
 private void openFile()
 {
     OpenFileDialog openFileDialog = new OpenFileDialog();
     openFileDialog.Filter = "Lines doc file (*.lin)|*.lin";
     openFileDialog.Title = "Open lines file";
     if (openFileDialog.ShowDialog() == DialogResult.OK)
     {
         FileName = openFileDialog.FileName;
         try
         {
             using (FileStream fileStream = new FileStream(FileName, FileMode.Open))
             {
                 IFormatter formater = new BinaryFormatter();
                 linesDoc = (LinesDoc)formater.Deserialize(fileStream);
             }
         }
         catch (Exception ex)
         {
             MessageBox.Show("Could not read file: " + FileName);
             FileName = null;
             return;
         }
         Invalidate(true);
     }
 }