protected void HookChildElements( UIElementCollection col ) { TimelineBand b; foreach (UIElement el in col) { if (el as TimelineBand != null) { b = (TimelineBand)el; b.TimelineTray = this; if (b.IsMainBand) { m_mainBand = b; } m_bands.Add(b); } else if (el as TimelineToolbox != null) { ((TimelineToolbox)el).SetSite(this); } else if (el as Panel != null) { HookChildElements(((el) as Panel).Children); } } }
public void AddElement(TimelineBand band) { Debug.Assert(band != null); band.SizeChanged += OnSizeChanged; m_elements.Add(band); }
public static void TimelineWindowSizeChanged( DependencyObject d, DependencyPropertyChangedEventArgs e ) { TimelineBand band = (TimelineBand)d; if (band != null) { band.OnTimelineWindowSizeChanged(e); } }
public static void ShortEventTemplateChanged( DependencyObject d, DependencyPropertyChangedEventArgs e ) { TimelineBand band = (TimelineBand)d; if (band != null) { band.OnShortEventTemplateChanged(e); } }
public TimelineBuilder( TimelineBand band, Canvas canvas, DataTemplate template, DataTemplate textTemplate, int columnCount, TimelineCalendar timeline, DataTemplate eventTemplate, double maxEventHeight, bool assignRows, DateTime currDateTime ) { SingleDelayedInvoke poolBuilder; Debug.Assert(template != null); Debug.Assert(canvas != null); Debug.Assert(eventTemplate != null); Debug.Assert(band != null); Debug.Assert(columnCount > 0); Debug.Assert(timeline != null); Debug.Assert(maxEventHeight > 0); m_parent = band; m_eventTemplate = eventTemplate; m_canvas = canvas; m_template = template;; m_columnCount = columnCount; m_timeline = timeline; m_assignRows = assignRows; m_markerTemplate = textTemplate; m_visibleEvents = new Dictionary <TimelineEvent, object>(); m_dispEvents = new Dictionary <TimelineEvent, TimelineDisplayEvent>(); m_maxEventHeight = maxEventHeight; CurrentDateTime = currDateTime; // // precreate some elements, so that we can later take them from pool // poolBuilder = new SingleDelayedInvoke(); for (int i = 0; i < INITIAL_EVENT_POOL_SIZE; ++i) { m_elementPool.Push((UIElement)CreateEventElement()); } Utilities.Trace(this); }
public void AddTimelineBand( int height, bool isMain, TimelineCalendarType srcType, int columnsCount, int eventSize ) { TimelineBand band; RowDefinition rd; band = new TimelineBand(); if (m_notifier != null) { m_notifier.AddElement(band); } band.IsMainBand = isMain; band.ItemSourceType = srcType; rd = new RowDefinition(); if (height > 0) { rd.Height = new GridLength((double)height); band.Height = height; } else { rd.Height = new GridLength(1.0, GridUnitType.Star); } this.RowDefinitions.Add(rd); band.SetValue(Grid.RowProperty, this.RowDefinitions.Count() - 1); band.Margin = new Thickness(0.0); band.TimelineWindowSize = columnsCount; band.MaxEventHeight = eventSize; band.TimelineTray = this; if (band.IsMainBand) { m_mainBand = band; } m_bands.Add(band); this.Children.Add(band); }
public TimelineBuilder( TimelineBand band, Canvas canvas, DataTemplate template, DataTemplate textTemplate, int columnCount, TimelineCalendar timeline, DataTemplate eventTemplate, double maxEventHeight, bool assignRows, DateTime currDateTime ) { Debug.Assert(template != null); Debug.Assert(canvas != null); Debug.Assert(eventTemplate != null); Debug.Assert(band != null); Debug.Assert(columnCount > 0); Debug.Assert(timeline != null); Debug.Assert(maxEventHeight > 0); m_parent = band; m_eventTemplate = eventTemplate; m_canvas = canvas; m_template = template;; m_columnCount = columnCount; m_timeline = timeline; m_assignRows = assignRows; m_textTemplate = textTemplate; m_visibleEvents = new Dictionary <TimelineEvent, object>(); m_dispEvents = new Dictionary <TimelineEvent, TimelineDisplayEvent>(); m_maxEventHeight = maxEventHeight; CurrentDateTime = currDateTime; Utilities.Trace(this); }
public void AddTimelineBand( int height, bool isMain, string srcType, int columnsCount, int eventSize ) { TimelineBand band; RowDefinition rd; band = new TimelineBand(); if (m_notifier != null) { m_notifier.AddElement(band); } band.IsMainBand = isMain; band.ItemSourceType = srcType; rd = new RowDefinition(); if (height > 0) { rd.Height = new GridLength((double) height); band.Height = height; } else { rd.Height = new GridLength(1.0, GridUnitType.Star); } this.RowDefinitions.Add(rd); band.SetValue(Grid.RowProperty, this.RowDefinitions.Count() - 1); band.Margin = new Thickness(0.0); band.TimelineWindowSize = columnsCount; band.MaxEventHeight = eventSize; band.TimelineTray = this; if (band.IsMainBand) { m_mainBand = band; } m_bands.Add(band); this.Children.Add(band); }
protected void HookChildElements( UIElementCollection col ) { TimelineBand b; foreach (UIElement el in col) { if (el as TimelineBand != null) { b = (TimelineBand) el; b.TimelineTray = this; if (b.IsMainBand) { m_mainBand = b; } m_bands.Add(b); } else if (el as TimelineToolbox != null) { ((TimelineToolbox) el).SetSite(this); } else if (el as Panel != null) { HookChildElements(((el) as Panel).Children); } } }
public void AddElement( TimelineBand band ) { Debug.Assert(band != null); band.SizeChanged += OnSizeChanged; m_elements.Add(band); }