Ejemplo n.º 1
0
        internal TimelinePosition DetermineItemPosition(TimelineItem item)
        {
            if (Mode == TimelineMode.Left)
            {
                return(TimelinePosition.Left);
            }

            if (Mode == TimelineMode.Right)
            {
                return(TimelinePosition.Right);
            }

            if (currentItemPosition == null)
            {
                currentItemPosition = TimelinePosition.Left;
                return(TimelinePosition.Left);
            }

            if (currentItemPosition == TimelinePosition.Left)
            {
                currentItemPosition = TimelinePosition.Right;
                return(TimelinePosition.Right);
            }

            if (currentItemPosition == TimelinePosition.Right)
            {
                currentItemPosition = TimelinePosition.Left;
                return(TimelinePosition.Left);
            }

            return(item.Position);
        }
Ejemplo n.º 2
0
        private void UpdateLastItem(TimelineItem item)
        {
            var previousLast = lastItem;

            lastItem = item;

            previousLast?.UpdateIsLast(false);
            lastItem.UpdateIsLast(true);
        }
Ejemplo n.º 3
0
        internal void Subscribe(TimelineItem item)
        {
            items.Add(item);
            if (item.Label != null)
            {
                hasLabels = true;
            }

            UpdateLastItem(item);
            StateHasChanged();
        }
Ejemplo n.º 4
0
 internal void Unsubscribe(TimelineItem item)
 {
     items.Remove(item);
 }