Пример #1
0
        private void delpage()
        {
            int num = this.colListBox1.SelectItemindex;

            if (this.colListBox1.SelectItemindex != -1)
            {
                if (!this.checkkeybangding(num))
                {
                    if (MessageOpen.Show("确认删除吗? ".Language() + "页面:".Language() + this.Myapp.pages[num].pagename, "确认".Language(), MessageBoxButtons.YesNo) == DialogResult.Yes)
                    {
                        this.Myapp.delpage(this.colListBox1.SelectItemindex, true);
                        if (num >= this.Myapp.pages.Count)
                        {
                            num = this.Myapp.pages.Count - 1;
                        }
                        this.RefList();
                        this.selectindex(num);
                        if (this.pagecheng != null)
                        {
                            this.pagecheng(null, null);
                        }
                    }
                }
            }
            else
            {
                MessageOpen.Show("请选择页面".Language());
            }
        }
Пример #2
0
 private void delpic()
 {
     try
     {
         if (this.dimgpic != null)
         {
             if (!this.piccheck(this.dimgpic.xuhao))
             {
                 if (MessageOpen.Show("确认删除吗? ".Language(), "确认".Language(), MessageBoxButtons.YesNo) == DialogResult.Yes)
                 {
                     int num = this.dimgpic.xuhao;
                     this.Myapp.delpic(this.dimgpic.xuhao);
                     this.Ref();
                     if (num >= this.imgpics.Count)
                     {
                         num = this.imgpics.Count - 1;
                     }
                     this.selectindex(num);
                     this.picupdate(null, null);
                 }
             }
         }
     }
     catch (Exception ex)
     {
         MessageOpen.Show(ex.Message);
     }
 }
Пример #3
0
 private void colListBox1_ItemEditEnd(object sender, ColListBoxItemEditEventArgs e)
 {
     if (e.itemindex >= 0 && e.itemindex < this.Myapp.pages.Count)
     {
         if (!(e.newtext == e.oldtext))
         {
             if (this.Myapp.pages[e.itemindex].mypage.pagelei != 0)
             {
                 this.colListBox1.Items[e.itemindex].Text = e.oldtext;
                 MessageOpen.Show("系统页面不可修改名称".Language());
             }
             else
             {
                 e.newtext = e.newtext.Trim();
                 int num = e.newtext.GetbytesssASCII().Length;
                 if (num == 0 || num > 14)
                 {
                     this.colListBox1.Items[e.itemindex].Text = e.oldtext;
                     MessageOpen.Show("名称长度最小1字节,最大14字节".Language());
                 }
                 else
                 {
                     string text = e.newtext.ishefaname();
                     if (text != "")
                     {
                         MessageOpen.Show(text);
                         this.colListBox1.Items[e.itemindex].Text = e.oldtext;
                     }
                     else if (this.Myapp.findpagename(e.newtext, e.itemindex) != -1)
                     {
                         this.colListBox1.Items[e.itemindex].Text = e.oldtext;
                         MessageOpen.Show("名称重复!".Language());
                     }
                     else if (this.Myapp.findobjname(this.Myapp.pages[e.itemindex], this.Myapp.pages[e.itemindex].objs[0], e.newtext))
                     {
                         this.colListBox1.Items[e.itemindex].Text = e.oldtext;
                         MessageOpen.Show("名称修改失败:当前页面下有此名称的控件".Language());
                     }
                     else
                     {
                         if (this.Myapp.pages[e.itemindex].objs.Count > 0)
                         {
                             if (this.Myapp.pages[e.itemindex].objs[0].atts[0].att.attlei == attshulei.Type.typevalue && this.Myapp.pages[e.itemindex].objs[0].atts[0].zhi[0] == objtype.page)
                             {
                                 this.Myapp.pages[e.itemindex].objs[0].objname = e.newtext;
                             }
                         }
                         this.colListBox1.Items[e.itemindex].Text = e.newtext;
                         this.Myapp.pages[e.itemindex].pagename   = e.newtext;
                         this.colListBox1_ItemSelectChang(sender, new EventArgs());
                         if (this.pagecheng != null)
                         {
                             this.pagecheng(null, null);
                         }
                     }
                 }
             }
         }
     }
 }
