public void ZipUpdated(ZipCityData zipCityData) { //MessageBox.Show(string.Format("Updated zipcode {0} with city {1}.", zipCityData.ZipCode, zipCityData.City)); SendOrPostCallback callback = arg => { lstUpdates.Items.Add(zipCityData); }; _SyncContext.Send(callback, null); }
public void ZipUpdated(ZipCityData zipCityData) { SendOrPostCallback updateUI = new SendOrPostCallback(arg => { lstUpdates.Items.Add(zipCityData); }); _SyncContext.Send(updateUI, null); }
public void ZipUpdated(ZipCityData zipCityData) { // MessageBox.Show($"updated zipcode {zipCityData.ZipCode} with city {zipCityData.City}."); SendOrPostCallback updateUI = new SendOrPostCallback(arg => { lstZips2.Items.Add(zipCityData); }); _SyncContext.Send(updateUI, null); }
public void ZipUpdated(ZipCityData zipCityData) { //MessageBox.Show($"Updated zipcode {zipCityData.ZipCode} with city {zipCityData.City}"); Task task = new Task(() => { lstUpdates.Items.Add(zipCityData); }); task.Start(_TaskScheduler); }
//If this callback call doesn't need to return anything it should be marked as IsOneWay = true //in the IUpdateCallback contract to make it 'fire and forget' communication that will help avoiding deadlock. //in this case the service will not wait to receive any call from the client. public void ZipUpdated(ZipCityData data) { // As it is in a different thread of the UI it has to marshal to it. // this means send the contents of this thread to the UI thread. SendOrPostCallback updateUi = arg => { ZipCodeLsb.Items.Add(data); }; _syncContext.Send(updateUi, null); }
public void ZipUpdated(ZipCityData zipCityData) { MessageBox.Show(string.Format("Updated zipcode {0} with city {1}", zipCityData.ZipCode, zipCityData.City)); }