Пример #1
0
        // Users Config Dialog

        private void AddUser(object args)
        {
            var u = new UserViewModel(new UserModel("", 0));

            var  dialog = new AddUserDialog(u);
            bool?result = dialog.ShowDialog();

            if (!((result == null) || (!result.Value)))
            {
                UsersList.Add(u);
                _model.UsersList.Add(u.GetModel());
            }
        }
 private void addUserBt_Click(object sender, EventArgs e)
 {
     using (var form = new AddUserDialog())
     {
         var result = form.ShowDialog();
         if (result == DialogResult.OK)
         {
             Operator newOperator = form.operatorModel;            //values preserved after close
             userList.Items.Add(newOperator.Name + " " + newOperator.Surname + " - " + newOperator.ID);
             XmlData.Operators.Add(newOperator);
         }
     }
 }
Пример #3
0
        private void AddUserCommandExecuted(object obj)
        {
            var dialog = new AddUserDialog(PHmi.Users, PHmi.Time.Ticks);

            if (AddUserDialogStyle != null)
            {
                dialog.Style = AddUserDialogStyle;
            }
            var result = dialog.ShowDialog(this);

            if (result == true && Paginator.RefreshCommand.CanExecute(null))
            {
                Paginator.RefreshCommand.Execute(null);
            }
        }