public void ExecuteDeleteExchCommand(object obj) { try { if (ListOfExchanges.Contains(SelectedExchange)) { ListOfExchanges.Remove(SelectedExchange); } else { statusManager.SetStatus(new Status("Exchange symbol does not exists !!", StatusSeverity.Information, null)); } } catch (Exception ex) { string str = "Failed to delete exchange"; statusManager.SetStatus(new Status(str, ex)); logger.Write(str + ex.Message); } }
public void ExecuteAddExchCommand(object obj) { try { if (ListOfExchanges.Contains(NewExchSymbol)) { statusManager.SetStatus(new Status("Exchange symbol already added !!", StatusSeverity.Information, null)); } else if (String.IsNullOrWhiteSpace(NewExchSymbol)) { statusManager.SetStatus(new Status("Select an exchange symbol !!", StatusSeverity.Information, null)); } else { ListOfExchanges.Add(NewExchSymbol); } } catch (Exception ex) { string str = "Failed to add new exchange\n"; statusManager.SetStatus(new Status(str, ex)); logger.Write(str + ex.Message); } }