Beispiel #1
0
        public virtual string _0001()
        {
            //Discarded unreachable code: IL_0002
            //IL_0003: Incompatible stack heights: 0 vs 1
            WatcherComposer watcherComposer = LoginComposer();

            switch (watcherComposer)
            {
            case WatcherComposer.None:
            case WatcherComposer.Null:
            case WatcherComposer.EndArray:
                return(null);

            case WatcherComposer.String:
                return((string)this._0001());

            default:
                if (RulesClientBridge.StartIssuer(watcherComposer))
                {
                    object obj = this._0001();
                    if (obj != null)
                    {
                        IFormattable formattable = obj as IFormattable;
                        string       text;
                        if (formattable != null)
                        {
                            text = formattable.ToString(null, this._0001());
                        }
                        else
                        {
                            Uri uri = obj as Uri;
                            text = (((object)uri != null) ? uri.OriginalString : obj.ToString());
                        }
                        CancelError(WatcherComposer.String, text, isstate: false);
                        return(text);
                    }
                }
                throw ContextError.CheckComposer(this, "Error reading string. Unexpected token: {0}.".ListReader(CultureInfo.InvariantCulture, watcherComposer));
            }
        }
        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 #3
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);
        }