Пример #4
0
 private void resetToolStripMenuItem_Click(object sender, EventArgs e)
 {
     if (this.colListBox1.SelectItemindex >= 0 && this.Myapp.pages.Count != 0)
     {
         int num = this.colListBox1.SelectItemindex;
         if (num < this.Myapp.pages.Count)
         {
             if (MessageOpen.Show("确认要重置".Language() + this.Myapp.pages[num].pagename + "?", "确认".Language(), MessageBoxButtons.YesNo) == DialogResult.Yes)
             {
                 this.Myapp.resetpage(num);
                 if (this.pagecheng != null)
                 {
                     this.pagecheng(null, null);
                 }
                 if (this.Selectenter != null)
                 {
                     this.Selectenter(-1, null);
                 }
                 this.RefList();
                 if (num >= this.Myapp.pages.Count)
                 {
                     num = this.Myapp.pages.Count - 1;
                 }
                 this.colListBox1.SelectItemindex = num;
             }
         }
     }
 }
Пример #5
0
 private void ClosemainThread()
 {
     try
     {
         this.myapp.upapp.runstate = 0;
         if (this.mainthread != null)
         {
             int num = 0;
             while (this.mainthread.IsAlive && (num < 0x3e8))
             {
                 num++;
                 Thread.Sleep(1);
             }
             num = 0;
             while (this.mainthread.IsAlive && (num < 0x3e8))
             {
                 this.mainthread.Abort();
                 Thread.Sleep(1);
             }
             if (this.mainthread.IsAlive)
             {
                 MessageOpen.Show("Close RunThread Overtime");
             }
             Thread.Sleep(100);
         }
     }
     catch (Exception exception)
     {
         MessageOpen.Show("Close RunThread Error" + exception.Message);
     }
 }
Пример #6
0
 private void Refhanzi()
 {
     this.button1.Enabled = false;
     try
     {
         if (this.checkBox1.Checked)
         {
             this.hanzipos.fonstyl = FontStyle.Bold;
         }
         else
         {
             this.hanzipos.fonstyl = FontStyle.Regular;
         }
         int num = int.Parse(this.comboBox1.Text);
         this.pictureBoxzi.Width  = num;
         this.pictureBoxzi.Height = num;
         this.hanzipos.ziti       = this.comboBox2.Text;
         this.hanzipos            = gdizi.Getzipos(Encoding.GetEncoding(datasize.encodes_App[this.Encode].encodename).GetString(new byte[]
         {
             datasize.encodes_App[this.Encode].jiaozhunh,
             datasize.encodes_App[this.Encode].jiaozhunl
         }), this.hanzipos, this.pictureBoxzi.Width, this.pictureBoxzi.Height, this.pictureBoxzi);
         if (this.hanzipos.zisize >= 1f)
         {
             this.viewhanzi();
             this.button1.Enabled = true;
         }
     }
     catch (Exception ex)
     {
         MessageOpen.Show(ex.Message);
     }
 }
Пример #7
0
 private void Refzifu()
 {
     this.button1.Enabled = false;
     try
     {
         if (this.checkBox1.Checked)
         {
             this.zifupos.fonstyl = FontStyle.Bold;
         }
         else
         {
             this.zifupos.fonstyl = FontStyle.Regular;
         }
         int num = int.Parse(this.comboBox1.Text);
         this.pictureBoxm.Width  = num / 2;
         this.pictureBoxm.Height = num;
         this.zifupos.ziti       = this.comboBox4.Text;
         this.zifupos            = gdizi.Getzipos("X", this.zifupos, this.pictureBoxm.Width, this.pictureBoxm.Height, this.pictureBoxm);
         if (this.zifupos.zisize >= 1f)
         {
             this.viewzifu();
             this.button1.Enabled = true;
         }
     }
     catch (Exception ex)
     {
         MessageOpen.Show(ex.Message);
     }
 }
