using System;
using System.Text;
using System.Security.Permissions;
using System.Runtime.Serialization;
using OpenADK.Library;
using OpenADK.Library.Global;
using OpenADK.Library.us.Common;

namespace OpenADK.Library.us.Assessment{

/// <summary>A Choice</summary>
/// <remarks>
///
/// <para>Author: Generated by adkgen</para>
/// <para>Version: 2.6</para>
/// <para>Since: 2.2</para>
/// </remarks>
[Serializable]
public class Choice : SifKeyedElement
{
	/// <summary>
	/// Creates an instance of a Choice
	/// </summary>
	public Choice() : base ( AssessmentDTD.CHOICE ){}

	/// <summary>
	/// Constructor that accepts values for all mandatory fields
	/// </summary>
	///<param name="choiceContent">The text of the choice, such as true, 27, or Important economic and social factors.</param>
	///
	public Choice( ContentElement choiceContent ) : base( AssessmentDTD.CHOICE )
	{
		this.ChoiceContent = choiceContent;
	}

	/// <summary>
	/// Constructor used by the .Net Serialization formatter
	/// </summary>
	[SecurityPermission( SecurityAction.Demand, SerializationFormatter=true )] 
	protected Choice( SerializationInfo info, StreamingContext context ) : base( info, context ) {} 
	/// <summary>
	/// Gets the metadata fields that make up the key of this object
	/// </summary>
	/// <value>
	/// an array of metadata fields that make up the object's key
	/// </value>
	public override IElementDef[] KeyFields {
		get { return new IElementDef[] { AssessmentDTD.CHOICE_CHOICECONTENT }; }
	}

	/// <summary>
	/// Gets or sets the value of the <c>&lt;ChoiceLabel&gt;</c> element.
	/// </summary>
	/// <value> The <c>ChoiceLabel</c> element of this object.</value>
	/// <remarks>
	/// <para>The SIF specification defines the meaning of this element as: "Identifier for the choice."</para>
	/// <para>Version: 2.6</para>
	/// <para>Since: 2.2</para>
	/// </remarks>
	public string ChoiceLabel
	{
		get
		{
			return (string) GetSifSimpleFieldValue( AssessmentDTD.CHOICE_CHOICELABEL ) ;
		}
		set
		{
			SetFieldValue( AssessmentDTD.CHOICE_CHOICELABEL, new SifString( value ), value );
		}
	}

	/// <summary>
	/// Gets or sets the value of the <c>&lt;ChoiceContent&gt;</c> element.
	/// </summary>
	/// <value> A ContentElement </value>
	/// <remarks>
	/// <para>The SIF specification defines the meaning of this null as: "The text of the choice, such as true, 27, or Important economic and social factors."</para>
	/// <para>To remove the <c>ContentElement</c>, set <c>ChoiceContent</c> to <c>null</c></para>
	/// <para>Version: 2.6</para>
	/// <para>Since: 2.2</para>
	/// </remarks>
	public ContentElement ChoiceContent
	{
		get
		{
			return (ContentElement)GetChild( AssessmentDTD.CHOICE_CHOICECONTENT);
		}
		set
		{
			RemoveChild( AssessmentDTD.CHOICE_CHOICECONTENT);
			if( value != null)
			{
				AddChild( AssessmentDTD.CHOICE_CHOICECONTENT, value );
			}
		}
	}

	/// <summary>
	/// Gets or sets the value of the <c>&lt;CreditValue&gt;</c> element.
	/// </summary>
	/// <value> The <c>CreditValue</c> element of this object.</value>
	/// <remarks>
	/// <para>The SIF specification defines the meaning of this element as: "A numeric value that indicates the amount of credit awarded for choosing the choice."</para>
	/// <para>Version: 2.6</para>
	/// <para>Since: 2.2</para>
	/// </remarks>
	public float? CreditValue
	{
		get
		{
			return (float?) GetSifSimpleFieldValue( AssessmentDTD.CHOICE_CREDITVALUE ) ;
		}
		set
		{
			SetFieldValue( AssessmentDTD.CHOICE_CREDITVALUE, new SifFloat( value ), value );
		}
	}

	/// <summary>
	/// Gets or sets the value of the <c>&lt;Responses&gt;</c> element.
	/// </summary>
	/// <value> The <c>Responses</c> element of this object.</value>
	/// <remarks>
	/// <para>The SIF specification defines the meaning of this element as: "The number of responses."</para>
	/// <para>Version: 2.6</para>
	/// <para>Since: 2.3</para>
	/// </remarks>
	public int? Responses
	{
		get
		{
			return (int?) GetSifSimpleFieldValue( AssessmentDTD.CHOICE_RESPONSES ) ;
		}
		set
		{
			SetFieldValue( AssessmentDTD.CHOICE_RESPONSES, new SifInt( value ), value );
		}
	}

}}
