예제 #1
0
        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++;
            }
        }
예제 #2
0
파일: info.cs 프로젝트: ykcycvl/Zeus2013
        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);
                }
            }
        }