public void GenerateEvents(Canvas canvas, EventModelManager eventManager)
        {
            var dictionary = eventManager.GetEventModel(TimeRangeCollection.First().StartDateTime, TimeRangeCollection.Last().EndDateTime);

            foreach (var axis in AxisDataCollection)
            {
                if (axis.IsDisplayed == false)
                {
                    continue;
                }

                if (!dictionary.ContainsKey(axis.Id))
                {
                    continue;
                }

                var placableRectList = new List <PlacableRect>();

                foreach (var evModl in dictionary[axis.Id])
                {
                    var top    = GetTop(evModl.StartDateTime);
                    var height = GetHeight(evModl.StartDateTime, evModl.EndDateTime.AddSeconds(-1));

                    var viewModel = new EventBorderViewModel()
                    {
                        Parent = evModl, MyBrush = axis.DrawBrush, Title = evModl.Title
                    };
                    placableRectList.Add(new PlacableRect()
                    {
                        rect = new Rect(0, top, 0, height), source = viewModel
                    });
                }
                GenerateEventBorders(canvas, placableRectList, GetLeft(axis.Id), axis.Width, axis.IsUnbound);
            }
        }
        public override void GenerateEvents(Canvas canvas, EventModelManager eventManager)
        {
            var dictionary = eventManager.GetEventModel(TimeRangeCollection.First().StartDateTime, TimeRangeCollection.Last().EndDateTime);

            foreach (var axis in _axisDataCollection)
            {
                if (axis.IsDisplayed == false)
                {
                    continue;
                }

                if (!dictionary.ContainsKey(axis.Id))
                {
                    continue;
                }

                var placableRectList = new List<PlacableRect>();

                foreach (var evModl in dictionary[axis.Id])
                {
                    var top = GetTop(evModl.StartDateTime);
                    var height = GetHeight(evModl.StartDateTime, evModl.EndDateTime.AddSeconds(-1));

                    var viewModel = new EventBorderViewModel() { Parent = evModl, MyBrush = axis.DrawBrush, Title = evModl.Title };
                    placableRectList.Add(new PlacableRect(){rect = new Rect(0, top, 0, height), source = viewModel});

                }
                GenerateEventBorders(canvas, placableRectList, GetAxisLeft(axis.Id), axis.Width, axis.IsUnbound);
            }
        }
Example #3
0
        public void ShowTimelineAxisEvents(TimelineAxis axis)
        {
            EventModelManager manager = _eventModelManager;

            var list = manager.GetEventModel(axis.Id);
            var eventListViewerViewModel = new EventViewerViewModel()
            {
                DataList = new List <EventViewerItemViewModel>()
            };

            foreach (var item in list)
            {
                eventListViewerViewModel.DataList.Add(new EventViewerItemViewModel()
                {
                    StartDateTime = item.StartDateTime,
                    EndDateTime   = item.EndDateTime,
                    Name          = item.Title,
                });
            }

            CommonLightBox  lightBox = new CommonLightBox();
            EventListViewer viewer   = new EventListViewer();

            viewer.DataContext = eventListViewerViewModel;

            lightBox.LightBoxKind = CommonLightBox.CommonLightBoxKind.CancelOnly;
            lightBox.BindUIElement(viewer);
            lightBox.Owner = Application.Current.MainWindow;

            if (ShowDialogManager.ShowDialog(lightBox) == true)
            {
                StartDateTime = viewer.JumpDateTime;
            }
        }
        /// <summary>
        /// ModelsCompositeからEventModelManagerを作る
        /// </summary>
        /// <returns>生成されたEventModelManager</returns>
        public static EventModelManager Generate()
        {
            EventModelManager manager = new EventModelManager();

            foreach (var model in ModelsComposite.StoryFrameModelManager.ModelCollection)
            {
                manager.Add(GenerateEventModel(model as StoryFrameModel));
            }

            foreach (var model in ModelsComposite.TimelineEventModelManager.ModelCollection)
            {
                manager.Add(GenerateEventModel(model));
            }

            return manager;
        }