예제 #1
0
        private void LoadGroups()
        {
            try
            {
                zeus.HelperClass.zMainMenuForm frm = Ipaybox.ifc.systemForms[0].groupList;
                int count = frm.count;

                int startx       = int.Parse(frm.startPos.Split(';')[0]);
                int starty       = int.Parse(frm.startPos.Split(';')[1]);
                int inline_count = frm.hcount;
                int dx           = frm.dx;
                int dy           = frm.dy;

                XmlElement root = (XmlElement)Ipaybox.config.DocumentElement.SelectSingleNode("groups");

                int x = startx, y = starty;
                int count1 = 0;

                for (int i = 0; i < root.ChildNodes.Count; i++)
                {
                    XmlElement row = (XmlElement)root.ChildNodes[i];

                    if (row.Name == "group" && row.GetAttribute("parent") == "0" && HasGroupProvider(row.GetAttribute("id")))
                    {
                        string id  = "group-" + row.GetAttribute("id");
                        string img = Ipaybox.GetImageFromInterface_Group(row.GetAttribute("id"));

                        if (img != "")
                        {
                            CreateNewProvider(img, x, y, id, new Size());
                            x += dx;
                            count1++;

                            if (count1 == inline_count)
                            {
                                x  = startx;
                                y += dy;

                                count1 = 0;
                            }
                        }
                    }
                }
            }
            catch
            {
                Ipaybox.Working = false;
            }
        }
