public void Handler(object sender, DataSetCommittedEventArgs arg) { if (CustomHandler != null) { CustomHandler(arg, this); } }
private void OnDataSetCommitted(DataSetCommittedEventArgs e, OnCommittedHandler handler) { if ((e.Changes.ChangesetSource & ChangesetSource.Remote) == 0) { return; // we're waiting for remote changes } var ds = e.DataSet; if (FetchClimateRequestBuilder.IsProcessingSuccessful(ds) || FetchClimateRequestBuilder.IsProcessingFailed(ds)) { ds.Committed -= handler.Handler; handler.Completed.Set(); } }
/// <summary>This method is called when source DataSet is committed. It may be called /// in thread different from UI</summary> /// <param name="sender">DataSet that was committed</param> /// <param name="args">Information about DataSet changes</param> private void OnDataSetCommittedAsync(object sender, DataSetCommittedEventArgs args) { int activeRequestCount; lock (commits) { commits.Add(args); activeRequestCount = activeRequests.Count; } if (wpfDispatcher.Thread == Thread.CurrentThread) // This event is in UI thread Sync(); else if (!syncEnqueued && activeRequestCount == 0) { syncEnqueued = true; wpfDispatcher.BeginInvoke(Priority, new SyncHandler( () => { try { if(!isDisposed) Sync(); } finally { syncEnqueued = false; } } )); } }
public void Handler(object sender, DataSetCommittedEventArgs arg) { if (CustomHandler != null) CustomHandler(arg, this); }