MTConnectSharp
MTConnectSharp copied to clipboard
DataItem.PreviousSample returns Current Sample
Need to skip Count-2 instead of Count-1. If you skip Count-1 you get to the end of the list and return a default (blank) sample
public DataItemSample PreviousSample { get { return _dataItemSamples.Skip(Math.Max(1, _dataItemSamples.Count - 2)).FirstOrDefault(); } }