コード例 #1
0
 public override void Attach(GanttViewDataItem data, object context)
 {
     base.Attach(data, context);
     this.cellContainer.Owner        = data.GanttViewElement.TextViewElement;
     this.cellContainer.DataProvider = (IEnumerable)this.cellContainer.Owner.ColumnScroller;
     this.cellContainer.Owner.ColumnScroller.ScrollerUpdated += new EventHandler(this.ColumnScroller_ScrollerUpdated);
 }
コード例 #2
0
        protected override void OnDropDownOpening(CancelEventArgs args)
        {
            base.OnDropDownOpening(args);
            GanttViewDataItem selectedItem = this.GanttViewElement.SelectedItem;

            if (this.ShowProgress && this.ProgressStep > new Decimal(0))
            {
                this.ProgressMenuItem.Visibility = ElementVisibility.Visible;
                bool    flag = selectedItem.Progress % this.ProgressStep != new Decimal(0);
                Decimal num  = new Decimal(0);
                while (num <= new Decimal(100))
                {
                    GanttViewMenuItem ganttViewMenuItem1 = new GanttViewMenuItem(num.ToString(), string.Format("{0:P0}", (object)(num / new Decimal(100))));
                    this.progressMenuItem.Items.Add((RadItem)ganttViewMenuItem1);
                    ganttViewMenuItem1.IsChecked = selectedItem.Progress == num;
                    ganttViewMenuItem1.Click    += new EventHandler(this.progressMenuItem_Click);
                    if (flag && selectedItem.Progress > num && selectedItem.Progress < num + this.ProgressStep)
                    {
                        GanttViewMenuItem ganttViewMenuItem2 = new GanttViewMenuItem(selectedItem.Progress.ToString(), string.Format("{0:P0}", (object)(selectedItem.Progress / new Decimal(100))));
                        this.progressMenuItem.Items.Add((RadItem)ganttViewMenuItem2);
                        ganttViewMenuItem2.IsChecked = true;
                        ganttViewMenuItem2.Click    += new EventHandler(this.progressMenuItem_Click);
                    }
                    num += this.ProgressStep;
                }
            }
            else
            {
                if (this.ShowProgress)
                {
                    return;
                }
                this.ProgressMenuItem.Visibility = ElementVisibility.Collapsed;
            }
        }
コード例 #3
0
 public override object this[GanttViewDataItem item]
 {
     get
     {
         if (((IDataItem)item).DataBoundItem == null)
         {
             return((object)null);
         }
         if (this.IsSubPropertyMode)
         {
             return(this.GetSubPropertyValue(this.Column.FieldName, ((IDataItem)item).DataBoundItem));
         }
         if (string.IsNullOrEmpty(this.Column.FieldName))
         {
             return((object)null);
         }
         return(this.GanttViewElement.BindingProvider.GetBoundValue(((IDataItem)item).DataBoundItem, this.Column.FieldName));
     }
     set
     {
         if (((IDataItem)item).DataBoundItem == null)
         {
             return;
         }
         if (this.IsSubPropertyMode)
         {
             this.GanttViewElement.BindingProvider.SetBoundValue((IDataItem)item, this.Column.FieldName, value, this.Column.FieldName);
         }
         else
         {
             this.GanttViewElement.BindingProvider.SetBoundValue((IDataItem)item, this.Column.FieldName, this.Column.Name, value, (string)null);
         }
     }
 }
コード例 #4
0
 public override bool IsCompatible(GanttViewDataItem data, object context)
 {
     if (data != null)
     {
         return(data.Start == data.End);
     }
     return(false);
 }
コード例 #5
0
        public override void Attach(GanttViewDataItem data, object context)
        {
            int num = (int)this.TaskElement.BindProperty(GanttGraphicalViewBaseTaskElement.SelectedProperty, (RadObject)data, GanttViewDataItem.SelectedProperty, PropertyBindingOptions.TwoWay);

            base.Attach(data, context);
            this.InvalidateMeasure();
            this.Invalidate();
        }
コード例 #6
0
 protected virtual void OnChildRemoved(GanttViewDataItem child)
 {
     if (this.Parent == null || this.GanttViewElement.AllowSummaryEditing)
     {
         return;
     }
     this.InvalidateStartAndEnd();
     this.InvalidateProgress();
 }
