Пример #1
0
        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();
        }
Пример #2
0
        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();
        }
Пример #3
0
        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;
        }
Пример #4
0
        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;
        }