Example #1
0
 /// <summary>
 /// Constructor that passes a state as a parameter.
 /// </summary>
 /// <param name="state">An auction state object.</param>
 public AuctionPausedState(AuctionState state)
 {
     Name         = "PAUSED";
     this.Auction = state.Auction;
     Console.WriteLine("Auction is paused.");
 }
 /// <summary>
 /// Constructor that passes a state as a parameter.
 /// </summary>
 /// <param name="state">An auction state object.</param>
 public AuctionInactiveState(AuctionState state)
 {
     this.Name    = "INACTIVE";
     this.Auction = state.Auction;
     Console.WriteLine("Auction is inactive.");
 }
 /// <summary>
 /// Constructor that passes a state as a parameter
 /// </summary>
 /// <param name="state">An auction state object.</param>
 public AuctionActiveState(AuctionState state)
 {
     Name         = "ACTIVE";
     this.Auction = state.Auction;
     Console.WriteLine("Auction is active.");
 }
Example #4
0
 /// <summary>
 /// Default Constructor
 /// </summary>
 public Auction()
 {
     // Auction is an Inactive state by default.
     State = new AuctionInactiveState(this);
     PopulateItems();
 }