public bool Remove(TimelineMarker marker) { DebugHelper.AssertUIThread(); Debug.Assert(this.Points != null); bool result = false; if (marker == null) { throw new ArgumentNullException("marker"); } KStudioWritableEventFile file = this.Source as KStudioWritableEventFile; if (file != null) { if (this.Points.Remove(marker)) { result = true; file.Markers.Remove(marker.Marker); file.FlushIndex(); } } return(result); }
public void RemoveAll() { DebugHelper.AssertUIThread(); Debug.Assert(this.Points != null); KStudioWritableEventFile file = this.Source as KStudioWritableEventFile; if ((file != null) && (this.Points.Count > 0)) { file.Markers.Clear(); this.Points.Clear(); this.IsDirty = true; file.FlushIndex(); } }
public TimelineMarker AddAt(TimeSpan relativeTime, string markerName) { DebugHelper.AssertUIThread(); Debug.Assert(this.Points != null); TimelineMarker markerProxy = null; KStudioWritableEventFile file = this.Source as KStudioWritableEventFile; if (file != null) { KStudioMarker marker = file.Markers.Add(markerName, relativeTime); if (marker != null) { markerProxy = new TimelineMarker(this, relativeTime, marker); this.Points.Add(markerProxy); } file.FlushIndex(); } return(markerProxy); }