public static void Main(string[] args) { #region Case One var decafWithCaramel = new Caramel(new Decaf()); Console.WriteLine(decafWithCaramel.Describe()); var espressoWithSoyAndCaramel = new Caramel(new Soy(new Decaf())); Console.WriteLine(espressoWithSoyAndCaramel.Describe()); #endregion #region Case Two var windowWithBorderAndVerticalScrollBar = new VerticalScrollBarDecorator(new BorderDecorator(new Window { Width = 12, Height = 32 })); windowWithBorderAndVerticalScrollBar.Draw(); var windowWithVerticalAndHorizontalBar = new HorizontalScrollBarDecorator( new VerticalScrollBarDecorator(new Window { Width = 11, Height = 22 })); windowWithVerticalAndHorizontalBar.Draw(); #endregion }
static void Main(string[] args) { Window decoratedWindow = new HorizontalScrollBarDecorator(new VerticalScrollBarDecorator(new SimpleWindow())); decoratedWindow.Draw(); Console.WriteLine(decoratedWindow.GetDescription()); }