Пример #8
0
        private string getpeizhistr()
        {
            string text = "whmi_set " + this.mycom.touch.ToString();

            try
            {
                string text2 = Convert.ToString((this.mycom.Lcdid & 65280) >> 8, 16);
                if (text2.Length == 1)
                {
                    text2 = "0" + text2;
                }
                text += text2;
                text2 = Convert.ToString(this.mycom.Lcdid & 255, 16);
                if (text2.Length == 1)
                {
                    text2 = "0" + text2;
                }
                text += text2;
                text += ",123";
            }
            catch (Exception ex)
            {
                MessageOpen.Show(ex.Message);
                text = "";
            }
            return(text);
        }
Пример #9
0
 private void sendall()
 {
     this.listBox1.Items.Clear();
     this.listBox2.Items.Clear();
     this.label4.Text      = "数据含义:".Language();
     this.label4.ForeColor = Color.Black;
     this.label5.Text      = "数据含义:".Language();
     this.label5.ForeColor = Color.Black;
     if (this.comboBox1.SelectedIndex == 1 || this.comboBox1.SelectedIndex == 2)
     {
         if (!this.com1.IsOpen)
         {
             MessageOpen.Show("设备未连接".Language());
         }
     }
     if (this.textEditorControl1.Document.TotalNumberOfLines > 0)
     {
         foreach (LineSegment current in this.textEditorControl1.Document.LineSegmentCollection)
         {
             string text = this.textEditorControl1.Document.GetText(current).Trim();
             if (text.Length > 0)
             {
                 this.SendLastCode(text);
             }
         }
     }
 }
Пример #10
0
 private void getports()
 {
     this.comboBox2.Items.Clear();
     this.comboBox3.Items.Clear();
     this.comboBox3.Items.Add("自动搜索".Language());
     try
     {
         string[] portNames = SerialPort.GetPortNames();
         string[] array     = portNames;
         for (int i = 0; i < array.Length; i++)
         {
             string item = array[i];
             this.comboBox3.Items.Add(item);
             this.comboBox2.Items.Add(item);
         }
         this.comboBox3.SelectedIndex = 0;
         if (this.comboBox2.Items.Count > 0)
         {
             this.comboBox2.SelectedIndex = 0;
         }
     }
     catch (Exception ex)
     {
         MessageOpen.Show("获取计算机COM口列表失败!".Language() + "\r\n" + "错误信息:".Language() + ex.Message);
     }
 }
Пример #11
0
        private void delziku()
        {
            int selectedIndex = this.listBox1.SelectedIndex;

            if (this.listBox1.Items.Count > 0 && selectedIndex > -1)
            {
                if (!this.zikucheck(selectedIndex))
                {
                    if (MessageOpen.Show("确认删除吗? ".Language(), "确认".Language(), MessageBoxButtons.YesNo) == DialogResult.Yes)
                    {
                        this.Myapp.delzimo(selectedIndex);
                        this.Ref();
                        this.zikuupdate(null, null);
                        if (this.listBox1.Items.Count > selectedIndex)
                        {
                            this.listBox1.SelectedIndex = selectedIndex;
                        }
                        else if (this.listBox1.Items.Count > 0)
                        {
                            this.listBox1.SelectedIndex = this.listBox1.Items.Count - 1;
                        }
                    }
                }
            }
        }
Пример #12
0
 private void picview_Load(object sender, EventArgs e)
 {
     try
     {
         this.pictureBox1.Width  = (int)this.Myapp.images[this.picindex].picturexinxi.W;
         this.pictureBox1.Height = (int)this.Myapp.images[this.picindex].picturexinxi.H;
         int num  = (this.panel1.Width - this.pictureBox1.Width) / 2;
         int num2 = (this.panel1.Height - this.pictureBox1.Height) / 2;
         if (num < 0)
         {
             num = 0;
         }
         if (num2 < 30)
         {
             num2 = 30;
         }
         this.label1.Left      = num;
         this.label1.Top       = num2 - this.label1.Height - 3;
         this.label1.Text      = "Size:" + this.pictureBox1.Width.ToString() + "*" + this.pictureBox1.Height.ToString();
         this.pictureBox1.Top  = num2;
         this.pictureBox1.Left = num;
         this.pictureBox1.BackgroundImageLayout = ImageLayout.None;
         this.pictureBox1.BackgroundImage       = this.Myapp.images[this.picindex].imagebitbmp;
     }
     catch (Exception ex)
     {
         MessageOpen.Show(ex.Message);
     }
 }
