Beispiel #1
0
        public JsonStruct getCustomGradient()
        {
            JsonStruct p = new JsonStruct();
            p.bgColor = new int[3] { cGradient7.BackColor.R, cGradient7.BackColor.G, cGradient7.BackColor.B };
            p.colors = new int[6][];

            for (int i = 0; i < pbsGradient.Length; i++)
            {
                p.colors[i] = new int[3] { pbsGradient[i].BackColor.R, pbsGradient[i].BackColor.G, pbsGradient[i].BackColor.B };
            }

            return p;
        }
        private void save2File(FileInfo file, JsonStruct preset)
        {
            string output = JsonConvert.SerializeObject(preset);
            using (StreamWriter writer = new StreamWriter(file.FullName, false))
            {
                writer.WriteLine(output);
                writer.Flush();
            }

            MessageBox.Show("You Preset has been saved as " + file.Name, "Preset saved", MessageBoxButtons.OK, MessageBoxIcon.Information);
        }