Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
12/11/12 16:36:26 (12 years ago)
Author:
sforsten
Message:

#1992: itemsGroupBox.Text displays the number of checked items. It is changed every time the content is changed or the checked items change.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/sources/HeuristicLab.Core.Views/3.3/CheckedItemCollectionView.cs

    r7259 r9026  
    2020#endregion
    2121
     22using System;
    2223using System.Drawing;
     24using System.Linq;
    2325using System.Windows.Forms;
    2426using HeuristicLab.Collections;
     
    3840      : base() {
    3941      InitializeComponent();
     42    }
     43
     44    protected override void OnContentChanged() {
     45      base.OnContentChanged();
     46      if (Content != null) {
     47        SetNumberOfCheckItems();
     48      }
    4049    }
    4150
     
    98107          }
    99108        }
     109        SetNumberOfCheckItems();
    100110      }
    101111    }
    102112    #endregion
     113
     114    private void SetNumberOfCheckItems() {
     115      this.itemsGroupBox.Text = String.Format("Items (Checked: {0}/{1})", Content.CheckedItems.Count(), Content.Count);
     116    }
    103117  }
    104118}
Note: See TracChangeset for help on using the changeset viewer.