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<>))))
51 List<BadFunctionParameter> ret =
new List<BadFunctionParameter>();
52 bool canBeOptional =
true;
54 for (
int i = t.Length - 1; i >= 0; i--)
57 bool isNullable =
false;
59 if (type.IsGenericType && type.GetGenericTypeDefinition() == typeof(
BadNullable<>))
62 type = type.GetGenericArguments()[0];
65 bool optional = canBeOptional && isNullable;
66 bool nullChecked = !isNullable;
72 canBeOptional =
false;
88 Func<BadExecutionContext, BadObject> func,
91 elem.SetProperty(propName,
107 Func<BadExecutionContext, T, BadObject> func,
110 elem.SetProperty(propName,
127 Func<BadExecutionContext, T1, T2, BadObject> func,
130 elem.SetProperty(propName,
151 Func<BadExecutionContext, T1, T2, T3, BadObject> func,
154 elem.SetProperty(propName,
176 Func<BadExecutionContext, T1, T2, T3, T4, BadObject> func,
179 elem.SetProperty(propName,
206 Func<BadExecutionContext, T1, T2, T3, T4, T5, BadObject> func,
209 elem.SetProperty(propName,
238 Func<BadExecutionContext, T1, T2, T3, T4, T5, T6, BadObject>
242 elem.SetProperty(propName,
277 elem.SetProperty(propName,
314 elem.SetProperty(propName,
353 elem.SetProperty(propName,
388 public static void SetFunction<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10>(
this BadObject elem,
394 elem.SetProperty(propName,
395 new BadDynamicInteropFunction<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10>(propName,
431 public static void SetFunction<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11>(
this BadObject elem,
433 Func<BadExecutionContext, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, BadObject> func,
436 elem.SetProperty(propName,
437 new BadDynamicInteropFunction<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11>(propName,
475 public static void SetFunction<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12>(
this BadObject elem,
477 Func<BadExecutionContext, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, BadObject> func,
480 elem.SetProperty(propName,
481 new BadDynamicInteropFunction<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12>(propName,
521 public static void SetFunction<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13>(
this BadObject elem,
523 Func<BadExecutionContext, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, BadObject> func,
526 elem.SetProperty(propName,
527 new BadDynamicInteropFunction<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13>(propName,
569 public static void SetFunction<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14>(
this BadObject elem,
571 Func<BadExecutionContext, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, BadObject> func,
574 elem.SetProperty(propName,
575 new BadDynamicInteropFunction<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
620 public static void SetFunction<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15>(
623 Func<BadExecutionContext, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, BadObject> func,
626 elem.SetProperty(propName,
627 new BadDynamicInteropFunction<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
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...