void attributeListView_SelectionChanged(object sender, CustomListViewControl <AttributeDefinition> .SelectionChangedEventArgs e) { if (e.IsSelected) { if (this.splitContainer2.SplitterDistance == 100) { this.splitContainer2.SplitterDistance = 350; } this.splitContainer2.Panel2Collapsed = e.Definition.Enum == null; } }
public void AttachListView(CustomListViewControl <T> listView) { if (_listView != listView) { _listView = listView; _listView.FilterTextChanged += new CustomListViewControl <T> .FilterTextChangedEventHandler(_listView_FilterTextChanged); _listView.SelectionChanged += new CustomListViewControl <T> .SelectionChangedEventHandler(_listView_SelectionChanged); FillListView(); } }
internal void DetachListView() { if (_listView != null) { _listView.FilterTextChanged -= new CustomListViewControl <T> .FilterTextChangedEventHandler(_listView_FilterTextChanged); _listView.SelectionChanged -= new CustomListViewControl <T> .SelectionChangedEventHandler(_listView_SelectionChanged); _listView.Clear(); } _listView = null; UnLoadDefinitions(); }
void _listView_SelectionChanged(object sender, CustomListViewControl <T> .SelectionChangedEventArgs e) { e.Definition.IsActive = e.IsSelected; if (e.IsSelected) { e.Definition.Load(); } else { e.Definition.UnLoad(); } }