Exemplo n.º 1
0
        void OnCanvasDoubleClick(
            Point point
            )
        {
            DateTime date = CurrentDateTime +
                            Calculator.PixelsToTimeSpan(point.X - Canvas.ActualWidth / 2);

            TimelineTray.FireTimelineDoubleClick(date, point);
        }
Exemplo n.º 2
0
        void OnCanvasDoubleClick(
            Point point
            )
        {
            DateTime date;

            date = CurrentDateTime +
                   m_calc.PixelsToTimeSpan(point.X - m_canvasPart.ActualWidth / 2);

            TimelineTray.FireTimelineDoubleClick(date, point);
        }
        public TimelineDisplayEvent(
            TimelineEvent e,
            TimelineTray tray,
            TimelineBuilder builder
            )
        {
            if (e.Link == null)
            {
                e.Link = String.Empty;
            }

            if (e.Description == null)
            {
                e.Description = String.Empty;
            }

            m_timelineEvent = e;
            m_selected      = e.Selected;
            m_timelineEvent.PropertyChanged += OnEventPropertyChanged;

            if (e.HeightOverride == -1.0)
            {
                m_eventDescriptionHeight = tray.MainBand.MaxEventHeight;
            }
            else
            {
                m_eventDescriptionHeight = e.HeightOverride;
            }

            if (e.WidthOverride == -1.0)
            {
                m_eventDescriptionWidth = tray.DescriptionWidth;
            }
            else
            {
                m_eventDescriptionWidth = e.WidthOverride;
            }

            if (e.TopOverride != -1)
            {
                SetCalculatedTop(e.TopOverride);
            }

            TimelineBuilder = builder;
            TimelineTray    = tray;

            UpdateDisplayEvent();
        }
Exemplo n.º 4
0
        public TimelineDisplayEvent(
            TimelineEvent                               e,
            TimelineTray                                tray,
            TimelineBuilder                             builder
            )
        {
            if (e.Link == null)
            {
                e.Link = String.Empty;
            }

            if (e.Description == null)
            {
                e.Description = String.Empty;
            }

            m_timelineEvent = e;
        	m_selected = e.Selected;
            m_timelineEvent.PropertyChanged += OnEventPropertyChanged;

            if (e.HeightOverride == -1.0)
            {
                m_eventDescriptionHeight = tray.MainBand.MaxEventHeight;
            }
            else
            {
                m_eventDescriptionHeight = e.HeightOverride;
            }

            if (e.WidthOverride == -1.0)
            {
                m_eventDescriptionWidth = tray.DescriptionWidth;
            }
            else
            {
                m_eventDescriptionWidth = e.WidthOverride;
            }

            if (e.TopOverride != -1)
            {
                SetCalculatedTop(e.TopOverride);
            }

            TimelineBuilder = builder;
            TimelineTray = tray;

            UpdateDisplayEvent();
        }
Exemplo n.º 5
0
        void System.Windows.Markup.IComponentConnector.Connect(int connectionId, object target)
        {
            switch (connectionId)
            {
            case 1:
                this.Timeline = ((TimelineLibrary.TimelineTray)(target));
                return;

            case 2:
                this.label1 = ((System.Windows.Controls.Label)(target));
                return;

            case 3:
                this.Button1 = ((System.Windows.Controls.Button)(target));
                return;

            case 4:
                this.rectangle1 = ((System.Windows.Shapes.Rectangle)(target));
                return;
            }
            this._contentLoaded = true;
        }
Exemplo n.º 6
0
 protected virtual void OnTimelineTrayChanged(
     TimelineTray old,
     TimelineTray newTray
     )
 {
 }
Exemplo n.º 7
0
        private void ResetTimeBands(object sender, RoutedEventArgs e)
        {
            var timeline = new TimelineTray
            {
                CalendarType = "gregorian",
                HorizontalAlignment = HorizontalAlignment.Stretch
            };
            _timeline = timeline;
            Grid.SetRow(timeline, 2);
            //timeline.SetBinding(TimelineTray.MinDateTimeProperty, new Binding { ElementName = "MinTime", Path = new PropertyPath("Text"), Converter = new StringDateTimeValueConverter() });
            //timeline.SetBinding(TimelineTray.MaxDateTimeProperty, new Binding { ElementName = "MaxTime", Path = new PropertyPath("Text"), Converter = new StringDateTimeValueConverter() });
            DateTime min;
            var minOk = DateTime.TryParse(MinTime.Text, out min);
            DateTime max;
            var maxOk = DateTime.TryParse(MaxTime.Text, out max);
            DateTime cur;
            var curOk = DateTime.TryParse(CurrentDate.Text, out cur);

            if (minOk && maxOk && max > min && curOk)
            {
                timeline.MinDateTime = min;
                timeline.MaxDateTime = max;
                timeline.CurrentDateTime = cur;
            }

            bool main = true;
            int bandNr = 0;

            //var toolBox = new TimelineToolbox();
            //toolBox.Style = GetApplicationStyle("TimelineToolboxStyle");
            ////_timeline.AddTimelineToolbox();
            ////toolBox.Height = 30;
            //Grid.SetRow(toolBox, bandNr++);
            //timeline.RowDefinitions.Add(new RowDefinition { Height = new GridLength(30) });
            //timeline.Children.Add(toolBox);

            if (milliseconds.IsChecked.Value) SetupBand("milliseconds", ref main, ref bandNr);
            if (milliseconds10.IsChecked.Value) SetupBand("milliseconds10", ref main, ref bandNr);
            if (milliseconds100.IsChecked.Value) SetupBand("milliseconds100", ref main, ref bandNr);
            if (seconds.IsChecked.Value) SetupBand("seconds", ref main, ref bandNr);
            if (minutes.IsChecked.Value) SetupBand("minutes", ref main, ref bandNr);
            if (minutes10.IsChecked.Value) SetupBand("minutes10", ref main, ref bandNr);
            if (hours.IsChecked.Value) SetupBand("hours", ref main, ref bandNr);
            if (days.IsChecked.Value) SetupBand("days", ref main, ref bandNr);
            if (months.IsChecked.Value) SetupBand("months", ref main, ref bandNr);
            if (years.IsChecked.Value) SetupBand("years", ref main, ref bandNr);
            if (decades.IsChecked.Value) SetupBand("decades", ref main, ref bandNr);

            if (_grdTimeLine.Children.Count > 1)
            {
                _grdTimeLine.Children.RemoveAt(_grdTimeLine.Children.Count - 1);
            }
            //timeline.TimelineReady += (x, y) => timeline.ResetEvents(Properties.Resources.Monet);
            timeline.Loaded += (x, y) => timeline.ResetEvents(Properties.Resources.Monet);

            _grdTimeLine.Children.Add(timeline);
        }
Exemplo n.º 8
0
 protected virtual void OnTimelineTrayChanged(
     TimelineTray                                old,
     TimelineTray                                newTray
 )
 {
 }