///<inheritdoc/> public void AddTableListenerEx(string key, ITableListener listener, NotifyFlags flags) { List <int> adapters; if (!m_listenerMap.TryGetValue(listener, out adapters)) { adapters = new List <int>(); m_listenerMap.Add(listener, adapters); } string fullKey = m_path + PathSeperatorChar + key; // ReSharper disable once InconsistentNaming EntryListenerFunction func = (uid, funcKey, value, flags_) => { if (!funcKey.Equals(fullKey)) { return; } listener.ValueChanged(this, key, value, flags_); }; int id = CoreMethods.AddEntryListener(fullKey, func, flags); adapters.Add(id); }
private async void GoToLoginPage() { var email = EntEmail; var pass = EntPassword; var confirmpass = ConfirmPassword; if (pass != confirmpass) { await CoreMethods.DisplayAlert("Passwords do not match", "Please enter again", "Ok"); } bool response = await _restInterface.RegisterUser(email, pass, confirmpass); if (!response) { await CoreMethods.DisplayAlert("Oops", "Please try again", "Cancel"); } else { await CoreMethods.DisplayAlert("Welcome to the application", "Your account has been created", "Ok"); await CoreMethods.PushPageModel <LoginPageModel>(); } }
public IEnumerator DownloandMyImage() { string location = File.DataPath() + "ProfilePic/"; string fileName, imageID, fbImgUrl; imageID = FBID; fbImgUrl = URL; fileName = imageID + ".jpg"; if (File.FileExists(location, fileName)) { SetProfileImage(location + fileName); } if (!string.IsNullOrEmpty(fbImgUrl)) { if (fbImgUrl.StartsWith("https://")) { fbImgUrl = fbImgUrl.Replace("https://", "http://"); } WWW www = new WWW(fbImgUrl); yield return(www); if (string.IsNullOrEmpty(www.error)) { byte[] fileData = www.bytes; File.WriteFile(location, fileName, fileData); yield return(StartCoroutine(CoreMethods.Wait(1f))); SetProfileImage(location + fileName); } else { MyDebug.Warning("Downlaod image ERROR: " + www.error); } } }
private async Task <bool> ChangePassword() { if (string.IsNullOrEmpty(NewPassword + ConfirmPassword)) { return(false); } if (NewPassword.Length < 6) { await CoreMethods.DisplayAlert("Mot de passe incorrect", "Le mot de passe doit contenir un minimum de 6 caractères", "OK"); return(false); } if (NewPassword != ConfirmPassword) { await CoreMethods.DisplayAlert("Mot de passe incorrect", "Les mots de passes doivent êtres identiques", "OK"); return(false); } //TODO: Change password through API await Task.Delay(10); return(true); }
private PhpCompilation( string assemblyName, PhpCompilationOptions options, ImmutableArray <MetadataReference> references, bool isSubmission, ReferenceManager referenceManager = null, bool reuseReferenceManager = false, //SyntaxAndDeclarationManager syntaxAndDeclarations AsyncQueue <CompilationEvent> eventQueue = null ) : base(assemblyName, references, SyntaxTreeCommonFeatures(ImmutableArray <SyntaxTree> .Empty), isSubmission, eventQueue) { _wellKnownMemberSignatureComparer = new WellKnownMembersSignatureComparer(this); _options = options; _tables = new SourceSymbolCollection(this); _coreTypes = new CoreTypes(this); _coreMethods = new CoreMethods(_coreTypes); _anonymousTypeManager = new AnonymousTypeManager(this); _referenceManager = (reuseReferenceManager && referenceManager != null) ? referenceManager : new ReferenceManager(MakeSourceAssemblySimpleName(), options.AssemblyIdentityComparer, referenceManager?.ObservedMetadata, options.SdkDirectory); }
private void ExecuteItemTappedCommand(object item) { CoreMethods.PushPageModel <TeamViewModel>(item); }
/// <summary> /// Connect application to the server and returns an error if the connection fails. /// </summary> private async void Connect() { try { Client.Connect(Connection.Address); for (var i = 0; i < Default.TimeOut; i++) { if (Client.Connected) { break; } await Task.Delay(TimeSpan.FromMilliseconds(10)); } if (Client.Connected) { var connections = SQLiteDB.Connection.GetConnections(); foreach (var t in connections) { t.Save = false; SQLiteDB.Connection.UpdateConnection(t); } if (Connection.Save) { if (SQLiteDB.Connection.GetConnection(Connection.Address) != null) { var localConnection = SQLiteDB.Connection.GetConnection(Connection.Address); localConnection.Save = true; SQLiteDB.Connection.UpdateConnection(localConnection); } else { SQLiteDB.Connection.AddConnection(Connection.Address, true); } } Device.BeginInvokeOnMainThread(() => { UserDialogs.Instance.HideLoading(); var page = FreshMvvm.FreshPageModelResolver.ResolvePageModel <HomePageModel>(); var navigation = new FreshMvvm.FreshNavigationContainer(page) { BarBackgroundColor = Color.FromHex("#008B8B"), BarTextColor = Color.White }; Application.Current.MainPage = navigation; }); return; } Device.BeginInvokeOnMainThread(async() => { UserDialogs.Instance.HideLoading(); await CoreMethods.DisplayAlert("Error: 315", "Connection timeout", "OK"); }); } catch (Exception ex) { Device.BeginInvokeOnMainThread(async() => { UserDialogs.Instance.HideLoading(); await CoreMethods.DisplayAlert("Error: " + Convert.ToString(ex.Id), ex.Message, "OK"); }); } }
private void InitializeMethods() { Core = new CoreMethods(this); Catalog = new CatalogMethods(this); Collection = new CollectionMethods(this); Playlists = new PlaylistsMethods(this); SocialNetwork = new SocialNetworkMethods(this); Activity = new ActivityMethods(this); Playback = new PlaybackMethods(this); OnInitializeMethods(); }
private void logout(object obj) { CoreMethods.PushPageModel <LoginPageModel>(); }
public void TestGetBooleanArrayNonExistant() { string key = "mykey"; Assert.Throws <TableKeyNotDefinedException>(() => CoreMethods.GetEntryBooleanArray(key)); }
private void AddQuote() { CoreMethods.PushPageModel <AddQuotePageModel>(Categories); }
async void HitTestClicked() { await CoreMethods.PushPageModel <MainPageModel>(false, false); }
private void OnContinue() { CoreMethods.PopToRoot(false); }
private void GoToSingUpPage() { CoreMethods.PushPageModel <SignUpPageModel>(); }
private async Task CreateTag() { var createdTag = await _customVisionService.CreateTag(_projectId, Name, Description); await CoreMethods.PopPageModel(createdTag); }
private async void CancelHandle(object obj, TaskCompletionSource <bool> tcs) { await CoreMethods.PopViewModel(modal : IsModal); tcs.TrySetResult(true); }
private void GoToVideoPage() { CoreMethods.PushPageModel <VideoPageModel>(); }
public NewsViewModel() { Title = "News"; News = new ObservableCollection <Post>(); GoToPostCommand = new Command <Post>(post => CoreMethods.PushPageModel <PostViewModel>(post)); }
private void _back(object obj) { CoreMethods.PushPageModel <AdminMenuPageModel>(); RaisePropertyChanged(); }
private async Task NavigateToMeetingPage(Meeting meeting) { await CoreMethods.PushPageModel <MeetingPageModel>(meeting); }
async void ShowErrorMessage() { await CoreMethods.DisplayAlert(AppResources.Error, AppResources.NotEntertainRequest, AppResources.Ok); }
private async Task saveEquipment() { if (Id == null) { var equipment = new EquipmentPost() { Name = Name, Quantity = Quantity, Status = 1, StatusName = "Active", Type = SelectedType.Id, TypeName = SelectedType.TypeName }; try { var isCreated = await _restServices.PostEquipment(equipment); if (isCreated) { var result = await CoreMethods.DisplayAlert("Hi", "Your record has been added successfully......", "Alright", "Cancel"); if (result) { await CoreMethods.PushPageModel <EquipmentPageModel>(); } } else { await CoreMethods.DisplayAlert("Opps", "Something went wrong......", "Ok"); } } catch (Exception) { //log errors here throw; } } else { var equipment = new EquipmentUpdate() { Id = Id, Name = Name, Quantity = Quantity, Status = 1, StatusName = "Active", Type = SelectedType.Id, TypeName = SelectedType.TypeName }; var isUpdated = await _restServices.UpdateEquipment(equipment); if (isUpdated) { var result = await CoreMethods.DisplayAlert("Hi", "Your record has been updated successfully......", "Alright", "Cancel"); if (result) { await CoreMethods.PushPageModel <EquipmentPageModel>(); } } else { await CoreMethods.DisplayAlert("Opps", "Something went wrong......", "Ok"); } } }
public async void Cancel(object sender) { await CoreMethods.PopPageModel(null, true); }
private void addHstruct(object obj) { Device.BeginInvokeOnMainThread(() => { isEnabled = false; isBusy = true; }); var hstruct = new HealthStruct() { fullName = fullName, adress = adress, phNumber = phNumber, email = email, star = star }; if (!isEdit) { Task.Run(async() => { try { if (await _hStructServices.SaveStruct(hstruct)) { MessagingCenter.Send(this, "HstructUpdated"); } if (await _restServices.AddHealthStruct(hstruct)) { _dialogSservices.ShowMessage(fullName + " a été ajouté avec succès ", false); Device.BeginInvokeOnMainThread(async() => { await App.Current.MainPage.Navigation.PopModalAsync(); }); } } catch { Console.WriteLine("error adding new hstruct"); _dialogSservices.ShowMessage("Erreur , veuillez essayer plus tard", true); } }); } if (isEdit) { Task.Run(async() => { hstruct.id = id; try { if (await _hStructServices.UpdateHStructAsync(hstruct)) { MessagingCenter.Send(this, "HstructUpdated"); } if (_restServices.UpdateHStruct(hstruct)) { _dialogSservices.ShowMessage(fullName + " a été modifié avec succès ", false); } } catch { Console.WriteLine("error adding new hstruct"); _dialogSservices.ShowMessage("Erreur , veuillez essayer plus tard", true); } Device.BeginInvokeOnMainThread(async() => { await CoreMethods.PopPageModel(); RaisePropertyChanged(); }); }); } isBusy = false; isEnabled = true; }
private void GoToMoreDetails() { CoreMethods.PushPageModel <MoreDetailsPageModel>(); }
private void GoToBubbleLeaderProfilePage() { var user = _selectedSWATLeader; CoreMethods.PushPageModel <SWATLeaderProfilePageModel>(user); }
public override void Init(object initData) { base.Init(initData); CoreMethods.RemoveFromNavigation(); }
async Task Save() { databaseService.UpdateContact(contact: Contact); await CoreMethods.PopPageModel(Contact); }
private void SelectCharacterPageModel(Character character) { CoreMethods.PushPageModel <CharacterDetailPageModel>(character); }
public override void Init(object initData) { base.Init(initData); Settings.LoginViewShown = true; CoreMethods.RemoveFromNavigation(); }
protected override async void ViewIsAppearing(object sender, EventArgs e) { base.ViewIsAppearing(sender, e); var currentUserCredentials = CredentialLocker.GetUserCredentials(); if (currentUserCredentials == null) { await CoreMethods.PushPageModel <LoginViewModel>(); CoreMethods.RemoveFromNavigation(); } else { var appData = new AppData(); if (_initData is StudentPersonalData studentPersonalData) { appData.StudentPersonalData = studentPersonalData; } else { appData.StudentPersonalData = await WebService.Instance.GetStudentPersonalData(); } appData.GradesDataModels = appData.StudentPersonalData.Oceny .GroupBy(x => x.Semestr) .OrderByDescending(x => x.Key) .Select(group => new GradesDataModel { Name = group.Key, Grades = group.ToList() }).ToList(); appData.PaymentsDataModel = new PaymentsDataModel { Konto_wplat = appData.StudentPersonalData.Konto_wplat, Konto_wyplat = appData.StudentPersonalData.Konto_wyplat, Kwota_naleznosci = appData.StudentPersonalData.Kwota_naleznosci, Kwota_wplat = appData.StudentPersonalData.Kwota_wplat, Kwota_wyplat = appData.StudentPersonalData.Kwota_wyplat, Saldo = appData.StudentPersonalData.Saldo, Oplaty = appData.StudentPersonalData.Oplaty.OrderByDescending(x => x.TerminPlatnosci).ToList(), Platnosci = appData.StudentPersonalData.Platnosci.OrderByDescending(x => x.DataWplaty).ToList() }; var today = DateTime.Today; var studentSchedules = await WebService.Instance.GetStudentSchedules(today, today.AddMonths(1)); appData.StudentScheduleDataModels = studentSchedules .GroupBy(x => x.Data_roz.Date) .OrderBy(x => x.Key) .Select(group => new ScheduleDataModel { Date = group.Key, StudentSchedules = group.ToList() }).ToList(); await CoreMethods.PushPageModel <DashboardViewModel>(appData); CoreMethods.RemoveFromNavigation(); } }