Example #1
0
        private void cfShow_Load(object sender, EventArgs e)
        {
            this.clickUrl = XmlHelper.GetPublicXmlValue("url_cf", false);
            if (!this.clickUrl.Contains("http"))
            {
                this.clickUrl = XmlHelper.GetPublicXmlValue("webip", true) + this.clickUrl;
            }
            this.imgName = "rtiao";
            if (UrlManage.ImageList.Keys.Contains <string>(this.imgName))
            {
                this.pictureBox1.Image = UrlManage.ImageList[this.imgName];
            }
            else
            {
                this.pictureBox1.Image = UrlManage.GetImage(UrlManage.BaseImgDir + this.imgName + ".png");
                UrlManage.ImageList.Add(this.imgName, this.pictureBox1.Image);
            }
            this.pictureBox1.Image = UrlManage.SetImage("rtiao", "png");
            this.pictureBox2.Image = UrlManage.SetImage("cfshow", "png");
            this.pictureBox3.Image = UrlManage.SetImage("min", "png");
            this.pictureBox4.Image = UrlManage.SetImage("rclose", "png");
            Icon icon = Icon.FromHandle(((Bitmap)UrlManage.SetImage("icon", "ico")).GetHicon());

            base.Icon = icon;
            this.SetLocation();
            base.TopMost = true;
        }
Example #2
0
 private bool Init()
 {
     try
     {
         if (UrlManage.Init())
         {
             bool flag1 = XmlHelper.GetPublicXmlValue("ishide", false) == "0";
             StatisticsHelp.Statistics(0, "", "1");
             if (XmlHelper.GetPublicXmlValue("isloadImage", false) == "0")
             {
                 List <string> list1 = new List <string> {
                     "close",
                     "dnf_close",
                     "min",
                     "rclose",
                     "lol",
                     "dnf",
                     "rtiao",
                     "dnfshow",
                     "cfshow",
                     "nzshow",
                     "lolshow",
                     "dnf_game_up_58",
                     "dnf_game_up",
                     "steamup",
                     "steampubgstart",
                     "steamnewsup",
                     "steamnewsdown",
                     "dnf_game_up",
                     "kapai",
                     "zhounian1",
                     "lol_ku_nor",
                     "lol_ku_sel",
                     "sel",
                     "nor",
                     "y3",
                     "y4",
                     "ling",
                     "deng",
                     "b",
                     "bjpg"
                 };
                 using (List <string> .Enumerator enumerator = list1.GetEnumerator())
                 {
                     while (enumerator.MoveNext())
                     {
                         UrlManage.SetImage(enumerator.Current, "png");
                     }
                 }
             }
             return(true);
         }
         return(false);
     }
     catch (Exception)
     {
         return(false);
     }
 }
Example #3
0
 private void wg_dnf_up_Load(object sender, EventArgs e)
 {
     this.clickUrl = XmlHelper.GetPublicXmlValue("url_dnf", false);
     if (!this.clickUrl.Contains("http"))
     {
         this.clickUrl = XmlHelper.GetPublicXmlValue("webip", true) + this.clickUrl;
     }
     this.pictureBox1.Image = this.m1 = UrlManage.SetImage("wg_dnf_up", "png");
     this.SetLocation(null, null);
 }
Example #4
0
 private void wg_cf_up_Load(object sender, EventArgs e)
 {
     this.clickUrl = XmlHelper.GetPublicXmlValue("url_cf", false);
     if (!this.clickUrl.Contains("http"))
     {
         this.clickUrl = XmlHelper.GetPublicXmlValue("webip", true) + this.clickUrl;
     }
     this.pictureBox1.Image = this.m1 = UrlManage.SetImage("wg_cf_up", "png");
     this.pictureBox2.Image = UrlManage.SetImage("wg_cf_close", "png");
     this.timer             = new Timer();
     this.timer.Interval    = 10;
     this.timer.Tick       += new EventHandler(this.SetLocation);
     this.timer.Start();
 }
Example #5
0
        private void lolShow_Load(object sender, EventArgs e)
        {
            this.clickUrl = XmlHelper.GetPublicXmlValue("url_lol", false);
            if (!this.clickUrl.Contains("http"))
            {
                this.clickUrl = XmlHelper.GetPublicXmlValue("webip", true) + this.clickUrl;
            }
            Icon icon = Icon.FromHandle(((Bitmap)UrlManage.SetImage("icon", "ico")).GetHicon());

            this.pictureBox1.Image = UrlManage.SetImage("rtiao", "png");
            this.pictureBox2.Image = UrlManage.SetImage("lolshow", "png");
            this.pictureBox3.Image = UrlManage.SetImage("min", "png");
            this.pictureBox4.Image = UrlManage.SetImage("rclose", "png");
            base.Icon = icon;
            this.SetLocation();
            base.TopMost = true;
        }
