Пример #1
0
 /// <summary>
 /// Read all standard settings from registry
 /// </summary>
 public void ReadSettingsFromRegistry()
 {
     using (RegistryKey registryKey = this.OpenRegistryKey())
     {
         this.AudioFeedback       = registryKey.GetBoolean(Constant.WindowRegistryKeys.AudioFeedback, false);
         this.BookmarkScale       = new Point(registryKey.GetDouble(Constant.WindowRegistryKeys.BookmarkScaleX, 1.0), registryKey.GetDouble(Constant.WindowRegistryKeys.BookmarkScaleY, 1.0));
         this.BookmarkTranslation = new Point(registryKey.GetDouble(Constant.WindowRegistryKeys.BookmarkTranslationX, 1.0), registryKey.GetDouble(Constant.WindowRegistryKeys.BookmarkTranslationY, 1.0));
         this.BoundingBoxAnnotate = registryKey.GetBoolean(Constant.WindowRegistryKeys.BoundingBoxAnnotate, false);
         this.BoundingBoxColorBlindFriendlyColors = registryKey.GetBoolean(Constant.WindowRegistryKeys.BoundingBoxColorBlindFriendlyColors, false);
         this.CSVDateTimeOptions = registryKey.GetEnum <CSVDateTimeOptionsEnum>(Constant.WindowRegistryKeys.CSVDateTimeOptions, CSVDateTimeOptionsEnum.DateTimeWithoutTSeparatorColumn);
         if (this.CSVDateTimeOptions == CSVDateTimeOptionsEnum.DateTimeUTCWithOffset)
         {
             // We no longer use the above option, so revert it to the default CSV setting
             this.CSVDateTimeOptions        = CSVDateTimeOptionsEnum.DateAndTimeColumns;
             this.CSVInsertSpaceBeforeDates = true;
         }
         this.CSVInsertSpaceBeforeDates            = registryKey.GetBoolean(Constant.WindowRegistryKeys.CSVInsertSpaceBeforeDates, true);
         this.CustomSelectionTermCombiningOperator = registryKey.GetEnum <CustomSelectionOperatorEnum>(Constant.WindowRegistryKeys.CustomSelectionTermCombiningOperator, CustomSelectionOperatorEnum.And);
         this.DarkPixelRatioThreshold          = registryKey.GetDouble(Constant.WindowRegistryKeys.DarkPixelRatio, Constant.ImageValues.DarkPixelRatioThresholdDefault);
         this.DarkPixelThreshold               = registryKey.GetInteger(Constant.WindowRegistryKeys.DarkPixelThreshold, Constant.ImageValues.DarkPixelThresholdDefault);
         this.DeleteFolderManagement           = (DeleteFolderManagementEnum)registryKey.GetInteger(Constant.WindowRegistryKeys.DeleteFolderManagementValue, (int)DeleteFolderManagementEnum.ManualDelete);
         this.EpisodeTimeThreshold             = registryKey.GetTimeSpanAsSeconds(Constant.WindowRegistryKeys.EpisodeTimeThreshold, TimeSpan.FromSeconds(Constant.EpisodeDefaults.TimeThresholdDefault));
         this.EpisodeMaxRangeToSearch          = registryKey.GetInteger(Constant.WindowRegistryKeys.EpisodeMaxRangeToSearch, Constant.EpisodeDefaults.DefaultRangeToSearch);
         this.FilePlayerSlowValue              = registryKey.GetDouble(Constant.WindowRegistryKeys.FilePlayerSlowValue, Constant.FilePlayerValues.PlaySlowDefault.TotalSeconds);
         this.FilePlayerFastValue              = registryKey.GetDouble(Constant.WindowRegistryKeys.FilePlayerFastValue, Constant.FilePlayerValues.PlayFastDefault.TotalSeconds);
         this.MagnifyingGlassOffsetLensEnabled = registryKey.GetBoolean(Constant.WindowRegistryKeys.MagnifyingGlassOffsetLensEnabled, true);
         this.MagnifyingGlassZoomFactor        = registryKey.GetDouble(Constant.WindowRegistryKeys.MagnifyingGlassZoomFactor, Constant.MarkableCanvas.MagnifyingGlassDefaultZoom);
         this.MetadataAskOnLoad                               = registryKey.GetBoolean(Constant.WindowRegistryKeys.MetadataAskOnLoad, false);
         this.MostRecentCheckForUpdates                       = registryKey.GetDateTime(Constant.WindowRegistryKeys.MostRecentCheckForUpdates, DateTime.Now);
         this.MostRecentImageSets                             = registryKey.GetRecencyOrderedList(Constant.WindowRegistryKeys.MostRecentlyUsedImageSets);
         this.OffsetLensZoomFactor                            = registryKey.GetDouble(Constant.WindowRegistryKeys.OffsetLensZoomFactor, Constant.MarkableCanvas.OffsetLensDefaultZoom);
         this.QuickPasteWindowPosition                        = registryKey.GetRect(Constant.WindowRegistryKeys.QuickPasteWindowPosition, new Rect(0.0, 0.0, 0.0, 0.0));
         this.SuppressAmbiguousDatesDialog                    = registryKey.GetBoolean(Constant.WindowRegistryKeys.SuppressAmbiguousDatesDialog, false);
         this.SuppressCsvExportDialog                         = registryKey.GetBoolean(Constant.WindowRegistryKeys.SuppressCsvExportDialog, false);
         this.SuppressCsvImportPrompt                         = registryKey.GetBoolean(Constant.WindowRegistryKeys.SuppressCsvImportPrompt, false);
         this.SuppressHowDuplicatesWork                       = registryKey.GetBoolean(Constant.WindowRegistryKeys.SuppressHowDuplicatesWorkDialog, false);
         this.SuppressMergeDatabasesPrompt                    = registryKey.GetBoolean(Constant.WindowRegistryKeys.SuppressMergeDatabasesDialog, false);
         this.SuppressOpeningMessageDialog                    = registryKey.GetBoolean(Constant.WindowRegistryKeys.SuppressOpeningMessageDialog, false);
         this.SuppressSelectedAmbiguousDatesPrompt            = registryKey.GetBoolean(Constant.WindowRegistryKeys.SuppressSelectedAmbiguousDatesPrompt, false);
         this.SuppressSelectedCsvExportPrompt                 = registryKey.GetBoolean(Constant.WindowRegistryKeys.SuppressSelectedCsvExportPrompt, false);
         this.SuppressSelectedDarkThresholdPrompt             = registryKey.GetBoolean(Constant.WindowRegistryKeys.SuppressSelectedDarkThresholdPrompt, false);
         this.SuppressSelectedDateTimeFixedCorrectionPrompt   = registryKey.GetBoolean(Constant.WindowRegistryKeys.SuppressSelectedDateTimeFixedCorrectionPrompt, false);
         this.SuppressSelectedDateTimeLinearCorrectionPrompt  = registryKey.GetBoolean(Constant.WindowRegistryKeys.SuppressSelectedDateTimeLinearCorrectionPrompt, false);
         this.SuppressSelectedDaylightSavingsCorrectionPrompt = registryKey.GetBoolean(Constant.WindowRegistryKeys.SuppressSelectedDaylightSavingsCorrectionPrompt, false);
         this.SuppressSelectedPopulateFieldFromMetadataPrompt = registryKey.GetBoolean(Constant.WindowRegistryKeys.SuppressSelectedPopulateFieldFromMetadataPrompt, false);
         this.SuppressSelectedRereadDatesFromFilesPrompt      = registryKey.GetBoolean(Constant.WindowRegistryKeys.SuppressSelectedRereadDatesFromFilesPrompt, false);
         this.SuppressSelectedSetTimeZonePrompt               = registryKey.GetBoolean(Constant.WindowRegistryKeys.SuppressSelectedSetTimeZonePrompt, false);
         this.TabOrderIncludeDateTime                         = registryKey.GetBoolean(Constant.WindowRegistryKeys.TabOrderIncludeDateTime, false);
         this.TabOrderIncludeDeleteFlag                       = registryKey.GetBoolean(Constant.WindowRegistryKeys.TabOrderIncludeDeleteFlag, false);
         this.TabOrderIncludeImageQuality                     = registryKey.GetBoolean(Constant.WindowRegistryKeys.TabOrderIncludeImageQuality, false);
         this.Throttles.SetDesiredImageRendersPerSecond(registryKey.GetDouble(Constant.WindowRegistryKeys.DesiredImageRendersPerSecond, Constant.ThrottleValues.DesiredMaximumImageRendersPerSecondDefault));
         this.TimelapseWindowPosition = registryKey.GetRect(Constant.WindowRegistryKeys.TimelapseWindowPosition, new Rect(0.0, 0.0, 1350.0, 900.0));
         this.UseDetections           = true; // registryKey.GetBoolean(Constant.WindowRegistryKeys.UseDetections, false);
     }
 }