internal static string SerializeType(TypeModel model, Type type)
 {
     if (model != null)
     {
         TypeFormatEventHandler dynamicTypeFormatting = model.DynamicTypeFormatting;
         if (dynamicTypeFormatting != null)
         {
             TypeFormatEventArgs typeFormatEventArgs = new TypeFormatEventArgs(type);
             dynamicTypeFormatting(model, typeFormatEventArgs);
             if (!Helpers.IsNullOrEmpty(typeFormatEventArgs.FormattedName))
             {
                 return(typeFormatEventArgs.FormattedName);
             }
         }
     }
     return(type.AssemblyQualifiedName);
 }
 internal static Type DeserializeType(TypeModel model, string value)
 {
     if (model != null)
     {
         TypeFormatEventHandler dynamicTypeFormatting = model.DynamicTypeFormatting;
         if (dynamicTypeFormatting != null)
         {
             TypeFormatEventArgs typeFormatEventArgs = new TypeFormatEventArgs(value);
             dynamicTypeFormatting(model, typeFormatEventArgs);
             if (typeFormatEventArgs.Type != null)
             {
                 return(typeFormatEventArgs.Type);
             }
         }
     }
     return(Type.GetType(value));
 }
Beispiel #3
0
 internal static Type DeserializeType(TypeModel model, string value)
 {
     if (model != null)
     {
         TypeFormatEventHandler handler = model.DynamicTypeFormatting;
         if (handler != null)
         {
             TypeFormatEventArgs args = new TypeFormatEventArgs(value);
             handler(model, args);
             if (args.Type != null)
             {
                 return(args.Type);
             }
         }
     }
     return(Type.GetType(value));
 }