Exemple #1
0
        protected virtual async Task SaveEntity(BaseEntity entity, ContentPage sendingPage)
        {
            if (_smSvc.GetInstance() == null)
            {
                await sendingPage.Navigation.PushModalAsync(new NavigationPage(new DeviceListPage()));
            }
            else
            {
                await DbProvider.AddOrUpdateAsync(entity).ConfigureAwait(false);

                OnSettingsChanged(sendingPage);
            }
        }
Exemple #2
0
        public async void CaptureEvent(object sender, ConfigurationEventArgs args)
        {
            try
            {
                if (_smService.GetInstance() == null)
                {
                    Device.BeginInvokeOnMainThread(async() =>
                    {
                        await Application.Current.MainPage.DisplayAlert("Select a Mirror!", "You will need to select a Lustro instance before your changes show up.", "OK");
                    });
                }
                else
                {
                    await SendOrSaveChanges(args);

                    _dbService.GetConnection().GetConnection().Commit();
                }
            }
            catch (Exception ex)
            {
                Debug.WriteLine(ex.Message);
            }
        }