Example #1
0
        ///<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);
        }
Example #2
0
        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>();
            }
        }
Example #3
0
        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);
        }
Example #5
0
        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);
        }
Example #6
0
 private void ExecuteItemTappedCommand(object item)
 {
     CoreMethods.PushPageModel <TeamViewModel>(item);
 }
Example #7
0
        /// <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");
                });
            }
        }
Example #8
0
		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();
		}
Example #9
0
 private void logout(object obj)
 {
     CoreMethods.PushPageModel <LoginPageModel>();
 }
Example #10
0
        public void TestGetBooleanArrayNonExistant()
        {
            string key = "mykey";

            Assert.Throws <TableKeyNotDefinedException>(() => CoreMethods.GetEntryBooleanArray(key));
        }
Example #11
0
 private void AddQuote()
 {
     CoreMethods.PushPageModel <AddQuotePageModel>(Categories);
 }
Example #12
0
 async void HitTestClicked()
 {
     await CoreMethods.PushPageModel <MainPageModel>(false, false);
 }
Example #13
0
 private void OnContinue()
 {
     CoreMethods.PopToRoot(false);
 }
Example #14
0
 private void GoToSingUpPage()
 {
     CoreMethods.PushPageModel <SignUpPageModel>();
 }
        private async Task CreateTag()
        {
            var createdTag = await _customVisionService.CreateTag(_projectId, Name, Description);

            await CoreMethods.PopPageModel(createdTag);
        }
Example #16
0
        private async void CancelHandle(object obj, TaskCompletionSource <bool> tcs)
        {
            await CoreMethods.PopViewModel(modal : IsModal);

            tcs.TrySetResult(true);
        }
Example #17
0
 private void GoToVideoPage()
 {
     CoreMethods.PushPageModel <VideoPageModel>();
 }
 public NewsViewModel()
 {
     Title           = "News";
     News            = new ObservableCollection <Post>();
     GoToPostCommand = new Command <Post>(post => CoreMethods.PushPageModel <PostViewModel>(post));
 }
Example #19
0
 private void _back(object obj)
 {
     CoreMethods.PushPageModel <AdminMenuPageModel>();
     RaisePropertyChanged();
 }
 private async Task NavigateToMeetingPage(Meeting meeting)
 {
     await CoreMethods.PushPageModel <MeetingPageModel>(meeting);
 }
Example #21
0
 async void ShowErrorMessage()
 {
     await CoreMethods.DisplayAlert(AppResources.Error, AppResources.NotEntertainRequest, AppResources.Ok);
 }
Example #22
0
        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");
                }
            }
        }
Example #23
0
 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>();
 }
Example #26
0
        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);
 }
Example #29
0
 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();
            }
        }