示例#1
0
 public static CurrencyCalculator getInstance()
 {
     if (instance == null)
     {
         instance = new CurrencyCalculator();
     }
     return(instance);
 }
示例#2
0
 private void Button_Clicked(object sender, EventArgs e)
 {
     if (String.IsNullOrEmpty(FirstCurrency) || String.IsNullOrEmpty(SecondCurrency))
     {
         DisplayAlert("Ошибка", "Выберите валюты", "OK");
     }
     else
     {
         CurrencyCalculator calculator = CurrencyCalculator.getInstance();
         calculator.FirstCurrency  = FirstCurrency;
         calculator.SecondCurrency = SecondCurrency;
         Navigation.PushModalAsync(new Page1(FirstCurrency, SecondCurrency));
     }
 }
示例#3
0
 private void Button_Clicked(object sender, EventArgs e)
 {
     if (String.IsNullOrEmpty(entry.Text))
     {
         DisplayAlert("Ошибка", "Введите номинал", "OK");
     }
     if (Convert.ToInt32(entry.Text) < 0)
     {
         DisplayAlert("Ошибка", "Ddtlbnt положительное число", "OK");
     }
     else
     {
         CurrencyCalculator calculator = CurrencyCalculator.getInstance();
         calculator.Value = Value;
         float reponse = calculator.Calculate();
         result.Text = Convert.ToString(reponse);
     }
 }
示例#4
0
 private async void Connect()
 {
     CurrencyCalculator calculator = CurrencyCalculator.getInstance();
     await calculator.ConnectToServerAsync();
 }