private object ChangeRequest(TagTestItem reference)
        {
            //Discarded unreachable code: IL_0002
            //IL_0003: Incompatible stack heights: 0 vs 1
            IDictionary <string, object> dictionary = new ExpandoObject();

            while (reference._0001())
            {
                switch (reference._0001())
                {
                case WatcherComposer.PropertyName:
                {
                    string key = reference._0001().ToString();
                    if (!reference._0001())
                    {
                        throw StrategyError.PatchComposer(reference, "Unexpected end when reading ExpandoObject.");
                    }
                    object obj2 = dictionary[key] = RemoveRequest(reference);
                    break;
                }

                case WatcherComposer.EndObject:
                    return(dictionary);
                }
            }
            throw StrategyError.PatchComposer(reference, "Unexpected end when reading ExpandoObject.");
        }
        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 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 byte[] RegisterRequest(TagTestItem spec)
        {
            //Discarded unreachable code: IL_0002
            //IL_0003: Incompatible stack heights: 0 vs 1
            List <byte> list = new List <byte>();

            while (spec._0001())
            {
                switch (spec._0001())
                {
                case WatcherComposer.Integer:
                    list.Add(Convert.ToByte(spec._0001(), CultureInfo.InvariantCulture));
                    break;

                case WatcherComposer.EndArray:
                    return(list.ToArray());

                default:
                    throw StrategyError.PatchComposer(spec, "Unexpected token when reading bytes: {0}".ListReader(CultureInfo.InvariantCulture, spec._0001()));

                case WatcherComposer.Comment:
                    break;
                }
            }
            throw StrategyError.PatchComposer(spec, "Unexpected end when reading bytes.");
        }
Beispiel #5
0
 internal void SortError()
 {
     //Discarded unreachable code: IL_0002
     //IL_0003: Incompatible stack heights: 0 vs 1
     if (!this._0001())
     {
         throw StrategyError.PatchComposer(this, "Unexpected end when reading JSON.");
     }
 }
Beispiel #6
0
 internal void CallError(ProcTest first, bool iscaller)
 {
     //Discarded unreachable code: IL_0002
     //IL_0003: Incompatible stack heights: 0 vs 1
     if (!PublishError(first, iscaller))
     {
         throw StrategyError.PatchComposer(this, "Unexpected end when reading JSON.");
     }
 }
        private bool CustomizeBroadcaster(RecordClassDispatcher res, object pol, ProductInstanceExpression filter, ProcTest second2, InitializerTest cfg3, ProductInstanceExpression visitor4)
        {
            //Discarded unreachable code: IL_0002
            //IL_0003: Incompatible stack heights: 0 vs 1
            if (pol == null)
            {
                return(true);
            }
            if (second2._ErrorProperty == (ParameterFilterResolver)3 || second2._ErrorProperty == (ParameterFilterResolver)4)
            {
                return(true);
            }
            FacadeComposer?facadeComposer = null;

            if (filter != null)
            {
                facadeComposer = filter._0001();
            }
            if (!facadeComposer.HasValue && visitor4 != null)
            {
                facadeComposer = visitor4._0002();
            }
            if (!facadeComposer.HasValue && cfg3 != null)
            {
                facadeComposer = cfg3._0001();
            }
            if ((baseProperty.m_SpecificationError != null) ? wrapperProperty.CollectTest(pol, baseProperty.m_SpecificationError) : wrapperProperty.Contains(pol))
            {
                string str = "Self referencing loop detected";
                if (filter != null)
                {
                    str += " for property '{0}'".ListReader(CultureInfo.InvariantCulture, filter._0001());
                }
                str += " with type '{0}'.".ListReader(CultureInfo.InvariantCulture, pol.GetType());
                switch (facadeComposer.GetValueOrDefault(baseProperty.helperError))
                {
                case (FacadeComposer)0:
                    throw StrategyError.ValidateComposer(null, res._0001(), str, null);

                case (FacadeComposer)1:
                    if (containerProperty != null && containerProperty._0001() >= TraceLevel.Verbose)
                    {
                        containerProperty._0001(TraceLevel.Verbose, QueueError.ComputeError(null, res._0002(), str + ". Skipping serializing self referenced value."), null);
                    }
                    return(false);

                case (FacadeComposer)2:
                    if (containerProperty != null && containerProperty._0001() >= TraceLevel.Verbose)
                    {
                        containerProperty._0001(TraceLevel.Verbose, QueueError.ComputeError(null, res._0002(), str + ". Serializing self referenced value."), null);
                    }
                    return(true);
                }
            }
            return(true);
        }
 private string CancelBroadcaster(RecordClassDispatcher info, object attr)
 {
     //Discarded unreachable code: IL_0002
     //IL_0003: Incompatible stack heights: 0 vs 1
     try
     {
         return(baseProperty.StopComposer()._0001((object)this, attr));
     }
     catch (Exception setup)
     {
         throw StrategyError.ValidateComposer(null, info._0001(), "Error writing object reference for '{0}'.".ListReader(CultureInfo.InvariantCulture, attr.GetType()), setup);
     }
 }
