BadScript 2
Loading...
Searching...
No Matches
BadMemberChangingEvent.cs
Go to the documentation of this file.
4
5namespace BadScript2.Runtime;
6
8{
10
11 public BadMemberChangingEvent(BadObject mInstance, BadMemberInfo mMember, BadObject mOldValue, BadObject mNewValue)
12 : base(mInstance, mMember, mOldValue, mNewValue)
13 {
14 m_CancelReference = BadObjectReference.Make("MemberChangingEvent.Cancel",
15 (p) => new BadInteropFunction("Cancel",
16 (ctx, args) =>
17 {
18 Cancel = true;
19
20 return Null;
21 },
22 false,
23 BadAnyPrototype.Instance
24 )
25 );
26 }
27
28 public bool Cancel { get; private set; }
29
30
35
36 public override bool HasProperty(string propName, BadScope? caller = null)
37 {
38 if (propName == "Cancel")
39 {
40 return true;
41 }
42
43 return base.HasProperty(propName, caller);
44 }
45
46 public override BadObjectReference GetProperty(string propName, BadScope? caller = null)
47 {
48 if (propName == "Cancel")
49 {
50 return m_CancelReference;
51 }
52
53 return base.GetProperty(propName, caller);
54 }
55}
override bool HasProperty(string propName, BadScope? caller=null)
Returns true if the object contains a given property or there exists an extension for the current Ins...
override BadObjectReference GetProperty(string propName, BadScope? caller=null)
Returns a Reference to the Property with the given Name.
BadMemberChangingEvent(BadObject mInstance, BadMemberInfo mMember, BadObject mOldValue, BadObject mNewValue)
Implements the Scope for the Script Engine.
Definition BadScope.cs:16
Interop Function taking an array of arguments.
The Base Class for all BadScript Objects.
Definition BadObject.cs:14
virtual BadObjectReference GetProperty(string propName, BadScope? caller=null)
Returns a Reference to the Property with the given Name.
Definition BadObject.cs:141
static readonly BadObject Null
The Null Value for the BadScript Language.
Definition BadObject.cs:28
Implements the base functionality for a BadScript Reference.
static BadObjectReference Make(string refText, Func< BadSourcePosition?, BadObject > getter, Action< BadObject, BadSourcePosition?, BadPropertyInfo?>? setter=null, Action< BadSourcePosition?>? delete=null)
Creates a new Reference Object.
Implements a Class Prototype for the BadScript Language.
Helper Class that Builds a Native Class from a Prototype.
static readonly BadInterfacePrototype MemberChangingEventArgs
Contains the Interop Function Classes for the BadScript2 Language.
Contains the Runtime Objects.
Definition BadArray.cs:10
Contains the Runtime Implementation.