/// <summary> /// Sets up initial properties for a graphical block object /// </summary> /// <param name="block">graphical object that contains event details on a timeline</param> private static void SetBlockProperties(InfoBlock block, IEvent aEvent) { block.aEvent = aEvent; block.Text += aEvent.Name + "\n"; block.Text += aEvent.EventTime + "\n"; block.Text += aEvent.EventType + "\n"; block.MouseEnter += Pages.TimelinePage.HoverBlock; block.MouseLeave += Pages.TimelinePage.HoverBlock; block.MouseRightButtonDown += Pages.TimelinePage.ClickBlock; block.MouseRightButtonUp += Pages.TimelinePage.ClickBlock; block.MouseLeftButtonDown += Pages.TimelinePage.LeftPopOut; ContextMenu contextMenu = new ContextMenu(); MenuItem parentFilter = new MenuItem(); parentFilter.Header = "Filter for events with same parent"; parentFilter.Click += Pages.TimelinePage.EventParentContextMenu_Click; parentFilter.Tag = aEvent.Parent; contextMenu.Items.Add(parentFilter); MenuItem popOut = new MenuItem(); popOut.Header = "Create new window for event"; popOut.Click += Pages.TimelinePage.popOut; popOut.Tag = block; contextMenu.Items.Add(popOut); block.ContextMenu = contextMenu; }
/// <summary> /// This method creates a list of nodes to be used for the timeline /// </summary> /// <param name="eventList">a list of events</param> /// <returns>a list of nodes</returns> public static List <Node> GetNodes(List <IEvent> eventList) { List <Node> nodeList = new List <Node>(); foreach (IEvent aEvent in eventList) { InfoBlock block = new InfoBlock(); SetBlockProperties(block, aEvent); Node node = new Node(aEvent, block); SetNodeProperties(node); nodeList.Add(node); } return(nodeList); }
/// <summary> /// The Node is an object that stores event data and has graphical objects to be displayed on a timeline. /// </summary> /// <param name="aEvent">object that stores event/shellbag data</param> /// <param name="block">object to display event details on a timeline</param> public Node(IEvent aEvent, InfoBlock block) { this.aEvent = aEvent; this.block = block; }