Пример #13
0
 public unsafe void RunStop()
 {
     try
     {
         this.myapp.upapp.runstate = 0;
         this.binpath = null;
         if (this.myapp.upapp.runapptype == runapptype.bianji)
         {
             if (this.myapp.upapp.filesr != null)
             {
                 this.tobjs.Clear();
                 this.selectobjedits.Clear();
                 while (this.allobjedits.Count > 0)
                 {
                     objedit item = this.allobjedits[0];
                     this.allobjedits.Remove(item);
                     item.Dispose();
                 }
                 this.myapp.upapp.filesr.Close();
                 this.myapp.upapp.filesr.Dispose();
                 this.myapp.upapp.filesr = null;
             }
         }
         else if (this.myapp.upapp.runapptype == runapptype.run)
         {
             this.Writedatetimespan();
             this.CloseTimerThread();
             this.ClosemainThread();
             if (this.myapp.upapp.filesr != null)
             {
                 this.myapp.upapp.filesr.Close();
                 this.myapp.upapp.filesr.Dispose();
                 this.myapp.upapp.filesr = null;
             }
         }
         if (this.merrya != null)
         {
             Commake.Comstrbuf      = null;
             this.myapp.mymerry     = null;
             Hmi.Hexstrbuf          = null;
             this.myapp.systimerbuf = null;
             this.myapp.Mycanshus   = null;
             Marshal.FreeHGlobal((IntPtr)this.merrya);
             Commake.Comstrbuf      = null;
             this.myapp.mymerry     = null;
             Hmi.Hexstrbuf          = null;
             this.myapp.systimerbuf = null;
             this.myapp.Mycanshus   = null;
             this.merrya            = null;
         }
         this.Myapp = null;
         this.myapp.upapp.images = null;
     }
     catch (Exception exception)
     {
         MessageOpen.Show(exception.Message);
     }
 }
Пример #14
0
 private void runscr_KeyDown(object sender, KeyEventArgs e)
 {
     if (this.myapp.upapp.runapptype == runapptype.bianji)
     {
         try
         {
             if ((e.KeyCode == Keys.A) && (Control.ModifierKeys == Keys.Control))
             {
                 this.ctrl_A();
             }
             else if ((e.KeyCode == Keys.Z) && (Control.ModifierKeys == Keys.Control))
             {
                 if (this.ObjKeyDown != null)
                 {
                     this.ObjKeyDown("Z", null);
                 }
             }
             else if ((e.KeyCode == Keys.Y) && (Control.ModifierKeys == Keys.Control))
             {
                 if (this.ObjKeyDown != null)
                 {
                     this.ObjKeyDown("Y", null);
                 }
             }
             else if ((e.KeyCode == Keys.C) && (Control.ModifierKeys == Keys.Control))
             {
                 if (this.ObjKeyDown != null)
                 {
                     this.ObjKeyDown("C", null);
                 }
             }
             else if ((e.KeyCode == Keys.V) && (Control.ModifierKeys == Keys.Control))
             {
                 if (this.ObjKeyDown != null)
                 {
                     this.ObjKeyDown("V", null);
                 }
             }
             else if ((e.KeyCode == Keys.X) && (Control.ModifierKeys == Keys.Control))
             {
                 if (this.ObjKeyDown != null)
                 {
                     this.ObjKeyDown("X", null);
                 }
             }
             else if ((e.KeyCode == Keys.Delete) && (this.ObjKeyDown != null))
             {
                 this.ObjKeyDown("D", null);
             }
         }
         catch (Exception exception)
         {
             MessageOpen.Show(exception.Message);
         }
     }
 }
