Пример #1
0
        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);
        }
Пример #2
0
        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();
            }
        }
Пример #3
0
        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);
        }