public MainWindow() { InitializeComponent(); bool useAppLocally = false; if (useAppLocally) { // Connect directly to the Controller placeBidsController = new PlaceBidsController(); } else { // Connect to the Controller through the SocketService: placeBidsController = new PlaceBidsClient("localhost", 13370); } placeBidsController.NewRound += newRoundEvent; placeBidsController.NewBidAccepted += newBidAcceptedEvent; placeBidsController.CallFirst += callFirst; placeBidsController.CallSecond += callSecond; placeBidsController.CallThird += callThird; logTextBox.Text += placeBidsController.JoinAuction(); getCurrentItem(); }
public PlaceBidsHandler(IPlaceBidsController placeBidsController, Socket commandSocket, object lockObj) { this.placeBidsController = placeBidsController; this.commandSocket = commandSocket; // This lock is used to lock access to port 16001 so that different Handlers don't try // to use it concurrently this.lockObj = lockObj; placeBidsController.NewRound += newRound; placeBidsController.NewBidAccepted += newBidAccepted; placeBidsController.CallFirst += first; placeBidsController.CallSecond += second; placeBidsController.CallThird += third; }