/// <summary> /// Clears the in-memory copy of the current set of gallery control settings. This will force a database retrieval the next time /// they are requested. /// </summary> public static void ClearGalleryControlSettingsCache() { _galleryControlSettings = null; }
/// <summary> /// Loads the settings for all galleries in the application. Guaranteed to not return null. /// </summary> /// <returns>Returns an <see cref="IGallerySettingsCollection" /> containing settings for all galleries in the application.</returns> public static IGalleryControlSettingsCollection LoadGalleryControlSettings() { if (_galleryControlSettings == null) { _galleryControlSettings = new GalleryControlSettingsCollection(); lock (_galleryControlSettings) { if (_galleryControlSettings.Count == 0) { // Ensure that writes related to instantiation are flushed. System.Threading.Thread.MemoryBarrier(); _galleryControlSettings.AddRange(GalleryControlSettings.RetrieveGalleryControlSettingsFromDataStore()); } } } return _galleryControlSettings; }