コード例 #1
0
 private static IEnumerable <ICommandFactory <ICommand> > GetFactories(ICarComponent component)
 {
     return(new ICommandFactory <ICommand>[]
     {
         new CommandFactory <EngineOn>(component)
         {
             Name = "On"
         },
         new CommandFactory <EngineOff>(component)
         {
             Name = "Off"
         },
         new CommandFactory <EngineUp>(component)
         {
             Name = "Up"
         },
         new CommandFactory <EngineDown>(component)
         {
             Name = "Down"
         }
     });
 }
コード例 #2
0
 public CommandFactory(ICarComponent component)
 {
     _component = component;
 }
コード例 #3
0
 protected CommandBase(ICarComponent carComponent)
 {
     CarComponent = carComponent;
 }
コード例 #4
0
 public EngineExecutor(ICarComponent component)
 {
     Component = component;
 }
コード例 #5
0
ファイル: EngineOn.cs プロジェクト: gsoulavy/Design-Patterns
 public EngineOn(ICarComponent carComponent) : base(carComponent)
 {
 }
コード例 #6
0
 public SpecialOffer(ICarComponent carComponent)
     : base(carComponent)
 {
 }
コード例 #7
0
 public CarDecorator(ICarComponent CarComponent)
 {
     this._carComponent = CarComponent;
 }