Example #1
0
        private void mMainProfileOpen_Click(object sender, EventArgs e)
        {
            string p = GetProfile(config.profile);

            if ((p != null) && (p.Length > 0))
            {
                string db = palm.GetBackupDir(p) + "\\iSec_iSecur_Data.pdb";

                if (File.Exists(db) == true)
                {
                    config.profile   = p;
                    config.currentDB = db;
                    LoadDatabase(db);
                }
                else
                {
                    MessageBox.Show("The selected user has not yet HotSync'ed the iSecur database.", "Error", MessageBoxButtons.OK, MessageBoxIcon.Stop);
                }
            }
        }
Example #2
0
        public fMain()
        {
            InitializeComponent();

            config = new Config();
            config.Load();

            if (Environment.OSVersion.ToString().IndexOf("Windows") > -1)
            {
                palm = new Palm();
                palm.GetUsers();

                if (palm.users != null)
                {
                    mMainProfileOpen.Enabled = true;
                }

                if ((config.currentDB == null) || (config.currentDB.Length == 0))
                {
                    if ((config.profile == null) || (config.profile.Length == 0))
                    {
                        config.profile = GetProfile(null);
                    }

                    if ((config.profile != null) && (config.profile.Length > 0))
                    {
                        config.currentDB = palm.GetBackupDir(config.profile) + "\\iSec_iSecur_Data.pdb";

                        if (File.Exists(config.currentDB) == false)
                        {
                            MessageBox.Show("The selected user has not yet HotSync'ed the iSecur database - please locate the database file manually.", "Error", MessageBoxButtons.OK, MessageBoxIcon.Stop);
                            config.currentDB = "";
                        }
                    }
                }
            }

            if ((config.currentDB == null) || (config.currentDB.Length == 0))
            {
                if (ofdDatabase.ShowDialog() == DialogResult.OK)
                {
                    config.currentDB = ofdDatabase.FileName;
                }
            }

            if ((config.currentDB != null) && (config.currentDB.Length > 0))
            {
                if (File.Exists(config.currentDB) == false)
                {
                    if (ofdDatabase.ShowDialog() == DialogResult.OK)
                    {
                        LoadDatabase(ofdDatabase.FileName);
                    }
                }
                else
                {
                    LoadDatabase(config.currentDB);
                }
            }

            switch (config.showIdx)
            {
            case 1:
                rbSecrets.Checked = true;
                break;

            case 2:
                rbTemplates.Checked = true;
                break;

            default:
                rbAll.Checked = true;
                break;
            }
        }