Exemple #1
0
        private bool getlogin()
        {
            string text = datasize.linpath + "\\login.jpg";
            bool   result;

            try
            {
                if (File.Exists(text))
                {
                    if (File.GetCreationTime(text).AddDays(1.0) < DateTime.Now)
                    {
                        result = false;
                    }
                    else
                    {
                        this.bitmap = new Bitmap(text);
                        result      = true;
                    }
                }
                else
                {
                    result = false;
                }
            }
            catch
            {
                Kuozhan.delfile(text);
                result = false;
            }
            return(result);
        }
Exemple #2
0
        public unsafe static void Sysatt_GetSysname(byte *name, byte lenth, runattinf *att)
        {
            if (lenth < 5)
            {
                uint num = 0u;
                Kuozhan.memcpy((byte *)(&num), name, (int)lenth);
                fixed(void *ptr = (&Sysatt.xitong32[0]))
                {
                    num = Datafind.Datafind_FindU32_Memory(&num, (uint *)ptr, Sysatt.xitong32qyt, (uint)(Marshal.SizeOf(default(xitongtype_32)) / 4));
                }

                if (num != 65535u)
                {
                    Sysatt.Sysatt_GetXitongval(4, (byte)num, att);
                }
            }
            else if (lenth < 9)
            {
                ulong num2 = 0uL;
                Kuozhan.memcpy((byte *)(&num2), name, (int)lenth);
                uint num;
                fixed(void *ptr = (&Sysatt.xitong64[0]))
                {
                    num = Datafind.Datafind_FindU64_Memory(&num2, (uint *)ptr, Sysatt.xitong64qyt, (uint)(Marshal.SizeOf(default(xitongtype_64)) / 4));
                }

                if (num != 65535u)
                {
                    Sysatt.Sysatt_GetXitongval(8, (byte)num, att);
                }
            }
        }
Exemple #3
0
        public static matt getatt_name(this List <matt> thismatt, byte[] name, int state)
        {
            matt result;

            for (int i = 0; i < thismatt.Count; i++)
            {
                if (Kuozhan.makebytes(thismatt[i].name, name))
                {
                    if (state > 0)
                    {
                        if (thismatt[i].att.attlei != (byte)state)
                        {
                            goto IL_62;
                        }
                        result = thismatt[i];
                    }
                    else
                    {
                        result = thismatt[i];
                    }
                    return(result);
                }
                IL_62 :;
            }
            result = null;
            return(result);
        }
Exemple #4
0
        public static int getattid_name(this List <matt> thismatt, byte[] name, int state)
        {
            int result;

            for (int i = 0; i < thismatt.Count; i++)
            {
                if (Kuozhan.makebytes(thismatt[i].name, name))
                {
                    if (state > 0)
                    {
                        if (thismatt[i].att.attlei != (byte)state)
                        {
                            goto IL_56;
                        }
                        result = i;
                    }
                    else
                    {
                        result = i;
                    }
                    return(result);
                }
                IL_56 :;
            }
            result = -1;
            return(result);
        }
Exemple #5
0
    public static unsafe byte Commake_ScanComcode()
    {
        PosLaction laction;

        if ((NorComSta.runmod == 1) && (Commake_GetComm(&laction) > 0))
        {
            if (myapp.comcrc > 0)
            {
                uint num2;
                uint num = Kuozhan.CRC32(Comstrbuf + laction.star, Comstrbuf[laction.star - 1] - 4);
                Kuozhan.memcpy((byte *)&num2, Comstrbuf + (laction.end - 3), 4);
                laction.end = (ushort)(laction.end - 4);
                if (num != num2)
                {
                    myapp.errcode = 0x22;
                    Commake_SendBackerr(myapp.errcode);
                    return(1);
                }
            }
            if (CodeRun.Coderun_Run(Comstrbuf, &laction) == 1)
            {
                Commake_SendBacksuc();
            }
            else if (myapp.errcode < 0xff)
            {
                Commake_SendBackerr(myapp.errcode);
            }
            return(1);
        }
        return(0);
    }
