Ejemplo n.º 1
0
 public bool Validate()
 {
     if (Value == null)
     {
         throw new Exception("请设置Value,Value不能为NULL");
     }
     if (FunctionHandler == null)
     {
         throw new Exception("请设置FunctionHandler,FunctionHandler不能为NULL");
     }
     else
     {
         if (Args == null)
         {
             Args = new Dictionary <string, object>();
         }
         Args["_value"] = Value;
         string errorMsg = FunctionHandler.Invoke(Args);
         if (string.IsNullOrEmpty(errorMsg))
         {
             return(true);
         }
         else
         {
             this.ErrorMessage = errorMsg;
             return(false);
         }
     }
 }