Click here to Skip to main content
15,895,557 members
Articles / Web Development / HTML

Gallery Server Pro - An ASP.NET Gallery for Sharing Photos, Video, Audio and Other Media

Rate me:
Please Sign up or sign in to vote.
4.86/5 (131 votes)
18 Oct 2013GPL331 min read 829.1K   539  
Gallery Server Pro is a complete, stable ASP.NET gallery for sharing photos, video, audio and other media. This article presents the overall architecture and major features.
using System.Configuration;

namespace GalleryServerPro.Configuration
{
	/// <summary>
	/// The galleryServerPro custom configuration section in web.config.
	/// </summary>
	public class GalleryServerProConfigSettings : ConfigurationSection
	{
		/// <summary>
		/// Gets a reference to the name attribute of the galleryServerPro section of web.config. This value is optional and only
		/// used by the DotNetNuke install/uninstall procedure as a means of uniquely identifying the section.
		/// </summary>
		[ConfigurationProperty("name", DefaultValue = "Gallery Server Pro", IsRequired = false)]
		[StringValidator(MinLength = 1)]
		public string Name
		{
			get
			{
				return (string)base["name"];
			}
		}

		/// <summary>
		/// Gets a reference to the core element defined within the galleryServerPro section of galleryServerPro.config.
		/// </summary>
		[ConfigurationProperty("core", IsDefaultCollection = false, IsRequired = true)]
		public Core Core
		{
			get
			{
				return (Core)base["core"];
			}
		}

		/// <summary>
		/// Gets a reference to the dataProvider element defined within the galleryServerPro section of galleryServerPro.config.
		/// </summary>
		[ConfigurationProperty("dataProvider", IsDefaultCollection = false, IsRequired = true)]
		public DataProvider DataProvider
		{
			get
			{
				return (DataProvider)base["dataProvider"];
			}
		}
	}

	/// <summary>
	/// Provides read/write access to the galleryServerPro/core section in web.config.
	/// </summary>
	public class Core : ConfigurationElement
	{
		#region Public Properties

		/// <summary>
		/// Gets the path, relative to the web site root, to the directory containing the Gallery Server Pro user controls and 
		/// other resources. May contain leading or trailing slashes (either forward or backward slashes).
		/// Examples: "gs", "DesktopModules\GalleryServerPro\gs"
		/// </summary>
		/// <remarks>The path is returned exactly how it appears in the configuration file.</remarks>
		[ConfigurationProperty("galleryResourcesPath", IsRequired = false)]
		public string GalleryResourcesPath
		{
			get { return this["galleryResourcesPath"].ToString(); }
		}

		#endregion
	}

	/// <summary>
	/// Provides read/write access to the galleryServerPro/dataProvider section of web.config.
	/// </summary>
	public class DataProvider : ConfigurationElement
	{

		/// <summary>
		/// Gets a reference to the providers defined within the galleryServerPro/dataProvider section of web.config.
		/// </summary>
		[ConfigurationProperty("providers")]
		public ProviderSettingsCollection Providers
		{
			get
			{
				return (ProviderSettingsCollection)base["providers"];
			}
		}

		/// <summary>
		/// Gets a reference to the default data provider defined in the galleryServerPro/gataProvider section of web.config.
		/// </summary>
		[ConfigurationProperty("defaultProvider")]
		public string DefaultProvider
		{
			get
			{
				return (string)base["defaultProvider"];
			}
		}
	}
}

By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.

If a file you wish to view isn't highlighted, and is a text file (not binary), please let us know and we'll add colourisation support for it.

License

This article, along with any associated source code and files, is licensed under The GNU General Public License (GPLv3)


Written By
Software Developer (Senior) Tech Info Systems
United States United States
I have nearly 20 years of industry experience in software development, architecture, and Microsoft Office products. My company Tech Info Systems provides custom software development services for corporations, governments, and other organizations. Tech Info Systems is a registered member of the Microsoft Partner Program and I am a Microsoft Certified Professional Developer (MCPD).

I am the creator and lead developer of Gallery Server Pro, a free, open source ASP.NET gallery for sharing photos, video, audio, documents, and other files over the web. It has been developed over several years and has involved thousands of hours. The end result is a robust, configurable, and professional grade gallery that can be integrated into your web site, whether you are a large corporation, small business, professional photographer, or a local church.

Comments and Discussions