Esempio n. 1
0
        private void ResultSelectedCallBack(ResultSelected resultSelected)
        {
            var queryElectricity = new GetTariffInfoForPlan(resultSelected.SupplierName,
                resultSelected.PlanKey,
                PaymentMethods.FixedMonthlyDirectDebit,
                Products.Electricity,
                resultSelected.Region);

            var queryGas = new GetTariffInfoForPlan(resultSelected.SupplierName,
                resultSelected.PlanKey,
                PaymentMethods.FixedMonthlyDirectDebit,
                Products.Electricity,
                resultSelected.Region);

            var state = new Tariff[2];

            queryElectricity.Execute(_restClient, tariff => CallDispatcher(() =>
            {
                lock (state)
                {
                    state[0] = tariff;
                    if (state[1] != null)
                    {
                        PublishTariffInformationFoundEvent(state);
                    }
                }
            }));

            queryGas.Execute(_restClient, tariff => CallDispatcher(() =>
            {
                lock (state)
                {
                    state[1] = tariff;
                    if (state[0] != null)
                    {
                        PublishTariffInformationFoundEvent(state);
                    }
                }
            }));
        }
Esempio n. 2
0
 private void ShowItemInfo()
 {
     ResultSelected?.Invoke(this, EventArgs.Empty);
 }