Beispiel #9
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 #10
0
        private static void PublishRequest(TagTestItem def, AttrBroadcasterFilter cont, CreatorIssuer consumer, string res2, string v3, XmlNamespaceManager value4, string reference5)
        {
            //Discarded unreachable code: IL_0002
            //IL_0003: Incompatible stack heights: 0 vs 1
            if (consumer._0001() == XmlNodeType.Document)
            {
                throw StrategyError.PatchComposer(def, "JSON root object has property '{0}' that will be converted to an attribute. A root object cannot have any attribute properties. Consider specifying a DeserializeRootElementName.".ListReader(CultureInfo.InvariantCulture, res2));
            }
            string        text  = XmlConvert.EncodeName(v3);
            string        text2 = WriteRequest(def);
            CreatorIssuer key   = (!SetterTest.StartReader(reference5)) ? cont._0002(text, value4.LookupNamespace(reference5), text2) : cont._0002(text, text2);

            ((InfoRequestStrategy)consumer)._0001(key);
        }
        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
            }));
        }
        private object SelectRequest(TagTestItem ident)
        {
            //Discarded unreachable code: IL_0002
            //IL_0003: Incompatible stack heights: 0 vs 1
            string text = (string)ident._0001();

            if (text.Length > 0 && text[0] == '/')
            {
                int num = text.LastIndexOf('/');
                if (num > 0)
                {
                    string       pattern = text.Substring(1, num - 1);
                    RegexOptions options = CustomerListAnnotation.QueryIssuer(text.Substring(num + 1));
                    return(new Regex(pattern, options));
                }
            }
            throw StrategyError.PatchComposer(ident, "Regex pattern must be enclosed by slashes.");
        }
        private Regex DeleteRequest(TagTestItem config, PrototypeError result)
        {
            //Discarded unreachable code: IL_0002
            //IL_0003: Incompatible stack heights: 0 vs 1
            string       text         = null;
            RegexOptions?regexOptions = null;

            while (config._0001())
            {
                switch (config._0001())
                {
                case WatcherComposer.PropertyName:
                {
                    string a = config._0001().ToString();
                    if (!config._0001())
                    {
                        throw StrategyError.PatchComposer(config, "Unexpected end when reading Regex.");
                    }
                    if (string.Equals(a, "Pattern", StringComparison.OrdinalIgnoreCase))
                    {
                        text = (string)config._0001();
                    }
                    else if (string.Equals(a, "Options", StringComparison.OrdinalIgnoreCase))
                    {
                        regexOptions = result.CompareComposer <RegexOptions>(config);
                    }
                    else
                    {
                        config.AssetError();
                    }
                    break;
                }

                case WatcherComposer.EndObject:
                    if (text == null)
                    {
                        throw StrategyError.PatchComposer(config, "Error deserializing Regex. No pattern found.");
                    }
                    return(new Regex(text, regexOptions.GetValueOrDefault()));
                }
            }
            throw StrategyError.PatchComposer(config, "Unexpected end when reading Regex.");
        }
        public override object _0001(TagTestItem first, Type result, object pool, PrototypeError spec2)
        {
            //Discarded unreachable code: IL_0002
            //IL_0003: Incompatible stack heights: 0 vs 1
            switch (first._0001())
            {
            case WatcherComposer.StartObject:
                return(DeleteRequest(first, spec2));

            case WatcherComposer.String:
                return(SelectRequest(first));

            case WatcherComposer.Null:
                return(null);

            default:
                throw StrategyError.PatchComposer(first, "Unexpected token when reading Regex.");
            }
        }
        private bool CollectBroadcaster(RecordClassDispatcher init, object pol, InitializerTest helper, [global::_0008._0012(2)] ProductInstanceExpression _0005, ProductInstanceExpression asset3, [global::_0008._0012(2)][ConsumerBroadcasterDispatcher(true)] out ProcTest _0007, [ConsumerBroadcasterDispatcher(true)][global::_0008._0012(2)] out object _0008)
        {
            //Discarded unreachable code: IL_0002
            //IL_0003: Incompatible stack heights: 0 vs 1
            if (!asset3._0001() && asset3._0002() && MapClass(init, asset3, pol) && InsertClass(init, asset3, pol))
            {
                if (asset3._0001() == null)
                {
                    asset3._0001(baseProperty.listenerError._0001(asset3._0002()));
                }
                _0008 = asset3._0001()._0001(pol);
                _0007 = (asset3._0001().propertyProperty ? asset3._0001() : DeleteBroadcaster(_0008));
                if (AssetBroadcaster(_0008, helper as PrototypeFilterResolver, asset3))
                {
                    if (CountBroadcaster(_0008, asset3, _0007, helper, _0005))
                    {
                        asset3.DefineClient(init);
                        QueryBroadcaster(init, _0008);
                        return(false);
                    }
                    if (!CustomizeBroadcaster(init, _0008, asset3, _0007, helper, _0005))
                    {
                        return(false);
                    }
                    if (_0008 == null)
                    {
                        PrototypeFilterResolver prototypeFilterResolver = helper as PrototypeFilterResolver;
                        switch (asset3.contextProperty ?? (prototypeFilterResolver?._0001()).GetValueOrDefault())
                        {
                        case (SpecificationTestItem)2:
                            throw StrategyError.ValidateComposer(null, init._0001(), "Cannot write a null value for property '{0}'. Property requires a value.".ListReader(CultureInfo.InvariantCulture, asset3._0001()), null);

                        case (SpecificationTestItem)3:
                            throw StrategyError.ValidateComposer(null, init._0001(), "Cannot write a null value for property '{0}'. Property requires a non-null value.".ListReader(CultureInfo.InvariantCulture, asset3._0001()), null);
                        }
                    }
                    return(true);
                }
            }
            _0007 = null;
            _0008 = null;
            return(false);
        }
        public override object _0001(TagTestItem instance, Type pred, object res, PrototypeError reference2)
        {
            //Discarded unreachable code: IL_0002
            //IL_0003: Incompatible stack heights: 0 vs 1
            if (instance._0001() == WatcherComposer.Null)
            {
                if (!ResolverErrorFilter.VerifyReader(pred))
                {
                    throw StrategyError.PatchComposer(instance, "Cannot convert null value to {0}.".ListReader(CultureInfo.InvariantCulture, pred));
                }
                return(null);
            }
            byte[] array;
            if (instance._0001() == WatcherComposer.StartArray)
            {
                array = RegisterRequest(instance);
            }
            else
            {
                if (instance._0001() != WatcherComposer.String)
                {
                    throw StrategyError.PatchComposer(instance, "Unexpected token parsing binary. Expected String or StartArray, got {0}.".ListReader(CultureInfo.InvariantCulture, instance._0001()));
                }
                array = Convert.FromBase64String(instance._0001().ToString());
            }
            Type type = ResolverErrorFilter.PatchReader(pred) ? Nullable.GetUnderlyingType(pred) : pred;

            if (type.FullName == "System.Data.Linq.Binary")
            {
                ResetRequest(type);
                return(_InfoIssuer._0001()(new object[1]
                {
                    array
                }));
            }
            if (type == typeof(SqlBinary))
            {
                return(new SqlBinary(array));
            }
            throw StrategyError.PatchComposer(instance, "Unexpected object type when writing binary: {0}".ListReader(CultureInfo.InvariantCulture, pred));
        }
