示例#1
0
        public bool TryGetValue(string name, out object value)
        {
            var found = _dictionary.TryGetValue(name, out value);

            if (found)
            {
                if (value is IDictionary <string, object> )
                {
                    value = new DictionaryObjectValueProvider((IDictionary <string, object>)value);
                }

                if (value is object[])
                {
                    value = new ObjectArrayValueProvider((object[])value);
                }
            }

            return(found);
        }
示例#2
0
        public bool TryGetValue(int index, out object value)
        {
            if ((index < 0) || (index >= _values.Length))
            {
                value = null;
                return(false);
            }

            value = _values[index];
            if (value is IDictionary <string, object> )
            {
                value = new DictionaryObjectValueProvider((IDictionary <string, object>)value);
            }
            else if (value is object[])
            {
                value = new ObjectArrayValueProvider((object[])value);
            }

            return(true);
        }