private void SetTema(string nome) { var t = temi.ToList().Where(f => f.NOME.Equals(nome.ToUpper())).FirstOrDefault(); if (t == null) { return; } ATTIVO = t; BackColor = t.MAIN; button1.BackColor = t.BTN; button2.BackColor = t.BTN; drpAttivo.BackColor = t.BTN; drpdGrandezza.BackColor = t.BTN; combob.BackColor = t.BTN; flowLayoutPanel1.BackColor = t.PANEL; ITMES.ForEach(r => { if (!r.IsDisposed) { r.BackColor = t.ITEM; } }); File.WriteAllText(Out.FileTEMA, nome.ToUpper()); }
private void Ricarica() { flowLayoutPanel1.Controls.Clear(); lora.Clear(); lcose.Clear(); lcombo.Clear(); ITMES.Clear(); if (File.Exists(Out.FileRuleBG)) { Enabled = false; var Inorder = new List <RuleBG>(); foreach (var sv in Out.leggiTXT(Out.FileRuleBG)) { try { Inorder.Add(new RuleBG(sv)); } catch (Exception ef) { if (Out.IS_ON_NET) { MessageBox.Show(ef.Message, "Problema", MessageBoxButtons.OK, MessageBoxIcon.Error); } else { MessageBox.Show("Connsesisone internet assente! alcune immagini potrebbero andare perse\nIl programma verrà chiuso!", "Problema", MessageBoxButtons.OK, MessageBoxIcon.Error); chiudu = true; Application.Exit(); } } } Inorder = Inorder.OrderBy(f => f.MinutiOra).ToList(); if (Inorder.Count > 0) { Task.Run(() => { RuleBG.Attuale(Inorder).Set(); }); } Inorder.ForEach(sv => { addRuleBG(sv); }); Enabled = true; flowLayoutPanel1.Update(); } }
private void toolStripMenuItem2_Click(object sender, EventArgs e) { ITMES.ForEach(r => { r.Dispose(); }); flowLayoutPanel1.BackgroundImage = ((System.Drawing.Image)(new ComponentResourceManager(typeof(Form1)).GetObject("flowLayoutPanel1.BackgroundImage"))); }