Example #1
0
        public matt GetCopymatt()
        {
            matt matt = new matt();

            matt.att    = this.att;
            matt.name   = new byte[this.name.Length];
            matt.zhi    = new byte[this.zhi.Length];
            matt.zhushi = new byte[this.zhushi.Length];
            this.zhi.CopyTo(matt.zhi, 0);
            this.name.CopyTo(matt.name, 0);
            this.zhushi.CopyTo(matt.zhushi, 0);
            return(matt);
        }
Example #2
0
        public static void checkattline(ref List <matt> thismatt)
        {
            int         num       = 0;
            int         num2      = 0;
            byte        lei       = thismatt[0].zhi[0];
            redianinf   redianinf = default(redianinf);
            List <matt> list      = objattcaozuo.Getmatts(lei, ref redianinf);
            string      text      = datasize.Objzhushiencoding.GetString(thismatt[0].zhushi);

            string[] array = text.Split(new char[]
            {
                '-'
            });
            if (array.Length > 1)
            {
                num = array[1].Getint();
            }
            text  = datasize.Objzhushiencoding.GetString(list[0].zhushi);
            array = text.Split(new char[]
            {
                '-'
            });
            if (array.Length > 1)
            {
                num2 = array[array.Length - 1].Getint();
            }
            if (num != num2)
            {
                for (int i = 0; i < list.Count; i++)
                {
                    matt matt = thismatt.getatt_name(list[i].name, (num > 0) ? ((int)list[i].att.attlei) : -1);
                    if (matt != null)
                    {
                        text = list[i].name.Getstring(datasize.Myencoding);
                        if (text == "txt")
                        {
                            list[i].att.merrylenth = matt.att.merrylenth;
                            text = matt.zhi.Getstring(datasize.Myencoding);
                            byte[] array2 = text.GetbytesssASCII();
                            list[i].zhi = text.GetbytesssASCII(array2.Length + 1);
                            list[i].att.zhanyonglenth = (ushort)list[i].zhi.Length;
                            if (list[i].att.merrylenth < list[i].att.zhanyonglenth)
                            {
                                list[i].att.merrylenth = list[i].att.zhanyonglenth;
                            }
                        }
                        else if (matt.zhi.Length <= list[i].zhi.Length)
                        {
                            matt.zhi.CopyTo(list[i].zhi, 0);
                        }
                    }
                    else if (list[i].name.Getstring(datasize.Myencoding) == "txt")
                    {
                        text = "";
                        byte[] array2 = text.GetbytesssASCII();
                        list[i].zhi = text.GetbytesssASCII(array2.Length + 1);
                        list[i].att.zhanyonglenth = (ushort)list[i].zhi.Length;
                        if (list[i].att.merrylenth < list[i].att.zhanyonglenth)
                        {
                            list[i].att.merrylenth = list[i].att.zhanyonglenth;
                        }
                    }
                }
                thismatt.Clear();
                for (int i = 0; i < list.Count; i++)
                {
                    thismatt.Add(list[i]);
                }
            }
        }
Example #3
0
        public bool changobjattch(int index, string attname, string newstr)
        {
            bool result;

            try
            {
                if (index >= this.objs.Count)
                {
                    result = false;
                }
                else
                {
                    string text = this.objs[index].GetattVal_string(attname);
                    if (!this.objs[index].Setattval(attname, newstr))
                    {
                        result = false;
                    }
                    else
                    {
                        matt matt = this.objs[index].Getatt(attname);
                        if (matt != null)
                        {
                            if (matt.att.isbangding == 1 && matt.att.attlei == attshulei.Picid.typevalue && newstr != "65535")
                            {
                                this.changobjxy(this.objs[index].objid, (int)this.objs[index].myobj.redian.x, (int)this.objs[index].myobj.redian.y, (int)this.Myapp.images[newstr.Getint()].picturexinxi.W, (int)this.Myapp.images[newstr.Getint()].picturexinxi.H);
                            }
                            else if (this.objs[index].atts[0].zhi[0] == objtype.OBJECT_TYPE_SLIDER)
                            {
                                if (attname == "pic2" && newstr != "65535")
                                {
                                    string arg_1D1_2 = "wid";
                                    ushort num       = this.Myapp.images[newstr.Getint()].picturexinxi.W;
                                    if (!this.changobjattch(index, arg_1D1_2, num.ToString()))
                                    {
                                        int num2 = (int)(this.objs[index].myobj.redian.endx - this.objs[index].myobj.redian.x + 1);
                                        if (num2 > 255)
                                        {
                                            num2 = 255;
                                        }
                                        this.changobjattch(index, "wid", num2.ToString());
                                    }
                                    string arg_273_2 = "hig";
                                    num = this.Myapp.images[newstr.Getint()].picturexinxi.H;
                                    if (!this.changobjattch(index, arg_273_2, num.ToString()))
                                    {
                                        int num2 = (int)(this.objs[index].myobj.redian.endy - this.objs[index].myobj.redian.y + 1);
                                        if (num2 > 255)
                                        {
                                            num2 = 255;
                                        }
                                        this.changobjattch(index, "hig", num2.ToString());
                                    }
                                }
                                else
                                {
                                    int num2 = (int)(this.objs[index].myobj.redian.endx - this.objs[index].myobj.redian.x + 1);
                                    if (this.objs[index].GetattVal_string("wid").Getint() > num2)
                                    {
                                        if (num2 > 255)
                                        {
                                            num2 = 255;
                                        }
                                        this.changobjattch(index, "wid", num2.ToString());
                                    }
                                    num2 = (int)(this.objs[index].myobj.redian.endy - this.objs[index].myobj.redian.y + 1);
                                    if (this.objs[index].GetattVal_string("hig").Getint() > num2)
                                    {
                                        if (num2 > 255)
                                        {
                                            num2 = 255;
                                        }
                                        this.changobjattch(index, "hig", num2.ToString());
                                    }
                                }
                            }
                        }
                        if (text == newstr)
                        {
                            result = true;
                        }
                        else
                        {
                            if (this.dcomp0 != null)
                            {
                                objsetcom item  = default(objsetcom);
                                objsetcom item2 = default(objsetcom);
                                item2.lei     = "attch";
                                item2.id      = index;
                                item2.attname = attname;
                                item2.attval  = newstr;
                                item.lei      = "attch";
                                item.id       = index;
                                item.attname  = attname;
                                item.attval   = text;
                                this.dcomp0.objset.Add(item);
                                this.dcomp1.objset.Add(item2);
                            }
                            result = true;
                        }
                    }
                }
            }
            catch (Exception ex)
            {
                MessageOpen.Show(ex.Message);
                result = false;
            }
            return(result);
        }