Changeset 4240
- Timestamp:
- 08/17/10 09:54:20 (14 years ago)
- Location:
- trunk/sources/HeuristicLab.Core.Views/3.3
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/sources/HeuristicLab.Core.Views/3.3/ItemArrayView.cs
r4099 r4240 94 94 foreach (T item in Content) 95 95 AddListViewItem(CreateListViewItem(item)); 96 AdjustListViewColumnSizes(); 96 97 if ((selectedIndex != -1) && (selectedIndex < itemsListView.Items.Count)) 97 98 itemsListView.Items[selectedIndex].Selected = true; … … 157 158 ((T)listViewItem.Tag).ToStringChanged += new EventHandler(Item_ToStringChanged); 158 159 } 159 AdjustListViewColumnSizes();160 160 } 161 161 protected virtual void InsertListViewItem(int index, ListViewItem listViewItem) { … … 165 165 ((T)listViewItem.Tag).ToStringChanged += new EventHandler(Item_ToStringChanged); 166 166 } 167 AdjustListViewColumnSizes();168 167 } 169 168 protected virtual void RemoveListViewItem(ListViewItem listViewItem) { … … 349 348 foreach (IndexedItem<T> item in e.Items) 350 349 InsertListViewItem(item.Index, CreateListViewItem(item.Value)); 350 AdjustListViewColumnSizes(); 351 351 352 352 for (int i = 0; i < selected.Length; i++) … … 378 378 foreach (IndexedItem<T> item in e.Items) 379 379 InsertListViewItem(item.Index, CreateListViewItem(item.Value)); 380 AdjustListViewColumnSizes(); 380 381 } 381 382 } -
trunk/sources/HeuristicLab.Core.Views/3.3/ItemCollectionView.cs
r4203 r4240 70 70 foreach (T item in Content) 71 71 AddListViewItem(CreateListViewItem(item)); 72 AdjustListViewColumnSizes(); 72 73 SortItemsListView(SortOrder.Ascending); 73 74 } … … 124 125 ((T)listViewItem.Tag).ItemImageChanged += new EventHandler(Item_ItemImageChanged); 125 126 ((T)listViewItem.Tag).ToStringChanged += new EventHandler(Item_ToStringChanged); 126 AdjustListViewColumnSizes();127 127 sortAscendingButton.Enabled = itemsListView.Items.Count > 1; 128 128 sortDescendingButton.Enabled = itemsListView.Items.Count > 1; … … 263 263 if (InvokeRequired) 264 264 Invoke(new CollectionItemsChangedEventHandler<T>(Content_ItemsAdded), sender, e); 265 else 265 else { 266 266 foreach (T item in e.Items) 267 267 AddListViewItem(CreateListViewItem(item)); 268 AdjustListViewColumnSizes(); 269 } 270 268 271 } 269 272 protected virtual void Content_ItemsRemoved(object sender, CollectionItemsChangedEventArgs<T> e) { … … 274 277 //remove only the first matching ListViewItem, because the IItem could be contained multiple times in the ItemCollection 275 278 ListViewItem listviewItem = GetListViewItemsForItem(item).FirstOrDefault(); 276 if (listviewItem != null) 277 RemoveListViewItem(listviewItem); 279 if (listviewItem != null) RemoveListViewItem(listviewItem); 278 280 } 279 281 } … … 286 288 //remove only the first matching ListViewItem, because the IItem could be contained multiple times in the ItemCollection 287 289 ListViewItem listviewItem = GetListViewItemsForItem(item).FirstOrDefault(); 288 if (listviewItem != null) 289 RemoveListViewItem(listviewItem); 290 if (listviewItem != null) RemoveListViewItem(listviewItem); 290 291 } 291 292 foreach (T item in e.Items) -
trunk/sources/HeuristicLab.Core.Views/3.3/ItemListView.cs
r4099 r4240 97 97 foreach (T item in Content) 98 98 AddListViewItem(CreateListViewItem(item)); 99 AdjustListViewColumnSizes(); 99 100 if ((selectedIndex != -1) && (selectedIndex < itemsListView.Items.Count)) 100 101 itemsListView.Items[selectedIndex].Selected = true; … … 158 159 ((T)listViewItem.Tag).ItemImageChanged += new EventHandler(Item_ItemImageChanged); 159 160 ((T)listViewItem.Tag).ToStringChanged += new EventHandler(Item_ToStringChanged); 160 AdjustListViewColumnSizes();161 161 } 162 162 protected virtual void InsertListViewItem(int index, ListViewItem listViewItem) { … … 164 164 ((T)listViewItem.Tag).ItemImageChanged += new EventHandler(Item_ItemImageChanged); 165 165 ((T)listViewItem.Tag).ToStringChanged += new EventHandler(Item_ToStringChanged); 166 AdjustListViewColumnSizes();167 166 } 168 167 protected virtual void RemoveListViewItem(ListViewItem listViewItem) { … … 321 320 if (InvokeRequired) 322 321 Invoke(new CollectionItemsChangedEventHandler<IndexedItem<T>>(Content_ItemsAdded), sender, e); 323 else 322 else { 324 323 foreach (IndexedItem<T> item in e.Items) 325 324 InsertListViewItem(item.Index, CreateListViewItem(item.Value)); 325 AdjustListViewColumnSizes(); 326 } 326 327 } 327 328 protected virtual void Content_ItemsRemoved(object sender, CollectionItemsChangedEventArgs<IndexedItem<T>> e) { … … 351 352 foreach (IndexedItem<T> item in e.Items) 352 353 InsertListViewItem(item.Index, CreateListViewItem(item.Value)); 354 AdjustListViewColumnSizes(); 353 355 354 356 for (int i = 0; i < selected.Length; i++) … … 380 382 foreach (IndexedItem<T> item in e.Items) 381 383 InsertListViewItem(item.Index, CreateListViewItem(item.Value)); 384 AdjustListViewColumnSizes(); 382 385 } 383 386 }
Note: See TracChangeset
for help on using the changeset viewer.