Example #1
0
 protected override void OnResize(EventArgs e)
 {
     base.OnResize(e);
     foreach (Control c in this.kryptonHeaderGroup1.Panel.Controls)
     {
         DataCard dc = c as DataCard;
         if (dc != null)
         {
             dc.UpdateHeight();
             dc.Invalidate();
         }
     }
 }
Example #2
0
        public DataCard this[string category]
        {
            get
            {
                foreach (Control c in this.kryptonHeaderGroup1.Panel.Controls)
                {
                    DataCard dc = (DataCard)c;
                    if (dc.CategoryName == category)
                    {
                        return(dc);
                    }
                }

                return(null);
            }
        }
Example #3
0
        private void CreateCards()
        {
            this.kryptonHeaderGroup1.Panel.Controls.Clear();
            if (this.objectData != null)
            {
                this.kryptonHeaderGroup1.HeaderVisiblePrimary  = true;
                this.kryptonHeaderGroup1.ValuesPrimary.Heading = this.objectData[SystemProperty.Name].ToString();
                this.kryptonHeaderGroup1.Panel.AutoScroll      = false;

                ObjectClass oc     = database.Classes[this.objectData.ObjectClass.Identifier];
                Field[]     fields = oc.FieldsBase.ToArray();

                Stack <DataCard> cards = new Stack <DataCard>();
                foreach (var category in oc.FieldsCategory)
                {
                    DataCard card = new DataCard(this.database, category.Key);
                    card.ObjectDataSelected += new EventHandler <EventArgs>(this.CardObjectDataSelected);
                    card.ImageDataSelected  += new EventHandler <EventArgs>(this.CardImageDataSelected);

                    card.BeginUpdate();
                    foreach (Field field in category)
                    {
                        object d = this.objectData[field];
                        if (!field.IsEmptyData(d))
                        {
                            card.AddValue(field, d);
                        }
                    }

                    if (card.CountValues != 0)
                    {
                        cards.Push(card);
                    }

                    card.EndUpdate();
                }

                while (cards.Count > 0)
                {
                    DataCard dc = cards.Pop();
                    dc.Dock = DockStyle.Top;
                    this.kryptonHeaderGroup1.Panel.Controls.Add(dc);
                    if (cards.Count > 0)
                    {
                        KryptonPanel p = new KryptonPanel();
                        p.Dock               = DockStyle.Top;
                        p.Height             = 6;
                        p.StateCommon.Color1 = Color.Transparent;
                        this.kryptonHeaderGroup1.Panel.Controls.Add(p);
                    }

                    dc.UpdateHeight();
                }
            }
            else
            {
                this.kryptonHeaderGroup1.HeaderVisiblePrimary = false;
            }

            this.kryptonHeaderGroup1.Panel.AutoScroll = true;
        }