Ejemplo n.º 1
0
        public override void MergeWith(Style s)
        {
            if ((s == null) || (s.IsEmpty))
            {
                return;
            }

            base.MergeWith(s);
            MenuItemStyle with = s as MenuItemStyle;

            if (with == null)
            {
                return;
            }

            if (!CheckBit((int)MenuItemStyles.HorizontalPadding) && with.CheckBit((int)MenuItemStyles.HorizontalPadding))
            {
                HorizontalPadding = with.HorizontalPadding;
            }

            if (!CheckBit((int)MenuItemStyles.ItemSpacing) && with.CheckBit((int)MenuItemStyles.ItemSpacing))
            {
                ItemSpacing = with.ItemSpacing;
            }

            if (!CheckBit((int)MenuItemStyles.VerticalPadding) && with.CheckBit((int)MenuItemStyles.VerticalPadding))
            {
                VerticalPadding = with.VerticalPadding;
            }
        }
Ejemplo n.º 2
0
        public override void CopyFrom(Style s)
        {
            if (s == null || s.IsEmpty)
            {
                return;
            }

            base.CopyFrom(s);
            MenuItemStyle from = s as MenuItemStyle;

            if (from == null)
            {
                return;
            }

            if (from.CheckBit((int)MenuItemStyles.HorizontalPadding))
            {
                HorizontalPadding = from.HorizontalPadding;
            }

            if (from.CheckBit((int)MenuItemStyles.ItemSpacing))
            {
                ItemSpacing = from.ItemSpacing;
            }

            if (from.CheckBit((int)MenuItemStyles.VerticalPadding))
            {
                VerticalPadding = from.VerticalPadding;
            }
        }