private void timelineView_entryResized(TimelineEntryControl sender, double startTime, double endTime)
        {
            //Reject the resize if the start time is after the end time
            if (startTime > endTime)
            {
                return;
            }

            //Resize the entry
            sender.timelineEntry.startTime = startTime;
            sender.timelineEntry.endTime   = endTime;
            sender.UpdateInterface();
        }
Exemplo n.º 2
0
        /// <summary>
        /// Adds an entry to the timeline
        /// </summary>
        /// <param name="timelineEntry"></param>
        public void AddEntry(TimelineEntry timelineEntry)
        {
            timelineEntries.Add(timelineEntry);

            //Create a control for this entry
            TimelineEntryControl entryControl = new TimelineEntryControl(timelineEntry, this);

            entryControls.Add(timelineEntry, entryControl);

            entriesCanvas.Children.Add(entryControl);

            //Position the control
            entryControl.UpdateInterface();

            //Subscribe to the control's events
            entryControl.UserResized += EntryControl_UserResized;
        }