Click here to Skip to main content
15,892,927 members
Articles / Web Development / ASP.NET

Photo album browsing control

Rate me:
Please Sign up or sign in to vote.
4.64/5 (30 votes)
1 Dec 20044 min read 344.5K   6.8K   138  
A web control that allows photo album browsing
using System;
using System.IO;

namespace Codefresh.PhotoBrowserLibrary
{
	/// <summary>
	/// Class that represents an individual photo comment.
	/// </summary>
	[Serializable]
	public class Comment : PhotoObjectBase
	{
		private string name;
		private string comment;
		private DateTime dateAdded;

		/// <summary>
		/// Initialises a new Comment object. Used by the PhotoBrowser web control
		/// when adding a new comment.
		/// </summary>
		/// <param name="name">The name of the person entering the comment.</param>
		/// <param name="comment">The comment itself.</param>
		public Comment(string name, string comment)
		{
			this.name = name;
			this.comment = comment;
			this.dateAdded = DateTime.Now;
		}

		/// <summary>
		/// Initialises a new Comment object. Used by CommentDB when retrieving a list
		/// of comments of the database. 
		/// </summary>
		/// <param name="token">A reference to the current SessionToken object.</param>
		/// <param name="name">The name of the person entering the comment.</param>
		/// <param name="comment">The comment itself.</param>
		/// <param name="dateAdded">The date that the comment was added.</param>
		internal Comment(SessionToken token, int id, string name, string comment, DateTime dateAdded) : this(name, comment)
		{
			// override the default value
			this.dateAdded = dateAdded;
			this.SetId(id);
		}

		/// <value>The date the comment was added to the photo.</value>
		public DateTime DateAdded
		{
			get
			{
				return dateAdded;
			}
		}

		/// <value>The name of the person who entered the comment.</value>
		public string Name
		{
			get
			{
				return name;
			}
		}

		/// <value>The comment text itself.</value>
		public string CommentText
		{
			get
			{
				return comment;
			}
		}

	}
}

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 has no explicit license attached to it but may contain usage terms in the article text or the download files themselves. If in doubt please contact the author via the discussion board below.

A list of licenses authors might use can be found here


Written By
Web Developer
United Kingdom United Kingdom
I'm currently working in London working on a variety of technologies.

Comments and Discussions