Пример #1
0
        // Get the property value by index.
        public override bool TryGetIndex(GetIndexBinder binder, object[] indexes, out object result)
        {
            if (typeof(long).IsAssignableFrom(indexes[0].GetType()))
            {
                result = SConvert.ToObject(Values[(long)indexes[0]]);
                return(true);
            }

            result = null;
            return(false);
        }
Пример #2
0
        public bool GetMember(string name, out object result)
        {
            // if the property doesn't exist, return null
            if (!_properties.ContainsKey(name))
            {
                result = null;
                return(true);
            }

            var value = _properties[name];

            result = SConvert.ToObject(value);

            return(true);
        }