示例#1
0
        private void serializeThreeOfClubs_Click(object sender, EventArgs e)
        {
            Card threeClubs = new Card(Suits.Clubs, Values.Three);

            using (Stream output = File.Create(fileThreeClubs))
            {
                BinaryFormatter bf = new BinaryFormatter();
                bf.Serialize(output, threeClubs);
            }
        }
示例#2
0
 public void Add(Card cardToAdd)
 {
     cards.Add(cardToAdd);
 }
示例#3
0
        private void serializeSixOfHearts_Click(object sender, EventArgs e)
        {
            Card sixHearts = new Card(Suits.Hearts, Values.Six);

            using (Stream output = File.Create(fileSixHearts))
            {
                BinaryFormatter bf = new BinaryFormatter();
                bf.Serialize(output, sixHearts);
            }
        }