Пример #1
0
 public void PostReport(JournalReport report)
 {
     lock (mSyncJournal)
     {
         mReports.Add(report);
         File.AppendAllText("journal.csv", report.ToCsv());
     }
 }
Пример #2
0
        public List <JournalReport> GetLastReports(int count)
        {
            var requestCount = (count > mReports.Count) ? mReports.Count : count;
            var data         = new JournalReport[requestCount];

            lock (mSyncJournal)
            {
                mReports.CopyTo(mReports.Count - requestCount, data, 0, requestCount);
            }


            var rv = new List <JournalReport>(data);

            rv.Reverse();

            return(rv);
        }