// myabstractFactoryUsing System;
/// Basic Products // AbstractProductSABSTRACT CLASS FONTSSTYLE {Public String StyleString;
abstract class TablesStyle {public string stylestring;}; // RealProductsclass FontsStyleA: FontsStyle {public FontsStyleA () {stylestring = "FontsStyleA";}}; class FontsStyleB: FontsStyle {public FontsStyleB () {stylestring = "FontsStyleB";}};
Class TablesSstylea: TableSStyle {Public TableSStyle () {StyleString = "TableSStylea";}}; Class TableSStyleb: TableSstyle {public TableB: TableSStyle {public TableSstyleb ()}}}}}}}}
// Basic Products
// Style Factorys
Abstract Class Stylefactory {Abstract Public FontSstyle CreateFontSstyle (); Abstract Public TableSstyle CreateTablesSstyle ();
Class Stylea: Stylefactory {Override Public FontsStyle CreateFontSstyle () {Return New FontSstyle ();} Override Public TableSstyle CreateTablesSstyle () {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 LastClass HomePage {Private FontsStyle FontsStyle; Private TableSstyle Table;
Private string htmlcode = "