Example #1
0
 private string GetDirectory(IPhoto photo, AlbumeSettings settings)
 {
     var date = photo.DateTaken ?? this.dateTimeService.GetCurrentDateTime();
     var format = photo.DateTaken != null ? settings.PhotoTakenDateToPathFormat : settings.EmptyDatePathFormat;
     return Path.Combine(settings.AlbumeRootPath, string.Format(format, date));
 }
        /// <summary>
        /// Сохранение настроек
        /// </summary>
        /// <param name="settings">
        /// Настройки
        /// </param>
        public void SaveSettings(AlbumeSettings settings)
        {
            RegistryKey registryKey = Registry.LocalMachine.CreateSubKey(RegistryKey);
            if (registryKey == null)
            {
                throw new PhotoToolException(string.Format("Не удалось создать ключ реестра {0}", RegistryKey));
            }

            registryKey.SetValue(AlbumeRootPathValue, settings.AlbumeRootPath);
            registryKey.SetValue(PhotoTakenDateToPathFormatValue, settings.PhotoTakenDateToPathFormat);
            registryKey.SetValue(EmptyDatePathFormatValue, settings.EmptyDatePathFormat);
            registryKey.SetValue(DeviceIdValue, settings.DeviceId ?? string.Empty);
        }
Example #3
0
 /// <summary>
 /// Initializes a new instance of the <see cref="SettingsForm"/> class.
 /// </summary>
 public SettingsForm()
 {
     this.InitializeComponent();
     this.settings = AlbumeSettingsService.Current.GetSettings() ?? new AlbumeSettings();
     this.UpdateControls();
 }
Example #4
0
 public void SaveSettings(AlbumeSettings settings)
 {
 }