Exemple #6
0
    private static unsafe byte Commake_CheckNorComOver()
    {
        byte num = 0;

        if (NorComSta.WrPos > NorComSta.RdPos)
        {
            if (NorComSta.WrPos > 0x3fa)
            {
                if (NorComSta.RdPos > (NorComSta.WrLen + 0x20))
                {
                    Comstrbuf[0] = 0;
                    Kuozhan.memcpy(Comstrbuf + 1, Comstrbuf + (NorComSta.WrPos - NorComSta.WrLen), NorComSta.WrLen);
                    NorComSta.WrPos = (short)(NorComSta.WrLen + 1);
                }
                else
                {
                    num = 1;
                }
            }
        }
        else if (NorComSta.WrPos > (NorComSta.RdPos - 6))
        {
            num = 1;
        }
        if (num > 0)
        {
            Commake_SendBackerr(0x24);
            NorComSta.WrPos = (short)(NorComSta.WrPos - NorComSta.WrLen);
            NorComSta.WrLen = 0;
            NorComSta.State = 4;
        }
        return(num);
    }
Exemple #7
0
 private void FromOpen(string message, string title, MessageBoxButtons mb, Color color)
 {
     this.InitializeComponent();
     this.checkbox1 = this.checkBox1;
     this.thismb    = mb;
     this.Language();
     Kuozhan.Setobj(this.contextMenuStrip1, datasize.Language);
     this.labelX3.Text = title;
     this.label1.Text  = message;
     this.panelEx2.Style.BackColor1.Color = color;
     this.panelEx2.Style.BackColor2.Color = color;
     if (this.thismb == MessageBoxButtons.OK)
     {
         this.p0.Visible = false;
         this.p1.Visible = false;
         this.p2.Text    = "确定".Language();
     }
     else if (this.thismb == MessageBoxButtons.YesNo)
     {
         this.p0.Visible = false;
         this.p1.Text    = "是".Language();
         this.p2.Text    = "否".Language();
     }
     else
     {
         this.p0.Visible = true;
         this.p0.Text    = "是".Language();
         this.p1.Text    = "否".Language();
         this.p2.Text    = "取消".Language();
     }
 }
Exemple #8
0
 private void pageadmin_Load(object sender, EventArgs e)
 {
     Kuozhan.Setobj(this.contextMenuStrip1, datasize.Language);
     this.colListBox1.Itemheight      = 20;
     this.colListBox1.itemeditenabled = true;
     this.colListBox1.listborderwidth = 0;
 }
Exemple #9
0
        public unsafe static ushort Hmi_GetPageid(byte *buf, PosLaction *bufpos)
        {
            byte[]     array      = new byte[14];
            PosLaction posLaction = default(PosLaction);
            ushort     result;

            if (buf[bufpos->star] == 112 && buf[bufpos->star + 1] == 91 && buf[bufpos->end] == 93)
            {
                posLaction.star = (ushort)(bufpos->star + 2);
                posLaction.end  = (ushort)(bufpos->end - 1);
                byte b;
                int  num = CodeRun.strgetS32(buf, &posLaction, &b);
                if (b == 0)
                {
                    result = 65535;
                }
                else
                {
                    result = (ushort)num;
                }
            }
            else
            {
                byte b = (byte)(bufpos->end - bufpos->star + 1);
                if (b > 14)
                {
                    result = 65535;
                }
                else
                {
                    fixed(byte *ptr = array)
                    {
                        Kuozhan.memcpy(ptr, buf + bufpos->star, (int)b);
                    }

                    uint num2 = array.getcrc(0);

                    if (num2 == Hmi.lastpagenamecrc[0])
                    {
                        result = Hmi.lastpageid[0];
                    }
                    else if (num2 == Hmi.lastpagenamecrc[1])
                    {
                        result = Hmi.lastpageid[1];
                    }
                    else
                    {
                        Hmi.lastpagenamecrc[0] = Hmi.lastpagenamecrc[1];
                        Hmi.lastpageid[0]      = Hmi.lastpageid[1];
                        Hmi.lastpagenamecrc[1] = num2;
                        uint num3 = Datafind.Datafind_FindU32_Flash(&num2, Hmi.myapp.pagenameseradd, Hmi.myapp.app.pageqyt, 6);
                        Hmi.lastpageid[1] = (ushort)num3;
                        result            = Hmi.lastpageid[1];
                    }
                }
            }
            return(result);
        }
