コード例 #1
0
        /// <summary>
        /// Demoteds the user.
        /// </summary>
        private void DemotedUser()
        {
            if (!ModulesHelper.IsPremiumModuleValid())
            {
                return;
            }

            _userDialogs.ShowLoading("Usuário perdendo acesso Premium", MaskType.Gradient);

            Menus = new ObservableCollection <Menu>
            {
                new Menu(Constants.MenuCheckingAccount, Constants.MenuIconCheckinAccout, true),
                new Menu(Constants.MenuCreditCard, Constants.MenuIconCreditCard, true),
                new Menu(Constants.MenuLoan, Constants.MenuIconLoan, true),
                new Menu(Constants.MenuInvestiments, Constants.MenuIconReward, false),
                new Menu(Constants.MenuReward, Constants.MenuIconReward, true),
                new Menu(Constants.MenuExit, Constants.MenuIconExit, true),
            };

            // Removendo assinatura para o evento
            _ea.GetEvent <UserProfileDemotedEvent>().Unsubscribe(() => { });

            // Garantindo para a lógica total da aplicação o
            // descarregar do módulo Premium
            ModulesHelper.UnloadPremiumModule();

            Xamarin.Forms.Device.BeginInvokeOnMainThread(() =>
            {
                Xamarin.Forms.Device.StartTimer(TimeSpan.FromSeconds(10), () =>
                {
                    _userDialogs.HideLoading();
                    return(false);
                });
            });
        }
コード例 #2
0
        /// <summary>
        /// Loads the menus.
        /// </summary>
        private void LoadMenus()
        {
            isBusy = true;

            if (ModulesHelper.IsPremiumModuleValid())
            {
                Menus = new ObservableCollection <Menu>
                {
                    new Menu(Constants.MenuCheckingAccount, Constants.MenuIconCheckinAccout, true),
                    new Menu(Constants.MenuCreditCard, Constants.MenuIconCreditCard, true),
                    new Menu(Constants.MenuLoan, Constants.MenuIconLoan, true),
                    new Menu(Constants.MenuInvestiments, Constants.MenuIconReward, true),
                    new Menu(Constants.MenuReward, Constants.MenuIconReward, true),
                    new Menu(Constants.MenuExit, Constants.MenuIconExit, true),
                };
            }
            else
            {
                Menus = new ObservableCollection <Menu>
                {
                    new Menu(Constants.MenuCheckingAccount, Constants.MenuIconCheckinAccout, true),
                    new Menu(Constants.MenuCreditCard, Constants.MenuIconCreditCard, true),
                    new Menu(Constants.MenuLoan, Constants.MenuIconLoan, true),
                    new Menu(Constants.MenuInvestiments, Constants.MenuIconReward, false),
                    new Menu(Constants.MenuReward, Constants.MenuIconReward, true),
                    new Menu(Constants.MenuExit, Constants.MenuIconExit, true),
                };
            }

            Xamarin.Forms.Device.BeginInvokeOnMainThread(() =>
            {
                Xamarin.Forms.Device.StartTimer(TimeSpan.FromSeconds(5), () =>
                {
                    IsBusy = false;
                    return(false);
                });
            });
        }