コード例 #1
0
 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);
     }
 }
コード例 #2
0
 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);
     }
 }