コード例 #1
0
		public GanttItemEventArgs(GanttItem item)
		{
			Item = item;
		}
コード例 #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;
 }
コード例 #3
0
ファイル: GanttRow.cs プロジェクト: eolandezhang/Diagram
        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);
                }

            }
        }
コード例 #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();
 }
コード例 #5
0
ファイル: GanttPanel.cs プロジェクト: eolandezhang/Diagram
        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();
        }