public void AppendAutoFocusPoint(AutoFocus.AutoFocusReport report) { if (report != null) { lock (lockObj) { var last = LimitedImageHistoryStack.LastOrDefault(); if (last != null) { last.PopulateAFPoint(report); AutoFocusPoints.Add(last); } } } }
public void Add(IStarDetectionAnalysis starDetectionAnalysis) { if (starDetectionAnalysis != null) { lock (lockObj) { var point = new ImageHistoryPoint(Interlocked.Increment(ref _nextStatHistoryId), starDetectionAnalysis); ImageHistory.Add(point); LimitedImageHistoryStack.Add(point); //Clear AF point if stack that is limited to 100 does not contain this point anymore var items = AutoFocusPoints.Except(LimitedImageHistoryStack).ToList(); foreach (var item in items) { AutoFocusPoints.Remove(item); } } } }