Ejemplo n.º 1
0
 private static string FormatCustomType(object input, FieldSchema schema, IContext context)
 {
     string result;
     if (input == null)
     {
         result = String.Empty;
     }
     else
     {
         var binder = context.GetBinder(schema.CustomType);
         Trace.WriteLineIf(binder == null, "Binder resolving failed for complex type: " + schema.CustomType);
         result = binder == null
                      ? String.Empty
                      : binder.Format(input, schema, context);
     }
     return result;
 }
Ejemplo n.º 2
0
 private static object ParseCustomType(string input, FieldSchema schema, IContext context)
 {
     object result;
     if (!String.IsNullOrWhiteSpace(schema.CustomType))
     {
         var binder = context.GetBinder(schema.CustomType);
         Trace.WriteLineIf(binder == null, "Binder resolving failed for complex type: " + schema.CustomType);
         result = binder == null
                      ? null
                      : binder.Parse(input, schema, context);
     }
     else
     {
         result = input ?? String.Empty;
     }
     return result;
 }