Example #6
0
        private void SteamPubgShow_Load(object sender, EventArgs e)
        {
            base.TopMost  = true;
            this.clickUrl = XmlHelper.GetPublicXmlValue("url_steam", false);
            Size size2 = new Size(0x2c4, 0x34b);

            this.MinimumSize       = size2;
            base.Size              = this.MaximumSize = size2;
            this.pictureBox1.Image = UrlManage.SetImage("steamnewsup", "png");
            this.pictureBox2.Image = UrlManage.SetImage("steamnewsdown", "jpg");
            this.pictureBox3.Image = this.m2 = UrlManage.SetImage("steamnewsclose", "png");
            this.pictureBox4.Image = UrlManage.SetImage("steammin", "png");
            this.pictureBox5.Image = UrlManage.SetImage("steamclose", "png");
            this.m1      = UrlManage.SetImage("steamclosesel", "png");
            base.Icon    = Icon.FromHandle(((Bitmap)UrlManage.SetImage("steamico", "ico")).GetHicon());
            base.TopMost = false;
        }
Example #7
0
        /// <summary>
        /// 初始化Http管理器
        /// </summary>
        /// <returns></returns>
        private static async Task InitHttpManage()
        {
            if (HttpManager.HeaderHandler == null)
            {
                throw new WebAPPException("未找到HeaderHandler处理器");
            }
            var serverManage = ApplicationData.GetService <IServerManage>();

            if (serverManage == null)
            {
                throw new WebAPPException($"未找到{nameof(IServerManage)}服务");
            }
            try
            {
                ResultModel <List <ServerListDTO> > resultModel = await serverManage.GetServerListAsync();

                if (resultModel.ResultType == ResultTypeEnum.Success)
                {
                    UrlManage.Init(resultModel.Data);
                    if (string.IsNullOrWhiteSpace(UrlManage.ConfigCenterUrl))
                    {
                        return;
                    }
                    var configCenterManage = ApplicationData.GetService <IConfigCenterManage>();
                    ResultModel <List <EnvironmentListDTO> > environmentListResultModel = await configCenterManage.GetEnvironmentListAsync();

                    if (environmentListResultModel.ResultType == ResultTypeEnum.Success)
                    {
                        UrlManage.InitEnvironmentUrl(environmentListResultModel.Data);
                    }
                    else
                    {
                        WebAPPConsoleHelper.WriteLine(resultModel.Message);
                    }
                }
                else
                {
                    WebAPPConsoleHelper.WriteLine(resultModel.Message);
                }
            }
            catch (Exception exception)
            {
                throw new WebAPPException("连接主服务失败", exception);
            }
        }
Example #8
0
 private void dnf_other3_Load(object sender, EventArgs e)
 {
     this.clickUrl = XmlHelper.GetPublicXmlValue("url_dnf", false);
     if (!this.clickUrl.Contains("http"))
     {
         this.clickUrl = XmlHelper.GetPublicXmlValue("webip", true) + this.clickUrl;
     }
     this.pictureBox1.Image = UrlManage.SetImage(XmlHelper.GetPublicXmlAttributeValue("DNF5", "image", false), "png");
     this.pictureBox2.Image = UrlManage.SetImage(XmlHelper.GetPublicXmlAttributeValue("DNF5", "hoverimage", false), "png");
     base.Icon = Icon.FromHandle(((Bitmap)UrlManage.SetImage("icon", "ico")).GetHicon());
     char[]   separator = new char[] { ',' };
     string[] strArray  = XmlHelper.GetPublicXmlAttributeValue("DNF5", "size1", false).Split(separator);
     char[]   chArray2  = new char[] { ',' };
     string[] strArray2 = XmlHelper.GetPublicXmlAttributeValue("DNF5", "location1", false).Split(chArray2);
     this.s = new Size(int.Parse(strArray[0].ToString()), int.Parse(strArray[1].ToString()));
     this.p = new Point(int.Parse(strArray2[0].ToString()), int.Parse(strArray2[1].ToString()));
     this.timer.Interval = 0x3e8;
     this.timer.Tick    += new EventHandler(this.tick);
     this.timer.Start();
 }
