CHAPTER 14 BUILDING AND CONFIGURING CLASS LIBRARIES
public abstract class Car
{
...
public void TurnOnRadio(bool musicOn, MusicMedia mm)
{
if(musicOn)
MessageBox.Show(string.Format("Jamming {0}", mm));
else
MessageBox.Show("Quiet time...");
}
}
Update the constructors of the Car class to display a MessageBox that verifies you are indeed using
CarLibrary 2.0.0.0 as follows:
public abstract class Car
{
...
public Car()
{
MessageBox.Show("CarLibrary Version 2.0!");
}
public Car(string name, int maxSp, int currSp)
{
MessageBox.Show("CarLibrary Version 2.0!");
PetName = name; MaxSpeed = maxSp; CurrentSpeed = currSp;
}
...
}
Last but not least, before you recompile your new library, update the version to be 2.0.0.0. Recall you
can do so in a visual manner by double-clicking the Properties icon of the Solution Explorer and clicking
the “Assembly Information...” button on the Application tab. After you do, simply update the Assembly
Version number (see Figure 14-23).
545