Example #1
0
        private void buttonEditDB_Click(object sender, EventArgs e)
        {
            bool isStandardDatabase = false;
            int  saveIndex          = -1;

            if (listBoxPicasaDBs.SelectedIndex == -1 ||
                listBoxPicasaDBs.SelectedIndex >= _settings.picasaDBs.Count)
            {
                MessageBox.Show("Please choose a picasa database from the list first");
                return;
            }
            if (_settings.picasaDBs[listBoxPicasaDBs.SelectedIndex].IsStandardDB == true)
            {
                isStandardDatabase = true;
            }

            PicasaDB picasaDB = _settings.picasaDBs[listBoxPicasaDBs.SelectedIndex];

            saveIndex = listBoxPicasaDBs.SelectedIndex;

            CreatePicasaDBForm createPicasaDB = new CreatePicasaDBForm(picasaDB, _appSettingsDir, _settings, isStandardDatabase);

            DialogResult result = createPicasaDB.ShowDialog();

            // If OK, update the picasaDB to the edited version
            if (result == DialogResult.OK)
            {
                _settings.picasaDBs[listBoxPicasaDBs.SelectedIndex] = createPicasaDB.PicasaDB;
                ReFillPicasaDBList(true);
                listBoxPicasaDBs.SelectedIndex = saveIndex;
                //Map the directory below the PicasaStarter Directory to the Virtual drive
                // if the drive is not mapped and virtual drive is enabled
                bool xxx = IOHelper.MapVirtualDrive(_settings.picasaDBs[listBoxPicasaDBs.SelectedIndex], _appSettingsDir);
                if (xxx)
                {
                    MessageBox.Show("Error Mapping Virtual Drive" +
                                    "\nCheck the Virtual Drive settings and Path.");
                }
            }
        }
Example #2
0
        private void buttonAddDB_Click(object sender, EventArgs e)
        {
            //Unmap old Virtual Drive if it was mapped
            bool xyz = false;

            xyz = IOHelper.UnmapVDrive();
            CreatePicasaDBForm createPicasaDB = new CreatePicasaDBForm(_appSettingsDir, _settings);

            DialogResult result = createPicasaDB.ShowDialog();

            // If OK, add the picasaDB as defined in the createPicasaDBForm...
            if (result == DialogResult.OK)
            {
                _settings.picasaDBs.Add(createPicasaDB.PicasaDB);
                ReFillPicasaDBList(true);
                bool xxx = IOHelper.MapVirtualDrive(_settings.picasaDBs[listBoxPicasaDBs.SelectedIndex], _appSettingsDir);
                if (xxx)
                {
                    MessageBox.Show("Error Mapping Virtual Drive" +
                                    "\nCheck the Virtual Drive settings and Path.");
                }
            }
        }
Example #3
0
        private void buttonEditDB_Click(object sender, EventArgs e)
        {
            bool isStandardDatabase = false;
            int saveIndex = -1;

            if (listBoxPicasaDBs.SelectedIndex == -1
                    || listBoxPicasaDBs.SelectedIndex >= _settings.picasaDBs.Count)
            {
                MessageBox.Show("Please choose a picasa database from the list first");
                return;
            }
            if (_settings.picasaDBs[listBoxPicasaDBs.SelectedIndex].IsStandardDB == true)
                isStandardDatabase = true;

            PicasaDB picasaDB = _settings.picasaDBs[listBoxPicasaDBs.SelectedIndex];
            saveIndex = listBoxPicasaDBs.SelectedIndex;

            CreatePicasaDBForm createPicasaDB = new CreatePicasaDBForm(picasaDB, _appSettingsDir, _settings, isStandardDatabase);

            DialogResult result = createPicasaDB.ShowDialog();

            // If OK, update the picasaDB to the edited version
            if (result == DialogResult.OK)
            {
                _settings.picasaDBs[listBoxPicasaDBs.SelectedIndex] = createPicasaDB.PicasaDB;
                ReFillPicasaDBList(true);
                listBoxPicasaDBs.SelectedIndex = saveIndex;
                //Map the directory below the PicasaStarter Directory to the Virtual drive
                // if the drive is not mapped and virtual drive is enabled
                bool xxx = IOHelper.MapVirtualDrive(_settings.picasaDBs[listBoxPicasaDBs.SelectedIndex], _appSettingsDir);
                if (xxx)
                {
                    MessageBox.Show("Error Mapping Virtual Drive" +
                     "\nCheck the Virtual Drive settings and Path.");
                }

            }
        }
Example #4
0
        private void buttonAddDB_Click(object sender, EventArgs e)
        {
            //Unmap old Virtual Drive if it was mapped
            bool xyz = false;
            xyz = IOHelper.UnmapVDrive();
            CreatePicasaDBForm createPicasaDB = new CreatePicasaDBForm(_appSettingsDir, _settings);

            DialogResult result = createPicasaDB.ShowDialog();

            // If OK, add the picasaDB as defined in the createPicasaDBForm...
            if (result == DialogResult.OK)
            {
                _settings.picasaDBs.Add(createPicasaDB.PicasaDB);
                ReFillPicasaDBList(true);
                bool xxx = IOHelper.MapVirtualDrive(_settings.picasaDBs[listBoxPicasaDBs.SelectedIndex], _appSettingsDir);
                if (xxx)
                {
                    MessageBox.Show("Error Mapping Virtual Drive" +
                     "\nCheck the Virtual Drive settings and Path.");
                }

            }
        }