Пример #15
0
 private void buttonX2_Click(object sender, EventArgs e)
 {
     if (this.selectxilieindex < 0)
     {
         MessageOpen.Show("请选择设备系列".Language());
     }
     else if (this.selectmodelindex < 0)
     {
         MessageOpen.Show("请选择设备型号".Language());
     }
     else
     {
         this.Myapp.myencode = this.comboBox2.Text.GetencodeId();
         datasize.Myencoding = Encoding.GetEncoding(datasize.encodes_App[(int)this.Myapp.myencode].encodename);
         this.Myapp.xilie    = (byte)this.selectxilieindex;
         this.Myapp.Model    = datasize.Modes[this.selectxilieindex][this.selectmodelindex];
         string[] array = datasize.Modes[this.selectxilieindex][this.selectmodelindex].fenbianlv.Split(new char[]
         {
             'X'
         });
         if (array.Length == 2)
         {
             this.Myapp.guidire = (byte)this.selectshowindex;
             string a = this.Myapp.lcdwidth.ToString() + "X" + this.Myapp.lcdheight.ToString();
             this.Myapp.lcdwidth  = ((this.Myapp.guidire % 2 == 0) ? ushort.Parse(array[0]) : ushort.Parse(array[1]));
             this.Myapp.lcdheight = ((this.Myapp.guidire % 2 == 0) ? ushort.Parse(array[1]) : ushort.Parse(array[0]));
             string b    = this.Myapp.lcdwidth.ToString() + "X" + this.Myapp.lcdheight.ToString();
             bool   flag = false;
             if (a != b)
             {
                 this.Myapp.loadkeyboardlist();
                 for (int i = 0; i < this.Myapp.pages.Count; i++)
                 {
                     if (this.Myapp.pages[i].mypage.pagelei > 0 && this.Myapp.pages[i].mypage.pagelei < 21)
                     {
                         flag = true;
                         break;
                     }
                 }
             }
             if (flag)
             {
                 MessageOpen.Show("此工程的分辨率发生变化,工程中使用的内置键盘页面可能会出现布局错乱,选中异常的内置键盘页面在右键菜单中可以重置此页面以适用新的分辨率".Language());
             }
             new datazhuan(this.Myapp).ShowDialog();
             foreach (mpage current in this.Myapp.pages)
             {
                 current.objs[0].Setscreenxy();
             }
             base.DialogResult = DialogResult.OK;
         }
         base.Close();
     }
 }
Пример #16
0
 private void buttonItem4_Click(object sender, EventArgs e)
 {
     if (!this.com1.IsOpen)
     {
         MessageOpen.Show("设备未连接".Language());
     }
     else
     {
         this.com1.sendstring_End("rest", this.checkBox3.Checked, null);
     }
 }
Пример #17
0
 private void pagedaochu()
 {
     if (this.Myapp != null && this.colListBox1.SelectItemindex != -1 && this.colListBox1.SelectItemindex < this.Myapp.pages.Count)
     {
         this.Myapp.putpage(this.Myapp.pages[this.colListBox1.SelectItemindex]);
     }
     else
     {
         MessageOpen.Show("请选择页面".Language());
     }
 }
Пример #18
0
 private void buttonItem6_Click(object sender, EventArgs e)
 {
     if (this.Myapp.zimos.Count > 0)
     {
         if (MessageOpen.Show("确认要删除所有字库吗? ".Language(), "确认".Language(), MessageBoxButtons.YesNo) == DialogResult.Yes)
         {
             this.Myapp.delAllzimo();
             this.Ref();
             this.zikuupdate(null, null);
         }
     }
 }
Пример #19
0
 private void delallpic()
 {
     if (this.Myapp.images.Count > 0)
     {
         if (MessageOpen.Show("确认要删除所有图片吗?".Language(), "确认".Language(), MessageBoxButtons.YesNo) == DialogResult.Yes)
         {
             this.Myapp.delAllpic();
             this.Ref();
             this.picupdate(null, null);
         }
     }
 }
Пример #20
0
 private void button1_Click(object sender, EventArgs e)
 {
     if (this.picindex == -1)
     {
         MessageOpen.Show("ûÓÐÑ¡ÔñͼƬ".Language());
     }
     else
     {
         this.fc.str[0]    = this.picindex.ToString();
         this.fc.str[1]    = (this.radioButton1.Checked ? "0" : "1");
         base.DialogResult = DialogResult.OK;
     }
 }
