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; } }
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"; } }
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"; } }
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"; }
public override string ExecuteAndGetResponse(ImputCommand param) { if(param.Count != 0) return @"#to many args"; return this.OffTimerAndGetResponse(); }
public override string ExecuteAndGetResponse(ImputCommand param) { if(param.Count!=0) return @"#to many args"; return ResetGenerator(); }
public override string ExecuteAndGetResponse(ImputCommand param) { if(param.Count!=1) return "#invalid numbers of arg"; return GetRowByWord(param[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"; } }
public override string ExecuteAndGetResponse(ImputCommand param) { if(param.Count != 0) return @"#to many args"; return QuitFromShellAndGetResponse(); }
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"; }
public abstract string ExecuteAndGetResponse(ImputCommand param);
public override string ExecuteAndGetResponse(ImputCommand param) { if(param.Count<=1 || param.Count>4) return "#invalid numbers of arg"; return InsertRowAndGetResponse(param); }
public override string ExecuteAndGetResponse(ImputCommand param) { if(param.Count != 0) return @"#to many args"; return this.GetCommandsAndDescription(); }
public override string ExecuteAndGetResponse(ImputCommand param) { if(param.Count!=1) return "#ivalid number of args"; return EnableWord(param[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"; }
public override string ExecuteAndGetResponse(ImputCommand param) { if(param.Count != 3) return "#ivalid number of args"; return TryChangeBordersandMedian(param); }