/// <exclude /> public static bool FunctionExists(string namespaceName, string name) { IFunction fun; bool exists = FunctionFacade.TryGetFunction(out fun, StringExtensionMethods.CreateNamespace(namespaceName, name)); return(exists); }
/// <exclude /> public static IFunction GetDefaultFunctionByType(Type type) { if (type == typeof(string)) { return(StandardFunctions.StringFunction); } if (type == typeof(int) || type == typeof(int?)) { return(StandardFunctions.IntegerFunction); } if (type == typeof(Decimal) || type == typeof(Decimal?)) { return(StandardFunctions.DecimalFunction); } if (type == typeof(DateTime) || type == typeof(DateTime?)) { return(StandardFunctions.DateTimeFunction); } if (type == typeof(Guid) || type == typeof(Guid?)) { return(StandardFunctions.GuidFunction); } if (type == typeof(bool) || type == typeof(bool?)) { return(StandardFunctions.BooleanFunction); } if (type == typeof(XhtmlDocument)) { return(StandardFunctions.XhtmlDocumentFunction); } if (type.IsGenericType) { if (type.GetGenericTypeDefinition() == typeof(NullableDataReference <>)) { var referenceType = type.GetGenericArguments().First(); var functionName = StringExtensionMethods.CreateNamespace(referenceType.FullName, "GetNullableDataReference"); IFunction function; if (FunctionFacade.TryGetFunction(out function, functionName)) { return(function); } } else if (type.GetGenericTypeDefinition() == typeof(DataReference <>)) { var referenceType = type.GetGenericArguments().First(); var functionName = StringExtensionMethods.CreateNamespace(referenceType.FullName, "GetDataReference"); IFunction function; if (FunctionFacade.TryGetFunction(out function, functionName)) { return(function); } } } return(null); }