Example #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;
     }
 }
Example #2
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)
     {
         saveButton.Command = newValue.NewListCommands.Add;
         cancelButton.Command = newValue.NewListCommands.Cancel;
     }
     else
     {
         saveButton.Command = null;
         cancelButton.Command = null;
     }
 }
Example #3
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)
     {
         //saveButton.Command = newValue.NewSymbolCommands.Add;
         ui_buttonX_newGroup.Command = newValue.NewSymbolCommands.NewGroup;
         ui_buttonX_editGroup.Command = newValue.NewSymbolCommands.EditGroup;
         ui_ButtonX_cancel.Command = newValue.NewSymbolCommands.Cancel;
     }
     else
     {
         ui_ButtonX_add.Command = null;
         ui_ButtonX_cancel.Command = null;
     }
 }
Example #4
0
        public FormMain()
        {
            SuspendLayout();

            InitializeComponent();

            _commands = new MetroBillCommands
            {
                StartControlCommands = { Logon = new Command(), Exit = new Command() },
                NewSymbolCommands = { NewGroup = new Command(), EditGroup = new Command(), Cancel = new Command() },
                NewListCommands = { Add = new Command(), Cancel = new Command() },
                EditListCommands = { Save = new Command(), Cancel = new Command() }
            };

            _commands.StartControlCommands.Logon.Executed += StartControl_LogonClick;
            _commands.StartControlCommands.Exit.Executed += StartControl_ExitClick;

            _commands.NewSymbolCommands.Cancel.Executed += CancelNewSymbolExecuted;
            _commands.NewSymbolCommands.NewGroup.Executed += NewGroupNewSymbolExecuted;
            _commands.NewSymbolCommands.EditGroup.Executed += EditGroupNewSymbolExecuted;

            _commands.NewListCommands.Add.Executed += AddListControl_SaveClick;
            _commands.NewListCommands.Cancel.Executed += AddListControl_CancelClick;

            _commands.EditListCommands.Save.Executed += EditListControl_SaveClick;
            _commands.EditListCommands.Cancel.Executed += CancelEditListExecuted;

            labelItemUserName.Text = @"ver " + Application.ProductVersion;

            _startControl = new StartControl { Commands = _commands };
            Controls.Add(_startControl);
            _startControl.BringToFront();
            _startControl.SlideSide = DevComponents.DotNetBar.Controls.eSlideSide.Right;
            ResumeLayout(false);
            _busySymbolList = new List<int>();
        }