Пример #21
0
 private void buttonX1_Click(object sender, EventArgs e)
 {
     if (this.mypage.mypage.password != this.textBox1.Text.GetbytesssASCII().getcrc(0))
     {
         MessageOpen.Show("ÃÜÂë´íÎó£¬ÇëÖØÐÂÊäÈ룡".Language());
         this.textBox1.Focus();
         this.textBox1.SelectAll();
     }
     else
     {
         base.DialogResult = DialogResult.OK;
     }
 }
Пример #22
0
 private void delall()
 {
     if (MessageOpen.Show("确认删除吗? ".Language(), "确认".Language(), MessageBoxButtons.YesNo) == DialogResult.Yes)
     {
         this.Myapp.delAllpage();
         this.RefList();
         this.selectindex(this.colListBox1.SelectItemindex);
         if (this.pagecheng != null)
         {
             this.pagecheng(null, null);
         }
     }
 }
Пример #23
0
        private ushort getbinver(ushort cpuid)
        {
            gujianinf gujianinf = default(gujianinf);
            int       num;
            ushort    result;

            if (cpuid == 61488 || cpuid == 61489)
            {
                num = 180;
            }
            else
            {
                if (cpuid != 61699)
                {
                    MessageOpen.Show("No Find Cpu Model");
                    result = 65535;
                    return(result);
                }
                num = 236;
            }
            StreamReader streamReader = new StreamReader(this.binpath);
            appinf0      appinf       = default(appinf0);

            byte[] array = new byte[Marshal.SizeOf(default(appinf0))];
            streamReader.BaseStream.Read(array, 0, array.Length);
            appinf = (appinf0)array.BytesTostruct(default(appinf0).GetType());
            streamReader.BaseStream.Position = (long)((ulong)appinf.hexaddr);
            hexhead hexhead = default(hexhead);

            array = new byte[Marshal.SizeOf(default(hexhead))];
            streamReader.BaseStream.Read(array, 0, array.Length);
            hexhead = (hexhead)array.BytesTostruct(default(hexhead).GetType());
            array   = new byte[Marshal.SizeOf(default(FIRMWARE_TABLE))];
            FIRMWARE_TABLE fIRMWARE_TABLE = default(FIRMWARE_TABLE);

            for (int i = 0; i < (int)hexhead.Count; i++)
            {
                streamReader.BaseStream.Read(array, 0, array.Length);
                fIRMWARE_TABLE = (FIRMWARE_TABLE)array.BytesTostruct(default(FIRMWARE_TABLE).GetType());
                if (fIRMWARE_TABLE.CPUID == cpuid)
                {
                    streamReader.BaseStream.Position = (long)((ulong)(appinf.hexaddr + fIRMWARE_TABLE.addr) + (ulong)((long)num));
                    array = new byte[Marshal.SizeOf(default(gujianinf))];
                    streamReader.BaseStream.Read(array, 0, array.Length);
                    result = ((gujianinf)array.BytesTostruct(default(gujianinf).GetType())).ver;
                    return(result);
                }
            }
            result = 65535;
            return(result);
        }
