Exemplo n.º 1
0
        private void saveProgress()
        {
            BPSettings bp       = new BPSettings();
            var        set_path = ProjectConfig.projectPath + "//" + "settings.json";

            try
            {
                var se = bp.ReadSettings(set_path);
                var i  = se.FindIndex(x => x.property == "progress");
                se[i].value = ProjectConfig.projectSettings["progress"];
                using (StreamWriter file = File.CreateText(set_path))
                {
                    JsonSerializer serializer = new JsonSerializer();
                    serializer.Serialize(file, se);
                }
            }
            catch (Exception e)
            {
                MessageBox.Show("Exception: " + e.Message);
            }
        }
Exemplo n.º 2
0
        private void ModifyBt_Click(object sender, EventArgs e)
        {
            BPSettings bps      = new BPSettings();
            var        set_path = ProjectConfig.projectPath + "//" + "settings.json";

            try
            {
                var se = bps.ReadSettings(set_path);
                var i  = se.FindIndex(x => x.property == "Title");
                se[i].value = projectName.Text;
                using (StreamWriter file = File.CreateText(set_path))
                {
                    JsonSerializer serializer = new JsonSerializer();
                    serializer.Serialize(file, se);
                }
                newName = projectName.Text;
            }
            catch (Exception ex)
            {
                MessageBox.Show("Exception: " + ex.Message);
            }
        }