public override object _0001(TagTestItem def, Type ord, object dir, PrototypeError reg2)
        {
            //Discarded unreachable code: IL_0002
            //IL_0003: Incompatible stack heights: 0 vs 1
            if (def._0001() == WatcherComposer.Null)
            {
                return(null);
            }
            DataSet           dataSet           = (ord == typeof(DataSet)) ? new DataSet() : ((DataSet)Activator.CreateInstance(ord));
            FieldReaderMapper fieldReaderMapper = new FieldReaderMapper();

            def.SortError();
            while (def._0001() == WatcherComposer.PropertyName)
            {
                DataTable dataTable = dataSet.Tables[(string)def._0001()];
                bool      num       = dataTable != null;
                dataTable = (DataTable)fieldReaderMapper._0001(def, typeof(DataTable), dataTable, reg2);
                if (!num)
                {
                    dataSet.Tables.Add(dataTable);
                }
                def.SortError();
            }
            return(dataSet);
        }
        public override object _0001(TagTestItem info, Type b, object c, PrototypeError asset2)
        {
            //Discarded unreachable code: IL_0002
            //IL_0003: Incompatible stack heights: 0 vs 1
            if (info._0001() == WatcherComposer.Null)
            {
                return(null);
            }
            DataTable dataTable = c as DataTable;

            if (dataTable == null)
            {
                dataTable = ((b == typeof(DataTable)) ? new DataTable() : ((DataTable)Activator.CreateInstance(b)));
            }
            if (info._0001() == WatcherComposer.PropertyName)
            {
                dataTable.TableName = (string)info._0001();
                info.SortError();
                if (info._0001() == WatcherComposer.Null)
                {
                    return(dataTable);
                }
            }
            if (info._0001() != WatcherComposer.StartArray)
            {
                throw StrategyError.PatchComposer(info, "Unexpected JSON token when reading DataTable. Expected StartArray, got {0}.".ListReader(CultureInfo.InvariantCulture, info._0001()));
            }
            info.SortError();
            while (info._0001() != WatcherComposer.EndArray)
            {
                RestartRequest(info, dataTable, asset2);
                info.SortError();
            }
            return(dataTable);
        }
        private static Type SearchRequest(TagTestItem key)
        {
            //Discarded unreachable code: IL_0002
            //IL_0003: Incompatible stack heights: 0 vs 1
            WatcherComposer watcherComposer = key._0001();

            switch (watcherComposer)
            {
            case WatcherComposer.Integer:
            case WatcherComposer.Float:
            case WatcherComposer.String:
            case WatcherComposer.Boolean:
            case WatcherComposer.Date:
            case WatcherComposer.Bytes:
                return(key._0001());

            case WatcherComposer.Null:
            case WatcherComposer.Undefined:
            case WatcherComposer.EndArray:
                return(typeof(string));

            case WatcherComposer.StartArray:
                key.SortError();
                if (key._0001() == WatcherComposer.StartObject)
                {
                    return(typeof(DataTable));
                }
                return(SearchRequest(key).MakeArrayType());

            default:
                throw StrategyError.PatchComposer(key, "Unexpected JSON token when reading DataTable: {0}".ListReader(CultureInfo.InvariantCulture, watcherComposer));
            }
        }
        public override object _0001(TagTestItem config, Type ivk, object template, PrototypeError connection2)
        {
            //Discarded unreachable code: IL_0002
            //IL_0003: Incompatible stack heights: 0 vs 1
            if (config._0001() == WatcherComposer.Null)
            {
                if (!ResolverErrorFilter.PatchReader(ivk))
                {
                    throw StrategyError.PatchComposer(config, "Cannot convert null value to KeyValuePair.");
                }
                return(null);
            }
            object obj  = null;
            object obj2 = null;

            config.SortError();
            Type res = ResolverErrorFilter.PatchReader(ivk) ? Nullable.GetUnderlyingType(ivk) : ivk;
            ModelInstanceExpression modelInstanceExpression = m_ListenerIssuer.InitReader(res);
            ProcTest procTest  = connection2._0001()._0001(modelInstanceExpression.SetupIssuer("Key"));
            ProcTest procTest2 = connection2._0001()._0001(modelInstanceExpression.SetupIssuer("Value"));

            while (config._0001() == WatcherComposer.PropertyName)
            {
                string a = config._0001().ToString();
                if (string.Equals(a, "Key", StringComparison.OrdinalIgnoreCase))
                {
                    config.CallError(procTest, iscaller: false);
                    obj = connection2.AddComposer(config, procTest._0002());
                }
                else if (string.Equals(a, "Value", StringComparison.OrdinalIgnoreCase))
                {
                    config.CallError(procTest2, iscaller: false);
                    obj2 = connection2.AddComposer(config, procTest2._0002());
                }
                else
                {
                    config.AssetError();
                }
                config.SortError();
            }
            return(modelInstanceExpression._0001()(new object[2]
            {
                obj,
                obj2
            }));
        }