Пример #24
0
 private void button2_Click(object sender, EventArgs e)
 {
     if (this.button2.Text == "发送".Language())
     {
         this.gettongdao();
         if (this.quxiantongdaos[0] == 255 && this.quxiantongdaos[1] == 255 && this.quxiantongdaos[2] == 255 && this.quxiantongdaos[3] == 255)
         {
             MessageOpen.Show("请输入正确的通道数".Language());
         }
         else
         {
             this.quxiansendmoni = false;
             this.quxiansendcom  = false;
             if (this.comboBox1.SelectedIndex == 0 || this.comboBox1.SelectedIndex == 2)
             {
                 this.quxiansendmoni = true;
             }
             if (this.comboBox1.SelectedIndex == 1 || this.comboBox1.SelectedIndex == 2)
             {
                 this.quxiansendcom = true;
             }
             this.quxianfudu   = (int.Parse(this.textBox9.Text) - int.Parse(this.textBox8.Text)) / 2;
             this.quxianfudu  *= 2;
             this.quxianyidong = int.Parse(this.textBox8.Text) + this.quxianfudu / 2;
             if (this.quxianfudu / 2 + this.quxianyidong > 255)
             {
                 MessageOpen.Show("值超出范围".Language());
             }
             else
             {
                 this.button2.Text      = "停止".Language();
                 this.textBox2.Enabled  = false;
                 this.textBox4.Enabled  = false;
                 this.textBox5.Enabled  = false;
                 this.textBox8.Enabled  = false;
                 this.textBox9.Enabled  = false;
                 this.Button3.Enabled   = false;
                 this.comboBox1.Enabled = false;
                 this.comboBox3.Enabled = false;
                 this.sendbo            = 1;
                 this.Threadsendbo      = new Thread(new ThreadStart(this.Sendbo));
                 this.Threadsendbo.Start();
             }
         }
     }
     else
     {
         this.sendboend();
     }
 }
Пример #25
0
 private void suodingToolStripMenuItem_Click(object sender, EventArgs e)
 {
     if (this.colListBox1.SelectItemindex >= 0 && this.Myapp.pages.Count != 0)
     {
         if (this.colListBox1.SelectItemindex < this.Myapp.pages.Count)
         {
             if (this.suodingToolStripMenuItem.Text == "锁定".Language())
             {
                 Form form = new pagelock(this.Myapp.pages[this.colListBox1.SelectItemindex]);
                 form.ShowDialog();
                 if (form.DialogResult != DialogResult.OK)
                 {
                     return;
                 }
             }
             else
             {
                 if (this.Myapp.pages[this.colListBox1.SelectItemindex].mypage.password != 0u)
                 {
                     Form form = new unpagelock(this.Myapp.pages[this.colListBox1.SelectItemindex]);
                     form.ShowDialog();
                     if (form.DialogResult != DialogResult.OK)
                     {
                         return;
                     }
                 }
                 if (this.Myapp.pages[this.colListBox1.SelectItemindex].mypage.pagelei > 0)
                 {
                     if (MessageOpen.Show("此页面为系统页面,解锁之后如果对此页面做了不正当的修改,可能会影响到其他页面的正常调用,请慎重!".Language() + "\r\n" + "确认要解锁码?".Language(), "确认".Language(), MessageBoxButtons.YesNo) != DialogResult.Yes)
                     {
                         return;
                     }
                 }
                 this.Myapp.pages[this.colListBox1.SelectItemindex].mypage.pagelock = 0;
                 this.Myapp.pages[this.colListBox1.SelectItemindex].mypage.password = 0u;
             }
             if (this.pagecheng != null)
             {
                 this.pagecheng(null, null);
             }
             if (this.Selectenter != null)
             {
                 this.Selectenter(-1, null);
             }
             int selectItemindex = this.colListBox1.SelectItemindex;
             this.RefList();
             this.colListBox1.SelectItemindex = selectItemindex;
         }
     }
 }
Пример #26
0
 private void colListBox1_ItemDoubleClick(object sender, EventArgs e)
 {
     if (this.colListBox1.SelectItemindex < this.Myapp.pages.Count)
     {
         if (this.Myapp.pages[this.colListBox1.SelectItemindex].mypage.pagelei != 0)
         {
             MessageOpen.Show("系统页面不可修改名称".Language());
         }
         else
         {
             this.colListBox1.EditState = true;
         }
     }
 }
