Exemplo n.º 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);
        }
Exemplo n.º 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>();
            }
        }
Exemplo n.º 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);
        }
Exemplo n.º 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);
        }
Exemplo n.º 6
0
 private void ExecuteItemTappedCommand(object item)
 {
     CoreMethods.PushPageModel <TeamViewModel>(item);
 }
Exemplo n.º 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");
                });
            }
        }
Exemplo n.º 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();
		}
Exemplo n.º 9
0
 private void logout(object obj)
 {
     CoreMethods.PushPageModel <LoginPageModel>();
 }
Exemplo n.º 10
0
        public void TestGetBooleanArrayNonExistant()
        {
            string key = "mykey";

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

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

            tcs.TrySetResult(true);
        }
Exemplo n.º 17
0
 private void GoToVideoPage()
 {
     CoreMethods.PushPageModel <VideoPageModel>();
 }
Exemplo n.º 18
0
 public NewsViewModel()
 {
     Title           = "News";
     News            = new ObservableCollection <Post>();
     GoToPostCommand = new Command <Post>(post => CoreMethods.PushPageModel <PostViewModel>(post));
 }
Exemplo n.º 19
0
 private void _back(object obj)
 {
     CoreMethods.PushPageModel <AdminMenuPageModel>();
     RaisePropertyChanged();
 }
Exemplo n.º 20
0
 private async Task NavigateToMeetingPage(Meeting meeting)
 {
     await CoreMethods.PushPageModel <MeetingPageModel>(meeting);
 }
Exemplo n.º 21
0
 async void ShowErrorMessage()
 {
     await CoreMethods.DisplayAlert(AppResources.Error, AppResources.NotEntertainRequest, AppResources.Ok);
 }
Exemplo n.º 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");
                }
            }
        }
Exemplo n.º 23
0
 public async void Cancel(object sender)
 {
     await CoreMethods.PopPageModel(null, true);
 }
Exemplo n.º 24
0
        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;
        }
Exemplo n.º 25
0
 private void GoToMoreDetails()
 {
     CoreMethods.PushPageModel <MoreDetailsPageModel>();
 }
Exemplo n.º 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);
 }
Exemplo n.º 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();
 }
Exemplo n.º 31
0
        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();
            }
        }