Exemple #1
0
 /// <summary>
 /// Called when Commands property has changed.
 /// </summary>
 /// <param name="oldValue">Old property value</param>
 /// <param name="newValue">New property value</param>
 protected virtual void OnCommandsChanged(MetroBillCommands oldValue, MetroBillCommands newValue)
 {
     if (newValue != null)
     {
         ui_buttonX_logon.Command = newValue.StartControlCommands.Logon;
         ui_buttonX_exit.Command = newValue.StartControlCommands.Exit;
     }
     else
     {
         ui_buttonX_logon.Command = null;
         ui_buttonX_exit.Command = null;
     }
 }
Exemple #2
0
        public FormMain()
        {
            InitializeComponent();

            ToastNotification.ToastBackColor = Color.SteelBlue;
            ToastNotification.DefaultToastPosition = eToastPosition.BottomCenter;

            SuspendLayout();

            _commands = new MetroBillCommands
            {
                StartControlCommands = { Logon = new Command(), Exit = new Command() },
            };

            _commands.StartControlCommands.Logon.Executed += StartControlLogonClick;
            _commands.StartControlCommands.Exit.Executed += startControl_ExitClick;

            _startControl = new StartControl { Commands = _commands };

            Controls.Add(_startControl);
            _startControl.BringToFront();
            _startControl.SlideSide = DevComponents.DotNetBar.Controls.eSlideSide.Right;
            FormClosing += StopProcess;
        }