Beispiel #5
0
 private static void SetRequest(TagTestItem param, string ord)
 {
     //Discarded unreachable code: IL_0002
     //IL_0003: Incompatible stack heights: 0 vs 1
     param.SortError();
     if (param._0001() != WatcherComposer.PropertyName || !string.Equals(param._0001()?.ToString(), ord, StringComparison.OrdinalIgnoreCase))
     {
         throw new StrategyError("Expected JSON property '{0}'.".ListReader(CultureInfo.InvariantCulture, ord));
     }
 }
        private static void RestartRequest(TagTestItem instance, DataTable cont, PrototypeError template)
        {
            //Discarded unreachable code: IL_0002
            //IL_0003: Incompatible stack heights: 0 vs 1
            DataRow dataRow = cont.NewRow();

            instance.SortError();
            while (instance._0001() == WatcherComposer.PropertyName)
            {
                string text = (string)instance._0001();
                instance.SortError();
                DataColumn dataColumn = cont.Columns[text];
                if (dataColumn == null)
                {
                    Type dataType = SearchRequest(instance);
                    dataColumn = new DataColumn(text, dataType);
                    cont.Columns.Add(dataColumn);
                }
                if (dataColumn.DataType == typeof(DataTable))
                {
                    if (instance._0001() == WatcherComposer.StartArray)
                    {
                        instance.SortError();
                    }
                    DataTable dataTable = new DataTable();
                    while (instance._0001() != WatcherComposer.EndArray)
                    {
                        RestartRequest(instance, dataTable, template);
                        instance.SortError();
                    }
                    dataRow[text] = dataTable;
                }
                else if (!dataColumn.DataType.IsArray || !(dataColumn.DataType != typeof(byte[])))
                {
                    object obj2 = dataRow[text] = ((instance._0001() != null) ? (template.AddComposer(instance, dataColumn.DataType) ?? DBNull.Value) : DBNull.Value);
                }
                else
                {
                    if (instance._0001() == WatcherComposer.StartArray)
                    {
                        instance.SortError();
                    }
                    List <object> list = new List <object>();
                    while (instance._0001() != WatcherComposer.EndArray)
                    {
                        list.Add(instance._0001());
                        instance.SortError();
                    }
                    Array array = Array.CreateInstance(dataColumn.DataType.GetElementType(), list.Count);
                    ((ICollection)list).CopyTo(array, 0);
                    dataRow[text] = array;
                }
                instance.SortError();
            }
            dataRow.EndEdit();
            cont.Rows.Add(dataRow);
        }
Beispiel #7
0
        public override object _0001(TagTestItem item, Type attr, object util, PrototypeError var12)
        {
            //Discarded unreachable code: IL_0002
            //IL_0003: Incompatible stack heights: 0 vs 1
            RateRequest(attr);
            object obj = m_SerializerIssuer._0001()(new object[0]);

            SetRequest(item, "Key");
            item.SortError();
            m_SerializerIssuer.ExcludeIssuer(obj, "Key", item._0001()?.ToString());
            SetRequest(item, "Type");
            item.SortError();
            Type type = Type.GetType(item._0001()?.ToString());

            SetRequest(item, "Value");
            item.SortError();
            m_SerializerIssuer.ExcludeIssuer(obj, "Value", var12.AddComposer(item, type));
            item.SortError();
            return(obj);
        }
