private void PasteRowValues(PasteParam pasteParam) { // create Paste Processor var clipboard = new Clipboard(); var clipboardParser = new CopyParser(clipboard); var newRowPasteProcessor = new NewRowPasteProcessor(clipboardParser, this.View); var existingRowPasteProcessor = new ExistingRowPasteProcessor(clipboardParser, this.View); string[][] copiedValues = clipboardParser.ToArray(); if (copiedValues == null) { return; } GridListEditor listEditor = ((ListView)View).Editor as GridListEditor; if (listEditor != null) { var gridView = listEditor.GridView; if ((gridView.IsNewItemRow(gridView.FocusedRowHandle))) { // paste to new rows newRowPasteProcessor.Process(pasteParam); } else { // paste to selected rows int[] selectedRowHandles = gridView.GetSelectedRows(); existingRowPasteProcessor.Process(selectedRowHandles, pasteParam); } } }
private void PasteRowValues(PasteParam pasteParam) { // create clipboard parser var clipboard = new Clipboard(); var clipboardParser = new CopyParser(clipboard); // validate string[][] copiedValues = clipboardParser.ToArray(); if (copiedValues == null) { return; } if (copiedValues.GetLength(0) > PasteSettings.MaximumOnlineRows) { logger.Log("Rows exceeded the maximum of {0}. OFFLINE mode used.", PasteSettings.MaximumOnlineRows); var sw = new Stopwatch(); sw.Start(); PasteOfflineRowValues(pasteParam, false); sw.Stop(); logger.Log("Import completed in {0:0.00} seconds.", sw.Elapsed.TotalSeconds); new Xafology.ExpressApp.SystemModule.GenericMessageBox( logger.LogMessage, "Import SUCCESSFUL"); return; } // create Paste Processor var newRowPasteProcessor = new NewRowPasteProcessor(clipboardParser, this.View); var existingRowPasteProcessor = new ExistingRowPasteProcessor(clipboardParser, this.View); GridListEditor listEditor = ((ListView)View).Editor as GridListEditor; if (listEditor != null) { var gridView = listEditor.GridView; if ((gridView.IsNewItemRow(gridView.FocusedRowHandle))) { // paste to new rows newRowPasteProcessor.Process(pasteParam); } else { // paste to selected rows existingRowPasteProcessor.Process(pasteParam); } } }