Пример #1
0
        /// <summary>
        /// The draw.
        /// </summary>
        /// <param name="context">
        /// The context.
        /// </param>
        /// <param name="skin">
        /// The skin.
        /// </param>
        /// <param name="layout">
        /// The layout.
        /// </param>
        public virtual void Draw(IRenderContext context, ISkin skin, Rectangle layout)
        {
            this.TextWidth = (int)Math.Ceiling(skin.MeasureText(context, this.Text).X);
            skin.DrawMenuItem(context, layout, this);

            var childrenLayout = this.GetMenuListLayout(skin, layout);

            if (this.Active && childrenLayout != null)
            {
                skin.DrawMenuList(context, childrenLayout.Value, this);
                foreach (var kv in this.GetMenuChildren(skin, layout))
                {
                    kv.Key.Draw(context, skin, kv.Value);
                }
            }
        }
Пример #2
0
        /// <summary>
        /// The draw.
        /// </summary>
        /// <param name="context">
        /// The context.
        /// </param>
        /// <param name="skin">
        /// The skin.
        /// </param>
        /// <param name="layout">
        /// The layout.
        /// </param>
        public virtual void Draw(IRenderContext context, ISkin skin, Rectangle layout)
        {
            this.TextWidth = (int)Math.Ceiling(skin.MeasureText(context, this.Text).X);
            skin.DrawMenuItem(context, layout, this);

            var childrenLayout = this.GetMenuListLayout(skin, layout);
            if (this.Active && childrenLayout != null)
            {
                skin.DrawMenuList(context, childrenLayout.Value, this);
                foreach (var kv in this.GetMenuChildren(skin, layout))
                {
                    kv.Key.Draw(context, skin, kv.Value);
                }
            }
        }