private void Process_Form(zeus.HelperClass.zForm frm) { // Установка таймаута бездействия в мс if (frm.timeout != 0) { flush_timer.Interval = frm.timeout * 1000; } //Установка "бэкграунда" try { this.BackgroundImage = new Bitmap(Ipaybox.StartupPath + @"\" + frm.bgimg); this.BackgroundImageLayout = ImageLayout.Stretch; } catch { Ipaybox.AddToLog(Ipaybox.Logs.Main, "Не удалось загрузить фоновое изображение"); ExitForm(); } //Добавляем элементы на форму //Надписи, кнопки, изображения, флэшки и т.п. for (int i = 0; i < frm.images.Count; i++) { Ipaybox.AddImage(frm.images[i], ref img[img_count], this); img_count++; } for (int i = 0; i < frm.buttons.Count; i++) { Ipaybox.AddButton(frm.buttons[i], ref img[img_count], this, new EventHandler(this.Pic_Click)); img_count++; } for (int i = 0; i < frm.labels.Count; i++) { Ipaybox.AddLabel(frm.labels[i], ref labels[labels_count], this); labels_count++; } }
private void Process_Form(zeus.HelperClass.zForm frm) { if (IsSelectedProviderOnline()) { ProgressAnimator a = new ProgressAnimator(); a.Show(); new System.Threading.Thread(ValidateAccount).Start(); int zz = 0; while (zz < 5000000 || !AccauntValidated) { Application.DoEvents(); zz++; } a.Hide(); a.Dispose(); } else { IsAccountValid = true; IsServiceAvailable = true; } // XmlElement root = frm; try { this.BackgroundImage = new Bitmap(frm.bgimg); } catch { this.BackColor = Color.FromArgb(230, 230, 230); } for (int i = 0; i < frm.images.Count; i++) { AddImage(frm.images[i], ref img[img_count]); img_count++; } for (int i = 0; i < frm.buttons.Count; i++) { AddButton(frm.buttons[i]); } for (int i = 0; i < frm.banners.Count; i++) { AddBanner(frm.banners[i], this, new EventHandler(this.Pic_Click)); } for (int i = 0; i < frm.labels.Count; i++) { if (frm.labels[i].name == "account") { AddLabel(frm.labels[i], ref label1, this); //labels_count++; } else { Ipaybox.AddLabel(frm.labels[i], ref labels[labels_count], this); labels_count++; } } AddProviderImage(frm.prvImage); string accname = ""; string acctext = ""; string accvalue = ""; string[] opt = Ipaybox.curPay.Options.Split('|'); for (int i = 0; i < opt.Length; i++) { if (opt[i] != "") { string ViewText = string.Empty; if (Ipaybox.curPay.ViewText != null && Ipaybox.curPay.ViewText[i] != null && !string.IsNullOrEmpty(Ipaybox.curPay.ViewText[i].ViewText)) { ViewText = Ipaybox.curPay.ViewText[i].ViewText; } string[] param = opt[i].Split('%'); accname = param[0].ToUpper(); acctext += accname + ": " + (string.IsNullOrEmpty(ViewText) ? param[2] : ViewText) + "\r\n"; //AddLabel(param[0] + ": " + param[2], new Point(100, 200 + y), "Times New Roman", "18","255;255;255"); if (param[1] == "account") { accvalue = param[2]; } } } //AddLabel(acctext, new Point(100, 200), "Times New Roman", "18", "255;255;255", ""); label1.Text = acctext; if (withProviderName) { //label1.TextAlign = ContentAlignment.MiddleCenter; label1.Text = "ПОЛУЧАТЕЛЬ: " + Ipaybox.PROVIDER_XML.GetAttribute("name") + "\r\n" + label1.Text; } if (!IsServiceAvailable) { ShowWarning(188, 500); AddLabel("Отсутствует связь.\r\nНевозможно провести платеж на этого провайдера.", new Point(350, 530), "Times New Roman", "20", "169;22;6"); } else if (!IsAccountValid) { ShowWarning(188, 500); AddLabel(acctext + "\r\nне прошел проверку или сервис провайдера не работает.", new Point(350, 530), "Times New Roman", "20", "169;22;6"); } else { // enable img[indexDalee].Visible = true; this.Invalidate(); } }
private void Process_Form(XmlElement frm) { XmlElement root = frm; try { this.BackgroundImage = new Bitmap(Ipaybox.StartupPath + @"\" + root.GetAttribute("backgroundimage")); } catch { } string bgcolor = string.Empty; try { root.GetAttribute("bgcolor"); } catch { } if (!string.IsNullOrEmpty(bgcolor)) { string[] rgb = bgcolor.Split(';'); if (rgb.Length == 3) { try { this.BackColor = Color.FromArgb(int.Parse(rgb[0]), int.Parse(rgb[1]), int.Parse(rgb[2])); } catch { Ipaybox.AddToLog(Ipaybox.Logs.Main, "Неверное представление цвета в тэге bgcolor"); } } } for (int i = 0; i < root.ChildNodes.Count; i++) { XmlElement row = (XmlElement)root.ChildNodes[i]; if (row.Name == "img") { Ipaybox.AddImage(row, ref img[img_count], this); img_count++; } if (row.Name == "button") { AddButton(row); } if (row.Name == "label") { Ipaybox.AddLabel(row, ref labels[label_count], this); label_count++; } if (row.Name == "flash") { AddFlash(row, this); } } }