private void UndoLastAction() { if (m_UndoActions.Count == 0) { return; } WhiskerPointViewModel whiskerPoint = m_UndoActions.Last(); if (whiskerPoint != null) { int whiskerId = whiskerPoint.Model.Parent.WhiskerId; int pointId = whiskerPoint.Model.PointId; WhiskerViewModel whisker = Whiskers.Single(x => x.WhiskerId == whiskerId); if (whisker != null) { WhiskerPointViewModel whiskerPointToReplace = whisker.WhiskerPoints.Single(x => x.PointId == pointId); if (whiskerPointToReplace != null) { int index = whisker.WhiskerPoints.IndexOf(whiskerPointToReplace); whisker.WhiskerPoints[index] = whiskerPoint; RemoveUndoAction(whiskerPoint); CreateWhiskerPointsList(); CreatePrevWhiskerPointsList(); //Need to re-select the Whisker and/or Whisker Point SelectedWhisker = whisker; SelectedWhiskerPoint = whiskerPoint; } } } }
public double[] GetWhiskerFrequencySignal(int whiskerId) { return(Whiskers.Single(x => x.WhiskerId == whiskerId).Signal); }