void CallbackManager_ProgressEvent(FS2ProgressInfo fs2ProgressInfos) { Application.Current.Dispatcher.Invoke(new Action(() =>{ ProgressInfos.Insert(0, fs2ProgressInfos); if (ProgressInfos.Count > 1000) ProgressInfos.RemoveAt(1000); })); Application.Current.Dispatcher.Invoke(DispatcherPriority.Background, new ThreadStart(delegate { })); }
static void OnProgressEvent(FS2ProgressInfo fs2ProgressInfo) { if (ProgressEvent != null) ProgressEvent(fs2ProgressInfo); }
public static void AddProgress(FS2ProgressInfo progressInfo) { FS2Contract.CheckCancellationRequested(); Add(new FS2Callbac() { FS2ProgressInfo = progressInfo }); OnProgressEvent(progressInfo); }