BadScript 2
Loading...
Searching...
No Matches
BadDynamicFunctionExtensions.cs
Go to the documentation of this file.
3
8
12public static partial class BadDynamicFunctionExtensions
13{
20 public static void SetFunction(this BadObject elem, string propName, Action<BadExecutionContext> func)
21 {
22 elem.SetFunction(propName,
23 ctx =>
24 {
25 func(ctx);
26
27 return BadObject.Null;
28 },
29 BadAnyPrototype.Instance
30 );
31 }
32
40 public static void SetFunction<T>(this BadObject elem, string propName, Action<BadExecutionContext, T> func)
41 {
42 elem.SetFunction<T>(propName,
43 (ctx, t) =>
44 {
45 func(ctx, t);
46
47 return BadObject.Null;
48 },
49 BadAnyPrototype.Instance
50 );
51 }
52
61 public static void SetFunction<T1, T2>(this BadObject elem,
62 string propName,
63 Action<BadExecutionContext, T1, T2> func)
64 {
65 elem.SetFunction<T1, T2>(propName,
66 (ctx, t1, t2) =>
67 {
68 func(ctx, t1, t2);
69
70 return BadObject.Null;
71 },
72 BadAnyPrototype.Instance
73 );
74 }
75
85 public static void SetFunction<T1, T2, T3>(this BadObject elem,
86 string propName,
87 Action<BadExecutionContext, T1, T2, T3> func)
88 {
89 elem.SetFunction<T1, T2, T3>(propName,
90 (ctx, t1, t2, t3) =>
91 {
92 func(ctx, t1, t2, t3);
93
94 return BadObject.Null;
95 },
96 BadAnyPrototype.Instance
97 );
98 }
99
110 public static void SetFunction<T1, T2, T3, T4>(this BadObject elem,
111 string propName,
112 Action<BadExecutionContext, T1, T2, T3, T4> func)
113 {
114 elem.SetFunction<T1, T2, T3, T4>(propName,
115 (ctx, t1, t2, t3, t4) =>
116 {
117 func(ctx, t1, t2, t3, t4);
118
119 return BadObject.Null;
120 },
121 BadAnyPrototype.Instance
122 );
123 }
124
136 public static void SetFunction<T1, T2, T3, T4, T5>(this BadObject elem,
137 string propName,
138 Action<BadExecutionContext, T1, T2, T3, T4, T5> func)
139 {
140 elem.SetFunction<T1, T2, T3, T4, T5>(propName,
141 (ctx,
142 t1,
143 t2,
144 t3,
145 t4,
146 t5) =>
147 {
148 func(ctx, t1, t2, t3, t4, t5);
149
150 return BadObject.Null;
151 },
152 BadAnyPrototype.Instance
153 );
154 }
155
168 public static void SetFunction<T1, T2, T3, T4, T5, T6>(this BadObject elem,
169 string propName,
170 Action<BadExecutionContext, T1, T2, T3, T4, T5, T6> func)
171 {
172 elem.SetFunction<T1, T2, T3, T4, T5, T6>(propName,
173 (ctx,
174 t1,
175 t2,
176 t3,
177 t4,
178 t5,
179 t6) =>
180 {
181 func(ctx, t1, t2, t3, t4, t5, t6);
182
183 return BadObject.Null;
184 },
185 BadAnyPrototype.Instance
186 );
187 }
188
203 string propName,
204 Action<BadExecutionContext, T1, T2, T3, T4, T5, T6, T7>
205 func)
206 {
207 elem.SetFunction<T1, T2, T3, T4, T5, T6, T7>(propName,
208 (ctx,
209 t1,
210 t2,
211 t3,
212 t4,
213 t5,
214 t6,
215 t7) =>
216 {
217 func(ctx, t1, t2, t3, t4, t5, t6, t7);
218
219 return BadObject.Null;
220 },
221 BadAnyPrototype.Instance
222 );
223 }
224
240 string propName,
241 Action<BadExecutionContext, T1, T2, T3, T4, T5, T6,
242 T7, T8> func)
243 {
244 elem.SetFunction<T1, T2, T3, T4, T5, T6, T7, T8>(propName,
245 (ctx,
246 t1,
247 t2,
248 t3,
249 t4,
250 t5,
251 t6,
252 t7,
253 t8) =>
254 {
255 func(ctx, t1, t2, t3, t4, t5, t6, t7, t8);
256
257 return BadObject.Null;
258 },
259 BadAnyPrototype.Instance
260 );
261 }
262
279 string propName,
280 Action<BadExecutionContext, T1, T2, T3, T4, T5,
281 T6, T7, T8, T9> func)
282 {
283 elem.SetFunction<T1, T2, T3, T4, T5, T6, T7, T8, T9>(propName,
284 (ctx,
285 t1,
286 t2,
287 t3,
288 t4,
289 t5,
290 t6,
291 t7,
292 t8,
293 t9) =>
294 {
295 func(ctx, t1, t2, t3, t4, t5, t6, t7, t8, t9);
296
297 return BadObject.Null;
298 },
299 BadAnyPrototype.Instance
300 );
301 }
302
320 string propName,
321 Action<BadExecutionContext, T1, T2, T3, T4,
322 T5, T6, T7, T8, T9, T10> func)
323 {
324 elem.SetFunction<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10>(propName,
325 (ctx,
326 t1,
327 t2,
328 t3,
329 t4,
330 t5,
331 t6,
332 t7,
333 t8,
334 t9,
335 t10) =>
336 {
337 func(ctx,
338 t1,
339 t2,
340 t3,
341 t4,
342 t5,
343 t6,
344 t7,
345 t8,
346 t9,
347 t10
348 );
349
350 return BadObject.Null;
351 },
352 BadAnyPrototype.Instance
353 );
354 }
355
374 string propName,
375 Action<BadExecutionContext, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11> func)
376 {
377 elem.SetFunction<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11>(propName,
378 (ctx,
379 t1,
380 t2,
381 t3,
382 t4,
383 t5,
384 t6,
385 t7,
386 t8,
387 t9,
388 t10,
389 t11) =>
390 {
391 func(ctx,
392 t1,
393 t2,
394 t3,
395 t4,
396 t5,
397 t6,
398 t7,
399 t8,
400 t9,
401 t10,
402 t11
403 );
404
405 return BadObject.Null;
406 },
407 BadAnyPrototype.Instance
408 );
409 }
410
430 string propName,
431 Action<BadExecutionContext, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12> func)
432 {
433 elem.SetFunction<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12>(propName,
434 (ctx,
435 t1,
436 t2,
437 t3,
438 t4,
439 t5,
440 t6,
441 t7,
442 t8,
443 t9,
444 t10,
445 t11,
446 t12) =>
447 {
448 func(ctx,
449 t1,
450 t2,
451 t3,
452 t4,
453 t5,
454 t6,
455 t7,
456 t8,
457 t9,
458 t10,
459 t11,
460 t12
461 );
462
463 return BadObject.Null;
464 },
465 BadAnyPrototype.Instance
466 );
467 }
468
489 string propName,
490 Action<BadExecutionContext, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13> func)
491 {
492 elem.SetFunction<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13>(propName,
493 (ctx,
494 t1,
495 t2,
496 t3,
497 t4,
498 t5,
499 t6,
500 t7,
501 t8,
502 t9,
503 t10,
504 t11,
505 t12,
506 t13) =>
507 {
508 func(ctx, t1, t2, t3, t4, t5, t6, t7, t8, t9, t10, t11, t12, t13);
509
510 return BadObject.Null;
511 },
512 BadAnyPrototype.Instance
513 );
514 }
515
537 string propName,
538 Action<BadExecutionContext, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14> func)
539 {
540 elem.SetFunction<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14>(propName,
541 (ctx,
542 t1,
543 t2,
544 t3,
545 t4,
546 t5,
547 t6,
548 t7,
549 t8,
550 t9,
551 t10,
552 t11,
553 t12,
554 t13,
555 t14) =>
556 {
557 func(ctx, t1, t2, t3, t4, t5, t6, t7, t8, t9, t10, t11, t12, t13, t14);
558
559 return BadObject.Null;
560 },
561 BadAnyPrototype.Instance
562 );
563 }
564
587 this BadObject elem,
588 string propName,
589 Action<BadExecutionContext, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15> func)
590 {
591 elem.SetFunction<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15>(propName,
592 (ctx,
593 t1,
594 t2,
595 t3,
596 t4,
597 t5,
598 t6,
599 t7,
600 t8,
601 t9,
602 t10,
603 t11,
604 t12,
605 t13,
606 t14,
607 t15) =>
608 {
609 func(ctx, t1, t2, t3, t4, t5, t6, t7, t8, t9, t10, t11, t12, t13, t14, t15);
610
611 return BadObject.Null;
612 },
613 BadAnyPrototype.Instance
614 );
615 }
616}
The Execution Context. Every execution of a script needs a context the script is running in....
Implements Extensions that aid in the creation of Interop Functions.
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.
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.
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.
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< 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.
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(this BadObject elem, string propName, Action< BadExecutionContext > 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.
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 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 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.
Definition BadObject.cs:14
static readonly BadObject Null
The Null Value for the BadScript Language.
Definition BadObject.cs:28
Contains the Extension Classes for Functions.
Contains the Runtime Objects.
Definition BadArray.cs:10