protected override void OnPreviewDragDrop(RadDropEventArgs e)
        {
            base.OnPreviewDragDrop(e);
            if (e.Handled || !(e.DragInstance is GanttGraphicalViewBaseTaskElement))
            {
                return;
            }
            GanttGraphicalViewBaseItemElement hitTarget = e.HitTarget as GanttGraphicalViewBaseItemElement;

            if (hitTarget == null)
            {
                return;
            }
            DateTime dateTime = this.Owner.GraphicalViewElement.TimelineBehavior.AdjustedTimelineStart.AddSeconds((double)(this.Owner.GraphicalViewElement.HorizontalScrollBarElement.Value + e.DropLocation.X - this.xOutlineFormOffset) * this.Owner.GraphicalViewElement.OnePixelTime.TotalSeconds);

            if (dateTime == hitTarget.Data.Start)
            {
                return;
            }
            TimeSpan timeSpan = hitTarget.Data.End - hitTarget.Data.Start;

            hitTarget.Data.Start = dateTime;
            hitTarget.Data.End   = dateTime + timeSpan;
            hitTarget.GraphicalViewElement.CalculateLinkLines(hitTarget.Data);
        }
        public virtual bool CanBeResized()
        {
            GanttGraphicalViewBaseItemElement parent = this.Parent as GanttGraphicalViewBaseItemElement;

            if (!parent.Data.ReadOnly)
            {
                return(!parent.Data.GanttViewElement.ReadOnly);
            }
            return(false);
        }
        protected override bool CanDragCore(Point dragStartPoint)
        {
            if (this.ElementState != ElementState.Loaded)
            {
                return(false);
            }
            GanttGraphicalViewBaseItemElement parent = this.Parent as GanttGraphicalViewBaseItemElement;

            if (!parent.Data.ReadOnly)
            {
                return(!parent.Data.GanttViewElement.ReadOnly);
            }
            return(false);
        }
Esempio n. 4
0
        private void SetEndItemVisibility(ElementVisibility visibility)
        {
            if (this.GanttViewElement == null)
            {
                return;
            }
            GanttGraphicalViewBaseItemElement element = this.GanttViewElement.GraphicalViewElement.GetElement(this.EndItem) as GanttGraphicalViewBaseItemElement;

            if (element == null)
            {
                return;
            }
            if (this.LinkType == TasksLinkType.FinishToStart || this.LinkType == TasksLinkType.StartToStart)
            {
                element.LeftLinkHandleElement.Visibility  = visibility;
                element.RightLinkHandleElement.Visibility = ElementVisibility.Hidden;
            }
            else
            {
                element.RightLinkHandleElement.Visibility = visibility;
                element.LeftLinkHandleElement.Visibility  = ElementVisibility.Hidden;
            }
        }
 public GanttViewItemPaintEventArgs(GanttGraphicalViewBaseItemElement element, Graphics graphics)
 {
     this.element  = element;
     this.graphics = graphics;
 }