private void setNotification(mainWindowNotification notificationType) { Thread thrpayProcessTerminated = new Thread(new ThreadStart(delegate { Gtk.Application.Invoke(delegate { string notification = string.Empty; string color = colors [0]; switch (notificationType) { case mainWindowNotification.insertTicket: color = iterBlink ? colors [0] : colors [1]; notification = markup.make(Culturize.GetString(18), color, null, "60000", "heavy"); break; case mainWindowNotification.readingTicket: color = iterBlink ? colors [2] : colors [3]; notification = string.Format("{0}\n{1}", markup.make(Culturize.GetString(19), color, null, "60000", "heavy"), markup.make(Culturize.GetString(9), colors[2], null, "40000", "heavy")); break; case mainWindowNotification.errReadingTicket: color = iterBlink ? colors [0] : colors [1]; notification = markup.make(Culturize.GetString(18), color, null, "60000", "heavy"); break; case mainWindowNotification.calculatingAmount: color = iterBlink ? colors [0] : colors [1]; notification = string.Format("{0}\n{1}", markup.make(Culturize.GetString(20), color, null, "60000", "heavy"), markup.make(Culturize.GetString(21), colors[0], null, "40000", "heavy")); break; } lblNotification.LabelProp = notification; }); })); thrpayProcessTerminated.Start(); }
public void configureIdiomsButtons() { int i = 0; MySqlDataReader idioms = Culturize.getCaIdioms(); if (idioms != null) { VBox vbox = null; Boolean par = false; while (idioms.Read()) { i++; if (!par) { vbox = new VBox(); vbox.Spacing = 6; vbox.Homogeneous = false; vbox.Visible = true; } Gtk.Button btn = new Gtk.Button(); btn.Name = string.Format("{0}", idioms ["siglas"].ToString()); btn.CanFocus = false; btn.UseUnderline = true; btn.Visible = true; btn.Image = new Gtk.Image(string.Format("{0}", cnfg.GetBaseImage(idioms["image_fileName"].ToString()))); btn.Clicked += (object sender, EventArgs e) => { string idiom = ((Gtk.Button)sender).Name; Culturize.changeLenguaje(idiom); }; vbox.Add(btn); Gtk.Box.BoxChild boxchild = ((Gtk.Box.BoxChild)(vbox [btn])); boxchild.Position = !par ? 0 : 1; boxchild.Expand = false; boxchild.Fill = false; boxchild.PackType = PackType.Start; if (par) { hbox1.Add(vbox); Box.BoxChild w1 = ((global::Gtk.Box.BoxChild)(hbox1 [vbox])); w1.Expand = false; w1.Fill = false; } par = !par; } if (i % 2 != 0) { Gtk.Alignment alignment = new Gtk.Alignment(0.5F, 0.5F, 1F, 1F); vbox.Add(alignment); Box.BoxChild boxchild = ((global::Gtk.Box.BoxChild)(vbox [alignment])); boxchild.Position = 1; hbox1.Add(vbox); Box.BoxChild w1 = ((global::Gtk.Box.BoxChild)(hbox1 [vbox])); w1.Expand = false; w1.Fill = false; } if (!idioms.IsClosed) { idioms.Close(); } } }