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(
23 propName,
24 ctx =>
25 {
26 func(ctx);
27
28 return BadObject.Null;
29 },
30 BadAnyPrototype.Instance
31 );
32 }
33
41 public static void SetFunction<T>(this BadObject elem, string propName, Action<BadExecutionContext, T> func)
42 {
43 elem.SetFunction<T>(
44 propName,
45 (ctx, t) =>
46 {
47 func(ctx, t);
48
49 return BadObject.Null;
50 },
51 BadAnyPrototype.Instance
52 );
53 }
54
63 public static void SetFunction<T1, T2>(
64 this BadObject elem,
65 string propName,
66 Action<BadExecutionContext, T1, T2> func)
67 {
68 elem.SetFunction<T1, T2>(
69 propName,
70 (ctx, t1, t2) =>
71 {
72 func(ctx, t1, t2);
73
74 return BadObject.Null;
75 },
76 BadAnyPrototype.Instance
77 );
78 }
79
89 public static void SetFunction<T1, T2, T3>(
90 this BadObject elem,
91 string propName,
92 Action<BadExecutionContext, T1, T2, T3> func)
93 {
94 elem.SetFunction<T1, T2, T3>(
95 propName,
96 (ctx, t1, t2, t3) =>
97 {
98 func(ctx, t1, t2, t3);
99
100 return BadObject.Null;
101 },
102 BadAnyPrototype.Instance
103 );
104 }
105
116 public static void SetFunction<T1, T2, T3, T4>(
117 this BadObject elem,
118 string propName,
119 Action<BadExecutionContext, T1, T2, T3, T4> func)
120 {
121 elem.SetFunction<T1, T2, T3, T4>(
122 propName,
123 (ctx, t1, t2, t3, t4) =>
124 {
125 func(ctx, t1, t2, t3, t4);
126
127 return BadObject.Null;
128 },
129 BadAnyPrototype.Instance
130 );
131 }
132
145 this BadObject elem,
146 string propName,
147 Action<BadExecutionContext, T1, T2, T3, T4, T5> func)
148 {
149 elem.SetFunction<T1, T2, T3, T4, T5>(
150 propName,
151 (
152 ctx,
153 t1,
154 t2,
155 t3,
156 t4,
157 t5) =>
158 {
159 func(ctx, t1, t2, t3, t4, t5);
160
161 return BadObject.Null;
162 },
163 BadAnyPrototype.Instance
164 );
165 }
166
180 this BadObject elem,
181 string propName,
182 Action<BadExecutionContext, T1, T2, T3, T4, T5, T6> func)
183 {
184 elem.SetFunction<T1, T2, T3, T4, T5, T6>(
185 propName,
186 (
187 ctx,
188 t1,
189 t2,
190 t3,
191 t4,
192 t5,
193 t6) =>
194 {
195 func(ctx, t1, t2, t3, t4, t5, t6);
196
197 return BadObject.Null;
198 },
199 BadAnyPrototype.Instance
200 );
201 }
202
217 this BadObject elem,
218 string propName,
219 Action<BadExecutionContext, T1, T2, T3, T4, T5, T6, T7> func)
220 {
221 elem.SetFunction<T1, T2, T3, T4, T5, T6, T7>(
222 propName,
223 (
224 ctx,
225 t1,
226 t2,
227 t3,
228 t4,
229 t5,
230 t6,
231 t7) =>
232 {
233 func(ctx, t1, t2, t3, t4, t5, t6, t7);
234
235 return BadObject.Null;
236 },
237 BadAnyPrototype.Instance
238 );
239 }
240
256 this BadObject elem,
257 string propName,
258 Action<BadExecutionContext, T1, T2, T3, T4, T5, T6, T7, T8> func)
259 {
260 elem.SetFunction<T1, T2, T3, T4, T5, T6, T7, T8>(
261 propName,
262 (
263 ctx,
264 t1,
265 t2,
266 t3,
267 t4,
268 t5,
269 t6,
270 t7,
271 t8) =>
272 {
273 func(ctx, t1, t2, t3, t4, t5, t6, t7, t8);
274
275 return BadObject.Null;
276 },
277 BadAnyPrototype.Instance
278 );
279 }
280
297 this BadObject elem,
298 string propName,
299 Action<BadExecutionContext, T1, T2, T3, T4, T5, T6, T7, T8, T9> func)
300 {
301 elem.SetFunction<T1, T2, T3, T4, T5, T6, T7, T8, T9>(
302 propName,
303 (
304 ctx,
305 t1,
306 t2,
307 t3,
308 t4,
309 t5,
310 t6,
311 t7,
312 t8,
313 t9) =>
314 {
315 func(ctx, t1, t2, t3, t4, t5, t6, t7, t8, t9);
316
317 return BadObject.Null;
318 },
319 BadAnyPrototype.Instance
320 );
321 }
322
340 this BadObject elem,
341 string propName,
342 Action<BadExecutionContext, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10> func)
343 {
344 elem.SetFunction<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10>(
345 propName,
346 (
347 ctx,
348 t1,
349 t2,
350 t3,
351 t4,
352 t5,
353 t6,
354 t7,
355 t8,
356 t9,
357 t10) =>
358 {
359 func(ctx, t1, t2, t3, t4, t5, t6, t7, t8, t9, t10);
360
361 return BadObject.Null;
362 },
363 BadAnyPrototype.Instance
364 );
365 }
366
385 this BadObject elem,
386 string propName,
387 Action<BadExecutionContext, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11> func)
388 {
389 elem.SetFunction<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11>(
390 propName,
391 (
392 ctx,
393 t1,
394 t2,
395 t3,
396 t4,
397 t5,
398 t6,
399 t7,
400 t8,
401 t9,
402 t10,
403 t11) =>
404 {
405 func(ctx, t1, t2, t3, t4, t5, t6, t7, t8, t9, t10, t11);
406
407 return BadObject.Null;
408 },
409 BadAnyPrototype.Instance
410 );
411 }
412
432 this BadObject elem,
433 string propName,
434 Action<BadExecutionContext, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12> func)
435 {
436 elem.SetFunction<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12>(
437 propName,
438 (
439 ctx,
440 t1,
441 t2,
442 t3,
443 t4,
444 t5,
445 t6,
446 t7,
447 t8,
448 t9,
449 t10,
450 t11,
451 t12) =>
452 {
453 func(ctx, t1, t2, t3, t4, t5, t6, t7, t8, t9, t10, t11, t12);
454
455 return BadObject.Null;
456 },
457 BadAnyPrototype.Instance
458 );
459 }
460
481 this BadObject elem,
482 string propName,
483 Action<BadExecutionContext, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13> func)
484 {
485 elem.SetFunction<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13>(
486 propName,
487 (
488 ctx,
489 t1,
490 t2,
491 t3,
492 t4,
493 t5,
494 t6,
495 t7,
496 t8,
497 t9,
498 t10,
499 t11,
500 t12,
501 t13) =>
502 {
503 func(ctx, t1, t2, t3, t4, t5, t6, t7, t8, t9, t10, t11, t12, t13);
504
505 return BadObject.Null;
506 },
507 BadAnyPrototype.Instance
508 );
509 }
510
532 this BadObject elem,
533 string propName,
534 Action<BadExecutionContext, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14> func)
535 {
536 elem.SetFunction<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14>(
537 propName,
538 (
539 ctx,
540 t1,
541 t2,
542 t3,
543 t4,
544 t5,
545 t6,
546 t7,
547 t8,
548 t9,
549 t10,
550 t11,
551 t12,
552 t13,
553 t14) =>
554 {
555 func(ctx, t1, t2, t3, t4, t5, t6, t7, t8, t9, t10, t11, t12, t13, t14);
556
557 return BadObject.Null;
558 },
559 BadAnyPrototype.Instance
560 );
561 }
562
585 this BadObject elem,
586 string propName,
587 Action<BadExecutionContext, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15> func)
588 {
589 elem.SetFunction<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15>(
590 propName,
591 (
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}
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