|
using System.Windows.Forms;
namespace FactoryRegistration
{
class BasicRoom : IRoomType
{
#region IRoomType Members
/// <summary>
///
/// </summary>
public void GetDetails()
{
MessageBox.Show("Basic Room is selected");
}
///<summary> Returns the instance of its
/// own type</summary>
/// <returns></returns>
public IRoomType CreateProduct()
{
return new BasicRoom();
}
#endregion
/// <summary>
/// static method to register the roomtype
/// with corresponding key into RoomFactory
/// </summary>
/// <param name="roomType"></param>
public static void RegisterProduct(RoomTypes roomType)
{
RoomFactory.Singleton.RegisterRoom(roomType, new BasicRoom());
}
}
}
|
By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.
If a file you wish to view isn't highlighted, and is a text file (not binary), please
let us know and we'll add colourisation support for it.
This member has not yet provided a Biography. Assume it's interesting and varied, and probably something to do with programming.
This member has not yet provided a Biography. Assume it's interesting and varied, and probably something to do with programming.