/// <summary> /// Set the list of marker points on the current row in the marker table. /// </summary> public void SetMarkerPositions(long imageID, MarkersForCounter markersForCounter) { // Find the current row number MarkerRow marker = this.Markers.Find(imageID); if (marker == null) { Debug.Fail(String.Format("Image ID {0} missing in markers table.", imageID)); return; } // Update the database and datatable marker[markersForCounter.DataLabel] = markersForCounter.GetPointList(); this.SyncMarkerToDatabase(marker); }
/// <summary> /// Get all markers for the specified file. /// </summary> /// <returns>list of counters having an entry for each counter even if there are no markers </returns> public List<MarkersForCounter> GetMarkersOnFile(long fileID) { List<MarkersForCounter> markersForAllCounters = new List<MarkersForCounter>(); MarkerRow markersForImage = this.Markers.Find(fileID); if (markersForImage == null) { // if no counter controls are defined no rows are added to the marker table return markersForAllCounters; } foreach (string dataLabel in markersForImage.DataLabels) { // create a marker for each point and add it to the counter's markers MarkersForCounter markersForCounter = new MarkersForCounter(dataLabel); string pointList; try { pointList = markersForImage[dataLabel]; } catch (Exception exception) { Debug.Fail(String.Format("Read of marker failed for dataLabel '{0}'.", dataLabel), exception.ToString()); pointList = String.Empty; } markersForCounter.Parse(pointList); markersForAllCounters.Add(markersForCounter); } return markersForAllCounters; }