Пример #27
0
 public void ViewPic(Color bcolor, Color pforcolor)
 {
     if (base.Width >= 1)
     {
         try
         {
             int num;
             if ((int)this.Myapp.images[this.xuhao].picturexinxi.W <= base.Width)
             {
                 num = (int)this.Myapp.images[this.xuhao].picturexinxi.W;
             }
             else
             {
                 num = base.Width;
             }
             int num2 = (int)this.Myapp.images[this.xuhao].picturexinxi.H * num / (int)this.Myapp.images[this.xuhao].picturexinxi.W;
             base.Height       = num2 + 40;
             this.BackColor    = bcolor;
             this.imagepp.Size = new Size(num, num2);
             this.imagepp.BackgroundImageLayout = ImageLayout.Zoom;
             this.imagepp.BackgroundImage       = this.Myapp.images[this.xuhao].imagebitbmp;
             this.imagepp.Location    = new Point(0, 20);
             this.imagepp.Visible     = true;
             this.labeltext.Font      = new Font(SystemFonts.DefaultFont.Name, 12f);
             this.labeltext.ForeColor = pforcolor;
             this.labeltext.BackColor = bcolor;
             Control  arg_1FA_0 = this.labeltext;
             string[] array     = new string[5];
             array[0] = this.xuhao.ToString();
             array[1] = "--SIZE:";
             string[] arg_1BC_0 = array;
             int      arg_1BC_1 = 2;
             ushort   num3      = this.Myapp.images[this.xuhao].picturexinxi.W;
             arg_1BC_0[arg_1BC_1] = num3.ToString();
             array[3]             = "X";
             string[] arg_1F2_0 = array;
             int      arg_1F2_1 = 4;
             num3 = this.Myapp.images[this.xuhao].picturexinxi.H;
             arg_1F2_0[arg_1F2_1]    = num3.ToString();
             arg_1FA_0.Text          = string.Concat(array);
             this.labeltext.Visible  = true;
             this.labeltext.Location = new Point(10, base.Height - 20);
         }
         catch (Exception ex)
         {
             MessageOpen.Show(ex.Message);
         }
     }
 }
Пример #28
0
        public void Ref()
        {
            Pen pen = new Pen(Color.Black, 1f);

            this.dimgpic = null;
            this.Clearpic();
            if (this.Myapp != null)
            {
                try
                {
                    imagesizexytype imagesizexytype = new imagesizexytype
                    {
                        x      = 0,
                        y      = 0,
                        width  = 0,
                        height = 0
                    };
                    if (this.panel1.Width > 24)
                    {
                        for (int i = 0; i < this.Myapp.images.Count; i++)
                        {
                            imgpicture imgpicture = new imgpicture(this.Myapp, i);
                            Point      point      = new Point(0, imagesizexytype.y + imagesizexytype.height);
                            imgpicture.Location = point;
                            imgpicture.Tag      = point;
                            imgpicture.Width    = this.panel1.Width - 24;
                            imgpicture.ViewPic(Color.White, Color.Black);
                            this.panel1.Controls.Add(imgpicture);
                            imgpicture.Visible = true;
                            imgpicture.Focus();
                            imgpicture.img_MouseDown   += new EventHandler(this.buttonimg_MouseDown);
                            imgpicture.img_DoubleClick += new EventHandler(this.buttonimg_DoubleClick);
                            imgpicture.img_Keydown     += new KeyEventHandler(this.buttonimg_KeyDown);
                            imgpicture.ContextMenuStrip = this.contextMenuStrip1;
                            imagesizexytype.x           = point.X;
                            imagesizexytype.y           = point.Y;
                            imagesizexytype.width       = imgpicture.Width;
                            imagesizexytype.height      = imgpicture.Height;
                            this.imgpics.Add(imgpicture);
                        }
                    }
                }
                catch (Exception ex)
                {
                    MessageOpen.Show(ex.Message);
                }
                this.label1.Text = this.Myapp.images.Count.ToString();
            }
        }
Пример #29
0
 public void Upsr()
 {
     if (this.binpath != null)
     {
         try
         {
             this.myapp.upapp.filesr = new StreamReader(this.binpath);
             Readdata.Readdata_ReadBinapp();
         }
         catch (Exception exception)
         {
             MessageOpen.Show(exception.Message);
         }
     }
 }
Пример #30
0
 private void runscr1_Runcodestr(object sender, EventArgs e)
 {
     try
     {
         if (this.codetext.Visible)
         {
             string runCodeListBox = (string)sender;
             this.SetRunCodeListBox(runCodeListBox);
         }
     }
     catch (Exception ex)
     {
         MessageOpen.Show(ex.Message);
     }
 }