Ejemplo n.º 1
0
 internal override bool Callback()
 {
     if (base.Callback())
     {
         object value = Value;
         if (!Object.Equals(value, null))
         {
             Type type = value.GetType();
             if (type != mapping.ParameterType)
             {
                 if (mapping.ParameterType == typeof(string))
                 {
                     value = value.ToString();
                 }
                 else
                 {
                     value = Convert.ChangeType(value, mapping.ParameterType);
                 }
             }
         }
         mapping.Set(callbackData, value);
         return(true);
     }
     else
     {
         return(false);
     }
 }
Ejemplo n.º 2
0
        internal override bool Callback()
        {
            if (base.Callback())
            {
                var value = Value;
                if (!Equals(value, null))
                {
                    var type = value.GetType();
                    if (type != mapping.ParameterType)
                    {
                        value = mapping.ParameterType == typeof(string) ? value.ToString() : Convert.ChangeType(value, mapping.ParameterType);
                    }
                }
                mapping.Set(callbackData, value);
                return(true);
            }

            return(false);
        }