Пример #1
0
            bool ParseObjectDict(IRTSDict dict, Type type)
            {
                if (NextToken != TOKEN.CURLY_OPEN)
                {
                    return(false);
                }
                json.Read();
                while (true)
                {
                    switch (NextToken)
                    {
                    case TOKEN.NONE:
                        return(false);

                    case TOKEN.COMMA:
                        continue;

                    case TOKEN.CURLY_CLOSE:
                        return(true);
                    }
                    string name = ParseString(type_string);
                    if (name == null)
                    {
                        return(false);
                    }
                    if (NextToken != TOKEN.COLON)
                    {
                        return(false);
                    }
                    json.Read();
                    object value = ParseNext(type);
                    if (dict != null && name != "[]")
                    {
                        dict.Add(name, value);
                    }
                }
            }