1using System.Reflection;
23 private static readonly Dictionary<Type, BadReflectedMemberTable>
s_TableCache =
24 new Dictionary<Type, BadReflectedMemberTable>();
29 private readonly Dictionary<string, BadReflectedMember>
m_Members;
66 return member.IsReadOnly
96 BadLogger.
Log($
"Creating Member Table for {t.Name}",
"BadReflection");
110 Dictionary<string, BadReflectedMember> members =
new Dictionary<string, BadReflectedMember>();
117 foreach (MemberInfo info
in t.GetMembers())
119 if (info is FieldInfo field && !members.ContainsKey(field.Name))
123 else if (info is PropertyInfo property)
125 if (property.Name ==
"Item" && property.GetIndexParameters().Length > 0)
132 else if (!members.ContainsKey(property.Name))
137 else if (info is MethodInfo method)
139 if (method.Name ==
"GetEnumerator")
143 else if (members.ContainsKey(method.Name) && members[method.Name] is
BadReflectedMethod m)
147 else if (!members.ContainsKey(method.Name))
Contains Static Data for the BadScript Language.
const string ARRAY_ACCESS_OPERATOR_NAME
Public facing interface for a logger.
static void Log(string message)
Writes a Log to the Message Handler.
Gets thrown by the runtime.
Implements a Member Table for a specific Type, including a Caching Mechanism for Reflected Members to...
readonly Dictionary< string, BadReflectedMember > m_Members
The Reflected Members.
static BadReflectedMemberTable Create(Type t)
Creates a new Member Table for the given Type.
static readonly Dictionary< Type, BadReflectedMemberTable > s_TableCache
The Member Table Cache.
BadReflectedMemberTable(Dictionary< string, BadReflectedMember > members)
Creates a new BadReflectedMemberTable.
IEnumerable< string > MemberNames
The Member Names.
static BadReflectedMemberTable Create< T >()
Creates a new Member Table for the given Type.
bool Contains(string name)
Returns true if the Member Table contains the given Member.
BadObjectReference GetMember(object instance, string name)
Returns a reference to the Member with the given Name.
static BadReflectedMemberTable CreateInternal(Type t)
Creates a new Member Table for the given Type.
Implements a Reflected 'GetEnumerator' Method.
Implements a Reflected Field Member.
Implements a Reflected Member.
Implements a Reflected Method Member.
Implements a Reflected Property Member.
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.
Contains Logging system for the BadScript Runtime.
Contains Shared Data Structures and Functionality.
Contains the Error Objects for the BadScript2 Language.
Contains the Member Classes for Reflection Objects.
Contains the Classes for Reflection Objects.
Contains the Runtime Objects.