/** * Aktualisiert die Optionen in der Ansicht */ private void UpdateActiveSyncOptionsView() { ActiveSyncOptions aso = OptionsAccess.ActiveSyncOptions; this.checkBoxConnectToMobile.IsChecked = aso.UseDevice; this.textBoxTimeout.Text = Convert.ToString(aso.ConnectingTimeOut); this.textBoxDiversityMobileDB.Text = aso.DiversityMobileDBPath; this.textBoxTaxonNamesDB.Text = aso.TaxonNamesDBPath; }
private void copyPictures(ActiveSyncOptions aso) { string mobilePictureDirectory = Path.GetDirectoryName(aso.DiversityMobileDBPath) + "\\pictures"; if (Directory.Exists(mobilePictureDirectory)) { foreach (var picture in Directory.GetFiles(mobilePictureDirectory)) { copyFromDevice(OptionsAccess.getFolderPath(ApplicationFolder.Pictures) + "\\" + Path.GetFileName(picture), picture, aso.UseDevice); } } }
public void connectToMobileDB(ActiveSyncOptions aso) { try { copyPictures(aso); } catch (Exception ex) { _Log.ErrorFormat("Picture Copy Error: {0}", ex.Message != null ? ex.Message : ""); } //Lokale Kopie der Datenbanken anlegen localDivDBPath = OptionsAccess.getFolderPath(ApplicationFolder.CurrentTransaction) + "\\" + Path.GetFileName(aso.DiversityMobileDBPath); localTaxDBPath = OptionsAccess.getFolderPath(ApplicationFolder.CurrentTransaction) + "\\" + Path.GetFileName(aso.TaxonNamesDBPath); bool divCopySuccess = false; bool taxCopySuccess = false; try { divCopySuccess = copyFromDevice(localDivDBPath, aso.DiversityMobileDBPath, aso.UseDevice); if (divCopySuccess == false) { throw new Exception(); } } catch (Exception divEx) { _Log.ErrorFormat("Copy Failure MobileDB: {0}", divEx.Message != null ? divEx.Message : ""); } try { taxCopySuccess = copyFromDevice(localTaxDBPath, aso.TaxonNamesDBPath, aso.UseDevice); if (taxCopySuccess == false) { throw new Exception(); } } catch (Exception taxEx) { _Log.ErrorFormat("Copy Failure TaxonNames: {0}", taxEx.Message != null ? taxEx.Message : ""); } if (divCopySuccess && taxCopySuccess) { _Log.Info("Database working copy created."); connectMobile(); } }
/** * Aktualisiert die angezeigten Active-Sync-Einstellungen */ public void UpdateActiveSyncOptionsView() { ILanguage lf = OptionsAccess.Language; ActiveSyncOptions aso = OptionsAccess.ActiveSyncOptions; if (aso.UseDevice == true) { this.labelConnectToMobileDevice2.Content = lf.getLanguageString(939); } else { this.labelConnectToMobileDevice2.Content = lf.getLanguageString(940); } this.labelTimeOut2.Content = aso.ConnectingTimeOut; this.labelDiversityMobileDB2.Content = aso.DiversityMobileDBPath; this.labelTaxonNamesDB2.Content = aso.TaxonNamesDBPath; }
/** * Speichert die Optionen ab */ private void SaveActiveSyncOptions() { ActiveSyncOptions aso = OptionsAccess.ActiveSyncOptions; if (this.checkBoxConnectToMobile.IsChecked == null || this.checkBoxConnectToMobile.IsChecked == false) { aso.UseDevice = false; } else { aso.UseDevice = true; } aso.ConnectingTimeOut = Convert.ToInt32(this.textBoxTimeout.Text); aso.DiversityMobileDBPath = this.textBoxDiversityMobileDB.Text; aso.TaxonNamesDBPath = this.textBoxTaxonNamesDB.Text; OptionsAccess.ActiveSyncOptions = aso; DialogResult = true; }