Beispiel #8
0
        private void PatchIterator(TagTestItem setup, AttrBroadcasterFilter selection, CreatorIssuer util)
        {
            //Discarded unreachable code: IL_0002
            //IL_0003: Incompatible stack heights: 0 vs 1
            string spec   = null;
            string caller = null;
            string state  = null;
            string config = null;

            while (setup._0001() && setup._0001() != WatcherComposer.EndObject)
            {
                switch (setup._0001()?.ToString())
                {
                case "@name":
                    setup.SortError();
                    spec = WriteRequest(setup);
                    break;

                case "@public":
                    setup.SortError();
                    caller = WriteRequest(setup);
                    break;

                case "@system":
                    setup.SortError();
                    state = WriteRequest(setup);
                    break;

                case "@internalSubset":
                    setup.SortError();
                    config = WriteRequest(setup);
                    break;

                default:
                    throw StrategyError.PatchComposer(setup, "Unexpected property name encountered while deserializing XmlDeclaration: " + setup._0001());
                }
            }
            CreatorIssuer asset = selection._0001(spec, caller, state, config);

            util._0001(asset);
        }
Beispiel #9
0
        private void VerifyIterator(TagTestItem setup, AttrBroadcasterFilter visitor, CreatorIssuer temp, string setup2)
        {
            //Discarded unreachable code: IL_0002
            //IL_0003: Incompatible stack heights: 0 vs 1
            if (setup2 == "?xml")
            {
                string instance = null;
                string caller   = null;
                string tag      = null;
                while (setup._0001() && setup._0001() != WatcherComposer.EndObject)
                {
                    switch (setup._0001()?.ToString())
                    {
                    case "@version":
                        setup.SortError();
                        instance = WriteRequest(setup);
                        break;

                    case "@encoding":
                        setup.SortError();
                        caller = WriteRequest(setup);
                        break;

                    case "@standalone":
                        setup.SortError();
                        tag = WriteRequest(setup);
                        break;

                    default:
                        throw StrategyError.PatchComposer(setup, "Unexpected property name encountered while deserializing XmlDeclaration: " + setup._0001());
                    }
                }
                CreatorIssuer asset = visitor._0001(instance, caller, tag);
                temp._0001(asset);
            }
            else
            {
                CreatorIssuer asset2 = visitor._0001(setup2.Substring(1), WriteRequest(setup));
                temp._0001(asset2);
            }
        }
Beispiel #10
0
        private void SortRequest(TagTestItem spec, AttrBroadcasterFilter connection, CreatorIssuer template, string pred2, XmlNamespaceManager connection3)
        {
            //Discarded unreachable code: IL_0002
            //IL_0003: Incompatible stack heights: 0 vs 1
            if (SetterTest.StartReader(pred2))
            {
                throw StrategyError.PatchComposer(spec, "XmlNodeConverter cannot convert JSON with an empty property name to XML.");
            }
            Dictionary <string, string> token = null;
            string asset = null;

            if (!_0005())
            {
                token = (CheckIterator(spec) ? DisableIterator(spec, connection3) : null);
                asset = CustomerListAnnotation.CountIssuer(pred2);
                if (pred2.ExcludeReader('@'))
                {
                    string text      = pred2.Substring(1);
                    string reference = CustomerListAnnotation.CountIssuer(text);
                    PublishRequest(spec, connection, template, pred2, text, connection3, reference);
                    return;
                }
                if (pred2.ExcludeReader('$'))
                {
                    switch (pred2)
                    {
                    case "$values":
                        pred2 = pred2.Substring(1);
                        asset = connection3.LookupPrefix("http://james.newtonking.com/projects/json");
                        CallRequest(spec, connection, template, pred2, connection3, asset, token);
                        return;

                    case "$id":
                    case "$ref":
                    case "$type":
                    case "$value":
                    {
                        string v          = pred2.Substring(1);
                        string reference2 = connection3.LookupPrefix("http://james.newtonking.com/projects/json");
                        PublishRequest(spec, connection, template, pred2, v, connection3, reference2);
                        return;
                    }
                    }
                }
            }
            else if (CheckIterator(spec))
            {
                spec.SortError();
            }
            CallRequest(spec, connection, template, pred2, connection3, asset, token);
        }
