Exemplo n.º 1
0
 public void ConnectEventHandlers(PassOneController controller)
 {
     ShowPasswordBtn.Click += controller.showPasswordBtn_Click;
     CopyPasswordBtn.Click += controller.copyPasswordBtn_Click;
     GenerateButton.Click += controller.generateButton_Click;
     SaveBtn.Click += controller.SaveBtn_Click;
     CredentialsListBox.SelectedIndexChanged += controller.CredentialsList_SelectedIndexChanged;
     newToolStripButton.Click += controller.newEntry_Click;
     newToolStripMenuItem.Click += controller.newEntry_Click;
     saveToolStripButton.Click += controller.SaveBtn_Click;
     saveToolStripMenuItem.Click += controller.SaveBtn_Click;
     deleteCredentialsToolStripMenuItem.Click += controller.deleteCredentials_Click;
     logOutToolStripMenuItem.Click += controller.logoutBtn_Click;
 }
Exemplo n.º 2
0
        private static void Main()
        {
            Application.EnableVisualStyles();
            Application.SetCompatibleTextRenderingDefault(false);

            _model = new PassOneModel();
            _view = new View();
            _controller = new PassOneController();

            _model.View = _view;
            _view.Controller = _controller;
            _controller.Model = _model;
            _controller.ModelState = ModelStates.Login;
            _view.ConnectEventHandlers(_controller);
            Application.Run(_view.LoginForm);
        }
Exemplo n.º 3
0
 /// <summary>
 /// Attaches the controller's event handlers to the view's GUI elements
 /// </summary>
 /// <param name="controller">An instance of the controller which will contain the event handlers</param>
 public void ConnectEventHandlers(PassOneController controller)
 {
     MainForm.ConnectEventHandlers(controller);
     RegisterForm.ConnectEventHandlers(this);
     LoginForm.ConnectEventHandlers(this);
 }
        public void MyTestInitialize()
        {
            if (!Directory.Exists(Path + "data"))
                Directory.CreateDirectory(Path + "data");
            Stream = new FileStream(Path + "data\\users.bin", FileMode.Create, FileAccess.ReadWrite);
            _model = new PassOneModel();
            _view = new PassOneView();
            _controller = new PassOneController();

            _model.View = _view;
            _view.Controller = _controller;
            _controller.Model = _model;
            _controller.ModelState = ModelStates.Login;
            _view.ConnectEventHandlers(_controller);
        }