public RcpaListViewMultipleFileField(Button btnAddFiles, Button btnRemoveFiles, Button btnLoad, Button btnSave, ListView lvItems, String key, OpenFileArgument fileArgument, bool required, bool validateSelectedItemOnly) : base(btnRemoveFiles, btnLoad, btnSave, lvItems, key, fileArgument.GetFileDescription()) { this.fileArgument = fileArgument; this.validator = new ItemInfosValidator(new ItemInfosListViewAdaptor(lvItems), validateSelectedItemOnly, required, (m => File.Exists(m)), fileArgument.GetFileDescription(), "File not exists : {0}"); btnAddFiles.Text = "Add"; btnAddFiles.Click += AddFileClick; lvItems.AllowDrop = true; lvItems.DragEnter += this.lvDatFiles_DragEnter; lvItems.DragDrop += this.lvDatFiles_DragDrop; }
public RcpaListBoxMultipleFileField(Button btnAddFiles, Button btnRemoveFiles, Button btnClear, Button btnLoad, Button btnSave, ListBox lstFiles, String key, OpenFileArgument fileArgument, bool required, bool validateSelectedItemOnly) { Childrens.Add(lstFiles); listBoxAdaptor = new ItemInfosListBoxAdaptor(lstFiles); validator = new ItemInfosValidator(listBoxAdaptor, validateSelectedItemOnly, required, (m => File.Exists(m)), fileArgument.GetFileDescription(), "File not exists : {0}"); this.fileArgument = fileArgument; this.lstFiles = lstFiles; ListBoxFileEventHandlers handlers = new ListBoxFileEventHandlers(lstFiles, fileArgument); if (btnAddFiles != null) { btnAddFiles.Text = "Add"; btnAddFiles.Click += handlers.AddEvent; Childrens.Add(btnAddFiles); } if (btnRemoveFiles != null) { btnRemoveFiles.Text = "Remove"; btnRemoveFiles.Click += handlers.RemoveEvent; Childrens.Add(btnRemoveFiles); } if (btnLoad != null) { btnLoad.Text = "Load"; btnLoad.Click += handlers.LoadEvent; Childrens.Add(btnLoad); } if (btnSave != null) { btnSave.Text = "Save"; btnSave.Click += handlers.SaveEvent; Childrens.Add(btnSave); } Adaptor = new OptionFileItemInfosAdaptor(listBoxAdaptor, key); }