Exemplo n.º 1
0
 private void AddFilterItemControl(FilterItemPair item)
 {
     FilterItemControl control = new FilterItemControl(this.database);
     control.Item = item.NewItem;
     control.Location = new Point(0, this.controls.Count * 26 + 55);
     control.Size = new Size(this.groupFilters.Panel.Width, 26);
     control.Anchor = AnchorStyles.Left | AnchorStyles.Top | AnchorStyles.Right;
     this.groupFilters.Panel.Controls.Add(control);
     this.controls.Add(control);
 }
Exemplo n.º 2
0
 private void RemoveFilterItem(FilterItemControl item)
 {
     this.controls.Remove(item);
     this.groupFilters.Panel.Controls.Remove(item);
     Stack<FilterItemPair> deleted = new Stack<FormFilter.FilterItemPair>();
     for (int i = 0; i < this.items.Count; i++)
     {
         FilterItemPair pair = this.items[i];
         if (pair.NewItem == item.Item)
         {
             pair.NewItem = null;
         }
         
         if (pair.IsEmpty)
         {
             deleted.Push(pair);
         }
     }
     
     while (deleted.Count > 0)
     {
         this.items.Remove(deleted.Pop());
     }
 }