/// <summary> /// Проверка входящих данных /// </summary> /// <param name="onUpdate"></param> public override void CheckUpdate(Action <ISyncService <DataTable>, IRemoteData> onUpdate) { mBgWorker = new BackgroundWorker(); mBgWorker.DoWork += (p, b) => { IsBusy = true; if (!mSyncClient.Init()) { return; } if (!mSyncClient.CheckUpdate()) { return; } //если есть новые входящие данные while (mSyncClient.New.Any()) { var data = mSyncClient.New.Pop(); data.State = RemoteState.ToRecive; onUpdate(this, data); //обновляю их } }; mBgWorker.RunWorkerCompleted += (sender, obj) => IsBusy = false; mBgWorker.RunWorkerAsync(); }