예제 #1
0
 public string ExecuteAndGetResponse(ImputCommand param)
 {
     try {
         return comands[param.CallNameCommand].ExecuteAndGetResponse(param);
     } catch(KeyNotFoundException) {
         return "#Command not found";
     } catch(System.Exception e) {
         return "Undefined error :" + e.Message + "\n.Source :" + e.Source;
     }
 }
예제 #2
0
 public override string ExecuteAndGetResponse(ImputCommand param)
 {
     switch(param.Count) {
         case 0:
             return GetCurrentTimerInterval();
         case 1:
             return GetResponseTrySetInterval(param[0]);
         default:
             return "#invalid numbers of arg";
     }
 }
예제 #3
0
 public override string ExecuteAndGetResponse(ImputCommand param)
 {
     switch(param.Count) {
         case 0:
             return this.getUsingDictionList();
         case 1:
             return this.TrySetDiction(param[0]);
         default:
             return @"#to many args";
     }
 }
예제 #4
0
 public override string ExecuteAndGetResponse(ImputCommand param)
 {
     foreach(var item in dictions.GetUsingdictions()) {
         if(param.Count != 2)
             return "#ivalid number of args";
         Record row = new Record(item.ToString());
         row.word = param[0];
         if(!row.SelectByWord())
             return "#word not found";
         if(!row.Delete())
             return "#something wrong :(";
         if(!this.TrySetPriorForRow(row,param[1]))
             return "#invalid arg priority";
         if (!row.Insert())
             return "#something wrong :(";
     }
     return "#done";
 }
예제 #5
0
 public override string ExecuteAndGetResponse(ImputCommand param)
 {
     if(param.Count != 0)
         return @"#to many args";
     return this.OffTimerAndGetResponse();
 }
예제 #6
0
 public override string ExecuteAndGetResponse(ImputCommand param)
 {
     if(param.Count!=0)
         return @"#to many args";
     return ResetGenerator();
 }
예제 #7
0
 public override string ExecuteAndGetResponse(ImputCommand param)
 {
     if(param.Count!=1)
         return "#invalid numbers of arg";
     return GetRowByWord(param[0]);
 }
예제 #8
0
 public override string ExecuteAndGetResponse(ImputCommand param)
 {
     switch(param.Count) {
         case 0 :
             return this.GetCurrentPopupDalay();
         case 1:
             return this.TrySetPopupDelay(param[0]);
         default:
             return @"#to many args";
     }
 }
예제 #9
0
 public override string ExecuteAndGetResponse(ImputCommand param)
 {
     if(param.Count != 0)
         return @"#to many args";
     return QuitFromShellAndGetResponse();
 }
예제 #10
0
 private string InsertRowAndGetResponse(ImputCommand param)
 {
     foreach(var item in dictions.GetUsingdictions()) {
         Record row = new Record(item.ToString());
         row = this.SetWordForRow(row,param[0]);
         row = this.SetTransForRow(row,param[1]);
         if(param.Count > 2)
             row = this.SetRemarkForRow(row,param[2]);
         if(param.Count > 3)
             if(!this.TrySetPriorForRow(row,param[3]))
                 return "#Invalid priopity";
         if (!row.Insert() )
             return "#error inserting";
     }
     return "#done";
 }
예제 #11
0
 public abstract string ExecuteAndGetResponse(ImputCommand param);
예제 #12
0
 public override string ExecuteAndGetResponse(ImputCommand param)
 {
     if(param.Count<=1 || param.Count>4)
         return "#invalid numbers of arg";
     return InsertRowAndGetResponse(param);
 }
예제 #13
0
 public override string ExecuteAndGetResponse(ImputCommand param)
 {
     if(param.Count != 0)
         return @"#to many args";
     return this.GetCommandsAndDescription();
 }
예제 #14
0
 public override string ExecuteAndGetResponse(ImputCommand param)
 {
     if(param.Count!=1)
         return "#ivalid number of args";
     return EnableWord(param[0]);
 }
예제 #15
0
 private string TryChangeBordersandMedian(ImputCommand param)
 {
     int leftBorder;
     int rightBorder;
     int median;
     if(!int.TryParse(param[0],out leftBorder))
         return "#invalid left border";
     if(!int.TryParse(param[1],out rightBorder))
         return "#invelid right border";
     if(!int.TryParse(param[2],out median))
         return "#invalid median";
     try {
         selector.SetBordersAndMedian(leftBorder,rightBorder,median);
     } catch(System.Exception e) {
         return e.Message;
     }
     return "#distribution changed";
 }
예제 #16
0
 public override string ExecuteAndGetResponse(ImputCommand param)
 {
     if(param.Count != 3)
         return "#ivalid number of args";
     return TryChangeBordersandMedian(param);
 }