Beispiel #11
0
        public override object _0001(TagTestItem ident, Type b, object field, PrototypeError config2)
        {
            //Discarded unreachable code: IL_0002
            //IL_0003: Incompatible stack heights: 0 vs 1
            if (ident._0001() == WatcherComposer.Null)
            {
                return(null);
            }
            FactoryDicCandidate factoryDicCandidate = null;
            string text = null;
            InstanceClassDispatcher instanceClassDispatcher = null;

            ident.SortError();
            while (ident._0001() == WatcherComposer.PropertyName)
            {
                string text2 = ident._0001().ToString();
                if (string.Equals(text2, "Case", StringComparison.OrdinalIgnoreCase))
                {
                    ident.SortError();
                    UtilsClientBridge utilsClientBridge = m_ParameterIssuer.InitReader(b);
                    text = ident._0001().ToString();
                    factoryDicCandidate = utilsClientBridge.m_StatusIssuer.SingleOrDefault((FactoryDicCandidate P_0) => P_0._HelperIssuer == text);
                    if (factoryDicCandidate == null)
                    {
                        throw StrategyError.PatchComposer(ident, "No union type found with the name '{0}'.".ListReader(CultureInfo.InvariantCulture, text));
                    }
                }
                else
                {
                    if (!string.Equals(text2, "Fields", StringComparison.OrdinalIgnoreCase))
                    {
                        throw StrategyError.PatchComposer(ident, "Unexpected property '{0}' found when reading union.".ListReader(CultureInfo.InvariantCulture, text2));
                    }
                    ident.SortError();
                    if (ident._0001() != WatcherComposer.StartArray)
                    {
                        throw StrategyError.PatchComposer(ident, "Union fields must been an array.");
                    }
                    instanceClassDispatcher = (InstanceClassDispatcher)ParserFilterResolver.SelectClass(ident);
                }
                ident.SortError();
            }
            if (factoryDicCandidate == null)
            {
                throw StrategyError.PatchComposer(ident, "No '{0}' property with union name found.".ListReader(CultureInfo.InvariantCulture, "Case"));
            }
            object[] array = new object[factoryDicCandidate.exceptionIssuer.Length];
            if (factoryDicCandidate.exceptionIssuer.Length != 0 && instanceClassDispatcher == null)
            {
                throw StrategyError.PatchComposer(ident, "No '{0}' property with union fields found.".ListReader(CultureInfo.InvariantCulture, "Fields"));
            }
            if (instanceClassDispatcher != null)
            {
                if (factoryDicCandidate.exceptionIssuer.Length != instanceClassDispatcher.get_Count())
                {
                    throw StrategyError.PatchComposer(ident, "The number of field values does not match the number of properties defined by union '{0}'.".ListReader(CultureInfo.InvariantCulture, text));
                }
                for (int i = 0; i < instanceClassDispatcher.get_Count(); i++)
                {
                    ParserFilterResolver parserFilterResolver = instanceClassDispatcher[i];
                    PropertyInfo         propertyInfo         = factoryDicCandidate.exceptionIssuer[i];
                    array[i] = parserFilterResolver.ListClass(propertyInfo.PropertyType, config2);
                }
            }
            object[] task = new object[1]
            {
                array
            };
            return(factoryDicCandidate.m_DatabaseIssuer.ConnectIssuer(task));
        }