Exemple #10
0
        private void Downloadfile()
        {
            int i = 0;

            while (i <= this.chongshi)
            {
                try
                {
                    WebClient webClient = new WebClient();
                    if (this.downok)
                    {
                        this.downok = false;
                    }
                    if (this.error != "")
                    {
                        this.error = "";
                    }
                    if (!Kuozhan.delfile(this.temppath))
                    {
                        this.error = "file error" + this.temppath;
                        break;
                    }
                    this.comsr = new StreamWriter(this.temppath);
                    this.file1 = webClient.OpenRead(this.url);
                    byte[] array = new byte[65536];
                    this.filelenth = 0;
                    int j = 1;
                    while (j > 0)
                    {
                        j = this.file1.Read(array, 0, array.Length);
                        this.comsr.BaseStream.Write(array, 0, j);
                        this.filelenth += j;
                    }
                    this.comsr.Close();
                    this.comsr.Dispose();
                    this.file1.Close();
                    this.file1.Dispose();
                    if (!Kuozhan.delfile(this.filepath))
                    {
                        this.error = "file error" + this.temppath;
                        break;
                    }
                    File.Move(this.temppath, this.filepath);
                    this.downok = true;
                    break;
                }
                catch (Exception ex)
                {
                    this.closeziyuan();
                    i++;
                    if (i > this.chongshi)
                    {
                        this.error = ex.Message + "\r\n";
                    }
                }
            }
        }
Exemple #11
0
 public unsafe static byte Strmake_Makestr(byte *v1, string str, byte lenth)
 {
     byte[] array = str.GetbytesssASCII();
     array = Kuozhan.Gethebingbytes(array, "".GetbytesssASCII(1));
     fixed(byte *ptr = array)
     {
         return(Strmake.Strmake_Makestr(v1, ptr, lenth));
     }
 }
Exemple #12
0
 private void checkBox1_CheckedChanged(object sender, EventArgs e)
 {
     if (this.checkBox1.Checked)
     {
         Kuozhan.putxmlstring(datasize.tanchuangid.ToString(), "st0");
     }
     else
     {
         Kuozhan.putxmlstring("a", "st0");
     }
 }
Exemple #13
0
        public void DownStar()
        {
            int num = 0;

            this.temppath = datasize.linpath + "\\downtemp.temp";
            while (!Kuozhan.delfile(this.temppath))
            {
                this.temppath += num;
                num++;
            }
            this.uu = new Thread(new ThreadStart(this.Downloadfile));
            this.uu.Start();
        }
Exemple #14
0
 public Comuser()
 {
     this.Bot.Clear();
     this.Bot.Add(2400);
     this.Bot.Add(4800);
     this.Bot.Add(9600);
     this.Bot.Add(19200);
     this.Bot.Add(38400);
     this.Bot.Add(57600);
     this.Bot.Add(115200);
     this.Oldbo  = Kuozhan.getxmlstring("oldbo_").Getint();
     this.Oldcom = Kuozhan.getxmlstring("oldcom_");
 }
Exemple #15
0
 private void objatt_Load(object sender, EventArgs e)
 {
     this.textBox1.ContextMenuStrip = this.contextMenuStrip1;
     Kuozhan.Setobj(this.contextMenuStrip1, datasize.Language);
     this.textBox1.ShowEOLMarkers  = false;
     this.textBox1.Encoding        = Encoding.Default;
     this.textBox1.ShowSpaces      = false;
     this.textBox1.ShowTabs        = false;
     this.textBox1.ShowVRuler      = false;
     this.textBox1.TabIndent       = 2;
     this.textBox1.ShowLineNumbers = false;
     this.textBox1.Text            = "";
     this.codehigset();
 }
Exemple #16
0
 private void tanchuang_Load(object sender, EventArgs e)
 {
     this.timer1.Interval = 4000;
     this.timer1.Enabled  = true;
     this.chongshi        = 0;
     this.webBrowser1.Navigate(this.thisadd);
     if (Kuozhan.getxmlstring("st0") == datasize.tanchuangid.ToString())
     {
         this.checkBox1.Checked = true;
     }
     else
     {
         this.checkBox1.Checked = false;
     }
 }
