// ------------------------------------------------------------------------------
// <auto-generated>
//     This code was generated by a tool Xbim.CodeGeneration 
//  
//     Changes to this file may cause incorrect behaviour and will be lost if
//     the code is regenerated.
// </auto-generated>
// ------------------------------------------------------------------------------

using Xbim.Ifc4.Interfaces;
using System.Collections.Generic;
using System.Linq;
using Xbim.Common;

//## Custom using statements
//##

// ReSharper disable once CheckNamespace
namespace Xbim.Ifc4x3.ProcessExtension
{
	public partial class @IfcEvent : IIfcEvent
	{

		[CrossSchemaAttribute(typeof(IIfcEvent), 8)]
		Ifc4.Interfaces.IfcEventTypeEnum? IIfcEvent.PredefinedType 
		{ 
			get
			{
				//## Custom code to handle enumeration of PredefinedType
				//##
				switch (PredefinedType)
				{
					case IfcEventTypeEnum.ENDEVENT:
						return Ifc4.Interfaces.IfcEventTypeEnum.ENDEVENT;
					case IfcEventTypeEnum.INTERMEDIATEEVENT:
						return Ifc4.Interfaces.IfcEventTypeEnum.INTERMEDIATEEVENT;
					case IfcEventTypeEnum.STARTEVENT:
						return Ifc4.Interfaces.IfcEventTypeEnum.STARTEVENT;
					case IfcEventTypeEnum.USERDEFINED:
						//## Optional custom handling of PredefinedType == .USERDEFINED. 
						//##
						return Ifc4.Interfaces.IfcEventTypeEnum.USERDEFINED;
					case IfcEventTypeEnum.NOTDEFINED:
						return Ifc4.Interfaces.IfcEventTypeEnum.NOTDEFINED;
					case null: 
						return null;
					
					default:
						throw new System.ArgumentOutOfRangeException();
				}
			} 
			set
			{
				//## Custom code to handle setting of enumeration of PredefinedType
				//##
				switch (value)
				{
					case Ifc4.Interfaces.IfcEventTypeEnum.STARTEVENT:
						PredefinedType = IfcEventTypeEnum.STARTEVENT;
						return;
					case Ifc4.Interfaces.IfcEventTypeEnum.ENDEVENT:
						PredefinedType = IfcEventTypeEnum.ENDEVENT;
						return;
					case Ifc4.Interfaces.IfcEventTypeEnum.INTERMEDIATEEVENT:
						PredefinedType = IfcEventTypeEnum.INTERMEDIATEEVENT;
						return;
					case Ifc4.Interfaces.IfcEventTypeEnum.USERDEFINED:
						PredefinedType = IfcEventTypeEnum.USERDEFINED;
						return;
					case Ifc4.Interfaces.IfcEventTypeEnum.NOTDEFINED:
						PredefinedType = IfcEventTypeEnum.NOTDEFINED;
						return;
					
					case null:
						PredefinedType = null;
						return;
					default:
						throw new System.ArgumentOutOfRangeException();
				}
				
			}
		}

		[CrossSchemaAttribute(typeof(IIfcEvent), 9)]
		Ifc4.Interfaces.IfcEventTriggerTypeEnum? IIfcEvent.EventTriggerType 
		{ 
			get
			{
				//## Custom code to handle enumeration of EventTriggerType
				//##
				switch (EventTriggerType)
				{
					case IfcEventTriggerTypeEnum.EVENTCOMPLEX:
						return Ifc4.Interfaces.IfcEventTriggerTypeEnum.EVENTCOMPLEX;
					case IfcEventTriggerTypeEnum.EVENTMESSAGE:
						return Ifc4.Interfaces.IfcEventTriggerTypeEnum.EVENTMESSAGE;
					case IfcEventTriggerTypeEnum.EVENTRULE:
						return Ifc4.Interfaces.IfcEventTriggerTypeEnum.EVENTRULE;
					case IfcEventTriggerTypeEnum.EVENTTIME:
						return Ifc4.Interfaces.IfcEventTriggerTypeEnum.EVENTTIME;
					case IfcEventTriggerTypeEnum.USERDEFINED:
						//## Optional custom handling of EventTriggerType == .USERDEFINED. 
						//##
						return Ifc4.Interfaces.IfcEventTriggerTypeEnum.USERDEFINED;
					case IfcEventTriggerTypeEnum.NOTDEFINED:
						return Ifc4.Interfaces.IfcEventTriggerTypeEnum.NOTDEFINED;
					case null: 
						return null;
					
					default:
						throw new System.ArgumentOutOfRangeException();
				}
			} 
			set
			{
				//## Custom code to handle setting of enumeration of EventTriggerType
				//##
				switch (value)
				{
					case Ifc4.Interfaces.IfcEventTriggerTypeEnum.EVENTRULE:
						EventTriggerType = IfcEventTriggerTypeEnum.EVENTRULE;
						return;
					case Ifc4.Interfaces.IfcEventTriggerTypeEnum.EVENTMESSAGE:
						EventTriggerType = IfcEventTriggerTypeEnum.EVENTMESSAGE;
						return;
					case Ifc4.Interfaces.IfcEventTriggerTypeEnum.EVENTTIME:
						EventTriggerType = IfcEventTriggerTypeEnum.EVENTTIME;
						return;
					case Ifc4.Interfaces.IfcEventTriggerTypeEnum.EVENTCOMPLEX:
						EventTriggerType = IfcEventTriggerTypeEnum.EVENTCOMPLEX;
						return;
					case Ifc4.Interfaces.IfcEventTriggerTypeEnum.USERDEFINED:
						EventTriggerType = IfcEventTriggerTypeEnum.USERDEFINED;
						return;
					case Ifc4.Interfaces.IfcEventTriggerTypeEnum.NOTDEFINED:
						EventTriggerType = IfcEventTriggerTypeEnum.NOTDEFINED;
						return;
					
					case null:
						EventTriggerType = null;
						return;
					default:
						throw new System.ArgumentOutOfRangeException();
				}
				
			}
		}

		[CrossSchemaAttribute(typeof(IIfcEvent), 10)]
		Ifc4.MeasureResource.IfcLabel? IIfcEvent.UserDefinedEventTriggerType 
		{ 
			get
			{
				if (!UserDefinedEventTriggerType.HasValue) return null;
				return new Ifc4.MeasureResource.IfcLabel(UserDefinedEventTriggerType.Value);
			} 
			set
			{
				UserDefinedEventTriggerType = value.HasValue ? 
					new MeasureResource.IfcLabel(value.Value) :  
					 new MeasureResource.IfcLabel?() ;
				
			}
		}

		[CrossSchemaAttribute(typeof(IIfcEvent), 11)]
		IIfcEventTime IIfcEvent.EventOccurenceTime 
		{ 
			get
			{
				return EventOccurenceTime;
			} 
			set
			{
				EventOccurenceTime = value as DateTimeResource.IfcEventTime;
				
			}
		}
	//## Custom code
	//##
	}
}