private void calculateButton_Click(object sender, EventArgs e) { Validator validator = new Validator(); validator.ValidationState += new Action <string>(client_DoReport); if (this.currencyListComboBox.SelectedItem != null) { string currency = validator.ValidateText(this.currencyListComboBox.SelectedItem.ToString()); double amount = validator.ValidateAndConvertToDouble(this.amountTextBox.Text); const string UAH = "UAH"; DateTime date = DateTime.Now; if (validator.DataIsValid) { DataModelForConverter data = new DataModelForConverter(); data.Amount = amount; data.Date = date; data.DestinationCurrency = UAH; data.SourceCurrency = currency; ProxyWorker <MoneyConverterClient> client = null; client = new ProxyWorker <MoneyConverterClient>(data); client.DoReport += new Action <string>(client_DoReport); client.DoAction += new Action <MoneyConverterClient, object>(client_ConvertCurrency); client.Login = auth.Login; client.Password = auth.Password; client.Start(); } } }
private void GetCurrencyList() { ProxyWorker <MoneyConverterClient> client = null; client = new ProxyWorker <MoneyConverterClient>(null); client.DoReport += new Action <string>(client_DoReport); client.DoAction += new Action <MoneyConverterClient, object>(client_DoList); client.Login = auth.Login; client.Password = auth.Password; client.Start(); }
private void calculateButton_Click(object sender, EventArgs e) { Validator validator = new Validator(); validator.ValidationState += new Action<string>(client_DoReport); if(this.currencyListComboBox.SelectedItem!=null) { string currency = validator.ValidateText(this.currencyListComboBox.SelectedItem.ToString()); double amount = validator.ValidateAndConvertToDouble(this.amountTextBox.Text); const string UAH = "UAH"; DateTime date = DateTime.Now; if (validator.DataIsValid) { DataModelForConverter data = new DataModelForConverter(); data.Amount = amount; data.Date = date; data.DestinationCurrency = UAH; data.SourceCurrency = currency; ProxyWorker<MoneyConverterClient> client = null; client = new ProxyWorker<MoneyConverterClient>(data); client.DoReport += new Action<string>(client_DoReport); client.DoAction += new Action<MoneyConverterClient, object>(client_ConvertCurrency); client.Login = auth.Login; client.Password = auth.Password; client.Start(); } } }
private void GetCurrencyList() { ProxyWorker<MoneyConverterClient> client = null; client = new ProxyWorker<MoneyConverterClient>(null); client.DoReport += new Action<string>(client_DoReport); client.DoAction += new Action<MoneyConverterClient,object>(client_DoList); client.Login = auth.Login; client.Password = auth.Password; client.Start(); }