Exemplo n.º 1
0
        public bool SetContent(string key, object?value, Json.Token jsonType)
        {
            if (ContentTable.ContainsKey(key))
            {
                return(Program.ReportFailure($"Key '{key}' already parsed for object"));
            }

            Debug.Assert(!ContentTypeTable.ContainsKey(key));

            ContentTable.Add(key, value !);
            ContentTypeTable.Add(key, jsonType);

            return(true);
        }
Exemplo n.º 2
0
        public bool FinishArray(string key, ParsingContext arrayContext)
        {
            if (ContentTable.ContainsKey(key))
            {
                return(Program.ReportFailure($"Key '{key}' already parsed for object"));
            }

            Debug.Assert(!ContentTypeTable.ContainsKey(key));

            ContentTable.Add(key, arrayContext.ItemCollection);
            ContentTypeTable.Add(key, arrayContext.LastItemType);

            return(true);
        }