Beispiel #12
0
        private Dictionary <string, string> DisableIterator(TagTestItem v, XmlNamespaceManager token)
        {
            //Discarded unreachable code: IL_0002
            //IL_0003: Incompatible stack heights: 0 vs 1
            Dictionary <string, string> dictionary = null;
            bool flag = false;

            while (!flag && v._0001())
            {
                switch (v._0001())
                {
                case WatcherComposer.PropertyName:
                {
                    string text = v._0001().ToString();
                    if (!SetterTest.StartReader(text))
                    {
                        switch (text[0])
                        {
                        case '@':
                        {
                            if (dictionary == null)
                            {
                                dictionary = new Dictionary <string, string>();
                            }
                            text = text.Substring(1);
                            v.SortError();
                            string value = WriteRequest(v);
                            dictionary.Add(text, value);
                            if (OrderIterator(text, out string _0003))
                            {
                                token.AddNamespace(_0003, value);
                            }
                            break;
                        }

                        case '$':
                            switch (text)
                            {
                            case "$values":
                            case "$id":
                            case "$ref":
                            case "$type":
                            case "$value":
                            {
                                string text2 = token.LookupPrefix("http://james.newtonking.com/projects/json");
                                if (text2 == null)
                                {
                                    if (dictionary == null)
                                    {
                                        dictionary = new Dictionary <string, string>();
                                    }
                                    int?num = null;
                                    int?num2;
                                    while (true)
                                    {
                                        num2 = num;
                                        if (token.LookupNamespace("json" + num2) == null)
                                        {
                                            break;
                                        }
                                        num = num.GetValueOrDefault() + 1;
                                    }
                                    num2  = num;
                                    text2 = "json" + num2;
                                    dictionary.Add("xmlns:" + text2, "http://james.newtonking.com/projects/json");
                                    token.AddNamespace(text2, "http://james.newtonking.com/projects/json");
                                }
                                if (text == "$values")
                                {
                                    flag = true;
                                    break;
                                }
                                text = text.Substring(1);
                                v.SortError();
                                if (!RulesClientBridge.StartIssuer(v._0001()))
                                {
                                    throw StrategyError.PatchComposer(v, "Unexpected JsonToken: " + v._0001());
                                }
                                if (dictionary == null)
                                {
                                    dictionary = new Dictionary <string, string>();
                                }
                                string value = v._0001()?.ToString();
                                dictionary.Add(text2 + ":" + text, value);
                                break;
                            }

                            default:
                                flag = true;
                                break;
                            }
                            break;

                        default:
                            flag = true;
                            break;
                        }
                    }
                    else
                    {
                        flag = true;
                    }
                    break;
                }

                case WatcherComposer.Comment:
                case WatcherComposer.EndObject:
                    flag = true;
                    break;

                default:
                    throw StrategyError.PatchComposer(v, "Unexpected JsonToken: " + v._0001());
                }
            }
            return(dictionary);
        }
