Esempio n. 1
0
        public FormMain()
        {
            InitializeComponent();
            metroShellMain.SelectedTab = metroTabItem_users;

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

            SuspendLayout();

            _commands = new MetroBillCommands
            {
                StartControlCommands = { Logon = new Command(), Exit = new Command() },
                AddUserControlCommands = { Add = new Command(), Cancel = new Command() },
                EditUserControlCommands = { SaveChanges = new Command(), Cancel = new Command() },
                AddListCommands = { Save = 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.AddUserControlCommands.Add.Executed += AddNewUserControl_AddClick;
            _commands.AddUserControlCommands.Cancel.Executed += AddNewUserControl_CancelClick;

            _commands.EditUserControlCommands.SaveChanges.Executed += EditUserControl_SaveClick;
            _commands.EditUserControlCommands.Cancel.Executed += EditUserControl_CancelClick;

            _commands.AddListCommands.Cancel.Executed += AddListControl_CancelClick;
            _commands.AddListCommands.Save.Executed += AddListControl_SaveClick;

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

            //**
            _startControl = new StartControl {Commands = _commands};

            Controls.Add(_startControl);
            _startControl.BringToFront();
            _startControl.SlideSide = DevComponents.DotNetBar.Controls.eSlideSide.Right;

            //NetworkInterface[] networks = NetworkInterface.GetAllNetworkInterfaces();

            //foreach (NetworkInterface network in networks)
            //{
            //    if (network.Name != "Hamachi") continue;
            //   _hamachiIp = network.GetIPProperties().UnicastAddresses[0].Address.ToString();

            //}

            ResumeLayout(false);
        }
Esempio n. 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.AddListCommands.Save;
         cancelButton.Command = newValue.AddListCommands.Cancel;
     }
     else
     {
         saveButton.Command = null;
         cancelButton.Command = null;
     }
 }
Esempio n. 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)
     {
         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;
     }
 }
Esempio n. 4
0
 protected virtual void OnCommandsChanged(MetroBillCommands oldValue, MetroBillCommands newValue)
 {
     if (newValue != null)
     {
         ui_buttonX_Save.Command = newValue.EditUserControlCommands.SaveChanges;
         ui_buttonX_cancel.Command = newValue.EditUserControlCommands.Cancel;
     }
     else
     {
         ui_buttonX_Save.Command = null;
         ui_buttonX_cancel.Command = null;
     }
 }
Esempio n. 5
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_add.Command = newValue.AddUserControlCommands.Add;
         ui_buttonX_cancel.Command = newValue.AddUserControlCommands.Cancel;
     }
     else
     {
         ui_buttonX_add.Command = null;
         ui_buttonX_cancel.Command = null;
     }
 }