private void CopyCsvClick(object sender, RoutedEventArgs e) { if (LastSortedValues != null) { try { List <string> header = new List <string> { "Seconds", choicesList.SelectedValue as string, "Name" }; var data = new List <List <object> >(); LastSortedValues.Where(values => LastFilter == null || LastFilter(values.First())).ToList().ForEach(sortedValue => { foreach (var chartData in sortedValue) { double chartValue = 0; if (CurrentConfig == CONFIG_AVG) { chartValue = chartData.Avg; } else if (CurrentConfig == CONFIG_CRIT_RATE) { chartValue = chartData.CritRate; } else if (CurrentConfig == CONFIG_TOTAL) { chartValue = chartData.Total; } else if (CurrentConfig == CONFIG_VPS) { chartValue = chartData.VPS; } data.Add(new List <object> { chartData.CurrentTime, chartValue, chartData.Name }); Clipboard.SetDataObject(TextFormatUtils.BuildCsv(header, data, titleLabel.Content as string)); } }); } catch (ExternalException ex) { LOG.Error(ex); } } }
private void CopyCsvClick(object sender, RoutedEventArgs e) { try { var export = BuildExportData(); string result = TextFormatUtils.BuildCsv(export.Item1, export.Item2); Clipboard.SetDataObject(result); } catch (ArgumentNullException ane) { Clipboard.SetDataObject("EQ Log Parser Error: Failed to create BBCode\r\n"); LOG.Error(ane); } catch (ExternalException ex) { LOG.Error(ex); } }
internal static void CopyCsvFromTable(DataGrid dataGrid, string title) { try { var export = BuildExportData(dataGrid); string result = TextFormatUtils.BuildCsv(export.Item1, export.Item2, title); Clipboard.SetDataObject(result); } catch (ArgumentNullException ane) { Clipboard.SetDataObject("EQ Log Parser Error: Failed to create CSV\r\n"); LOG.Error(ane); } catch (ExternalException ex) { LOG.Error(ex); } }
private void CopyCsvClick(object sender, RoutedEventArgs e) { try { var header = new List <string> { "Hit Value", "Frequency", "Difference" }; List <List <object> > data = new List <List <object> >(); for (int i = 0; i < YValues.Count; i++) { data.Add(new List <object> { XValues[i], YValues[i], XValuesDiff[i] }); } Clipboard.SetDataObject(TextFormatUtils.BuildCsv(header, data)); } catch (ExternalException ex) { LOG.Error(ex); } }