Exemple #1
0
 public static ConsoleResponse GetValue(string name)
 {
     lock (_varables)
         if (ValueContains(name))
         {
             return(ConsoleResponse.Succeeded(_varables[name].Value));
         }
     return(ConsoleResponse.Failed());
 }
Exemple #2
0
 public static ConsoleResponse SetValue(string name, string value)
 {
     lock (_varables)
         if (_varables.Contains(name))
         {
             if (_varables[name].ValidCheck == null || _varables[name].ValidCheck(value).Sucess)
             {
                 ConsoleVarable cv = _varables[name];
                 cv.Value        = value;
                 _varables[name] = cv;
                 return(ConsoleResponse.Succeeded(value));
             }
             else
             {
                 return(ConsoleResponse.Failed(DefaultLanguage.Strings.GetFormatedString("Console_Validation_Failure", name, value)));
             }
         }
         else
         {
             return(ConsoleResponse.Failed("No such variable " + name));
         }
 }