Exemple #17
0
        private void savecodemessage(string key, codemessagetype m1)
        {
            string path = string.Concat(new string[]
            {
                m1.allen.ToString(),
                "-",
                m1.keyword.ToString(),
                "-",
                m1.comshow.ToString(),
                "-",
                m1.mouseshow.ToString()
            });

            Kuozhan.putxmlstring(path, key);
        }
Exemple #18
0
        public unsafe static ushort Strmake_StrSubstring(byte *buf, ref PosLaction bufpos, string val, byte starmod)
        {
            byte[] array = Kuozhan.Gethebingbytes(val.GetbytesssASCII(), "".GetbytesssASCII(1));
            ushort result;

            fixed(PosLaction *ptr = &bufpos)
            {
                fixed(byte *ptr2 = array)
                {
                    result = Strmake.Strmake_StrSubstring(buf, ptr, ptr2, starmod);
                }
            }

            return(result);
        }
Exemple #19
0
    // hmitype.Attmake
    public unsafe static byte Attmake_GetAttindex(byte *name, byte lenth)
    {
        byte result;

        if (lenth < 5)
        {
            uint num = 0u;
            Kuozhan.memcpy((byte *)(&num), name, (int)lenth);
            fixed(void *ptr = Attmake.attstr32)
            {
                num = Datafind.Datafind_FindU32_Memory(&num, (uint *)ptr, 53u, (uint)(sizeof(attstrtype_32) / 4));
            }

            if (num == 65535u)
            {
                result = 255;
            }
            else
            {
                result = Attmake.attstr32[(int)((UIntPtr)num)].id;
            }
        }
        else if (lenth < 9)
        {
            ulong num2 = 0uL;
            Kuozhan.memcpy((byte *)(&num2), name, (int)lenth);
            uint num;
            fixed(void *ptr = Attmake.attstr64)
            {
                num = Datafind.Datafind_FindU64_Memory(&num2, (uint *)ptr, 11u, (uint)(sizeof(attstrtype_64) / 4));
            }

            if (num == 65535u)
            {
                result = 255;
            }
            else
            {
                result = Attmake.attstr64[(int)((UIntPtr)num)].id;
            }
        }
        else
        {
            result = 255;
        }
        return(result);
    }
Exemple #20
0
        public List <byte> Getjiaochaobjs(int index)
        {
            List <byte> list = new List <byte>();

            if (index > 0 && index < this.objs.Count)
            {
                for (int i = 1; i < this.objs.Count; i++)
                {
                    if (i != index && objtype.getobjmark(this.objs[i].atts[0].zhi[0]).show != 0)
                    {
                        if (Kuozhan.checkbaohan((int)this.objs[i].myobj.redian.x, (int)this.objs[i].myobj.redian.y, (int)this.objs[i].myobj.redian.endx, (int)this.objs[i].myobj.redian.endy, (int)this.objs[index].myobj.redian.x, (int)this.objs[index].myobj.redian.y, (int)this.objs[index].myobj.redian.endx, (int)this.objs[index].myobj.redian.endy))
                        {
                            list.Add((byte)i);
                        }
                    }
                }
            }
            return(list);
        }
Exemple #21
0
        private static void Loadcodemessage(string key, ref codemessagetype m1)
        {
            string text = Kuozhan.getxmlstring(key);

            if (text != "")
            {
                string[] array = text.Split(new char[]
                {
                    '-'
                });
                if (array.Length == 5)
                {
                    m1.allen     = (byte)array[0].Getint();
                    m1.keyword   = (byte)array[1].Getint();
                    m1.comshow   = (byte)array[2].Getint();
                    m1.mouseshow = (byte)array[3].Getint();
                    m1.codehig   = (byte)array[4].Getint();
                }
            }
        }
Exemple #22
0
 private void timer1_Tick(object sender, EventArgs e)
 {
     this.timer1.Enabled = false;
     if (this.Myapp == null)
     {
         StreamReader streamReader = new StreamReader(this.binpath);
         if (!Kuozhan.CheckData(streamReader, datasize.hmibiaoshiL, 1))
         {
             base.Close();
             return;
         }
         streamReader.Close();
         streamReader.Dispose();
         this.runscr1.guiint_run(null, this.binpath);
     }
     else
     {
         this.runscr1.guiint_run(this.Myapp.images, this.binpath);
     }
     this.apprun_Resize(null, null);
     this.runscr1.Visible = true;
 }
