protected override void OnCollectionChanged(NotifyCollectionChangedEventArgs args)
        {
            base.OnCollectionChanged(args);
            if (this.Suspended)
            {
                return;
            }
            RadGanttViewElement ganttViewElement = this.GanttViewElement;

            if (ganttViewElement == null)
            {
                return;
            }
            if (args.Action == NotifyCollectionChangedAction.Add)
            {
                GanttViewLinkDataItem newItem = (GanttViewLinkDataItem)args.NewItems[0];
                ganttViewElement.Update(RadGanttViewElement.UpdateActions.LinkAdded, newItem);
                ganttViewElement.OnLinkAdded(new GanttViewLinkAddedEventArgs(newItem));
            }
            else if (args.Action == NotifyCollectionChangedAction.Remove)
            {
                GanttViewLinkDataItem newItem = (GanttViewLinkDataItem)args.NewItems[0];
                ganttViewElement.Update(RadGanttViewElement.UpdateActions.LinkRemoved, newItem);
                ganttViewElement.OnLinkRemoved(new GanttViewLinkRemovedEventArgs(newItem));
            }
            else
            {
                if (args.Action != NotifyCollectionChangedAction.Reset)
                {
                    return;
                }
                RadGanttViewElement.UpdateActions updateAction = RadGanttViewElement.UpdateActions.Reset;
                ganttViewElement.Update(updateAction);
            }
        }
예제 #2
0
        protected override void OnMouseEnter(EventArgs e)
        {
            base.OnMouseEnter(e);
            RadGanttViewElement ancestor = this.FindAncestor <RadGanttViewElement>();

            if (ancestor != null && !ancestor.ReadOnly)
            {
                this.Visibility = ElementVisibility.Visible;
            }
            this.ElementTree.Control.Cursor = Cursors.Hand;
        }
예제 #3
0
        protected override void RemoveItem(int index)
        {
            GanttViewDataItem parent1 = this.Items[index];

            if (parent1.Current && this.GanttViewElement != null)
            {
                RadGanttViewElement ganttViewElement   = this.GanttViewElement;
                GanttViewDataItem   ganttViewDataItem1 = parent1.PrevVisibleItem;
                if (ganttViewDataItem1 == null)
                {
                    for (GanttViewDataItem ganttViewDataItem2 = parent1; ganttViewDataItem2 != null && ganttViewDataItem1 == null; ganttViewDataItem2 = ganttViewDataItem2.Parent)
                    {
                        ganttViewDataItem1 = ganttViewDataItem2.NextItem;
                    }
                }
                ganttViewElement.SelectedItem = ganttViewDataItem1;
                if (ganttViewElement.SelectedItem != ganttViewDataItem1)
                {
                    if (ganttViewDataItem1.Enabled)
                    {
                        return;
                    }
                    base.RemoveItem(index);
                    return;
                }
            }
            if (this.owner.GanttViewElement != null)
            {
                if (!this.owner.GanttViewElement.PreProcess(this.owner, parent1, (object)"Remove", (object)index))
                {
                    return;
                }
            }
            this.GanttViewElement.BeginUpdate();
            if (this.owner.GanttViewElement != null)
            {
                while (parent1.Items.Count > 0)
                {
                    GanttViewDataItem ganttViewDataItem = parent1.Items[0];
                    this.owner.GanttViewElement.PreProcess(parent1, ganttViewDataItem, (object)"Remove", (object)0);
                }
            }
            this.GanttViewElement.EndUpdate(false, RadGanttViewElement.UpdateActions.None);
            GanttViewDataItem parent2 = parent1.Parent;

            base.RemoveItem(index);
            parent1.Parent           = (GanttViewDataItem)null;
            parent1.GanttViewElement = (RadGanttViewElement)null;
            if (parent2 == null || parent2.items.Count != 0 || this.owner.GanttViewElement == null)
            {
                return;
            }
            this.owner.GanttViewElement.Update(RadGanttViewElement.UpdateActions.ItemStateChanged, parent2);
        }
 public GanttViewTextViewElement(RadGanttViewElement ganttView)
     : base(ganttView)
 {
     this.columns = new GanttViewTextViewColumnCollection(ganttView);
     this.columns.CollectionChanged      += new NotifyCollectionChangedEventHandler(this.columns_CollectionChanged);
     this.columnScroller.Traverser        = (ITraverser <GanttViewTextViewColumn>) new GanttViewTextViewColumnTraverser((IList <GanttViewTextViewColumn>) this.columns);
     this.columnContainer.DataProvider    = (IEnumerable)this.columnScroller;
     this.columnScroller.ScrollerUpdated += new EventHandler(this.columnScroller_ScrollerUpdated);
     this.Scroller.ScrollState            = ScrollState.AlwaysHide;
     this.Scroller.ScrollMode             = ItemScrollerScrollModes.Smooth;
     this.Scroller.Traverser              = (ITraverser <GanttViewDataItem>) new GanttViewTraverser(ganttView);
 }
        protected override void ClearItems()
        {
            RadGanttViewElement ganttViewElement = this.GanttViewElement;

            if (ganttViewElement != null)
            {
                if (!ganttViewElement.PreProcess((GanttViewLinkDataItem)null, (object)"Clear"))
                {
                    return;
                }
            }
            foreach (GanttViewLinkDataItem viewLinkDataItem in (IEnumerable <GanttViewLinkDataItem>) this.Items)
            {
                viewLinkDataItem.GanttViewElement = (RadGanttViewElement)null;
            }
            base.ClearItems();
        }
 public GanttViewDefaultContextMenu(RadGanttViewElement ganttViewElement)
 {
     this.ganttViewElement = ganttViewElement;
     this.addMenuItem      = new GanttViewMenuItem("Add", "&Add");
     this.Items.Add((RadItem)this.addMenuItem);
     this.addChildMenuItem        = new GanttViewMenuItem("AddChild", "Add &Child");
     this.addChildMenuItem.Click += new EventHandler(this.addMenuItem_Click);
     this.addMenuItem.Items.Add((RadItem)this.addChildMenuItem);
     this.addSiblingMenuItem        = new GanttViewMenuItem("AddSibling", "Add &Sibling");
     this.addSiblingMenuItem.Click += new EventHandler(this.addMenuItem_Click);
     this.addMenuItem.Items.Add((RadItem)this.addSiblingMenuItem);
     this.deleteMenuItem        = new GanttViewMenuItem("Delete", "&Delete");
     this.deleteMenuItem.Click += new EventHandler(this.deleteMenuItem_Click);
     this.Items.Add((RadItem)this.deleteMenuItem);
     this.progressMenuItem = new GanttViewMenuItem("Progress", "&Progress");
     this.Items.Add((RadItem)this.progressMenuItem);
 }
