コード例 #1
0
        private void EditProfileForm_Load(object sender, EventArgs e)
        {
            try
            {
                using (StreamReader r = new StreamReader(profilePath))
                {
                    dynamic profileex = JObject.Parse(r.ReadToEnd());

                    string t1 = (string)profileex["characters"]["pmc"].ToString();
                    profileToEdit = JsonConvert.DeserializeObject <ProfileExtended>(t1);
                    if (profileToEdit.hideout != null)
                    {
                        profileToEdit.hideout.areas      = profileToEdit.hideout.areas.OrderBy(o => o.type).ToList();
                        this.wipeProfileCheckbox.Checked = (bool)profileex["info"]["wipe"];
                        SetInfo();
                    }
                    else
                    {
                        MessageBox.Show(" the profile " + (string)profileex["info"]["username"] + " is not initialized, please start the game and choose your side ;)");
                        this.Close();
                    }
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show("profile can't be loaded : " + ex.Message);
                Close();
            }

            foreach (HideoutUpgradesArea h in hideoutLevels)
            {
                hideoutAreaComboBox.Items.Add(h.areaName);
            }
        }
コード例 #2
0
        private void EditProfileForm_Load(object sender, EventArgs e)
        {
            try
            {
                using (StreamReader r = new StreamReader(profilePath))
                {
                    profileToEdit = JsonConvert.DeserializeObject <ProfileExtended>(r.ReadToEnd());
                    SetInfo();
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show("profile can't be loaded : " + ex.Message);
                Close();
            }

            foreach (HideoutUpgradesArea h in hideoutLevels)
            {
                hideoutAreaComboBox.Items.Add(h.areaName);
            }
        }