8public static partial class BadDynamicFunctionExtensions
17 if (t == typeof(
string))
22 if (t == typeof(
bool))
27 if (t.IsNumericType())
34 (t.GetGenericTypeDefinition() == typeof(List<>) || t.GetGenericTypeDefinition() == typeof(IList<>))))
50 List<BadFunctionParameter> ret =
new List<BadFunctionParameter>();
51 bool canBeOptional =
true;
53 for (
int i = t.Length - 1; i >= 0; i--)
56 bool isNullable =
false;
58 if (type.IsGenericType && type.GetGenericTypeDefinition() == typeof(
BadNullable<>))
61 type = type.GetGenericArguments()[0];
64 bool optional = canBeOptional && isNullable;
65 bool nullChecked = !isNullable;
71 canBeOptional =
false;
87 Func<BadExecutionContext, BadObject> func,
90 elem.SetProperty(propName,
106 Func<BadExecutionContext, T, BadObject> func,
110 elem.SetProperty(propName,
127 Func<BadExecutionContext, T1, T2, BadObject> func,
131 elem.SetProperty(propName,
135 parameters[0], parameters[1]
152 Func<BadExecutionContext, T1, T2, T3, BadObject> func,
155 var parameters =
GetParameters(typeof(T1), typeof(T2), typeof(T3));
156 elem.SetProperty(propName,
160 parameters[0], parameters[1], parameters[2]
178 Func<BadExecutionContext, T1, T2, T3, T4, BadObject> func,
181 var parameters =
GetParameters(typeof(T1), typeof(T2), typeof(T3), typeof(T4));
182 elem.SetProperty(propName,
186 parameters[0], parameters[1], parameters[2], parameters[3]
205 Func<BadExecutionContext, T1, T2, T3, T4, T5, BadObject> func,
208 var parameters =
GetParameters(typeof(T1), typeof(T2), typeof(T3), typeof(T4), typeof(T5));
209 elem.SetProperty(propName,
213 parameters[0], parameters[1], parameters[2], parameters[3], parameters[4]
233 Func<BadExecutionContext, T1, T2, T3, T4, T5, T6, BadObject>
237 var parameters =
GetParameters(typeof(T1), typeof(T2), typeof(T3), typeof(T4), typeof(T5), typeof(T6));
238 elem.SetProperty(propName,
242 parameters[0], parameters[1], parameters[2], parameters[3], parameters[4], parameters[5]
267 var parameters =
GetParameters(typeof(T1), typeof(T2), typeof(T3), typeof(T4), typeof(T5), typeof(T6), typeof(T7));
268 elem.SetProperty(propName,
272 parameters[0], parameters[1], parameters[2], parameters[3], parameters[4], parameters[5], parameters[6]
298 var parameters =
GetParameters(typeof(T1), typeof(T2), typeof(T3), typeof(T4), typeof(T5), typeof(T6), typeof(T7), typeof(T8));
299 elem.SetProperty(propName,
303 parameters[0], parameters[1], parameters[2], parameters[3], parameters[4], parameters[5], parameters[6], parameters[7]
330 var parameters =
GetParameters(typeof(T1), typeof(T2), typeof(T3), typeof(T4), typeof(T5), typeof(T6), typeof(T7), typeof(T8), typeof(T9));
331 elem.SetProperty(propName,
335 parameters[0], parameters[1], parameters[2], parameters[3], parameters[4], parameters[5], parameters[6], parameters[7], parameters[8]
357 public static void SetFunction<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10>(
this BadObject elem,
363 var parameters =
GetParameters(typeof(T1), typeof(T2), typeof(T3), typeof(T4), typeof(T5), typeof(T6), typeof(T7), typeof(T8), typeof(T9), typeof(T10));
364 elem.SetProperty(propName,
365 new BadDynamicInteropFunction<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10>(propName,
368 parameters[0], parameters[1], parameters[2], parameters[3], parameters[4], parameters[5], parameters[6], parameters[7], parameters[8], parameters[9]
391 public static void SetFunction<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11>(
this BadObject elem,
393 Func<BadExecutionContext, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, BadObject> func,
396 var parameters =
GetParameters(typeof(T1), typeof(T2), typeof(T3), typeof(T4), typeof(T5), typeof(T6), typeof(T7), typeof(T8), typeof(T9), typeof(T10), typeof(T11));
397 elem.SetProperty(propName,
398 new BadDynamicInteropFunction<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11>(propName,
401 parameters[0], parameters[1], parameters[2], parameters[3], parameters[4], parameters[5], parameters[6], parameters[7], parameters[8], parameters[9], parameters[10]
425 public static void SetFunction<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12>(
this BadObject elem,
427 Func<BadExecutionContext, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, BadObject> func,
430 var parameters =
GetParameters(typeof(T1), typeof(T2), typeof(T3), typeof(T4), typeof(T5), typeof(T6), typeof(T7), typeof(T8), typeof(T9), typeof(T10), typeof(T11), typeof(T12));
431 elem.SetProperty(propName,
432 new BadDynamicInteropFunction<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12>(propName,
435 parameters[0], parameters[1], parameters[2], parameters[3], parameters[4], parameters[5], parameters[6], parameters[7], parameters[8], parameters[9], parameters[10], parameters[11]
460 public static void SetFunction<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13>(
this BadObject elem,
462 Func<BadExecutionContext, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, BadObject> func,
465 var parameters =
GetParameters(typeof(T1), typeof(T2), typeof(T3), typeof(T4), typeof(T5), typeof(T6), typeof(T7), typeof(T8), typeof(T9), typeof(T10), typeof(T11), typeof(T12), typeof(T13));
466 elem.SetProperty(propName,
467 new BadDynamicInteropFunction<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13>(propName,
470 parameters[0], parameters[1], parameters[2], parameters[3], parameters[4], parameters[5], parameters[6], parameters[7], parameters[8], parameters[9], parameters[10], parameters[11], parameters[12]
496 public static void SetFunction<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14>(
this BadObject elem,
498 Func<BadExecutionContext, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, BadObject> func,
501 var parameters =
GetParameters(typeof(T1), typeof(T2), typeof(T3), typeof(T4), typeof(T5), typeof(T6), typeof(T7), typeof(T8), typeof(T9), typeof(T10), typeof(T11), typeof(T12), typeof(T13), typeof(T14));
502 elem.SetProperty(propName,
503 new BadDynamicInteropFunction<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
507 parameters[0], parameters[1], parameters[2], parameters[3], parameters[4], parameters[5], parameters[6], parameters[7], parameters[8], parameters[9], parameters[10], parameters[11], parameters[12], parameters[13]
534 public static void SetFunction<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15>(
537 Func<BadExecutionContext, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, BadObject> func,
540 var parameters =
GetParameters(typeof(T1), typeof(T2), typeof(T3), typeof(T4), typeof(T5), typeof(T6), typeof(T7), typeof(T8), typeof(T9), typeof(T10), typeof(T11), typeof(T12), typeof(T13), typeof(T14), typeof(T15));
541 elem.SetProperty(propName,
542 new BadDynamicInteropFunction<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
546 parameters[0], parameters[1], parameters[2], parameters[3], parameters[4], parameters[5], parameters[6], parameters[7], parameters[8], parameters[9], parameters[10], parameters[11], parameters[12], parameters[13], parameters[14]
The Execution Context. Every execution of a script needs a context the script is running in....
Non Generic Interop Function.
static void SetFunction< T1, T2, T3, T4, T5, T6, T7, T8, T9, T10 >(this BadObject elem, string propName, Action< BadExecutionContext, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10 > func)
Sets a Function on the given Object.
BadScript2.Runtime.Interop.Functions.Extensions.BadDynamicFunctionExtensions.SetFunction< T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13 > static void SetFunction< T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13 >(this BadObject elem, string propName, Action< BadExecutionContext, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13 > func)
Sets a Function on the given Object.
BadScript2.Runtime.Interop.Functions.Extensions.BadDynamicFunctionExtensions.SetFunction< T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15 > static void SetFunction< T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15 >(this BadObject elem, string propName, Action< BadExecutionContext, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15 > func)
Sets a Function on the given Object.
BadScript2.Runtime.Interop.Functions.Extensions.BadDynamicFunctionExtensions.SetFunction< T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12 > static void SetFunction< T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12 >(this BadObject elem, string propName, Action< BadExecutionContext, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12 > func)
Sets a Function on the given Object.
static void SetFunction< T1, T2, T3, T4, T5, T6, T7, T8, T9 >(this BadObject elem, string propName, Action< BadExecutionContext, T1, T2, T3, T4, T5, T6, T7, T8, T9 > func)
Sets a Function on the given Object.
static void SetFunction< T1, T2, T3, T4 >(this BadObject elem, string propName, Action< BadExecutionContext, T1, T2, T3, T4 > func)
Sets a Function on the given Object.
static void SetFunction< T1, T2 >(this BadObject elem, string propName, Action< BadExecutionContext, T1, T2 > func)
Sets a Function on the given Object.
static void SetFunction(this BadObject elem, string propName, Func< BadExecutionContext, BadObject > func, BadClassPrototype returnType)
Sets a Function on the given Object.
static void SetFunction< T1, T2, T3, T4, T5 >(this BadObject elem, string propName, Action< BadExecutionContext, T1, T2, T3, T4, T5 > func)
Sets a Function on the given Object.
static void SetFunction< T1, T2, T3 >(this BadObject elem, string propName, Action< BadExecutionContext, T1, T2, T3 > func)
Sets a Function on the given Object.
static void SetFunction< T1, T2, T3, T4, T5, T6, T7 >(this BadObject elem, string propName, Action< BadExecutionContext, T1, T2, T3, T4, T5, T6, T7 > func)
Sets a Function on the given Object.
BadScript2.Runtime.Interop.Functions.Extensions.BadDynamicFunctionExtensions.SetFunction< T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14 > static void SetFunction< T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14 >(this BadObject elem, string propName, Action< BadExecutionContext, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14 > func)
Sets a Function on the given Object.
static void SetFunction< T >(this BadObject elem, string propName, Action< BadExecutionContext, T > func)
Sets a Function on the given Object.
BadScript2.Runtime.Interop.Functions.Extensions.BadDynamicFunctionExtensions.SetFunction< T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11 > static void SetFunction< T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11 >(this BadObject elem, string propName, Action< BadExecutionContext, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11 > func)
Sets a Function on the given Object.
static BadFunctionParameter[] GetParameters(params Type[] t)
Returns a list of BadFunctionParameters for the given Types.
static void SetFunction< T1, T2, T3, T4, T5, T6 >(this BadObject elem, string propName, Action< BadExecutionContext, T1, T2, T3, T4, T5, T6 > func)
Sets a Function on the given Object.
static ? BadClassPrototype TryConvertType(Type t)
Tries to convert a Type to a BadClassPrototype.
static void SetFunction< T1, T2, T3, T4, T5, T6, T7, T8 >(this BadObject elem, string propName, Action< BadExecutionContext, T1, T2, T3, T4, T5, T6, T7, T8 > func)
Sets a Function on the given Object.
The Base Class for all BadScript Objects.
Stores Meta Information about a Property.
Implements a function that can be called from the script.
static readonly BadClassPrototype Prototype
The Prototype for the Function Object.
Provides function parameter info.
Implements a Class Prototype for the BadScript Language.
Helper Class that Builds a Native Class from a Prototype.
static BadClassPrototype GetNative(string name)
Returns a Native Class Prototype for the given Native Type.
Contains the Extension Classes for Functions.
Contains the Interop Reflection Classes for the BadScript2 Language.
Contains Runtime Function Objects.
Contains Runtime Type Objects.
Contains the Runtime Objects.
This is a helper type that can be used when using the .SetFunction extensions to allow for nullable p...