///////////////Basic Products//////////////// //AbstractProducts abstract class FontsStyle { public string stylestring; };
abstract class TablesStyle { public string stylestring; }; //RealProducts class FontsStyleA:FontsStyle { public FontsStyleA(){stylestring="FontsStyleA";} }; class FontsStyleB:FontsStyle { public FontsStyleB(){stylestring="FontsStyleB";} };
class TablesStyleA:TablesStyle { public TablesStyleA(){stylestring="TablesStyleA";} }; class TablesStyleB:TablesStyle { public TablesStyleB(){stylestring="TablesStyleB";} };
//////////////Basic Products////////////////
//////////////Style Factorys////////////////
abstract class StyleFactory { abstract public FontsStyle createFontsStyle(); abstract public TablesStyle createTablesStyle(); };
class StyleA:StyleFactory { override public FontsStyle createFontsStyle() { return new FontsStyleA(); } override public TablesStyle createTablesStyle() { return new TablesStyleA(); } };
class StyleB:StyleFactory { override public FontsStyle createFontsStyle() { return new FontsStyleB(); } override public TablesStyle createTablesStyle() { return new TablesStyleB(); } }; //////////////Style Factorys////////////////
//////////////////////HomePage is the product as last class HomePage { private FontsStyle fontsstyle; private TablesStyle tablesstyle;