コード例 #7
0
 public GanttViewEditorRequiredEventArgs(
     GanttViewDataItem item,
     GanttViewTextViewColumn column,
     Type editorType)
     : base(item)
 {
     this.column     = column;
     this.editorType = editorType;
 }
コード例 #8
0
        private RadGanttViewElement FindGanttView()
        {
            GanttViewDataItem ganttViewDataItem = this;

            while (ganttViewDataItem.parent != null)
            {
                ganttViewDataItem = ganttViewDataItem.parent;
            }
            return(ganttViewDataItem.ganttView);
        }
コード例 #9
0
        public object GetNestedValue(
            GanttViewDataItem item,
            LinkedList <PropertyDescriptor> nestedDescriptor)
        {
            object dataBoundItem = ((IDataItem)item).DataBoundItem;

            for (LinkedListNode <PropertyDescriptor> linkedListNode = nestedDescriptor.First; linkedListNode != null; linkedListNode = linkedListNode.Next)
            {
                dataBoundItem = linkedListNode.Value.GetValue(dataBoundItem);
            }
            return(dataBoundItem);
        }
コード例 #10
0
        protected virtual void AddMenuItemClicked(GanttViewMenuItem item)
        {
            if (!(item.Command == "AddChild") && !(item.Command == "AddSibling"))
            {
                return;
            }
            CreateGanttDataItemEventArgs e = new CreateGanttDataItemEventArgs();

            this.GanttViewElement.OnCreateDataItem(e);
            GanttViewDataItem ganttViewDataItem = e.Item ?? this.GanttViewElement.CreateNewTask();
            DateTime          dateTime1         = this.GanttViewElement.GraphicalViewElement.TimelineBehavior.AdjustedTimelineStart.AddSeconds((double)(this.GanttViewElement.GraphicalViewElement.PointFromScreen(this.DropDown.Location).X + this.GanttViewElement.GraphicalViewElement.HorizontalScrollBarElement.Value) * this.GanttViewElement.GraphicalViewElement.OnePixelTime.TotalSeconds);
            DateTime          dateTime2         = dateTime1.AddSeconds(this.GanttViewElement.GraphicalViewElement.OnePixelTime.TotalSeconds * 20.0);

            ganttViewDataItem.Start = dateTime1;
            ganttViewDataItem.End   = dateTime2;
            if (item.Command == "AddChild")
            {
                this.GanttViewElement.SelectedItem.Items.Add(ganttViewDataItem);
            }
            else
            {
                if (!(item.Command == "AddSibling"))
                {
                    return;
                }
                if (this.GanttViewElement.SelectedItem.Parent == null)
                {
                    int index = this.GanttViewElement.Items.IndexOf(this.GanttViewElement.SelectedItem);
                    if (index < this.GanttViewElement.Items.Count)
                    {
                        this.GanttViewElement.Items.Insert(index, ganttViewDataItem);
                    }
                    else
                    {
                        this.GanttViewElement.Items.Add(ganttViewDataItem);
                    }
                }
                else
                {
                    int index = this.GanttViewElement.SelectedItem.Parent.Items.IndexOf(this.GanttViewElement.SelectedItem);
                    if (index < this.GanttViewElement.SelectedItem.Parent.Items.Count)
                    {
                        this.GanttViewElement.SelectedItem.Parent.Items.Insert(index, ganttViewDataItem);
                    }
                    else
                    {
                        this.GanttViewElement.SelectedItem.Parent.Items.Add(ganttViewDataItem);
                    }
                }
            }
        }
コード例 #11
0
 protected virtual void NotifyExpandedChanged(GanttViewDataItem item)
 {
     if (this.GanttViewElement == null)
     {
         return;
     }
     if (item != null)
     {
         this.GanttViewElement.Update(RadGanttViewElement.UpdateActions.ExpandedChanged, item);
         ControlTraceMonitor.TrackAtomicFeature((RadElement)this.GanttViewElement, item.Expanded ? "Expanded" : "Collapsed", (object)item.Title);
     }
     else
     {
         this.GanttViewElement.Update(RadGanttViewElement.UpdateActions.ExpandedChanged);
     }
 }
コード例 #12
0
 private GanttViewDataItem GetLastVisibleItem(GanttViewDataItem parent)
 {
     for (int index = parent.Items.Count - 1; index >= 0; --index)
     {
         GanttViewDataItem parent1 = parent.Items[index];
         if (parent1.Visible)
         {
             if (parent1.Expanded && parent1.Items.Count > 0)
             {
                 return(this.GetLastVisibleItem(parent1));
             }
             return(parent1);
         }
     }
     return((GanttViewDataItem)null);
 }
