コード例 #1
0
        public void Execute(object parameter)
        {
            if (App.MainViewModel.BIN != null)
            {
                if (App.MainViewModel.BIN.Length > 16)
                {
                    AlertsHelper.ShowAlert("Invalid BIN", "Invalid Bin Entered !\nCheck BIN And Try Again !", "OK");
                    return;
                }

                while (App.MainViewModel.BIN.Length < 16)
                {
                    App.MainViewModel.BIN += "x";
                }

                if (App.MainViewModel.BIN.Length == 16)
                {
                    App.MainViewModel.IsBusy = true;

                    App.MainViewModel.GeneratedCards.Clear();

                    Task.Run(new Action(() =>
                    {
                        CreditCardsHelper.GenerateCreditCards(
                            App.MainViewModel.BIN,
                            App.MainViewModel.CVV,
                            App.MainViewModel.ExMonth,
                            App.MainViewModel.ExYear,
                            App.MainViewModel.CountToGenerate
                            );
                    }));
                }
            }
        }
コード例 #2
0
        private async void Bads_ItemTapped(object sender, ItemTappedEventArgs e)
        {
            CreditCard card = e.Item as CreditCard;

            Bads.SelectedItem = null;
            await ClipboardHelper.SetClipboard(card.RawCard);

            AlertsHelper.ShowShortToast("Card Copied !");
        }
コード例 #3
0
        public ActionResult GetMessages()
        {
            AlertsHelper _messageRepository = new AlertsHelper();

            return(PartialView("_MessagesList", _messageRepository.GetAllMessages()));
        }
コード例 #4
0
        protected override async void OnNavigatedTo(NavigationEventArgs e)
        {
            /// Create the connected animation
            var animation = ConnectedAnimationService.GetForCurrentView().GetAnimation("toCoinDetails");

            if (animation != null)
            {
                animation.TryStart(PriceChart, new UIElement[] { ChartCard });
            }


            /// Get timespan before updating
            timeSpan = App._LocalSettings.Get <string>(UserSettings.Timespan);
            TimeRangeRadioButtons.TimeSpan = timeSpan;
            (timeUnit, limit, aggregate)   = GraphHelper.TimeSpanParser[timeSpan];


            /// Create the auto-refresh timer
            var      autoRefresh = App._LocalSettings.Get <string>(UserSettings.AutoRefresh);
            TimeSpan period;

            if (autoRefresh != "None")
            {
                switch (autoRefresh)
                {
                case "30 sec":
                    period = TimeSpan.FromSeconds(30);
                    break;

                case "1 min":
                default:
                    period = TimeSpan.FromSeconds(60);
                    break;

                case "2 min":
                    period = TimeSpan.FromSeconds(120);
                    break;
                }

                // Update the price each 30 seconds
                PricePeriodicTimer = ThreadPoolTimer.CreatePeriodicTimer(async(source) => {
                    await Dispatcher.RunAsync(CoreDispatcherPriority.Normal, () => {
                        UpdatePrice();
                    });
                }, TimeSpan.FromSeconds(30));

                // Update the chart & portfolio if
                ChartPeriodicTimer = ThreadPoolTimer.CreatePeriodicTimer(async(source) => {
                    await Dispatcher.RunAsync(CoreDispatcherPriority.Normal, () => {
                        if (timeUnit == "minute")
                        {
                            TimeRangeButtons_Tapped(null, null);
                        }
                    });
                }, period);
            }

            try {
                var           type = (e.Parameter.GetType()).Name;
                CoinGeckoCoin coinGeckoCoin;
                switch (type)
                {
                case nameof(HomeCard):
                    vm.Chart          = ((HomeCard)e.Parameter).Chart;
                    vm.Coin           = ((HomeCard)e.Parameter).Info;
                    vm.Chart.TimeSpan = vm.Chart.TimeSpan;

                    var coin = App.coinListPaprika.Find(x => x.symbol == vm.Coin.Name);
                    vm.Coin.FullName = coin.name;

                    await GetCoinGeckoInfo(vm.Coin.Name);
                    await UpdatePortfolio();

                    break;

                case nameof(CoinDetailsViewModel):
                    vm       = (CoinDetailsViewModel)e.Parameter;
                    timeSpan = vm.Chart.TimeSpan;
                    (timeUnit, limit, aggregate) = GraphHelper.TimeSpanParser[timeSpan];
                    await UpdatePage();

                    break;

                default:
                case "string":
                    var crypto = e.Parameter?.ToString().ToUpperInvariant() ?? "NULL";
                    vm.Coin.Name = crypto;
                    if (App.coinListGecko.Count == 0)
                    {
                        await App.GetCoinList();
                    }

                    var _coin = App.coinListPaprika.Find(x => x.symbol == crypto) ?? new CoinPaprikaCoin();
                    vm.Coin.FullName = _coin?.name ?? "NULL";

                    UpdatePrice();

                    await GetCoinGeckoInfo(vm.Coin.Name);

                    TimeRangeButtons_Tapped(null, null);
                    vm.Coin.IsLoading = false;
                    break;
                }
            }
            catch (Exception ex) {
                var message = $"There was an error loading that coin. Try again later.\n\n{ex.Message}";
                vm.InAppNotification(message, ex.Message);
                vm.Coin.IsLoading = false;
            }

            vm.Alerts = await AlertsHelper.GetCryptoAlerts(vm.Coin.Name);
        }
コード例 #5
0
 private void Flyout_Closed(object sender, object e)
 {
     // sort alerts before saving
     vm.Alerts = new ObservableCollection <Alert>(vm.Alerts.OrderBy(x => x.Threshold).ToList());
     AlertsHelper.UpdateOneCryptoAlerts(vm.Coin.Name, vm.Alerts);
 }
コード例 #6
0
        private async void btnCopyPassword_Clicked(object sender, EventArgs e)
        {
            await ClipboardHelper.SetClipboard(App.MainViewModel.GeneratedPassword);

            AlertsHelper.ShowShortToast("Password Copied !");
        }