public GalleryComponentControl(GalleryComponent component) : this() { _component = component; _listView.AllowDrop = component.AllowsDropAtIndex || component.AllowsDropOnItem; _listView.MultiSelect = _component.MultiSelect; _listView.View = _component.ShowDescription ? System.Windows.Forms.View.Tile : System.Windows.Forms.View.LargeIcon; _listView.HideSelection = _component.HideSelection; _listView.LargeImageList.ImageSize = _component.ImageSize; _listView.LabelEdit = _component.AllowRenaming; if (_component.MaxDescriptionLines >= 0) { // add and remove columns as necessary to allow the correct number of description lines to show (first column is always the label/name) while (_listView.Columns.Count - 1 > _component.MaxDescriptionLines) { _listView.Columns.RemoveAt(1); } while (_listView.Columns.Count - 1 < _component.MaxDescriptionLines) { _listView.Columns.Add(""); } } InitializeToolStrip(); InitializeContextMenu(); this.DataSource = _component.DataSource; _component.DataSourceChanged += OnDataSourceChanged; _component.SelectionChanged += OnDataSourceSelectionChanged; }
public void SetComponent(IApplicationComponent component) { _component = (GalleryComponent) component; }
public void SetComponent(IApplicationComponent component) { _component = (GalleryComponent)component; }