Object Oriented Programming using C#

(backadmin) #1

Object Oriented Programming using C#
Case Study


The application window will look as shown below....


Note this includes buttons for increasing a client’s credit and deleting a client – functionality we realised some time ago
that we needed but functionality that was not added to the first version of this system. We will extend our system to add
this additional functionality once a basic system is working.


The ApplicationWindow_Load() method is shown below :-


private void ApplicationWindow_Load(object sender, EventArgs e)
{
clientBook = new ClientBook();
messageSet = new MessageSet();
try
{
FileStream inFile = new FileStream(“ClientAndMessageData”,
FileMode.Open, FileAccess.Read);
BinaryFormatter bFormatter = new BinaryFormatter();
clientBook = (ClientBook)bFormatter.Deserialize(inFile);
messageSet = (MessageSet)bFormatter.Deserialize(inFile);
inFile.Close();
inFile.Dispose();
}
catch (FileNotFoundException)
{
}
}
Free download pdf