private void btn_save_Click(object sender, EventArgs e) { List <ColorTagged> c = new List <ColorTagged>(); Swatche temp = null; for (int i = 0; i < flowLayoutPanel1.Controls.Count; i++) { temp = flowLayoutPanel1.Controls[i] as Swatche; c.Add(temp.ColorTag); c[i].Name = temp.ColorName; //try //{ if (temp.NewColorTag != temp.ColorTag.Tag) { this.colorList.SetNewColorTag(temp.ColorTag, temp.NewColorTag); flowLayoutPanel1.Controls.SetChildIndex(temp, temp.NewColorTag); } //} //catch(Exception err) //{ // MessageBox.Show("Não pode conter tags repetidas"); //} } SaveLoadColorList.Save(this.colorList, $"{Application.StartupPath}\\swatche.xml"); //CreateColorPanel(); }
private void Form1_Load(object sender, EventArgs e) { List <ColorTagged> list = SaveLoadColorList.Load($"{Application.StartupPath}\\swatche.xml"); if (list == null) { return; } for (int i = 0; i < list.Count; i++) { this.colorList.Add(list[i]); } this.colorList.Sort(); this.bmp = new BmpUnpack(this.colorList); imageRender.BMP = this.bmp; imgSlice.BMP = bmp; start("C:\\Users\\bonus\\OneDrive\\Ambiente de Trabalho\\8 METROS TAQUEADO PARA CONTAGEM .bmp"); //btn_process_Click(null, null); }