Exemple #23
0
 private void timer2_Tick(object sender, EventArgs e)
 {
     this.timer2.Enabled = false;
     try
     {
         string path = datasize.linpath + "\\login.jpg";
         datasize.loginjpgurl = null;
         Win32.gethmiver(2500, 5000, 0, 5000, false, false, false, 1);
         while (!datasize.findendstate)
         {
             Application.DoEvents();
         }
         this.bitmap.Dispose();
         if (File.Exists(path))
         {
             Kuozhan.delfile(path);
         }
         base.Close();
     }
     catch (Exception ex)
     {
         MessageOpen.Show(ex.Message);
     }
 }
Exemple #24
0
        public unsafe static void Strmake_S32ToStr(int num, byte *buf, byte lenth, byte isend)
        {
            byte b = Strmake.Strmake_GetS32strlen(num);

            if (lenth == 0)
            {
                lenth = b;
            }
            if (num == -2147483648)
            {
                *buf = 45;
                buf++;
                byte[] array = "2147483648".GetbytesssASCII();
                fixed(byte *ptr = array)
                {
                    Kuozhan.memcpy(buf, ptr, (int)lenth);
                }

                if (isend == 1)
                {
                    buf[lenth] = 0;
                }
            }
            else
            {
                if (num < 0)
                {
                    num *= -1;
                    *buf = 45;
                    buf++;
                }
                byte b2;
                if (b > lenth)
                {
                    b2 = (byte)(b - lenth);
                    for (int i = 1; i <= (int)b2; i++)
                    {
                        num /= 10;
                    }
                    b2 += 1;
                }
                else
                {
                    b  = lenth;
                    b2 = 1;
                }
                for (int i = (int)b2; i <= (int)b; i++)
                {
                    if (num == 0)
                    {
                        buf[(int)b - i] = Strmake.u8tables[0];
                    }
                    else
                    {
                        buf[(int)b - i] = Strmake.u8tables[num % 10];
                    }
                    num /= 10;
                }
                if (isend == 1)
                {
                    buf[lenth] = 0;
                }
            }
        }
Exemple #25
0
 private void linkLabel1_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e)
 {
     Kuozhan.Openhttp(this.linkLabel1.Text);
 }
Exemple #26
0
        private void Sendbo()
        {
            Random     random = new Random();
            List <int> list   = new List <int>();
            int        num    = 0;
            int        num2   = 1;

            byte[] array = new byte[3];
            Win32.timeBeginPeriod(1);
            array[0] = 255;
            array[1] = 255;
            array[2] = 255;
            Kuozhan.Getquxian(this.quxianfudu, this.quxianyidong, ref list);
            this.sendboyan = this.textBox2.Text.Getint();
            while (this.sendbo == 1)
            {
                try
                {
                    Application.DoEvents();
                    this.sendboyan = this.textBox2.Text.Getint();
                    byte b    = (byte)list[num];
                    int  num3 = 0;
                    for (int i = 0; i < 4; i++)
                    {
                        if (this.quxiantongdaos[i] < 4)
                        {
                            byte b2;
                            if (num + 16 * i >= list.Count)
                            {
                                int j;
                                for (j = num + 16 * i; j >= list.Count; j -= list.Count)
                                {
                                }
                                b2 = (byte)list[j];
                            }
                            else
                            {
                                b2 = (byte)list[num + 16 * i];
                            }
                            if (this.checkBox2.Checked)
                            {
                                b  = (byte)random.Next(int.Parse(this.textBox8.Text), int.Parse(this.textBox9.Text));
                                b2 = (byte)random.Next(int.Parse(this.textBox8.Text), int.Parse(this.textBox9.Text));
                            }
                            string text = string.Concat(new string[]
                            {
                                "add ",
                                this.textBox5.Text,
                                ",",
                                this.quxiantongdaos[i].ToString(),
                                ",",
                                b2.ToString()
                            });
                            if (this.quxiansendmoni)
                            {
                                this.sendmoni(text, this.checkBox3.Checked, null);
                                num3 += text.Length;
                            }
                            if (this.quxiansendcom)
                            {
                                if (this.com1.IsOpen)
                                {
                                    this.com1.sendstring_End(text, this.checkBox3.Checked, null);
                                    num3 = 0;
                                }
                            }
                        }
                    }
                    Application.DoEvents();
                    for (int k = 0; k < this.sendboyan; k++)
                    {
                        Thread.Sleep(1);
                        Application.DoEvents();
                        if (this.sendbo != 1)
                        {
                            break;
                        }
                    }
                    for (int k = 0; k < num3; k++)
                    {
                        Thread.Sleep(1);
                        Application.DoEvents();
                        if (this.sendbo != 1)
                        {
                            break;
                        }
                    }
                    num2++;
                    num++;
                    if (num == list.Count)
                    {
                        num  = 0;
                        num2 = 1;
                    }
                }
                catch (Exception ex)
                {
                    MessageOpen.Show(ex.Message);
                    this.sendbo = 1;
                    while (this.sendbo == 1)
                    {
                        Application.DoEvents();
                    }
                }
            }
            this.sendbo = 0;
        }
