コード例 #1
0
        public void PrepareForSale(IWag wag)
        {
            WagRegistration wagReg = new WagRegistration(wag);

            wagReg.AllocateWagNumber();

            WagDocumentation.PrintSpecSheet(wag);
        }
コード例 #2
0
        private static void SmallWidget()
        {
            AbstractWidget widget      = new SmallWidget();
            WagBuilder     builder     = new WidgetBuilder(widget);
            WagDirector    director    = new WidgetDirector();
            IWag           smallWidget = director.Build(builder);

            Console.WriteLine(smallWidget);
        }
コード例 #3
0
        private static void MediumWidget()
        {
            AbstractWidget widget       = new MediumWidget(FinishColor.PaintedGreen);
            WagBuilder     builder      = new WidgetBuilder(widget);
            WagDirector    director     = new WidgetDirector();
            IWag           mediumWidget = director.Build(builder);

            Console.WriteLine(mediumWidget);
        }
コード例 #4
0
        private static void BuilderPatternDemo()
        {
            AbstractWidget abstractWidget = new SmallWidget(FinishColor.PlatedPlatinum);
            WagBuilder     wagBuilder     = new WidgetBuilder(abstractWidget);
            WagDirector    wagDirector    = new WidgetDirector();
            IWag           widget         = wagDirector.Build(wagBuilder);

            Console.WriteLine(widget);

            AbstractGadget abstractGadget = new SmallGadget(FinishColor.PlainBlack);
            WagBuilder     builder        = new GadgetBuilder(abstractGadget);
            WagDirector    director       = new GadgetDirector();
            IWag           gadget         = director.Build(builder);

            Console.WriteLine(gadget);
        }
コード例 #5
0
 public CustomComponentsOption(IWag wag) : base(wag)
 {
 }
コード例 #6
0
 public AbstractWagOption(IWag wag) : base(FinishColor.PlatedGold)
 {
     this.decoratedWag = wag;
 }
コード例 #7
0
 public EverythingGoldOption(IWag wag) : base(wag)
 {
 }
コード例 #8
0
 public WagRegistration(IWag wag)
 {
     this._wag = wag;
 }
コード例 #9
0
 public static void PrintSpecSheet(IWag wag)
 {
     Console.WriteLine("Printing Specifications SHeet . . .");
 }