public object GetNestedValue(
            GanttViewLinkDataItem 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);
        }
        public void SetNestedValue(
            GanttViewLinkDataItem 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);
            }
        }
Beispiel #3
0
 public RadGanttViewLinkCancelEventArgs(GanttViewLinkDataItem link)
 {
     this.link = link;
 }
 public GanttViewLinkItemFormattingEventArgs(GanttViewLinkDataItem link, Pen pen)
     : base(link)
 {
     this.pen = pen;
 }
 public void SetLinkType(GanttViewLinkDataItem item, object value)
 {
     this.SetNestedValue(item, this.linkTypeDescriptor, value);
 }
 public void SetEndItem(GanttViewLinkDataItem item, object value)
 {
     this.SetNestedValue(item, this.endItemDescriptor, value);
 }
 public object GetLinkType(GanttViewLinkDataItem item)
 {
     return(this.GetNestedValue(item, this.linkTypeDescriptor));
 }
 public object GetEndItem(GanttViewLinkDataItem item)
 {
     return(this.GetNestedValue(item, this.endItemDescriptor));
 }