Exemple #27
0
        private bool addpic(string lei, int index)
        {
            Bitmap         bitmap         = new Bitmap(1, 1);
            int            num            = 1;
            int            num2           = 0;
            int            num3           = 0;
            OpenFileDialog openFileDialog = new OpenFileDialog();

            openFileDialog.Multiselect = !(lei == "tihuan");
            openFileDialog.Filter      = "所有文件|*.*".Language();
            openFileDialog.Getpath("pic");
            bool result;

            if (openFileDialog.ShowDialog() != DialogResult.OK)
            {
                result = false;
            }
            else
            {
                openFileDialog.Putpath("pic");
                guiimagetype guiimagetype = default(guiimagetype);
                string[]     fileNames    = openFileDialog.FileNames;
                for (int i = 0; i < fileNames.Length; i++)
                {
                    string file = fileNames[i];
                    this.label1.Text = "正在转换图片".Language() + num.ToString();
                    num++;
                    Application.DoEvents();
                    bitmap = new Bitmap(1, 1);
                    if (this.openpic(ref bitmap, file))
                    {
                        num3++;
                        guiimagetype.imagebytes = new byte[bitmap.Width * bitmap.Height * 2];
                        int num4 = 0;
                        for (int j = 0; j < bitmap.Height; j++)
                        {
                            for (int k = 0; k < bitmap.Width; k++)
                            {
                                if (bitmap.GetPixel(k, j).A == 0)
                                {
                                    guiimagetype.imagebytes[num4]     = (byte)(datasize.Color_touming % 256);
                                    guiimagetype.imagebytes[num4 + 1] = 0;
                                }
                                else
                                {
                                    ushort num5 = bitmap.GetPixel(k, j).Get16Color();
                                    guiimagetype.imagebytes[num4]     = (byte)(num5 % 256);
                                    guiimagetype.imagebytes[num4 + 1] = (byte)(num5 / 256);
                                    if ((ushort)guiimagetype.imagebytes[num4] == datasize.Color_touming && guiimagetype.imagebytes[num4 + 1] == 0)
                                    {
                                        guiimagetype.imagebytes[num4] = (byte)datasize.Color_toumingtihuan;
                                    }
                                }
                                num4 += 2;
                            }
                        }
                        guiimagetype.picturexinxi.qumo = Convert.ToByte(this.Myapp.guidire + 10);
                        if (guiimagetype.picturexinxi.qumo != 10)
                        {
                            Kuozhan.getxuanzhuanimage(guiimagetype.imagebytes, ref guiimagetype.imagebytes, bitmap.Width, bitmap.Height, 0, (int)this.Myapp.guidire);
                        }
                        guiimagetype.picturexinxi.H           = (ushort)bitmap.Height;
                        guiimagetype.picturexinxi.imgbytesize = (uint)guiimagetype.imagebytes.Length;
                        guiimagetype.picturexinxi.W           = (ushort)bitmap.Width;
                        guiimagetype.imagebitbmp = guiimagetype.imagebytes.GetBitmap(guiimagetype.picturexinxi, datasize.Opentouming);
                        guiimagetype.imgxulie    = guiimagetype.imagebitbmp.ClassToBytes();
                        if (lei == "add")
                        {
                            this.Myapp.images.Add(guiimagetype);
                        }
                        else if (lei == "insert")
                        {
                            if (index >= this.Myapp.images.Count)
                            {
                                result = false;
                                return(result);
                            }
                            this.Myapp.images.Insert(index, guiimagetype);
                        }
                        else if (lei == "tihuan")
                        {
                            this.Myapp.images[index] = guiimagetype;
                        }
                    }
                    else
                    {
                        num2++;
                    }
                    if (bitmap != null)
                    {
                        bitmap.Dispose();
                    }
                }
                if (num3 > 0 && lei == "insert")
                {
                    byte[] array = ((ushort)index).structToBytes();
                    foreach (mpage current in this.Myapp.pages)
                    {
                        foreach (mobj current2 in current.objs)
                        {
                            foreach (matt current3 in current2.atts)
                            {
                                if (current3.att.attlei == attshulei.Picid.typevalue)
                                {
                                    ushort num6 = (ushort)current3.zhi.BytesTostruct(0.GetType());
                                    if (num6 != 65535 && (int)num6 >= index)
                                    {
                                        current3.zhi = ((ushort)((int)num6 + num3)).structToBytes();
                                    }
                                }
                            }
                        }
                    }
                    foreach (mpage current in this.Myapp.pages)
                    {
                        foreach (objsetcom_P current4 in current.objsetcomps)
                        {
                            foreach (objsetcom current5 in current4.objset)
                            {
                                if (current5.backobj != null)
                                {
                                    foreach (matt current3 in current5.backobj.atts)
                                    {
                                        if (current3.att.attlei == attshulei.Picid.typevalue)
                                        {
                                            ushort num6 = (ushort)current3.zhi.BytesTostruct(0.GetType());
                                            if (num6 != 65535 && (int)num6 >= index)
                                            {
                                                current3.zhi = ((ushort)((int)num6 + num3)).structToBytes();
                                            }
                                        }
                                    }
                                }
                            }
                        }
                    }
                    foreach (mobj current2 in this.Myapp.copymobjs)
                    {
                        foreach (matt current3 in current2.atts)
                        {
                            if (current3.att.attlei == attshulei.Picid.typevalue)
                            {
                                ushort num6 = (ushort)current3.zhi.BytesTostruct(0.GetType());
                                if (num6 != 65535 && (int)num6 >= index)
                                {
                                    current3.zhi = ((ushort)((int)num6 + num3)).structToBytes();
                                }
                            }
                        }
                    }
                }
                if (num2 == 0)
                {
                    MessageOpen.Show(string.Concat(new string[]
                    {
                        "成功导入".Language(),
                        " ",
                        num3.ToString(),
                        " ",
                        "张".Language()
                    }));
                }
                else
                {
                    MessageOpen.Show(string.Concat(new string[]
                    {
                        "成功导入".Language(),
                        " ",
                        num3.ToString(),
                        " ",
                        "张,失败".Language(),
                        " ",
                        num2.ToString(),
                        " ",
                        "张".Language()
                    }));
                }
                result = true;
            }
            return(result);
        }
