Exemplo n.º 1
0
 private void ProcessData(BalanceData balanceData, Action callback = null)
 {
     BalanceRefillViewModel.LoadUnfulfilledConsumables((Action <List <InAppUnfulfilledProduct> >)(unfulfilledProducts =>
     {
         BalanceData balanceData1 = balanceData;
         this.Balance             = balanceData1 != null ? balanceData1.Balance : 0;
         this.VotesPacks          = new List <VotesPackViewModel>();
         BalanceData balanceData2 = balanceData;
         List <VotesPack> m0List;
         if (balanceData2 == null)
         {
             m0List = null;
         }
         else
         {
             List <VotesPack> votesPacks = balanceData2.VotesPacks;
             m0List = votesPacks != null ? Enumerable.ToList <VotesPack>(Enumerable.OrderBy <VotesPack, int>(votesPacks, (Func <VotesPack, int>)(votesPack => votesPack.VotesCount))) : null;
         }
         List <VotesPack> votesPackList = m0List;
         if (votesPackList != null)
         {
             for (int index = 0; index < votesPackList.Count; ++index)
             {
                 VotesPack votesPack = votesPackList[index];
                 bool flag           = Enumerable.Any <InAppUnfulfilledProduct>(unfulfilledProducts, (Func <InAppUnfulfilledProduct, bool>)(product => product.ProductId == votesPack.MerchantProductId));
                 VotesPackViewModel votesPackViewModel = new VotesPackViewModel(votesPack);
                 votesPackViewModel.IconCoinId         = index + 1;
                 int num = !flag ? 1 : 0;
                 votesPackViewModel.CanPurchase = num != 0;
                 this.VotesPacks.Add(votesPackViewModel);
             }
         }
         Execute.ExecuteOnUIThread((Action)(() =>
         {
             // ISSUE: type reference
             // ISSUE: method reference
             this.NotifyPropertyChanged <int>(() => this.Balance);
             // ISSUE: type reference
             // ISSUE: method reference
             this.NotifyPropertyChanged <List <VotesPackViewModel> >(() => this.VotesPacks);
         }));
         Action action = callback;
         if (action == null)
         {
             return;
         }
         action();
     }));
 }
Exemplo n.º 2
0
 private void ProcessData(BalanceData balanceData, Action callback = null)
 {
     BalanceRefillViewModel.LoadUnfulfilledConsumables((Action <List <InAppUnfulfilledProduct> >)(unfulfilledProducts =>
     {
         BalanceData balanceData1 = balanceData;
         this.Balance             = balanceData1 != null ? balanceData1.Balance : 0;
         this.VotesPacks          = new List <VotesPackViewModel>();
         BalanceData balanceData2 = balanceData;
         List <VotesPack> votesPackList1;
         if (balanceData2 == null)
         {
             votesPackList1 = (List <VotesPack>)null;
         }
         else
         {
             List <VotesPack> votesPacks = balanceData2.VotesPacks;
             votesPackList1 = votesPacks != null ? votesPacks.OrderBy <VotesPack, int>((Func <VotesPack, int>)(votesPack => votesPack.VotesCount)).ToList <VotesPack>() : (List <VotesPack>)null;
         }
         List <VotesPack> votesPackList2 = votesPackList1;
         if (votesPackList2 != null)
         {
             for (int index = 0; index < votesPackList2.Count; ++index)
             {
                 VotesPack votesPack = votesPackList2[index];
                 bool flag           = unfulfilledProducts.Any <InAppUnfulfilledProduct>((Func <InAppUnfulfilledProduct, bool>)(product => product.ProductId == votesPack.MerchantProductId));
                 VotesPackViewModel votesPackViewModel = new VotesPackViewModel(votesPack);
                 votesPackViewModel.IconCoinId         = index + 1;
                 int num = !flag ? 1 : 0;
                 votesPackViewModel.CanPurchase = num != 0;
                 this.VotesPacks.Add(votesPackViewModel);
             }
         }
         Execute.ExecuteOnUIThread((Action)(() =>
         {
             this.NotifyPropertyChanged <int>((Expression <Func <int> >)(() => this.Balance));
             this.NotifyPropertyChanged <List <VotesPackViewModel> >((Expression <Func <List <VotesPackViewModel> > >)(() => this.VotesPacks));
         }));
         Action action = callback;
         if (action == null)
         {
             return;
         }
         action();
     }));
 }