Exemple #1
0
 public virtual void Synchronize()
 {
   CardListViewVisualItem ancestor = this.FindAncestor<CardListViewVisualItem>();
   if (this.CardField == null || ancestor == null || ancestor.Data == null)
     return;
   this.Text = this.CardField.HeaderText;
   object obj = ancestor.Data[this.CardField];
   if (obj is byte[])
   {
     Image image = (Image) new ImageConverter().ConvertFrom((object) (obj as byte[]));
     if (image == null)
       return;
     this.EditorItem.DrawText = false;
     this.editorItem.ShouldHandleMouseInput = false;
     this.EditorItem.Image = image;
   }
   else if (obj is Image)
   {
     Image image = obj as Image;
     this.EditorItem.DrawText = false;
     this.editorItem.ShouldHandleMouseInput = false;
     this.EditorItem.Image = image;
   }
   else
     this.EditorItem.Text = Convert.ToString(obj);
 }
Exemple #2
0
        protected override void UpdateOnExpandCollapse()
        {
            bool flag = this.CheckIsHidden() || this.IsHidden;

            foreach (LayoutControlItemBase layoutControlItemBase in this.Items)
            {
                layoutControlItemBase.IsHidden = flag || !this.IsExpanded;
            }
            this.FindAncestor <LayoutControlContainerElement>()?.LayoutTree.UpdateItemsBounds();
            this.ContainerElement.Visibility = !this.IsExpanded || this.Visibility != ElementVisibility.Visible ? ElementVisibility.Collapsed : ElementVisibility.Visible;
            this.SetBounds(this.Bounds);
            if (this.ElementTree == null)
            {
                return;
            }
            CardListViewVisualItem ancestor = this.FindAncestor <CardListViewVisualItem>();

            if (ancestor == null || ancestor.Data.Owner.isSynchronizing)
            {
                return;
            }
            if (!this.isAttaching)
            {
                ancestor.Data.Owner.ViewElement.ProcessSelection(ancestor.Data, Control.ModifierKeys, true);
            }
            if (ancestor.Data != null)
            {
                ancestor.Data.Owner.ViewElement.ViewElement.UpdateItems();
            }
            if (this.isAttaching)
            {
                return;
            }
            ancestor.UpdateLayout();
        }
Exemple #3
0
 public CardViewItemFormattingEventArgs(
     LayoutControlItemBase item,
     CardListViewVisualItem visualItem)
 {
     this.item       = item;
     this.visualItem = visualItem;
 }
 public CardViewItemCreatingEventArgs(
     LayoutControlItemBase sourceItem,
     LayoutControlItemBase newItem,
     CardListViewVisualItem visualItem)
 {
     this.sourceItem = sourceItem;
     this.newItem    = newItem;
     this.visualItem = visualItem;
 }
Exemple #5
0
        public virtual void Synchronize()
        {
            CardListViewVisualItem ancestor = this.FindAncestor <CardListViewVisualItem>();

            if (this.CardField == null || ancestor == null || ancestor.Data == null)
            {
                return;
            }
            this.Text = ancestor.Data[this.CardField].ToString();
        }
Exemple #6
0
        protected override SizeF MeasureOverride(SizeF availableSize)
        {
            RadListView            control = this.ElementTree.Control as RadListView;
            CardListViewVisualItem parent  = this.Parent as CardListViewVisualItem;

            if (parent != null && parent.ToggleElement.Visibility == ElementVisibility.Visible)
            {
                CheckBoxesPosition checkBoxesPosition = control.CheckBoxesPosition;
                availableSize.Width  -= checkBoxesPosition == CheckBoxesPosition.Left || checkBoxesPosition == CheckBoxesPosition.Right ? parent.ToggleElement.DesiredSize.Width : 0.0f;
                availableSize.Height -= checkBoxesPosition == CheckBoxesPosition.Top || checkBoxesPosition == CheckBoxesPosition.Bottom ? parent.ToggleElement.DesiredSize.Height : 0.0f;
            }
            return(base.MeasureOverride(availableSize));
        }
        protected override void OnMouseDown(MouseEventArgs e)
        {
            base.OnMouseDown(e);
            RadCardView            control  = this.ElementTree.Control as RadCardView;
            CardListViewVisualItem ancestor = this.FindAncestor <CardListViewVisualItem>();
            CardViewItem           parent   = this.Parent as CardViewItem;

            if (control == null || ancestor == null || parent == null)
            {
                return;
            }
            if (parent.CardField != null)
            {
                parent.CardField.Current = true;
            }
            if (this.Editor != null)
            {
                return;
            }
            control.SelectedItem = ancestor.Data;
            ancestor.EditingItem = parent;
            control.ListViewElement.BeginEdit();
        }