Esempio n. 1
0
        public static void AddImage(zeus.HelperClass.zImage image, ref zPictureBox img)
        {
            string location = image.location;
            string limg     = image.src;
            string size     = image.size;

            int X = int.Parse(location.Split(';')[0]);
            int Y = int.Parse(location.Split(';')[1]);

            Bitmap bmp = new Bitmap(Ipaybox.StartupPath + @"\" + limg);

            img          = new zPictureBox();
            img.Location = new Point(X, Y);
            img.Image    = bmp;

            if (size != "")
            {
                X            = int.Parse(size.Split(';')[0]);
                Y            = int.Parse(size.Split(';')[1]);
                img.SizeMode = PictureBoxSizeMode.StretchImage;
                img.Size     = new Size(X, Y);
            }
            else
            {
                img.Size = bmp.Size;
            }
        }
Esempio n. 2
0
        private void AddButton(zeus.HelperClass.zButton btn)
        {
            string location = btn.location;
            string limg     = btn.img;
            string key      = btn.key;

            int X = int.Parse(location.Split(';')[0]);
            int Y = int.Parse(location.Split(';')[1]);

            Bitmap bmp = new Bitmap(Ipaybox.StartupPath + @"\" + limg);

            img[img_count]          = new zPictureBox();
            img[img_count].Location = new Point(X, Y);
            img[img_count].Image    = bmp;
            img[img_count].Size     = bmp.Size;
            img[img_count].Tag      = btn.value;
            img[img_count].key      = key;

            if ((string)img[img_count].Tag == "ok")
            {
                img[img_count].Visible = false;
                indexDalee             = img_count;
            }

            if (!string.IsNullOrEmpty(btn.value))
            {
                img[img_count].Click += new System.EventHandler(this.Pic_Click);
            }

            img_count++;
        }
Esempio n. 3
0
        private void Pic_Click(object sender, System.EventArgs e)
        {
            //System.GC.Collect();
            Sound.Play(Ipaybox.StartupPath.TrimEnd('\\') + "\\sounds\\" + "click1.wav");
            zPictureBox pb = (zPictureBox)sender;
            //MessageBox.Show("CLICK PRV=" + pb.Tag);
            string tag = pb.Tag.ToString().ToLower();

            // Нажата не кнопка на клаве
            switch (tag)
            {
            case "ok":
                Ipaybox.AddToLog(Ipaybox.Logs.Main, "Номер подтвержден");
                Ipaybox.curPay.IsAccountConfirmed = true;
                Ipaybox.StartForm.Main_Process();
                this.Dispose();
                break;

            case "vmenu":
                Ipaybox.AddToLog(Ipaybox.Logs.Main, "Возврат в главное меню.");
                ExitForm();
                break;

            case "goprev":
                Ipaybox.AddToLog(Ipaybox.Logs.Main, "Возврат в предыдущее меню.");
                Ipaybox.cFormIndex = Ipaybox.cFormIndex - 1;
                Ipaybox.StartForm.Main_Process();
                this.Dispose();
                //ExitForm();
                break;
            }
        }
Esempio n. 4
0
        private void AddProviderImage(zeus.HelperClass.zPrvImage prvImage)
        {
            if (prvImage != null)
            {
                string location = prvImage.location;
                string limg     = Ipaybox.GetImageFromInterface_Prv(Ipaybox.PRV_SELECTED_ID);
                string size     = prvImage.size;

                int X = int.Parse(location.Split(';')[0]);
                int Y = int.Parse(location.Split(';')[1]);

                Bitmap bmp = new Bitmap(Ipaybox.StartupPath + @"\" + limg);
                img[img_count]          = new zPictureBox();
                img[img_count].Location = new Point(X, Y);
                img[img_count].Image    = bmp;

                if (size != "")
                {
                    X = int.Parse(size.Split(';')[0]);
                    Y = int.Parse(size.Split(';')[1]);
                    img[img_count].SizeMode = PictureBoxSizeMode.StretchImage;
                    img[img_count].Size     = new Size(X, Y);
                }
                else
                {
                    img[img_count].Size = bmp.Size;
                }

                img[img_count].Visible = true;
                img_count++;
            }
        }
Esempio n. 5
0
        private void AddProviderImage(XmlElement el)
        {
            string location = el.GetAttribute("location");
            string limg     = Ipaybox.GetImageFromInterface_Prv(Ipaybox.PRV_SELECTED_ID);
            string size     = el.GetAttribute("size");

            int X = int.Parse(location.Split(';')[0]);
            int Y = int.Parse(location.Split(';')[1]);

            Bitmap bmp = new Bitmap(Ipaybox.StartupPath + @"\" + limg);

            img[img_count]          = new zPictureBox();
            img[img_count].Location = new Point(X, Y);
            img[img_count].Image    = bmp;

            if (size != "")
            {
                X = int.Parse(size.Split(';')[0]);
                Y = int.Parse(size.Split(';')[1]);
                img[img_count].SizeMode = PictureBoxSizeMode.StretchImage;
                img[img_count].Size     = new Size(X, Y);
            }
            else
            {
                img[img_count].Size = bmp.Size;
            }
            img[img_count].Visible = true;
            //this.Controls.Add(img[img_count]);
            img_count++;
        }
Esempio n. 6
0
        private void CreateNewProvider(string img, int x, int y, string tag, Size size)
        {
            try
            {
                pics[pb_count]            = new zPictureBox();
                pics[pb_count].WaitOnLoad = false;

                Bitmap bmp = Ipaybox.Pics[int.Parse(Ipaybox.images[img])];
                pics[pb_count].Image     = bmp;
                pics[pb_count].SizeMode  = PictureBoxSizeMode.CenterImage;
                pics[pb_count].BackColor = Color.Transparent;
                if (size.Width != 0 && size.Height != 0)
                {
                    pics[pb_count].Size = size;
                }
                else
                {
                    pics[pb_count].Size = bmp.Size;
                }
                pics[pb_count].Location = new Point(x, y);
                pics[pb_count].Tag      = tag;
                pics[pb_count].Click   += new System.EventHandler(this.Pic_Click);

                pics[pb_count].Paint += new PaintEventHandler(main_menu_Paint);
                //this.Controls.Add(pics[pb_count]);

                pb_count++;
            }
            catch { }
        }
Esempio n. 7
0
        private void ShowWarning(int x, int y)
        {
            Bitmap bmp = new Bitmap(Ipaybox.StartupPath + @"\" + "\\osmp17\\warning.gif");

            img[img_count]          = new zPictureBox();
            img[img_count].Location = new Point(x, y);
            img[img_count].Image    = bmp;
            img[img_count].Size     = bmp.Size;
            img[img_count].Visible  = true;
            this.Controls.Add(img[img_count]);
            img_count++;
        }
Esempio n. 8
0
        public static void AddImage(zeus.HelperClass.zImage zimg, ref zPictureBox img, System.Windows.Forms.Form f)
        {
            string location = zimg.location;
            string limg     = zimg.src;
            string size     = zimg.size;

            int X = int.Parse(location.Split(';')[0]);
            int Y = int.Parse(location.Split(';')[1]);

            Bitmap bmp = new Bitmap(Ipaybox.StartupPath + @"\" + limg);

            bmp.MakeTransparent();
            img          = new zPictureBox();
            img.Location = new Point(X, Y);
            img.Image    = bmp;
            img.Tag      = "";

            if (zimg.type == "solid" || zimg.type == "alert")
            {
                img.BackColor = Color.White;
            }
            else
            if (zimg.type == "error")
            {
                img.Visible   = false;
                img.BackColor = Color.White;
            }
            else
            {
                img.BackColor = Color.Transparent;
            }

            if (size != "")
            {
                X            = int.Parse(size.Split(';')[0]);
                Y            = int.Parse(size.Split(';')[1]);
                img.SizeMode = PictureBoxSizeMode.StretchImage;
                img.Size     = new Size(X, Y);
            }
            else
            {
                img.Size = bmp.Size;
            }

            f.Controls.Add(img);
        }
Esempio n. 9
0
        //Добавление кнопки на форму
        public static void AddButton(zeus.HelperClass.zButton btn, ref zPictureBox img, System.Windows.Forms.Form f, EventHandler tar)
        {
            string location = btn.location;
            string limg     = btn.img;
            string tag      = btn.value;
            string key      = btn.key;

            int X = int.Parse(location.Split(';')[0]);
            int Y = int.Parse(location.Split(';')[1]);

            Bitmap tmp = Ipaybox.Pics[int.Parse(Ipaybox.images[limg])];

            img          = new zPictureBox();
            img.Location = new Point(X, Y);
            img.Image    = tmp;
            img.Size     = tmp.Size;
            img.Tag      = tag;
            img.key      = key;
            // НЕРАБОТАЕТ
            img.Click += tar;

            //f.Controls.Add(img);
        }
Esempio n. 10
0
        private void Pic_Click(object sender, System.EventArgs e)
        {
            Sound.Play(Ipaybox.StartupPath.TrimEnd('\\') + "\\sounds\\" + "click2.wav");
            System.Diagnostics.Debug.WriteLine("Нажата кнопка:" + DateTime.Now.ToString("HH:mm:ss.") + DateTime.Now.Millisecond.ToString());
            zPictureBox pb = (zPictureBox)sender;

            //MessageBox.Show("CLICK PRV=" + pb.Tag);
            if (pb.Tag.ToString() == "tomenu" || (pb.Tag.ToString() == "page--" && Page == 0))
            {
                ToMenu();
            }
            else
            {
                if (pb.Tag.ToString() == "page--")
                {
                    Ipaybox.AddToLog(Ipaybox.Logs.Main, "Страница назад");
                    Page--;
                    Process(Ipaybox.Ececution.Group, Ipaybox.PRV_SELECTED_GROUP.id);
                }
                else
                if (pb.Tag.ToString() == "page++")
                {
                    Ipaybox.AddToLog(Ipaybox.Logs.Main, "Страница Вперед");
                    Page++;
                    Process(Ipaybox.Ececution.Group, Ipaybox.PRV_SELECTED_GROUP.id);
                }
                else
                {
                    if (pb.Tag.ToString() == "information")
                    {
                        try
                        {
                            Ipaybox.StartForm.StartForm(Ipaybox.Forms.Information);
                            _backBuffer.Dispose();
                            this.BackgroundImage.Dispose();
                            pooling.Stop();
                            pooling.Dispose();
                            this.Dispose();
                            GC.Collect();
                        }
                        catch
                        {
                        }
                    }

                    try
                    {
                        string[] group   = pb.Tag.ToString().Split('-');
                        string   groupid = group[1];
                        //IsGroup = true;
                        Hide_Elements();
                        Process(Ipaybox.Ececution.Group, groupid);
                        Ipaybox.AddToLog(Ipaybox.Logs.Main, "Выбрана Группа ID#" + groupid + "(" + Ipaybox.GroupNames[groupid] + ")");
                    }
                    catch
                    {
                        Page = 0;
                        Process(Ipaybox.Ececution.Provider, pb.Tag.ToString());
                        Ipaybox.AddToLog(Ipaybox.Logs.Main, "Выбран провайдер ID#" + pb.Tag.ToString().Trim() + "(" + Ipaybox.ProviderNames[pb.Tag.ToString().Trim()] + ")");
                        _backBuffer.Dispose();
                        this.BackgroundImage.Dispose();
                        pooling.Stop();
                        pooling.Dispose();
                        this.Dispose();
                        GC.Collect();
                    }
                }
            }
        }