Пример #1
0
        public void AddStyle(Product_Style_Model Style, List <Product_Color_Model> lstColor)
        {
            ImageStyle item = new ImageStyle(this.Size);

            item.setLstColor(lstColor.Where(c => c.colorofstyle == Style.Id).ToList());
            item.SetStyle(Style);
            this.Controls.Add(item);
            CalculateSize();
            this.lstColor = lstColor;
        }
Пример #2
0
        public void SetStyle(List <Product_Style_Model> lstStyle)
        {
            foreach (Control item in this.Controls)
            {
                item.Dispose();
            }

            foreach (Product_Style_Model item in lstStyle)
            {
                this.Controls.Clear();
                ImageStyle style = new ImageStyle(this.Size);
                style.SetStyle(item);
                this.Controls.Add(style);
            }

            CalculateSize();
        }
Пример #3
0
 public void RemoveStyle(Product_Style_Model Style)
 {
     foreach (Control item in this.Controls)
     {
         if (item is ImageStyle)
         {
             ImageStyle rmItem = (ImageStyle)item;
             if (rmItem.Style.Id == Style.Id)
             {
                 this.Controls.Remove(rmItem);
                 rmItem.Dispose();
                 break;
             }
         }
     }
     CalculateSize();
 }