/// <summary> /// Returns true if the type specified is a custom parsable type - and should have a static (shared) Parse method on the definition on it. /// The convert parameter will be set to a delegate that calls this method. /// </summary> /// <param name="type">The type to check for parsability</param> /// <param name="convert">If it is a custom parsable type then it will be set to the converter of this type</param> /// <returns>True if the type is decoated with a custom parsable type</returns> public static bool IsCustomParsableObjectType(Type type, out PDFValueConverter convert) { PDFParsableValueAttribute valattr = GetCustomAttribute <PDFParsableValueAttribute>(type, true); if (null != valattr) { convert = ConvertObjects.GetParsableValueConverter(type); return(null != convert); } else { convert = null; return(false); } }
/// <summary> /// Returns true if the type is a simple convertable value from a string. /// And sets the converter to the metho that will convert a string to this required type. /// If not its null and false. /// </summary> /// <param name="type"></param> /// <param name="convert"></param> /// <returns></returns> public static bool IsSimpleObjectType(Type type, out PDFValueConverter convert) { return(ConvertObjects.IsSimpleObjectType(type, out convert)); }