public int Add(StrokeSample sample) { var resultIndex = Samples.Count; if (!hasUpdatesAtEndFrom.HasValue) { hasUpdatesAtEndFrom = resultIndex; } Samples.Add(sample); if (PreviousPredictedSamples.Count == 0) { PreviousPredictedSamples.AddRange(PredictedSamples); } if (sample.EstimatedPropertiesExpectingUpdates != 0) { sampleIndicesExpectingUpdates.Add(resultIndex); } PredictedSamples.Clear(); return(resultIndex); }