Beispiel #1
0
 public bool IsReadOnly(string name)
 {
     if (Context.Context.InstanceVariables.Contains(name, StringComparer.Ordinal))
     {
         return(FieldAccessor <Value> .IsReadOnly(this, name));
     }
     return(instancevars[name].IsReadOnly);
 }
Beispiel #2
0
 public bool CheckIndex(string name, int i1, int i2)
 {
     if (Context.Context.InstanceVariables.Contains(name, StringComparer.Ordinal))
     {
         return(FieldAccessor <Value> .CheckIndex(this, name, i1, i2));
     }
     return(instancevars[name].CheckIndex(i1, i2));
 }
Beispiel #3
0
 public Value GetLocalVar(string name, int i1, int i2)
 {
     if (Context.Context.InstanceVariables.Contains(name, StringComparer.Ordinal))
     {
         return(FieldAccessor <Value> .GetNamedValue(this, name, i1, i2));
     }
     return(instancevars[name][i1, i2]);
 }
Beispiel #4
0
        private static FieldAccessor <T> GetFieldAccessor(Type t)
        {
            FieldAccessor <T> accessor;

            if (!FieldAccessors.TryGetValue(t, out accessor))
            {
                FieldAccessors.Add(t, accessor = new FieldAccessor <T>(t));
            }

            return(accessor);
        }
        public static GetSetValue GetGlobalVariable(string name)
        {
            if (GlobalVariables.ContainsKey(name))
            {
                return(GlobalVariables[name]);
            }

            var obj = FieldAccessor <Value> .ChooseObject(GlobalObjects, name);

            return(obj == null ? null : new VariableWrapper(obj, name));
        }
Beispiel #6
0
 public void SetLocalVar(string name, int i1, int i2, Value val)
 {
     if (Context.Context.InstanceVariables.Contains(name, StringComparer.Ordinal))
     {
         FieldAccessor <Value> .SetNamedValue(this, name, val);
     }
     else if (instancevars.ContainsKey(name))
     {
         instancevars[name][i1, i2] = val;
     }
     else
     {
         instancevars.Add(name, new Variable(i1, i2, val));
     }
 }
Beispiel #7
0
 public GetSetValue Variable(string name)
 {
     if (Context.Context.InstanceVariables.Contains(name, StringComparer.Ordinal))
     {
         return(FieldAccessor <Value> .Variable(this, name));
     }
     else if (instancevars.ContainsKey(name))
     {
         return(instancevars[name]);
     }
     else
     {
         return(null);
     }
 }
Beispiel #8
0
 public override bool CheckIndex(int i1, int i2)
 {
     return(FieldAccessor <Value> .CheckIndex(m_obj, m_name, i1, i2));
 }
Beispiel #9
0
 public override void Set(int i1, int i2, Value value)
 {
     FieldAccessor <Value> .SetNamedValue(m_obj, m_name, i1, i2, value);
 }
Beispiel #10
0
 public override Value Get(int i1, int i2)
 {
     return(FieldAccessor <Value> .GetNamedValue(m_obj, m_name, i1, i2));
 }
 public static bool GlobalVariableExists(string name)
 {
     return(GlobalVariables.ContainsKey(name) ||
            FieldAccessor <Value> .ChooseObject(GlobalObjects, name) != null);
 }