Beispiel #17
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 #18
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);
        }
        private object PostRequest(TagTestItem init)
        {
            //Discarded unreachable code: IL_0002
            //IL_0003: Incompatible stack heights: 0 vs 1
            IList <object> list = new List <object>();

            while (init._0001())
            {
                switch (init._0001())
                {
                case WatcherComposer.EndArray:
                    return(list);

                case WatcherComposer.Comment:
                    continue;
                }
                object item = RemoveRequest(init);
                list.Add(item);
            }
            throw StrategyError.PatchComposer(init, "Unexpected end when reading ExpandoObject.");
        }
        private void OrderClass(RecordClassDispatcher first, ISerializable visitor, CollectionProperty dic, ProductInstanceExpression selection2, InitializerTest cust3, ProductInstanceExpression asset4)
        {
            //Discarded unreachable code: IL_0002
            //IL_0003: Incompatible stack heights: 0 vs 1
            if (!ConfigProperty._0002())
            {
                string asset5 = "Type '{0}' implements ISerializable but cannot be serialized using the ISerializable interface because the current application is not fully trusted and ISerializable can expose secure data." + Environment.NewLine + "To fix this error either change the environment to be fully trusted, change the application to not deserialize the type, add JsonObjectAttribute to the type or change the JsonSerializer setting ContractResolver to use a new DefaultContractResolver with IgnoreSerializableInterface set to true." + Environment.NewLine;
                asset5 = asset5.ListReader(CultureInfo.InvariantCulture, visitor.GetType());
                throw StrategyError.ValidateComposer(null, first._0001(), asset5, null);
            }
            ManageBroadcaster(first, dic, visitor);
            wrapperProperty.Add(visitor);
            SortBroadcaster(first, visitor, dic, selection2, cust3, asset4);
            SerializationInfo serializationInfo = new SerializationInfo(((ProcTest)dic)._0002(), new FormatterConverter());

            visitor.GetObjectData(serializationInfo, baseProperty.roleError);
            SerializationInfoEnumerator enumerator = serializationInfo.GetEnumerator();

            while (enumerator.MoveNext())
            {
                SerializationEntry current  = enumerator.Current;
                ProcTest           procTest = DeleteBroadcaster(current.Value);
                if (CountBroadcaster(current.Value, null, procTest, dic, selection2))
                {
                    first._0002(current.Name);
                    QueryBroadcaster(first, current.Value);
                }
                else if (CustomizeBroadcaster(first, current.Value, null, procTest, dic, selection2))
                {
                    first._0002(current.Name);
                    InvokeBroadcaster(first, current.Value, procTest, null, dic, selection2);
                }
            }
            first._0011();
            wrapperProperty.RemoveAt(wrapperProperty.Count - 1);
            InitBroadcaster(first, dic, visitor);
        }
        private object RemoveRequest(TagTestItem spec)
        {
            //Discarded unreachable code: IL_0002
            //IL_0003: Incompatible stack heights: 0 vs 1
            if (!spec.RevertError())
            {
                throw StrategyError.PatchComposer(spec, "Unexpected end when reading ExpandoObject.");
            }
            switch (spec._0001())
            {
            case WatcherComposer.StartObject:
                return(ChangeRequest(spec));

            case WatcherComposer.StartArray:
                return(PostRequest(spec));

            default:
                if (RulesClientBridge.StartIssuer(spec._0001()))
                {
                    return(spec._0001());
                }
                throw StrategyError.PatchComposer(spec, "Unexpected token when converting ExpandoObject: {0}".ListReader(CultureInfo.InvariantCulture, spec._0001()));
            }
        }
