//------------------------------------------------------------------------------
// <copyright company="Telligent Systems">
//     Copyright (c) Telligent Systems Corporation.  All rights reserved.
// </copyright> 
//------------------------------------------------------------------------------

using System;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.ComponentModel;

using CommunityServer;
using CommunityServer.Components;
using CommunityServer.Controls;


namespace CommunityServer.Controls
{
	/// <summary>
	/// Summary description for AccountActivationRadioButtonList.
	/// </summary>
	public class AccountActivationRadioButtonList : RadioButtonList
	{
		public AccountActivationRadioButtonList() {
			this.Items.Add( new ListItem( ResourceManager.GetString("MemberSettings_ActivateMode_Automatic"), AccountActivation.Automatic.ToString() ));
			// only add this option if the admin hasn't turned off email support
			if( CSContext.Current.SiteSettings.EnableEmail )
			{
				this.Items.Add( new ListItem( ResourceManager.GetString("MemberSettings_ActivateMode_Email"), AccountActivation.Email.ToString() ));
				this.Items.Add( new ListItem( ResourceManager.GetString("MemberSettings_ActivateMode_InvitationOnly"), AccountActivation.InvitationOnly.ToString() ));
			}

			this.Items.Add( new ListItem( ResourceManager.GetString("MemberSettings_ActivateMode_Admin"), AccountActivation.AdminApproval.ToString() ));
		}

		public new AccountActivation SelectedValue {
			get { return (AccountActivation)Enum.Parse( typeof( AccountActivation ), base.SelectedValue ); }
			set { base.SelectedValue = value.ToString(); }
		}

	}
}
