예제 #1
0
    /// <summary>
    /// Record varying data in a DataRecorder.
    /// </summary>
    /// <param name="DataRecorder">Plug a DataRecorder object.</param>
    /// <param name="data">Data to record.</param>
    /// <param name="record">Record data?</param>
    /// <param name="reset">Flush all data from the DataRecorder?</param>
    /// <returns name = "recordedData">The data stored in the DataRecorder.</returns>
    public static List <object> Record(DataRecorder DataRecorder, object data, bool record = true, bool reset = false)
    {
        if (record)
        {
            DataRecorder.Add(data);
        }

        if (reset)
        {
            DataRecorder.Flush();
        }

        return(DataRecorder.GetRecords());
    }