Exemple #28
0
 public picadmin()
 {
     this.InitializeComponent();
     Kuozhan.Setobj(this.contextMenuStrip1, datasize.Language);
 }
Exemple #29
0
 private void runscr_MouseUp(object sender, MouseEventArgs e)
 {
     if (this.myapp.upapp.runapptype == runapptype.run)
     {
         this.myapp.upapp.tp_dev.touchtime  = 0;
         this.myapp.upapp.tp_dev.touchstate = 0;
         this.myapp.tpupenter = 1;
     }
     else
     {
         this.Refresh();
         this.setxuanzhong_all(false);
         foreach (objedit objedit in this.allobjedits)
         {
             if (((objedit.dobj.atts[0].zhi[0] != objtype.page) && (objtype.getobjmark(objedit.dobj.atts[0].zhi[0]).show != 0)) && Kuozhan.checkbaohan(objedit.Left, objedit.Top, (objedit.Left + objedit.Width) - 1, (objedit.Top + objedit.Height) - 1, this.dpoint.X, this.dpoint.Y, e.X, e.Y))
             {
                 this.setxuanzhong_add(objedit);
             }
         }
         if (this.selectobjedits.Count == 0)
         {
             this.setxuanzhong_add(0);
         }
         this.dpoint.X = 0xffff;
         if (this.Objselect != null)
         {
             this.Objselect(null, null);
         }
         base.Focus();
     }
 }