예제 #2
0
        private void Load_Group(string group_id)
        {
            TimerEnabled = true;
            pb_count     = 0;

            zeus.HelperClass.zMainMenuForm frm = Ipaybox.ifc.systemForms[0].group;
            int count = frm.count;
            //Начальные координаты
            int startx         = int.Parse(frm.startPos.Split(';')[0]);
            int starty         = int.Parse(frm.startPos.Split(';')[1]);
            int dx             = frm.dx;
            int dy             = frm.dy;
            int inline_count   = frm.hcount;
            int countProviders = 0;

            //Добавление кнопок на форму
            for (int i = 0; i < frm.buttons.Count; i++)
            {
                Ipaybox.AddButton(frm.buttons[i], ref pics[pb_count], this, new EventHandler(this.Pic_Click));
                pb_count++;
            }

            try
            {
                /*
                 * Добавление кнопок групп на форму
                 */
                int x = startx, y = starty;
                //int lastx = x, lasty = y;
                int count1     = 0;
                int count2     = 1;
                int CountAdded = 0;

                if (Page == 0)
                {
                    XmlElement root = (XmlElement)Ipaybox.config.DocumentElement.SelectSingleNode("groups");

                    for (int i = 0; i < root.ChildNodes.Count; i++)
                    {
                        XmlElement row = (XmlElement)root.ChildNodes[i];
                        if (row.Name == "group" && row.GetAttribute("parent") == group_id)
                        {
                            string id  = "group-" + row.GetAttribute("id");
                            string img = Ipaybox.GetImageFromInterface_Group(row.GetAttribute("id"));
                            if (img != "")
                            {
                                CreateNewProvider(img, x, y, id, new Size(), true);
                                CountAdded++;
                                x += dx;
                                count1++;

                                if (count1 == inline_count)
                                {
                                    x  = startx;
                                    y += dy;
                                    count2++;
                                    count1 = 0;
                                }
                            }
                        }
                    }
                }

                int countGroup = Ipaybox.config.DocumentElement.SelectSingleNode("groups").SelectNodes("//group[@parent='" + group_id + "']").Count;
                //XmlNodeList root1 = Ipaybox.providers.DocumentElement.SelectNodes("//provider[@group-id='"+group_id +"']");
                XmlNodeList root1 = Ipaybox.providers.DocumentElement.SelectNodes("//*[@group-id='" + group_id + "']");
                countProviders = root1.Count;
                // Если нет провайдеров в группе
                if (countProviders == 0)
                {
                    //Ipaybox.PRV_SELECTED_GROUP = "";
                    ToMenu();
                }
                if (root1.Count + countGroup <= Page * count + count)
                {
                    HideElement("page++");
                }

                int startPrv = Page > 0 ? Page * count - countGroup:0;
                int countPrv = Page * count + count;

                if (countPrv >= root1.Count + countGroup)
                {
                    countPrv = root1.Count;
                }
                else
                {
                    countPrv = countPrv - countGroup;
                }

                for (int i = startPrv; i < countPrv; i++)
                {
                    XmlElement row = (XmlElement)root1[i];
                    if (row.Name == "provider" && row.GetAttribute("group-id") == group_id)
                    {
                        if (((count2 - 1) * 2 + count1) < count)
                        {
                            string id  = row.GetAttribute("id");
                            string img = Ipaybox.GetImageFromInterface_Prv(id);

                            if (img != "")
                            {
                                CreateNewProvider(img, x, y, id, new Size(), true);
                                x += dx;
                                count1++;

                                if (count1 == inline_count)
                                {
                                    x      = startx;
                                    y     += dy;
                                    startx = x;
                                    starty = y;
                                    count2++;
                                    count1 = 0;
                                }
                            }
                        }
                        else
                        {
                            dalee.Visible = true;
                        }
                    }
                    else
                    {
                        if (row.Name == "group" && row.GetAttribute("group-id") == group_id)
                        {
                            if (((count2 - 1) * 2 + count1) < count)
                            {
                                string id  = "group-" + row.GetAttribute("id");
                                string img = Ipaybox.GetImageFromInterface_Group(row.GetAttribute("id"));

                                if (img != "")
                                {
                                    CreateNewProvider(img, x, y, id, new Size(), true);
                                    x += dx;
                                    count1++;

                                    if (count1 == inline_count)
                                    {
                                        x      = startx;
                                        y     += dy;
                                        startx = x;
                                        starty = y;
                                        count2++;
                                        count1 = 0;
                                    }
                                }
                            }
                            else
                            {
                                dalee.Visible = true;
                            }
                        }
                    }
                }
            }
            catch
            {
                Ipaybox.Working = false;
            }

            if (countProviders > 0)
            {
                string bgimage = Ipaybox.ifc.systemForms[0].bgimg;

                if (bgimage != "")
                {
                    this.BackgroundImage = new Bitmap(Ipaybox.StartupPath + @"\" + bgimage);
                }
            }
        }
예제 #3
0
        private void LoadTop5(int inches)
        {
            TimerEnabled = false;
            LoadGroups();

            try
            {
                zeus.HelperClass.zMainMenuForm frm = Ipaybox.ifc.systemForms.Find(p => p.name == "main_menu").top;
                int count        = frm.count;
                int startx       = int.Parse(frm.startPos.Split(';')[0]);
                int starty       = int.Parse(frm.startPos.Split(';')[1]);
                int inline_count = frm.hcount;
                int dx           = frm.dx;
                int dy           = frm.dy;

                for (int i = 0; i < frm.buttons.Count; i++)
                {
                    Ipaybox.AddButton(frm.buttons[i], ref pics[pb_count], this, new EventHandler(this.Pic_Click));
                    pb_count++;
                }

                for (int i = 0; i < frm.banners.Count; i++)
                {
                    Ipaybox.AddBanner(frm.banners[i], this, new EventHandler(this.Pic_Click));
                    //AddFlash(frm.banners[i], this, new EventHandler(this.Pic_Click));
                }

                XmlElement root = (XmlElement)Ipaybox.config.DocumentElement.SelectSingleNode("top");

                if (root == null)
                {
                    root = (XmlElement)Ipaybox.config.DocumentElement.SelectSingleNode("top5");
                }

                int x = startx, y = starty;
                int count1 = 0;

                for (int i = 0; i < root.ChildNodes.Count; i++)
                {
                    if (i >= count)
                    {
                        break;
                    }

                    XmlElement row = (XmlElement)root.ChildNodes[i];

                    if (row.Name == "prv")
                    {
                        string id  = row.GetAttribute("id");
                        string img = Ipaybox.GetImageFromInterface_Prv(id);

                        if (img == "")
                        {
                            break;
                        }

                        CreateNewProvider(img, x, y, id, new Size());
                        x += dx;
                        count1++;

                        if (count1 > inline_count - 1)
                        {
                            x      = startx;
                            y     += dy;
                            starty = y;
                            count1 = 0;
                        }
                    }
                    else
                    {
                        if (row.Name == "group")
                        {
                            string id  = "group-" + row.GetAttribute("id");
                            string img = Ipaybox.GetImageFromInterface_Group(row.GetAttribute("id"));

                            if (img == "")
                            {
                                break;
                            }

                            CreateNewProvider(img, x, y, id, new Size());
                            x += dx;
                            count1++;

                            if (count1 > inline_count - 1)
                            {
                                x      = startx;
                                y     += dy;
                                starty = y;
                                count1 = 0;
                            }
                        }
                    }
                }
            }
            catch (Exception ex)
            {
                Ipaybox.Working = false;
                Ipaybox.AddToLog(Ipaybox.Logs.Main, "LoadTop5. " + ex.Message);
            }
        }