private void lvDataviews_DragDrop(object sender, DragEventArgs e) { if (e.Data.GetDataPresent("FileDrop")) { var fid = new frmImportDataviews(); // show them a list of all the dataview names, let them select a subset string[] files = e.Data.GetData("FileDrop") as string[]; foreach (string f in files) { if (f.ToLower().EndsWith(".dat") || f.ToLower().EndsWith(".dataview")) { fid.ImportFiles.Add(f); } } if (fid.ImportFiles.Count > 0) { if (DialogResult.OK == MainFormPopupForm(fid, this, false)) { RefreshData(); MainFormUpdateStatus(getDisplayMember("dataviewsDragDrop{imported}", "Imported {0} dataview(s)", fid.ImportedDataviews.Count.ToString("###,##0")), true); } } } }
private void cmiImport_Click(object sender, EventArgs e) { if (DialogResult.OK == ofdImport.ShowDialog(this)) { var fid = new frmImportDataviews(); // show them a list of all the dataview names, let them select a subset foreach (var f in ofdImport.FileNames) { fid.ImportFiles.Add(f); } if (DialogResult.OK == MainFormPopupForm(fid, this, false)) { RefreshData(); MainFormUpdateStatus(getDisplayMember("import{imported}", "Imported {0} dataview(s)", fid.ImportedDataviews.Count.ToString("###,##0")), true); } } }
private void lvDataviews_DragOver(object sender, DragEventArgs e) { if (e.Data.GetDataPresent("FileDrop")) { var fid = new frmImportDataviews(); // show them a list of all the dataview names, let them select a subset string[] files = e.Data.GetData("FileDrop") as string[]; foreach (string f in files) { if (f.ToLower().EndsWith(".dat") || f.ToLower().EndsWith(".dataview")) { fid.ImportFiles.Add(f); } } if (fid.ImportFiles.Count > 0) { e.Effect = DragDropEffects.Copy; } } }