コード例 #13
0
 public virtual object this[GanttViewDataItem item]
 {
     get
     {
         if (item.Cache[this.Column] == null)
         {
             PropertyInfo property = item.GetType().GetProperty(this.Column.FieldName);
             if ((object)property != null)
             {
                 object obj = property.GetValue((object)item, (object[])null);
                 this.SetUnboundValue(item, obj);
             }
         }
         return(item.Cache[this.Column]);
     }
     set
     {
         this.SetUnboundValue(item, value);
     }
 }
コード例 #14
0
        private void SetUnboundValue(GanttViewDataItem item, object value)
        {
            if (item == null)
            {
                return;
            }
            if (this.GanttViewElement != null)
            {
                this.GanttViewElement.Items.OnCollectionItemChanging(item);
            }
            item.Cache[this.column] = value;
            PropertyInfo property = item.GetType().GetProperty(this.column.FieldName);

            if ((object)property != null)
            {
                property.SetValue((object)item, value, (object[])null);
            }
            if (this.GanttViewElement == null)
            {
                return;
            }
            this.GanttViewElement.Items.OnCollectionItemChanged(item);
        }
コード例 #15
0
        public void SetNestedValue(
            GanttViewDataItem item,
            LinkedList <PropertyDescriptor> nestedDescriptor,
            object value)
        {
            object dataBoundItem = ((IDataItem)item).DataBoundItem;
            LinkedListNode <PropertyDescriptor> first = nestedDescriptor.First;

            while (first != null)
            {
                if (first.Next == null)
                {
                    object        obj       = value;
                    TypeConverter converter = first.Value.Converter;
                    if (value != null && converter.CanConvertFrom(value.GetType()))
                    {
                        obj = converter.ConvertFrom(value);
                    }
                    first.Value.SetValue(dataBoundItem, obj);
                    break;
                }
                dataBoundItem = first.Value.GetValue(dataBoundItem);
            }
        }
コード例 #16
0
 public object GetEnd(GanttViewDataItem item)
 {
     return(this.GetNestedValue(item, this.endDescriptor));
 }
コード例 #17
0
 public virtual void SetCurrent(GanttViewDataItem item)
 {
 }
コード例 #18
0
 public GanttViewTraversingEventArgs(GanttViewDataItem item)
 {
   this.item = item;
   this.process = item == null || item.Visible;
 }
コード例 #19
0
 public void SetProgress(GanttViewDataItem item, object value)
 {
     this.SetNestedValue(item, this.progressDescriptor, value);
 }
コード例 #20
0
 public void SetEnd(GanttViewDataItem item, object value)
 {
     this.SetNestedValue(item, this.endDescriptor, value);
 }
コード例 #21
0
 public void SetStart(GanttViewDataItem item, object value)
 {
     this.SetNestedValue(item, this.startDescriptor, value);
 }
コード例 #22
0
 public void SetTitle(GanttViewDataItem item, object value)
 {
     this.SetNestedValue(item, this.titleDescriptor, value);
 }
コード例 #23
0
 protected virtual void OnChildProgressChanged(GanttViewDataItem child)
 {
     this.InvalidateProgress();
 }
コード例 #24
0
 public object GetParent(GanttViewDataItem item)
 {
     return(this.GetNestedValue(item, this.parentDescriptor));
 }
コード例 #25
0
 public abstract IList <GanttViewDataItem> GetItems(GanttViewDataItem parent);
コード例 #26
0
 public object GetTitle(GanttViewDataItem item)
 {
     return(this.GetNestedValue(item, this.titleDescriptor));
 }
コード例 #27
0
 protected virtual void OnChildEndChanged(GanttViewDataItem child)
 {
     this.InvalidateStartAndEnd();
 }
コード例 #28
0
 public object GetProgress(GanttViewDataItem item)
 {
     return(this.GetNestedValue(item, this.progressDescriptor));
 }
コード例 #29
0
 public object GetStart(GanttViewDataItem item)
 {
     return(this.GetNestedValue(item, this.startDescriptor));
 }
コード例 #30
0
 public void SetParent(GanttViewDataItem item, object value)
 {
     this.SetNestedValue(item, this.parentDescriptor, value);
 }