Esempio n. 1
0
        private void CreateDatabase()
        {
            Globals.CurrentPasswordDb = SaveAsDatabase();

            _repo = new PasswordDatabaseRepository(Globals.CurrentPasswordDb);
            //_data = _repo.Read();
            _data = new PasswordDatabase();

            var dbSetupForm = new PasswordForm();

            if (dbSetupForm.ShowDialog() == DialogResult.OK)
            {
                _data.Password = dbSetupForm.Password;
                _data.Items.Add(new Entry
                {
                    Title = "Sample",
                    Notes = "Notes go here"
                            //Created = DateTime.Now,
                            //Modified = DateTime.Now
                });

                SaveDatabase();
            }

            LoadData();
        }
Esempio n. 2
0
        public MainForm()
        {
            InitializeComponent();

            if (!string.IsNullOrEmpty(Globals.CurrentPasswordDb))
            {
                _repo = new PasswordDatabaseRepository(Globals.CurrentPasswordDb);
                _data = _repo.Read();

                var loginDialog = new OpenDatabaseForm(_data);

                if (loginDialog.ShowDialog() == DialogResult.OK)
                {
                    LoadData();
                }
            }
        }
Esempio n. 3
0
        public MainForm()
        {
            InitializeComponent();

            if (!string.IsNullOrEmpty(Globals.CurrentPasswordDb))
            {
                _repo = new PasswordDatabaseRepository(Globals.CurrentPasswordDb);
                _data = _repo.Read();

                var loginDialog = new OpenDatabaseForm(_data);

                if (loginDialog.ShowDialog() == DialogResult.OK)
                {
                    LoadData();
                }
            }
        }
Esempio n. 4
0
        private void OpenDatabase()
        {
            var fileDialog = new OpenFileDialog();

            fileDialog.Filter           = "password database (*.mpd)|*.mpd|All Files (*.*)|*.*";
            fileDialog.DefaultExt       = "*.mpd";
            fileDialog.FilterIndex      = 1;
            fileDialog.RestoreDirectory = true;

            if (fileDialog.ShowDialog() == DialogResult.OK)
            {
                var _filename = fileDialog.FileName;
                _repo = new PasswordDatabaseRepository(_filename);
                _data = _repo.Read();

                var loginDialog = new OpenDatabaseForm(_data);
                if (loginDialog.ShowDialog() == DialogResult.OK)
                {
                    Globals.CurrentPasswordDb = _filename;

                    LoadData();
                }
            }
        }
Esempio n. 5
0
        private void importToolStripMenuItem_Click(object sender, EventArgs e)
        {
            var fileDialog = new OpenFileDialog();

            fileDialog.Filter           = "KeePass CSV (1.x) (*.csv)|*.csv|All Files (*.*)|*.*";
            fileDialog.DefaultExt       = "*.csv";
            fileDialog.FilterIndex      = 1;
            fileDialog.RestoreDirectory = true;

            if (fileDialog.ShowDialog() == DialogResult.OK)
            {
                var _filename = fileDialog.FileName;
                _repo = new PasswordDatabaseRepository(_filename);
                _data = _repo.Read();

                var loginDialog = new OpenDatabaseForm(_data);
                if (loginDialog.ShowDialog() == DialogResult.OK)
                {
                    Globals.CurrentPasswordDb = _filename;

                    LoadData();
                }
            }
        }
Esempio n. 6
0
        private void CreateDatabase()
        {
            Globals.CurrentPasswordDb = SaveAsDatabase();

            _repo = new PasswordDatabaseRepository(Globals.CurrentPasswordDb);
            //_data = _repo.Read();
            _data = new PasswordDatabase();

            var dbSetupForm = new PasswordForm();
            if (dbSetupForm.ShowDialog() == DialogResult.OK)
            {
                _data.Password = dbSetupForm.Password;
                _data.Items.Add(new Entry
                {
                    Title = "Sample",
                    Notes = "Notes go here"
                    //Created = DateTime.Now,
                    //Modified = DateTime.Now
                });

                SaveDatabase();
            }

            LoadData();
        }
Esempio n. 7
0
        private void OpenDatabase()
        {
            var fileDialog = new OpenFileDialog();

            fileDialog.Filter = "password database (*.mpd)|*.mpd|All Files (*.*)|*.*";
            fileDialog.DefaultExt = "*.mpd";
            fileDialog.FilterIndex = 1;
            fileDialog.RestoreDirectory = true;

            if (fileDialog.ShowDialog() == DialogResult.OK)
            {
                var _filename = fileDialog.FileName;
                _repo = new PasswordDatabaseRepository(_filename);
                _data = _repo.Read();

                var loginDialog = new OpenDatabaseForm(_data);
                if (loginDialog.ShowDialog() == DialogResult.OK)
                {
                    Globals.CurrentPasswordDb = _filename;

                    LoadData();
                }
            }
        }
Esempio n. 8
0
        private void importToolStripMenuItem_Click(object sender, EventArgs e)
        {
            var fileDialog = new OpenFileDialog();

            fileDialog.Filter = "KeePass CSV (1.x) (*.csv)|*.csv|All Files (*.*)|*.*";
            fileDialog.DefaultExt = "*.csv";
            fileDialog.FilterIndex = 1;
            fileDialog.RestoreDirectory = true;

            if (fileDialog.ShowDialog() == DialogResult.OK)
            {
                var _filename = fileDialog.FileName;
                _repo = new PasswordDatabaseRepository(_filename);
                _data = _repo.Read();

                var loginDialog = new OpenDatabaseForm(_data);
                if (loginDialog.ShowDialog() == DialogResult.OK)
                {
                    Globals.CurrentPasswordDb = _filename;

                    LoadData();
                }
            }
        }
Esempio n. 9
0
 public OpenDatabaseForm(PasswordDatabase db)
 {
     _db = db;
     InitializeComponent();
 }
Esempio n. 10
0
 public OpenDatabaseForm(PasswordDatabase db)
 {
     _db = db;
     InitializeComponent();
 }