Changeset 4162
- Timestamp:
- 08/05/10 10:16:57 (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/sources/HeuristicLab.Optimization.Views/3.3/RunCollectionConstraintCollectionView.cs
r4068 r4162 34 34 [Content(typeof(IItemCollection<IRunCollectionConstraint>), false)] 35 35 public partial class RunCollectionConstraintCollectionView : ItemCollectionView<IRunCollectionConstraint> { 36 /// <summary>37 /// Initializes a new instance of <see cref="VariablesScopeView"/> with caption "Variables Scope View".38 /// </summary>39 36 public RunCollectionConstraintCollectionView() { 40 37 InitializeComponent(); … … 61 58 } 62 59 60 protected override ListViewItem CreateListViewItem(IRunCollectionConstraint item) { 61 ListViewItem listViewItem = base.CreateListViewItem(item); 62 if (item.Active) 63 listViewItem.Font = new Font(listViewItem.Font, FontStyle.Bold); 64 else 65 listViewItem.Font = new Font(listViewItem.Font, FontStyle.Regular); 66 return listViewItem; 67 } 68 63 69 protected override void RegisterContentEvents() { 64 70 base.RegisterContentEvents(); … … 75 81 foreach (IRunCollectionConstraint constraint in e.Items) 76 82 RegisterConstraintEvents(constraint); 83 77 84 } 78 85 protected override void Content_ItemsRemoved(object sender, CollectionItemsChangedEventArgs<IRunCollectionConstraint> e) { … … 92 99 constraint.ActiveChanged += new EventHandler(constraint_ActiveChanged); 93 100 } 94 95 101 protected virtual void DeregisterConstraintEvents(IRunCollectionConstraint constraint) { 96 102 constraint.ActiveChanged -= new EventHandler(constraint_ActiveChanged); 97 103 } 98 99 104 protected virtual void constraint_ActiveChanged(object sender, EventArgs e) { 100 IRunCollectionConstraint constraint = sender as IRunCollectionConstraint; 101 if (constraint != null) { 102 foreach (ListViewItem listViewItem in GetListViewItemsForItem(constraint)) { 103 if (constraint.Active) 104 listViewItem.Font = new Font(listViewItem.Font, FontStyle.Bold); 105 else 106 listViewItem.Font = new Font(listViewItem.Font, FontStyle.Regular); 107 } 105 IRunCollectionConstraint constraint = (IRunCollectionConstraint)sender; 106 foreach (ListViewItem listViewItem in GetListViewItemsForItem(constraint)) { 107 if (constraint.Active) 108 listViewItem.Font = new Font(listViewItem.Font, FontStyle.Bold); 109 else 110 listViewItem.Font = new Font(listViewItem.Font, FontStyle.Regular); 108 111 } 109 112 this.AdjustListViewColumnSizes();
Note: See TracChangeset
for help on using the changeset viewer.