BadScript 2
Loading...
Searching...
No Matches
BadScript2.Runtime.BadMemberChangingEvent Class Reference
Inheritance diagram for BadScript2.Runtime.BadMemberChangingEvent:
BadScript2.Runtime.BadMemberChangeEvent BadScript2.Runtime.Objects.BadObject

Public Member Functions

override BadClassPrototype GetPrototype ()
 
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 Instance.
 
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)
 
- Public Member Functions inherited from BadScript2.Runtime.BadMemberChangeEvent
override string ToSafeString (List< BadObject > done)
 
- Public Member Functions inherited from BadScript2.Runtime.Objects.BadObject
BadClassPrototype GetPrototype ()
 Returns the Prototype of this Object.
 
string ToSafeString (List< BadObject > done)
 Returns a String Representation of this Object. This function is recursion proof and supports circular references.
 
override string ToString ()
 Returns a String Representation of this Object.
 

Properties

bool Cancel [get, private set]
 

Private Attributes

readonly BadObjectReference m_CancelReference
 

Additional Inherited Members

- Static Public Member Functions inherited from BadScript2.Runtime.Objects.BadObject
static bool CanWrap (object? o)
 Returns true if the given object cam be wrapped.
 
static BadObject Wrap< T > (T obj, bool allowNative=true)
 Wraps the given object into a BadObject Instance.
 
static implicit operator BadObject (bool b)
 Implicit Converstion from Boolean to BadObject.
 
static implicit operator BadObject (BadNullable< bool > b)
 Converts the given object to a BadObject Instance.
 
static implicit operator BadObject (decimal d)
 Implicit Converstion from Number to BadObject.
 
static implicit operator BadObject (BadNullable< decimal > b)
 Converts the given object to a BadObject Instance.
 
static implicit operator BadObject (string s)
 Implicit Converstion from String to BadObject.
 
static implicit operator BadObject (BadNullable< string > b)
 Converts the given object to a BadObject Instance.
 
- Static Public Attributes inherited from BadScript2.Runtime.Objects.BadObject
static readonly BadObject Null = new BadNullObject()
 The Null Value for the BadScript Language.
 
static readonly BadObject True = new BadBoolean(true)
 The True Value for the BadScript Language.
 
static readonly BadObject False = new BadBoolean(false)
 The False Value for the BadScript Language.
 
- Protected Member Functions inherited from BadScript2.Runtime.BadMemberChangeEvent
 BadMemberChangeEvent (BadObject mInstance, BadMemberInfo mMember, BadObject mOldValue, BadObject mNewValue)
 

Detailed Description

Definition at line 63 of file BadScope.cs.

Constructor & Destructor Documentation

◆ BadMemberChangingEvent()

BadScript2.Runtime.BadMemberChangingEvent.BadMemberChangingEvent ( BadObject  mInstance,
BadMemberInfo  mMember,
BadObject  mOldValue,
BadObject  mNewValue 
)

Definition at line 93 of file BadScope.cs.

93 : base(mInstance, mMember, mOldValue, mNewValue)
94 {
95 m_CancelReference = BadObjectReference.Make("MemberChangingEvent.Cancel", () => new BadInteropFunction("Cancel", (ctx, args) =>
96 {
97 Cancel = true;
98 return Null;
99 }, false, BadAnyPrototype.Instance));
100 }
readonly BadObjectReference m_CancelReference
Definition BadScope.cs:66
Interop Function taking an array of arguments.
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< BadObject > getter, Action< BadObject, BadPropertyInfo?>? setter=null, Action? delete=null)
Creates a new Reference Object.
The Any Prototype, Base type for all types.
static readonly BadAnyPrototype Instance
The Instance of the BadAnyPrototype.

Member Function Documentation

◆ GetProperty()

override BadObjectReference BadScript2.Runtime.BadMemberChangingEvent.GetProperty ( string  propName,
BadScope caller = null 
)
virtual

Returns a Reference to the Property with the given Name.

Parameters
propNameThe Property Name
callerThe caller Scope
Returns
The Property Reference

Reimplemented from BadScript2.Runtime.BadMemberChangeEvent.

Definition at line 83 of file BadScope.cs.

84 {
85 if (propName == "Cancel")
86 {
87 return m_CancelReference;
88 }
89
90 return base.GetProperty(propName, caller);
91 }
virtual BadObjectReference GetProperty(string propName, BadScope? caller=null)
Returns a Reference to the Property with the given Name.
Definition BadObject.cs:129

◆ GetPrototype()

override BadClassPrototype BadScript2.Runtime.BadMemberChangingEvent.GetPrototype ( )

Definition at line 69 of file BadScope.cs.

70 {
72 }
Helper Class that Builds a Native Class from a Prototype.
static readonly BadInterfacePrototype MemberChangingEventArgs

◆ HasProperty()

override bool BadScript2.Runtime.BadMemberChangingEvent.HasProperty ( string  propName,
BadScope caller = null 
)
virtual

Returns true if the object contains a given property or there exists an extension for the current Instance.

Parameters
propNameThe Property Name
callerThe caller Scope
Returns
True if the Property or an Extension with that name exists

Reimplemented from BadScript2.Runtime.BadMemberChangeEvent.

Definition at line 74 of file BadScope.cs.

75 {
76 if(propName == "Cancel")
77 {
78 return true;
79 }
80 return base.HasProperty(propName, caller);
81 }

Member Data Documentation

◆ m_CancelReference

readonly BadObjectReference BadScript2.Runtime.BadMemberChangingEvent.m_CancelReference
private

Definition at line 66 of file BadScope.cs.

Property Documentation

◆ Cancel

bool BadScript2.Runtime.BadMemberChangingEvent.Cancel
getprivate set

Definition at line 65 of file BadScope.cs.

65{ get; private set; }

The documentation for this class was generated from the following file: