Ejemplo n.º 1
0
    protected bool LoadSettings()
    {
        AuthorCreationProject authorCreationProject;
        string str;
        int    num;
        bool   flag;
        Stream stream = this.GetStream(true, "dat.asc", out authorCreationProject);

        if (stream == null)
        {
            return(false);
        }
        try
        {
            using (JSONStream jSONStream = JSONStream.CreateWriter(stream))
            {
                while (jSONStream.Read())
                {
                    if (jSONStream.token == JSONToken.ObjectStart)
                    {
                        while (jSONStream.ReadNextProperty(out str))
                        {
                            string str1 = str;
                            if (str1 == null)
                            {
                                continue;
                            }
                            if (AuthorCreation.< > f__switch$map0 == null)
                            {
                                Dictionary <string, int> strs = new Dictionary <string, int>(2)
                                {
                                    { "project", 0 },
                                    { "settings", 1 }
                                };
                                AuthorCreation.< > f__switch$map0 = strs;
                            }
                            if (!AuthorCreation.< > f__switch$map0.TryGetValue(str1, out num))
                            {
                                continue;
                            }
                            if (num == 0)
                            {
                                jSONStream.ReadSkip();
                            }
                            else if (num == 1)
                            {
                                this.LoadSettings(jSONStream);
                            }
                        }
                    }
                }
            }
            flag = true;
        }
        finally
        {
            stream.Dispose();
        }
        return(flag);
    }
Ejemplo n.º 2
0
    // Token: 0x06000043 RID: 67 RVA: 0x00002CC0 File Offset: 0x00000EC0
    protected bool LoadSettings()
    {
        global::AuthorCreationProject authorCreationProject;
        Stream stream = this.GetStream(true, "dat.asc", out authorCreationProject);

        if (stream != null)
        {
            try
            {
                using (JSONStream jsonstream = JSONStream.CreateWriter(stream))
                {
                    while (jsonstream.Read())
                    {
                        JSONToken token = jsonstream.token;
                        if (token == 1)
                        {
                            string text;
                            while (jsonstream.ReadNextProperty(ref text))
                            {
                                string text2 = text;
                                if (text2 != null)
                                {
                                    if (global::AuthorCreation.< > f__switch$map0 == null)
                                    {
                                        global::AuthorCreation.< > f__switch$map0 = new Dictionary <string, int>(2)
                                        {
                                            {
                                                "project",
                                                0
                                            },
                                            {
                                                "settings",
                                                1
                                            }
                                        };
                                    }
                                    int num;
                                    if (global::AuthorCreation.< > f__switch$map0.TryGetValue(text2, out num))
                                    {
                                        if (num != 0)
                                        {
                                            if (num == 1)
                                            {
                                                this.LoadSettings(jsonstream);
                                            }
                                        }
                                        else
                                        {
                                            jsonstream.ReadSkip();
                                        }
                                    }
                                }
                            }
                        }
                    }
                }
                return(true);
            }
            finally
            {
                stream.Dispose();
            }
            return(false);
        }
        return(false);
    }