Пример #1
0
 public void delobj(int index)
 {
     if (index < this.objs.Count)
     {
         objsetcom item  = default(objsetcom);
         objsetcom item2 = default(objsetcom);
         if (this.dcomp0 != null)
         {
             item2.lei = "delobj";
             item2.id  = index;
             if (index == this.objs.Count - 1)
             {
                 item.lei = "addobj";
                 item.id  = 65535;
             }
             else
             {
                 item.lei = "insertobj";
                 item.id  = index;
             }
             item.backobj = this.objs[index].copyobj();
             this.dcomp0.objset.Add(item);
             this.dcomp1.objset.Add(item2);
         }
         this.objs.Remove(this.objs[index]);
         this.Myapp.RefobjID(this);
     }
 }
Пример #2
0
        public void addobj(mobj obj)
        {
            objsetcom item  = default(objsetcom);
            objsetcom item2 = default(objsetcom);

            if (this.dcomp0 != null)
            {
                item2.lei     = "addobj";
                item2.id      = 65535;
                item2.backobj = obj.copyobj();
                item.lei      = "delobj";
                item.id       = this.objs.Count;
                this.dcomp0.objset.Add(item);
                this.dcomp1.objset.Add(item2);
            }
            this.objs.Add(obj);
            this.Myapp.RefobjID(this);
        }
Пример #3
0
 public void insertobj(int index, mobj obj)
 {
     if (index < this.objs.Count)
     {
         objsetcom item  = default(objsetcom);
         objsetcom item2 = default(objsetcom);
         if (this.dcomp0 != null)
         {
             item2.lei     = "insertobj";
             item2.id      = index;
             item2.backobj = obj.copyobj();
             item.lei      = "delobj";
             item.id       = this.objs.Count;
             this.dcomp0.objset.Add(item);
             this.dcomp1.objset.Add(item2);
         }
         this.objs.Insert(index, obj);
         this.Myapp.RefobjID(this);
     }
 }
Пример #4
0
        public bool moveobjid(int index, int newindex)
        {
            bool result;

            if (index >= this.objs.Count || newindex >= this.objs.Count || index == newindex)
            {
                result = false;
            }
            else
            {
                objsetcom item  = default(objsetcom);
                objsetcom item2 = default(objsetcom);
                if (this.dcomp0 != null)
                {
                    this.dcomp0.Refpage = true;
                    this.dcomp1.Refpage = true;
                    item2.lei           = "moveobjid";
                    item2.id            = index;
                    item2.Tag           = newindex.ToString();
                    item.lei            = "moveobjid";
                    item.id             = newindex;
                    item.Tag            = index.ToString();
                    this.dcomp0.objset.Add(item);
                    this.dcomp1.objset.Add(item2);
                }
                mobj item3 = this.objs[index];
                this.objs.Remove(item3);
                if (newindex == this.objs.Count)
                {
                    this.objs.Add(item3);
                }
                else
                {
                    this.objs.Insert(newindex, item3);
                }
                this.Myapp.RefobjID(this);
                result = true;
            }
            return(result);
        }
Пример #5
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);
        }