Exemplo n.º 1
0
        private void readPt()
        {
            PpHelper pptHelper = new PpHelper(propertiesFile);
            Dictionary <string, string> dic = pptHelper.getAllProperties();

            dicNum = dic.Count();
            int i = 1;

            foreach (KeyValuePair <string, string> p in dic)
            {
                this.allProperties.Add(p.Key, p.Value);
                TextBox txtBoxK = new TextBox();
                txtBoxK.Name = "K_" + i.ToString();
                txtBoxK.Text = p.Key;
                txtBoxK.Left = 0;
                txtBoxK.Top  = i * 50;
                Label l1 = new Label();
                l1.Text          = "=";
                txtBoxK.Location = new Point(pannelPts.Location.X - 20, i * 25);
                l1.Location      = new Point(120, i * 25);
                l1.Size          = new System.Drawing.Size(10, 23);
                txtBoxK.KeyUp   += new KeyEventHandler(this.txt_Change);
                pannelPts.Controls.Add(txtBoxK);
                pannelPts.Controls.Add(l1);
                TextBox txtBoxV = new TextBox();
                txtBoxV.Name     = "V_" + i.ToString();
                txtBoxV.Text     = p.Value;
                txtBoxV.Location = new Point(130, i * 25);
                txtBoxV.Size     = new System.Drawing.Size(230, 23);
                txtBoxV.Top      = i * 25;
                txtBoxV.KeyUp   += new KeyEventHandler(this.txt_Change);
                pannelPts.Controls.Add(txtBoxV);
                i++;
            }
        }
Exemplo n.º 2
0
        //       public Dictionary<string, string> allProperties = new Dictionary<string, string>();
        private void readPt()
        {
            PpHelper pptHelper = new PpHelper(propertiesFile);
            Dictionary <string, string> dic = null;

            try
            {
                dic = pptHelper.getAllProperties();
            }
            catch (Exception)
            {
                MessageBox.Show("获取gameConfig参数配置异常,请检查!");
                this.DialogResult = DialogResult.Cancel;
                return;
            }

            dicNum = dic.Count();
            int i = 1;

            foreach (KeyValuePair <string, string> p in dic)
            {
                //     this.allProperties.Add(p.Key, p.Value);
                TextBox txtBoxK = new TextBox();
                txtBoxK.Name     = "K_" + i.ToString();
                txtBoxK.Text     = p.Key;
                txtBoxK.Left     = 0;
                txtBoxK.Top      = i * 50;
                txtBoxK.Location = new Point(pannelPts.Location.X + 5, i * 25);
                pannelPts.Controls.Add(txtBoxK);

                Label l1 = new Label();
                l1.Text     = "=";
                l1.Location = new Point(112, i * 25);
                l1.Size     = new System.Drawing.Size(10, 23);
                pannelPts.Controls.Add(l1);

                TextBox txtBoxV = new TextBox();
                txtBoxV.Name = "V_" + i.ToString();
                txtBoxV.Text = p.Value;

                if (p.Key == "version")
                {
                    txtBoxV.Text = selGame.version;
                }

                //if (p.Key == "version" && selGame.version != p.Value)
                //{
                //    txtBoxV.Text = selGame.version;

                //    DialogResult dr = MessageBox.Show("游戏版本" + selGame.version + "号与打包参数" + p.Value + "不一致,确定采用游戏版本? ", "版本不一致!", MessageBoxButtons.OKCancel, MessageBoxIcon.Question);
                //    if (dr == DialogResult.OK)
                //    {
                //        txtBoxV.Text = selGame.version;
                //    }

                //}

                txtBoxV.Location = new Point(130, i * 25);
                txtBoxV.Size     = new System.Drawing.Size(230, 23);
                txtBoxV.Top      = i * 25;

                pannelPts.Controls.Add(txtBoxV);
                i++;
            }
        }