Esempio n. 1
0
 public Form1()
 {
     InitializeComponent();
     bob = new Guy() { Cash = 100, Name = "Bob" };
     joe = new Guy() { Cash = 50, Name = "Joe" };
     UpdateForm();
 }
Esempio n. 2
0
 private void loadJoe_Click(object sender, EventArgs e)
 {
     using (Stream input = File.OpenRead("Guy_File.dat"))
     {
         BinaryFormatter formatter = new BinaryFormatter();
         joe = (Guy)formatter.Deserialize(input);
     }
     UpdateForm();
 }
Esempio n. 3
0
 public Form1()
 {
     InitializeComponent();
     joe = new Guy();
     bob = new Guy();
     joe.Name = "Joe";
     joe.Cash = 50;
     bob.Name = "Bob";
     bob.Cash = 100;
     updateForm();
 }