// THIS FILE WAS AUTO-GENERATED BY ADKGEN -- DO NOT MODIFY!

//
// Copyright (c)1998-2011 Pearson Education, Inc. or its affiliate(s).
// All rights reserved.
//

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

namespace OpenADK.Library.Infra{

/// <summary>A SIF_EventObject</summary>
/// <remarks>
///
/// <para>Author: Generated by adkgen</para>
/// <para>Version: 2.6</para>
/// <para>Since: 1.1</para>
/// </remarks>
[Serializable]
public class SIF_EventObject : SifElement
{
	/// <summary>
	/// Creates an instance of a SIF_EventObject
	/// </summary>
	public SIF_EventObject() : base ( InfraDTD.SIF_EVENTOBJECT ){}

	/// <summary>
	/// Constructor that accepts values for all mandatory fields
	/// </summary>
	///<param name="objectName">This is the name of the object being added, changed or deleted.</param>
	///<param name="action">This is the action associated with the object that is being conveyed by this SIF_Event.</param>
	///<param name="value">Gets or sets the content value of the &amp;lt;SIF_EventObject&amp;gt; element</param>
	///
	public SIF_EventObject( string objectName, Action action, string value ) : base( InfraDTD.SIF_EVENTOBJECT )
	{
		this.ObjectName = objectName;
		this.SetAction( action );
		this.Value = value;
	}

	/// <summary>
	/// Constructor used by the .Net Serialization formatter
	/// </summary>
	[SecurityPermission( SecurityAction.Demand, SerializationFormatter=true )] 
	protected SIF_EventObject( 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  IElementDef[] KeyFields {
		get { return new IElementDef[] { InfraDTD.SIF_EVENTOBJECT_OBJECTNAME, InfraDTD.SIF_EVENTOBJECT_ACTION }; }
	}

	/// <summary>
	/// Gets or sets the value of the <c>&lt;SIF_EventObject&gt;</c> element.
	/// </summary>
	/// <value> The <c>Value</c> of the content of this object.</value>
	/// <remarks>
	/// <para>The SIF specification defines the meaning of this of the content as: "Gets or sets the content value of the &amp;lt;SIF_EventObject&amp;gt; element"</para>
	/// <para>Version: 2.6</para>
	/// <para>Since: 1.1</para>
	/// </remarks>
	public string Value
	{
		get
		{
			return (string) GetSifSimpleFieldValue( InfraDTD.SIF_EVENTOBJECT ) ;
		}
		set
		{
			SetFieldValue( InfraDTD.SIF_EVENTOBJECT, new SifString( value ), value );
		}
	}

	/// <summary>
	/// Gets or sets the value of the <c>ObjectName</c> attribute.
	/// </summary>
	/// <value> The <c>ObjectName</c> attribute of this object.</value>
	/// <remarks>
	/// <para>The SIF specification defines the meaning of this attribute as: "This is the name of the object being added, changed or deleted."</para>
	/// <para>Version: 2.6</para>
	/// <para>Since: 1.1</para>
	/// </remarks>
	public string ObjectName
	{
		get
		{
			return (string) GetSifSimpleFieldValue( InfraDTD.SIF_EVENTOBJECT_OBJECTNAME ) ;
		}
		set
		{
			SetFieldValue( InfraDTD.SIF_EVENTOBJECT_OBJECTNAME, new SifString( value ), value );
		}
	}

	/// <summary>
	/// Gets or sets the value of the <c>Action</c> attribute.
	/// </summary>
	/// <value> The <c>Action</c> attribute of this object.</value>
	/// <remarks>
	/// <para>The SIF specification defines the meaning of this attribute as: "This is the action associated with the object that is being conveyed by this SIF_Event."</para>
	/// <para>Version: 2.6</para>
	/// <para>Since: 1.1</para>
	/// </remarks>
	public string Action
	{
		get
		{ 
			return GetFieldValue( InfraDTD.SIF_EVENTOBJECT_ACTION );
		}
		set
		{
			SetField( InfraDTD.SIF_EVENTOBJECT_ACTION, value );
		}
	}

	/// <summary>
	/// Sets the value of the <c>Action</c> attribute.
	/// </summary>
	/// <param name="val">A Action object</param>
	/// <remarks>
	/// <para>The SIF specification defines the meaning of this attribute as: "This is the action associated with the object that is being conveyed by this SIF_Event."</para>
	/// <para>Version: 2.6</para>
	/// <para>Since: 1.1</para>
	/// </remarks>
	public void SetAction( Action val )
	{
		SetField( InfraDTD.SIF_EVENTOBJECT_ACTION, val );
	}

		#region EXTRA METHODS

// BEGIN EXTRA METHODS (C:/GitHub/rafidzal/OpenADK-java/adk-generator/../adk-generator/datadef/core/sif20/SIF_EventObject.txt.cs)

    /// <summary>Attach a SifMessagePayload to this EventObject.<p></summary>
    public virtual void Attach( SifDataObject payload )
    {
        AddChild( payload );
    }

    /// <summary>Detach a SifMessagePayload from this EventObject.<p></summary>
    public virtual void Detach( SifDataObject payload )
    {
        RemoveChild( payload );
    }

// END EXTRA METHODS

		#endregion // EXTRA METHODS
}}