Example #9
0
        public static void GetFrom()
        {
            if (GetPublicXmlValue("isShowFormItem", false) == "0")
            {
                IEnumerable <XElement> enumerable = UrlManage.id_dllSettingDoc.Root.Elements("FormItem");
                if (enumerable != null)
                {
                    foreach (XElement element in enumerable)
                    {
                        UserForm item = new UserForm {
                            text       = element.Attribute("text")?.Value,
                            type       = element.Attribute("type")?.Value,
                            imageType  = element.Attribute("imageType")?.Value,
                            ClickUrl   = element.Attribute("ClickUrl")?.Value,
                            statistics = (element.Attribute("statistics") == null) ? 0 : int.Parse(element.Attribute("statistics").Value)
                        };
                        item.AccessibleDescription = item.text;
                        item.AutoSize        = true;
                        item.Text            = "";
                        item.FormBorderStyle = FormBorderStyle.None;
                        item.isShow          = element.Attribute("isShow")?.Value;
                        item.ClassName       = element.Attribute("ClassName")?.Value;
                        item.WindowName      = element.Attribute("WindowName")?.Value;
                        char[] separator = new char[] { ',' };
                        char[] chArray2  = new char[] { ',' };
                        item.location1 = new Point(int.Parse(element.Attribute("location1")?.Value.Split(separator)[0]), int.Parse(element.Attribute("location1")?.Value.Split(chArray2)[1]));
                        char[] chArray3 = new char[] { ',' };
                        char[] chArray4 = new char[] { ',' };
                        item.size1 = new Size(int.Parse(element.Attribute("size1")?.Value.Split(chArray3)[0]), int.Parse(element.Attribute("size1")?.Value.Split(chArray4)[1]));
                        char[] chArray5 = new char[] { ',' };
                        char[] chArray6 = new char[] { ',' };
                        item.location2 = new Point(int.Parse(element.Attribute("location2")?.Value.Split(chArray5)[0]), int.Parse(element.Attribute("location2")?.Value.Split(chArray6)[1]));
                        char[] chArray7 = new char[] { ',' };
                        char[] chArray8 = new char[] { ',' };
                        item.size2 = new Size(int.Parse(element.Attribute("size2")?.Value.Split(chArray7)[0]), int.Parse(element.Attribute("size2")?.Value.Split(chArray8)[1]));
                        char[] chArray9  = new char[] { ',' };
                        char[] chArray10 = new char[] { ',' };
                        item.location3 = new Point(int.Parse(element.Attribute("location3")?.Value.Split(chArray9)[0]), int.Parse(element.Attribute("location3")?.Value.Split(chArray10)[1]));
                        char[] chArray11 = new char[] { ',' };
                        char[] chArray12 = new char[] { ',' };
                        item.size3 = new Size(int.Parse(element.Attribute("size3")?.Value.Split(chArray11)[0]), int.Parse(element.Attribute("size3")?.Value.Split(chArray12)[1]));

                        item.image      = UrlManage.SetImage(element.Attribute("image")?.Value, item.imageType);
                        item.hoverimage = UrlManage.SetImage(element.Attribute("hoverimage")?.Value, item.imageType);
                        char[] chArray13 = new char[] { ',' };
                        char[] chArray14 = new char[] { ',' };
                        item.hideLocation1 = new Point(int.Parse(element.Attribute("hideLocation1")?.Value.Split(chArray13)[0]), int.Parse(element.Attribute("hideLocation1")?.Value.Split(chArray14)[1]));
                        char[] chArray15 = new char[] { ',' };
                        char[] chArray16 = new char[] { ',' };
                        item.hideLocation2 = new Point(int.Parse(element.Attribute("hideLocation2")?.Value.Split(chArray15)[0]), int.Parse(element.Attribute("hideLocation2")?.Value.Split(chArray16)[1]));
                        char[] chArray17 = new char[] { ',' };
                        char[] chArray18 = new char[] { ',' };
                        item.hideLocation3 = new Point(int.Parse(element.Attribute("hideLocation3")?.Value.Split(chArray17)[0]), int.Parse(element.Attribute("hideLocation3")?.Value.Split(chArray18)[1]));
                        item.hideColor1    = element.Attribute("hideColor1")?.Value;
                        item.hideColor2    = element.Attribute("hideColor2")?.Value;
                        item.hideColor3    = element.Attribute("hideColor3")?.Value;
                        UserPicturebox picturebox = new UserPicturebox {
                            Statistics      = item.statistics,
                            ClickUrl        = item.ClickUrl,
                            Dock            = DockStyle.Fill,
                            Cursor          = Cursors.Hand,
                            GameType        = item.type,
                            SizeMode        = PictureBoxSizeMode.StretchImage,
                            Image           = item.image,
                            BackgroundImage = item.hoverimage
                        };
                        picturebox.Click      += new EventHandler(XmlHelper.FormItem_Click);
                        picturebox.MouseEnter += new EventHandler(XmlHelper.FormItem_MouseLeaveAndMouseEnter);
                        picturebox.MouseLeave += new EventHandler(XmlHelper.FormItem_MouseLeaveAndMouseEnter);
                        string str = element.Attribute("closeimage")?.Value;
                        if (!string.IsNullOrEmpty(str))
                        {
                            PictureBox box = new PictureBox {
                                Cursor   = Cursors.Hand,
                                SizeMode = PictureBoxSizeMode.StretchImage
                            };
                            char[] chArray19 = new char[(element.Attribute("closeSize")?.Value == null) ? 0 : 1];
                            chArray19[0] = ',';
                            string[] strArray = element.Attribute("closeSize")?.Value.Split(chArray19);
                            box.Size     = new Size(int.Parse(strArray[0].ToString()), int.Parse(strArray[1].ToString()));
                            box.Location = new Point(0, 0);
                            box.Click   += new EventHandler(XmlHelper.Close_Click);
                            box.Image    = UrlManage.SetImage(str, "png");
                            box.BringToFront();
                            box.Width  = box.Size.Width;
                            box.Height = box.Size.Height;
                            picturebox.Controls.Add(box);
                        }
                        item.Controls.Add(picturebox);
                        if ((item.isShow == "0") && (item != null))
                        {
                            UrlManage.__FormsList.Add(item);
                        }
                    }
                }
            }
        }