/// <summary> /// To Check the syncStaus /// </summary> /// <param name="passed"></param> private void SyncFinish(bool passed) { try { if (!AppData.SyncInProgress) { VwSyncStatus.SyncStopped(AppData.SyncInProgress); } else { VwSyncStatus.SyncStopped(passed); } //else //{ // SplitView.Instace() // .DisplayAlert("Sync Timed Out", "The sync has ran for too long and has timed out.", "Ok"); //} AppData.SyncInProgress = false; } catch (Exception ex) { LogTracking.LogTrace(ex.ToString()); } }
/// ------------------------------------------------------------------------------------------------ /// ------------------------------------------------------------------------------------------------ #region Private Functions /// <summary> /// Synchronize data /// </summary> private async void SyncBegin() { try { AppData.SyncInProgress = true; VwSyncStatus.SyncStarted(); // Clear the request mappings and remove all the sections from the table. AppData.PropertyModel.Mappings.Clear(); // await Task.Delay(800); if (await AppData.API.Sync()) { //Modified for IDXSR-343 on 10.05.2017 AppData.PropertyModel.SelectedProperty = null; await ReloadPropertyData(); SyncFinish(true); } else { //if syn fails, trigeer the propertyviewmodel to repopulate the data in memory AppData.PropertyModel.Update(new List <SRiProperty>()); SyncFinish(false); // //Call Resolution Manager when conflicts occurs if (API.m_Resolution?.Count > 0) { if (Device.OS == TargetPlatform.WinPhone || Device.OS == TargetPlatform.Windows) { await Task.Delay(1500); } else { await Task.Delay(800); } SplitView.CenterPopupContent.ShowPopupCenter(new ResolutionView(API.m_Resolution), 0.5, "Adding Resolution"); API.m_Resolution.Clear(); } // } ////show the Plus symbol //FullMapView.ShowHideAdd.Invoke(true); } catch (Exception ex) { LogTracking.LogTrace(ex.ToString()); } }