/// <summary>
        /// Copies all data to a different writer.
        /// </summary>
        /// <param name="writer"></param>
        /// <param name="progressReport">Used to report the progress of writing all DataSets, returning false tells WriteTo to cancel the process.</param>
        public void WriteTo(IProfilingDataWriter writer, Predicate <double> progressReport)
        {
            writer.ProcessorFrequency = processorFrequency;
            writer.WriteMappings(nameMappings.Values);
            writer.WritePerformanceCounterData(counters);
            writer.WriteEventData(events);

            for (int i = 0; i < DataSetCount; i++)
            {
                using (UnmanagedProfilingDataSet dataSet = LoadDataSet(i))
                    writer.WriteDataSet(dataSet);

                if (!progressReport.Invoke((i + 1) / (double)DataSetCount))
                {
                    break;
                }
            }
        }
		/// <summary>
		/// Copies all data to a different writer.
		/// </summary>
		/// <param name="writer"></param>
		/// <param name="progressReport">Used to report the progress of writing all DataSets, returning false tells WriteTo to cancel the process.</param>
		public void WriteTo(IProfilingDataWriter writer, Predicate<double> progressReport)
		{
			writer.ProcessorFrequency = processorFrequency;
			writer.WriteMappings(nameMappings.Values);
			writer.WritePerformanceCounterData(counters);
			writer.WriteEventData(events);
			
			for (int i = 0; i < DataSetCount; i++) {
				using (UnmanagedProfilingDataSet dataSet = LoadDataSet(i))
					writer.WriteDataSet(dataSet);
				
				if (!progressReport.Invoke((i + 1) / (double)DataSetCount))
					break;
			}
		}
 /// <inheritdoc/>
 public void WriteEventData(IEnumerable <EventDataEntry> events)
 {
     targetWriter.WriteEventData(events);
 }