コード例 #1
0
        public override void Copy(DrawingItem obj)
        {
            base.Copy(obj);
            DrawDataRepeater ddp = obj as DrawDataRepeater;

            this.Columns = ddp.Columns;
            this.Rows    = ddp.Rows;
            _gapx        = ddp._gapx;
            _gapy        = ddp._gapy;
        }
コード例 #2
0
        public DrawRepeaterItem(DrawDataRepeater owner, int col, int row)
        {
            this.Page            = owner.Page;
            _owner               = owner;
            _colIdx              = col;
            _rowIdx              = row;
            this.Location        = new Point(owner.Location.X + col * (owner.Width + owner.GapX), owner.Location.Y + row * (owner.Height + owner.GapY));
            this.Width           = owner.Width;
            this.Height          = owner.Height;
            this.BackgroundImage = owner.BackgroundImage;
            if (!string.IsNullOrEmpty(owner.BackImageFilename))
            {
                this.BackImageFilename = owner.BackImageFilename;
            }
            this.BackImageSizeMode = owner.BackImageSizeMode;
            List <DrawingItem> lst = new List <DrawingItem>();

            if (owner.Items != null)
            {
                createDataTable();
                foreach (DrawingItem di in owner.Items)
                {
                    DrawingItem d2   = di.Clone();
                    EventInfo[] eifs = di.GetType().GetEvents();
                    if (eifs != null && eifs.Length > 0)
                    {
                        for (int i = 0; i < eifs.Length; i++)
                        {
                            Delegate h = owner.GetHandler(di.Name, eifs[i].Name);
                            if (h != null)
                            {
                                eifs[i].AddEventHandler(d2, h);
                            }
                        }
                    }
                    lst.Add(d2);
                    setupDataBind(d2, di);
                }
            }
            this.SetItems(lst);
        }