Beispiel #13
0
        public override object _0001(TagTestItem param, Type reg, object serv, PrototypeError first2)
        {
            //Discarded unreachable code: IL_0002
            //IL_0003: Incompatible stack heights: 0 vs 1
            switch (param._0001())
            {
            case WatcherComposer.Null:
                return(null);

            default:
                throw StrategyError.PatchComposer(param, "XmlNodeConverter can only convert JSON that begins with an object.");

            case WatcherComposer.StartObject:
            {
                XmlNamespaceManager   xmlNamespaceManager   = new XmlNamespaceManager(new NameTable());
                AttrBroadcasterFilter attrBroadcasterFilter = null;
                CreatorIssuer         creatorIssuer         = null;
                if (typeof(XObject).IsAssignableFrom(reg))
                {
                    if (reg != typeof(XContainer) && reg != typeof(XDocument) && reg != typeof(XElement) && reg != typeof(XNode) && reg != typeof(XObject))
                    {
                        throw StrategyError.PatchComposer(param, "XmlNodeConverter only supports deserializing XDocument, XElement, XContainer, XNode or XObject.");
                    }
                    attrBroadcasterFilter = new AuthenticationComposerPool(new XDocument());
                    creatorIssuer         = attrBroadcasterFilter;
                }
                if (typeof(XmlNode).IsAssignableFrom(reg))
                {
                    if (reg != typeof(XmlDocument) && reg != typeof(XmlElement) && reg != typeof(XmlNode))
                    {
                        throw StrategyError.PatchComposer(param, "XmlNodeConverter only supports deserializing XmlDocument, XmlElement or XmlNode.");
                    }
                    attrBroadcasterFilter = new ConnectionComposerWorker(new XmlDocument
                        {
                            XmlResolver = null
                        });
                    creatorIssuer = attrBroadcasterFilter;
                }
                if (attrBroadcasterFilter == null || creatorIssuer == null)
                {
                    throw StrategyError.PatchComposer(param, "Unexpected type when converting XML: " + reg);
                }
                if (!SetterTest.StartReader(_0001()))
                {
                    SortRequest(param, attrBroadcasterFilter, creatorIssuer, _0001(), xmlNamespaceManager);
                }
                else
                {
                    param.SortError();
                    ValidateIterator(param, attrBroadcasterFilter, xmlNamespaceManager, creatorIssuer);
                }
                if (reg == typeof(XElement))
                {
                    XElement obj = (XElement)((CreatorIssuer)attrBroadcasterFilter._0001())._0001();
                    obj.Remove();
                    return(obj);
                }
                if (reg == typeof(XmlElement))
                {
                    return(((CreatorIssuer)attrBroadcasterFilter._0001())._0001());
                }
                return(((CreatorIssuer)attrBroadcasterFilter)._0001());
            }
            }
        }
Beispiel #14
0
        private void ValidateIterator(TagTestItem def, AttrBroadcasterFilter caller, XmlNamespaceManager tag, CreatorIssuer ord2)
        {
            //Discarded unreachable code: IL_0002
            //IL_0003: Incompatible stack heights: 0 vs 1
            do
            {
                switch (def._0001())
                {
                case WatcherComposer.EndObject:
                case WatcherComposer.EndArray:
                    return;

                case WatcherComposer.PropertyName:
                {
                    if (ord2._0001() == XmlNodeType.Document && caller._0001() != null)
                    {
                        throw StrategyError.PatchComposer(def, "JSON root object has multiple properties. The root object must have a single property in order to create a valid XML document. Consider specifying a DeserializeRootElementName.");
                    }
                    string text = def._0001().ToString();
                    def.SortError();
                    if (def._0001() == WatcherComposer.StartArray)
                    {
                        int num = 0;
                        while (def._0001() && def._0001() != WatcherComposer.EndArray)
                        {
                            CollectRequest(def, caller, tag, text, ord2);
                            num++;
                        }
                        if (num == 1 && this._0003())
                        {
                            CustomerListAnnotation.CustomizeIssuer(text, out string _0003, out string role);
                            string b = SetterTest.StartReader(_0003) ? tag.DefaultNamespace : tag.LookupNamespace(_0003);
                            foreach (CreatorIssuer item in ord2._0001())
                            {
                                InfoRequestStrategy infoRequestStrategy = item as InfoRequestStrategy;
                                if (infoRequestStrategy != null && ((CreatorIssuer)infoRequestStrategy)._0001() == role && infoRequestStrategy._0003() == b)
                                {
                                    LoginIterator(infoRequestStrategy, caller);
                                    break;
                                }
                            }
                        }
                    }
                    else
                    {
                        CollectRequest(def, caller, tag, text, ord2);
                    }
                    break;
                }

                case WatcherComposer.StartConstructor:
                {
                    string reg = def._0001().ToString();
                    while (def._0001() && def._0001() != WatcherComposer.EndConstructor)
                    {
                        CollectRequest(def, caller, tag, reg, ord2);
                    }
                    break;
                }

                case WatcherComposer.Comment:
                    ord2._0001(caller._0001((string)def._0001()));
                    break;

                default:
                    throw StrategyError.PatchComposer(def, "Unexpected JsonToken when deserializing node: " + def._0001());
                }
            }while (def._0001());
        }