Exemplo n.º 1
0
		public GanttItemEventArgs(GanttItem item)
		{
			Item = item;
		}
Exemplo n.º 2
0
 protected override void OnMouseLeave(System.Windows.Input.MouseEventArgs e)
 {
     base.OnMouseLeave(e);
     if (ParentPanel.IsReadOnly) return;
     Predecessor = null;
     ParentPanel.DependencyPresenter.DependencyLinker.Visibility = System.Windows.Visibility.Collapsed;
     ParentPanel.DependencyPresenter.IsHitTestVisible = true;
 }
Exemplo n.º 3
0
        private void GenerateItems()
        {
            if (Node == null)
            {
                ItemsPresenter.Children.Clear();
            }
            else if (!ItemsValid)
            {
                ItemsValid = true;
                ItemsPresenter.Children.Clear();

                GanttItem item = null;

                if (Node.Children.Count == 0)
                    item = new GanttItem();
                else
                    item = new HeaderGanttItem();

                item.GapBackgroundBrush = this.GapBackgroundBrush;
                item.GapBorderBrush = this.GapBorderBrush;
                item.ItemContent = this.Node;
                item.ToolTipContentTemplate = this.ParentPanel.ParentGanttChart.ToolTipContentTemplate;
                item.ItemLeftTemplate = this.ParentPanel.ParentGanttChart.ItemLeftTemplate;
                item.ItemRightTemplate = this.ParentPanel.ParentGanttChart.ItemRightTemplate;
                item.ItemTopTemplate = this.ParentPanel.ParentGanttChart.ItemTopTemplate;
                item.ItemBottomTemplate = this.ParentPanel.ParentGanttChart.ItemBottomTemplate;
                item.ParentRow = this;
                item.Node = Node;
                ItemsPresenter.ItemShadow.StartDate = Node.StartDate;
                ItemsPresenter.ItemShadow.EndDate = Node.EndDate;
                ItemsPresenter.Children.Add(item);
                ItemsPresenter.Children.Add(ItemsPresenter.ItemShadow);

                if (Node.ActualStartDate.HasValue && Node.ActualEndDate.HasValue)
                {
                    var actualItem = new GanttActualItem();
                    actualItem.ParentRow = this;
                    actualItem.ItemContent = Node;
                    actualItem.ToolTipContentTemplate = this.ParentPanel.ParentGanttChart.ToolTipContentTemplate;
                    actualItem.Node = Node;
                    actualItem.IsFinished = Node.PercentComplete == 100;
                    actualItem.Visibility = IsShowActualItem ? Visibility.Visible : Visibility.Hidden;
                    ItemsPresenter.Children.Add(actualItem);
                }

            }
        }
Exemplo n.º 4
0
 protected override void OnMouseLeftButtonUp(System.Windows.Input.MouseButtonEventArgs e)
 {
     base.OnMouseLeftButtonUp(e);
     if (ParentPanel.IsReadOnly) return;
     foreach (var row in Children.OfType<GanttRow>())
         foreach (GanttItem item in row.ItemsPresenter.Children.OfType<GanttItem>())
             item.DragState = DragState.None;
     Predecessor = null;
     ParentPanel.DependencyPresenter.DependencyLinker.Visibility = System.Windows.Visibility.Collapsed;
     ParentPanel.DependencyPresenter.IsHitTestVisible = true;
     ReleaseMouseCapture();
 }
Exemplo n.º 5
0
        private void UpdateDependencies(GanttItem ganttItem)
        {
            var deps = Dependencies.Where(d => d.Successor == ganttItem.Node || d.Predecessor == ganttItem.Node);

            var items = DependencyPresenter.Children.OfType<GanttDependencyItem>()
                .Where(d => d.Dependency.Successor == ganttItem.Node
                    || d.Dependency.Predecessor == ganttItem.Node);

            foreach (var d in items)
                d.UpdateDependencyLines();
        }