示例#1
0
        private void GuestForm_Load(object sender, EventArgs e)
        {
            this.btnJoinParty.Enabled = false;
            this.btnLeaveParty.Enabled = false;
            this.btnBeerRun.Enabled = false;
            this.btnDrinkBeer.Enabled = false;

            this.txtGuestName.TextChanged += new EventHandler(txtGuestName_TextChanged);
            this.FormClosing += new FormClosingEventHandler(GuestForm_FormClosing);

            // Capture the UI synchronization context
            _uiSyncContext = SynchronizationContext.Current;

            // The client callback interface must be hosted for the server to invoke the callback
            // Open a connection to the beer inventory service via the proxy
            _beerInventoryService = new BeerInventoryServiceClient(new InstanceContext(this), "TcpBinding");
            _beerInventoryService.Open();
        }
示例#2
0
        private void GuestForm_Load(object sender, EventArgs e)
        {
            this.btnJoinParty.Enabled  = false;
            this.btnLeaveParty.Enabled = false;
            this.btnBeerRun.Enabled    = false;
            this.btnDrinkBeer.Enabled  = false;

            this.txtGuestName.TextChanged += new EventHandler(txtGuestName_TextChanged);
            this.FormClosing += new FormClosingEventHandler(GuestForm_FormClosing);

            // Capture the UI synchronization context
            _uiSyncContext = SynchronizationContext.Current;

            // The client callback interface must be hosted for the server to invoke the callback
            // Open a connection to the beer inventory service via the proxy
            _beerInventoryService = new BeerInventoryServiceClient(new InstanceContext(this), "TcpBinding");
            _beerInventoryService.Open();
        }