コード例 #1
0
        public GraficadorForm()
        {
            //
            // Required for Windows Form Designer support
            //
            InitializeComponent();

            //
            // TODO: Add any constructor code after InitializeComponent call
            //
            dibujo = new Dibujo();
            trazo = null;
            color = Color.Black;
            width = 1;
        }
コード例 #2
0
 private void menuItem6_Click(object sender, System.EventArgs e)
 {
     int port = 13000;
     IPAddress add = IPAddress.Parse("127.0.0.1");
     TcpListener lsr = new TcpListener(add, port);
     lsr.Start();
     TcpClient cliente = lsr.AcceptTcpClient();
     Stream str = cliente.GetStream();
     BinaryFormatter bf = new BinaryFormatter();
     dibujo = (Dibujo)bf.Deserialize(str);
     str.Close();
     cliente.Close();
     lsr.Stop();
     this.Invalidate();
     this.Update();
 }
コード例 #3
0
 private void menuItem4_Click(object sender, System.EventArgs e)
 {
     DialogResult dr;
     dr = openFileDialog1.ShowDialog();
     if (dr == DialogResult.OK)
     {
         FileStream str = new FileStream(openFileDialog1.FileName, FileMode.Open);
         SoapFormatter sf = new SoapFormatter();
         dibujo = (Dibujo)sf.Deserialize(str);
         str.Close();
         this.Invalidate();
         this.Update();
     }
 }