예제 #7
0
        protected override void OnCollectionChanged(NotifyCollectionChangedEventArgs args)
        {
            base.OnCollectionChanged(args);
            if (this.Suspended || this.owner == null)
            {
                return;
            }
            RadGanttViewElement ganttViewElement = this.owner.GanttViewElement;

            if (ganttViewElement == null)
            {
                return;
            }
            if (args.Action == NotifyCollectionChangedAction.Add)
            {
                GanttViewDataItem newItem = (GanttViewDataItem)args.NewItems[0];
                ganttViewElement.Update(RadGanttViewElement.UpdateActions.ItemAdded, newItem);
                ganttViewElement.OnItemAdded(new GanttViewItemAddedEventArgs(newItem));
            }
            else if (args.Action == NotifyCollectionChangedAction.Remove)
            {
                GanttViewDataItem newItem = (GanttViewDataItem)args.NewItems[0];
                ganttViewElement.Update(RadGanttViewElement.UpdateActions.ItemRemoved, newItem);
                ganttViewElement.OnItemRemoved(new GanttViewItemRemovedEventArgs(newItem));
            }
            else if (args.Action == NotifyCollectionChangedAction.Move)
            {
                GanttViewDataItem newItem = (GanttViewDataItem)args.NewItems[0];
                ganttViewElement.Update(RadGanttViewElement.UpdateActions.ItemMoved, newItem);
            }
            else
            {
                if (args.Action != NotifyCollectionChangedAction.Reset)
                {
                    return;
                }
                RadGanttViewElement.UpdateActions updateAction = this.owner is RadGanttViewElement.RootDataItem ? RadGanttViewElement.UpdateActions.Reset : RadGanttViewElement.UpdateActions.Resume;
                ganttViewElement.Update(updateAction);
            }
        }
예제 #8
0
 public GanttViewBaseViewElement(RadGanttViewElement ganttView)
 {
     this.ganttView = ganttView;
 }
 public GanttViewDragDropService(RadGanttViewElement owner)
 {
     this.owner = owner;
 }
예제 #10
0
 protected override GanttViewGraphicalViewElement CreateGraphicalViewElement(RadGanttViewElement ganttView)
 {
     return(new CustomGanttViewGraphicalViewElement(this));
 }
예제 #11
0
 public GanttViewDataItemProvider(RadGanttViewElement gantt)
 {
     this.gantt = gantt;
 }
예제 #12
0
 public GanttViewTraverser(RadGanttViewElement owner)
 {
     this.owner = owner;
 }
예제 #13
0
 public GanttViewTextViewColumnCollection(RadGanttViewElement owner)
 {
     this.owner       = owner;
     this.columnNames = new HybridDictionary(true);
 }
예제 #14
0
 public MyGanttViewDragDropService(RadGanttViewElement owner)
     : base(owner)
 {
 }
예제 #15
0
 public GanttViewDataItemComparer(RadGanttViewElement ganttView)
 {
     this.ganttView = ganttView;
     this.Update();
 }
 public GanttViewLinkDataItemCollection(RadGanttViewElement ganttViewElement)
 {
     this.ganttViewElement = ganttViewElement;
 }
 public CustomGanttViewGraphicalViewElement(RadGanttViewElement ganttView)
     : base(ganttView)
 {
 }