Exemple #30
0
 public unsafe void gui_int(List <guiimagetype> guiimages_, string binpath_, Myapp_inf mapp_, byte bianjistate)
 {
     this.Myapp = mapp_;
     this.myapp.upapp.images     = guiimages_;
     this.binpath                = binpath_;
     this.myapp.upapp.filesr     = new StreamReader(this.binpath);
     this.myapp.upapp.runapptype = bianjistate;
     if (this.merrya == null)
     {
         this.merrya = (byte *)Marshal.AllocHGlobal(0x1f400);
     }
     this.myapp.upapp.pageidchange   = new pageidchange_(this.pageidchange);
     this.myapp.upapp.ScreenRef      = new ScreenRef_(this.Screenref);
     this.myapp.upapp.Sendruncodestr = new Sendruncodestr_(this.Sendruncodestr);
     this.myapp.upapp.Lcd_Set        = new Lcd_Set_(this.Lcd_Set);
     this.myapp.upapp.SendCom        = new SendCom_(this.SendCom_Code);
     Attmake.myapp          = this.myapp;
     CodeRun.myapp          = this.myapp;
     Commake.myapp          = this.myapp;
     GuiCurve.myapp         = this.myapp;
     Showpic.myapp          = this.myapp;
     Showfont.myapp         = this.myapp;
     GuiSlider.myapp        = this.myapp;
     GuiTimer.myapp         = this.myapp;
     Hmi.myapp              = this.myapp;
     Lcd.myapp              = this.myapp;
     Readdata.myapp         = this.myapp;
     Sys.myapp              = this.myapp;
     Sysatt.myapp           = this.myapp;
     Touch.myapp            = this.myapp;
     Usart.myapp            = this.myapp;
     Commake.Comstrbuf      = this.merrya;
     this.myapp.mymerry     = this.merrya + 0x400;
     Hmi.Hexstrbuf          = this.merrya + 0x2400;
     this.myapp.systimerbuf = this.merrya + 0x2c00;
     this.myapp.Mycanshus   = (PosLaction *)(this.merrya + 0x2e00);
     this.myapp.binsuc      = 1;
     if (Readdata.Readdata_ReadBinapp() == 0)
     {
         MessageOpen.Show("错误的资源文件或者资源文件已经受损".Language());
         this.myapp.binsuc = 0;
     }
     Hmi.Hmi_OpenInit();
     Hmi.Hmi_Init();
     Hmi.Hmi_RefPage(0);
     this.myapp.USART.State = 0;
     Commake.Commake_ClearNorComData();
     this.myapp.upapp.runstate = 1;
     if ((this.myapp.upapp.runapptype == runapptype.run) && ((this.mainthread == null) || !this.mainthread.IsAlive))
     {
         Win32.timeBeginPeriod(1);
         DateTime now   = DateTime.Now;
         DateTime time2 = now;
         Rtc.DatetimeSpan = now.AddDays((double)Kuozhan.Getval("datetime_d").Getint()).AddHours((double)Kuozhan.Getval("datetime_h").Getint()).AddMinutes((double)Kuozhan.Getval("datetime_m").Getint()).AddSeconds((double)Kuozhan.Getval("datetime_s").Getint()).Subtract(time2);
         if ((((Rtc.DatetimeSpan.Days == 0) && (Rtc.DatetimeSpan.Hours == 0)) && (Rtc.DatetimeSpan.Minutes == 0)) && (Rtc.DatetimeSpan.Seconds == 0))
         {
             Rtc.DatetimeSpan_val = false;
         }
         else
         {
             Rtc.DatetimeSpan_val = true;
         }
         this.mainthread = new Thread(new ThreadStart(this.runmain));
         this.timerms5   = new Thread(new ThreadStart(this.timerm_5ms));
         Hmi.Hmi_ClearTimer();
         this.timerms5.Start();
         this.mainthread.Start();
     }
 }