Пример #1
0
        public MetroMenuItem(Control control, MetroMenuTransition transition, string name)
        {
            if (control == null)
                throw new InvalidOperationException("Control cannot be null.");

            Control = control;
            Control.Margin = new Padding(0);
            Control.Padding = new Padding(0);
            Control.Anchor = AnchorStyles.Left | AnchorStyles.Top | AnchorStyles.Right | AnchorStyles.Bottom;

            if (string.IsNullOrEmpty(name))
                throw new InvalidOperationException("Name cannot be empty.");

            Name = name;

            MenuTransition = transition;
        }
Пример #2
0
        public MetroMenuItem(Control control, MetroMenuTransition transition, string name)
        {
            if (control == null)
            {
                throw new InvalidOperationException("Control cannot be null.");
            }

            Control         = control;
            Control.Margin  = new Padding(0);
            Control.Padding = new Padding(0);
            Control.Anchor  = AnchorStyles.Left | AnchorStyles.Top | AnchorStyles.Right | AnchorStyles.Bottom;

            if (string.IsNullOrEmpty(name))
            {
                throw new InvalidOperationException("Name cannot be empty.");
            }

            Name = name;

            MenuTransition = transition;
        }