private void add_ToolStripButton_Click(object sender, EventArgs e) { bool changeMade = false; using (AssetSelectionForm form = new AssetSelectionForm(_assetAttributes, ApplySelectionFilter, true)) { if (form.ShowDialog(this) == DialogResult.OK) { foreach (AssetInfo item in form.SelectedAssets) { if (!_assetRows.Any(n => n.AssetId == item.AssetId)) { _assetRows.Add(new AssetSelectionRow(item)); changeMade = true; } } } } asset_GridView.Refresh(); if (changeMade) { OnSelectionChanged(); OnDisplayedAssetsChanged(); } }
private void selectPrinters_Button_Click(object sender, EventArgs e) { using (AssetSelectionForm form = new AssetSelectionForm(AssetAttributes.Printer, _allowMultipleDevices)) { if (form.ShowDialog(this) == DialogResult.OK) { _selectedPrintDevices.Clear(); _selectedPrintDevices.AddRange(form.SelectedAssets.OfType <IPrinterInfo>()); printDevices_TextBox.Text = string.Join("; ", _selectedPrintDevices.Select(n => n.AssetId)); LoadCfmFiles(); } } }