private void SelectItemFromList() { using (var form = new FormImageList()) { form.LoadData(TabInfo.LayoutItems.Select(item => item.FilePath).ToList(), (CurrentLayoutItem ?? TabInfo.DefaultItem)?.FilePath); if (form.ShowDialog() == DialogResult.OK) { CurrentLayoutItem = LayoutItem.FromFile(form.SelectedFile); pictureEdit.Image = CurrentLayoutItem != null?Image.FromFile(CurrentLayoutItem.FilePath) : null; } } }
private void SelectItemFromList() { using (var form = new FormImageList()) { form.LoadData(TabInfo.ImageFiles, (_currentClipartObject ?? _defaultClipartObject)?.FilePath); if (form.ShowDialog() == DialogResult.OK) { _currentClipartObject = ImageClipartObject.FromFile(form.SelectedFile); _allowHandleEvents = false; clipartEditContainer.LoadData(_currentClipartObject); _allowHandleEvents = true; RaiseEditValueChanged(); } } }