Esempio n. 1
0
        /// <summary>
        /// Adds a LunaItem to the end of the List.
        /// </summary>
        /// <param name="header">The Header of the LunaItem.</param>
        /// <param name="image">The Image of the LunaItem.</param>
        /// <param name="info">The Info of the LunaItem.</param>
        /// <param name="id">The ID of the LunaItem.</param>
        /// <param name="index">An index to be linked to this LunaItem.</param>
        /// <param name="index2">An index to be linked to this LunaItem.</param>
        /// <param name="index3">An index to be linked to this LunaItem.</param>
        public void Add(string header, Image image, string info, string id, int index, int index2, int index3)
        {
            if (!checkCapacity())
            {
                if (!_isScrollable)
                {
                    return;
                }
            }
            if (_items.Count > 0)
            {
                LunaSeperator seperator = new LunaSeperator
                {
                    Location = new Point(0, 66),
                    Padding  = new Padding(5, 0, 5, 0),
                    Size     = new Size(Width, 7),
                    TabIndex = 1
                };
                flowLayoutPanel1.Controls.Add(seperator);
                seperator.Refresh();
            }
            LunaItem item = new LunaItem
            {
                ShowInfo          = true,
                AnimationInterval = _itemAnimationInterval,
                AnimationSteps    = _itemSteps,
                BackColorHover    = _itemBackColorHover,
                BackColorImage    = Color.White,
                BackColorNormal   = _backColor,
                ForeColorHeader   = _itemForeColorHeader,
                ForeColorInfo     = _itemForeColorInfo,
                Font                 = _itemFont,
                InfoFontSizePx       = _infoFontSizePx,
                Header               = header,
                HeaderLocation       = _itemHeaderLocation,
                Image                = image,
                Info                 = info,
                InfoLocation         = _itemInfoLocation,
                ShowBorder           = false,
                Size                 = new Size(showScrollBar ? flowLayoutPanel1.Width - _scrollBarMargin : flowLayoutPanel1.Width, 60),
                Id                   = id,
                VerticalPadding      = _seperatorVerticalPadding,
                ImageLocation        = _itemImageLocation,
                ForeColorHeaderHover = _itemForeColorHeaderHover,
                ForeColorInfoHover   = _itemForeColorInfoHover,
                Index                = index,
                Index2               = index2,
                Index3               = index3
            };

            item.ShowInfo        = true;
            item.VerticalPadding = 0;
            item.VerticalPadding = _seperatorVerticalPadding;
            item.OnClickEvent   += Control_clicked;
            item.MouseEnter     += LunaItem_MouseEnter;
            flowLayoutPanel1.Controls.Add(item);
            _items.Add(item);
            item.Refresh();
        }
        public void Add(string header, Image image, string info, string id, int index, int index2, int index3)
        {
            if (!CheckCapacity)
            {
                return;
            }
            if (_items.Count > 0)
            {
                LunaSeperator seperator = new LunaSeperator
                {
                    Location = new Point(0, 66),
                    Padding  = new Padding(5, 0, 5, 0),
                    Size     = new Size(Width, 7),
                    TabIndex = 1
                };
                Controls.Add(seperator);
                seperator.Refresh();
            }
            LunaSmallCardItem item = new LunaSmallCardItem
            {
                ShowInfo          = true,
                AnimationInterval = _animationInterval,
                AnimationSteps    = _steps,
                BackColorHover    = _backColorHover,
                BackColorImage    = Color.White,
                BackColorNormal   = _backColor,
                ForeColorHeader   = _foreColorHeader,
                ForeColorInfo     = _foreColorInfo,
                Font                 = _font,
                InfoFontSizePx       = _infoFontSizePx,
                Header               = header,
                HeaderLocation       = _headerLocation,
                Image                = image,
                Info                 = info,
                InfoLocation         = _infoLocation,
                ShowBorder           = false,
                Size                 = new Size(Width, 60),
                Id                   = id,
                VerticalPadding      = _seperatorVerticalPadding,
                ImageLocation        = _imageLocation,
                ForeColorHeaderHover = _foreColorHeaderHover,
                ForeColorInfoHover   = _foreColorInfoHover,
                Index                = index,
                Index2               = index2,
                Index3               = index3
            };

            item.ShowInfo        = true;
            item.VerticalPadding = 0;
            item.VerticalPadding = _seperatorVerticalPadding;
            item.OnClickEvent   += Control_clicked;
            Controls.Add(item);
            _items.Add(item);
            item.Refresh();
        }