Beispiel #22
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());
        }
Beispiel #23
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 #24
0
 public override void OnStrategyError(SchedulingStrategy strategy, string strategyDescription)
 {
     base.OnStrategyError(strategy, strategyDescription);
     StrategyError?.Invoke(strategy, strategyDescription);
 }
Beispiel #25
0
        private static string WriteRequest(TagTestItem init)
        {
            //Discarded unreachable code: IL_0002
            //IL_0003: Incompatible stack heights: 0 vs 1
            switch (init._0001())
            {
            case WatcherComposer.String:
                return(init._0001()?.ToString());

            case WatcherComposer.Integer:
            {
                object obj = init._0001();
                if (obj is BigInteger)
                {
                    return(((BigInteger)obj).ToString(CultureInfo.InvariantCulture));
                }
                return(XmlConvert.ToString(Convert.ToInt64(init._0001(), CultureInfo.InvariantCulture)));
            }

            case WatcherComposer.Float:
            {
                object obj = init._0001();
                if (obj is decimal)
                {
                    decimal value3 = (decimal)obj;
                    return(XmlConvert.ToString(value3));
                }
                obj = init._0001();
                if (obj is float)
                {
                    float value4 = (float)obj;
                    return(XmlConvert.ToString(value4));
                }
                return(XmlConvert.ToString(Convert.ToDouble(init._0001(), CultureInfo.InvariantCulture)));
            }

            case WatcherComposer.Boolean:
                return(XmlConvert.ToString(Convert.ToBoolean(init._0001(), CultureInfo.InvariantCulture)));

            case WatcherComposer.Date:
            {
                object obj = init._0001();
                if (obj is DateTimeOffset)
                {
                    DateTimeOffset value = (DateTimeOffset)obj;
                    return(XmlConvert.ToString(value));
                }
                DateTime value2 = Convert.ToDateTime(init._0001(), CultureInfo.InvariantCulture);
                return(XmlConvert.ToString(value2, DescriptorIteratorMapping.UpdateProperty(value2.Kind)));
            }

            case WatcherComposer.Bytes:
                return(Convert.ToBase64String((byte[])init._0001()));

            case WatcherComposer.Null:
                return(null);

            default:
                throw StrategyError.PatchComposer(init, "Cannot get an XML string value from token type '{0}'.".ListReader(CultureInfo.InvariantCulture, init._0001()));
            }
        }
Beispiel #26
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 #27
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));
        }