// ------------------------------------------------------------------------------
// <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 @IfcRelSequence : IIfcRelSequence
	{

		[CrossSchemaAttribute(typeof(IIfcRelSequence), 5)]
		IIfcProcess IIfcRelSequence.RelatingProcess 
		{ 
			get
			{
				return RelatingProcess;
			} 
			set
			{
				RelatingProcess = value as Kernel.IfcProcess;
				
			}
		}

		[CrossSchemaAttribute(typeof(IIfcRelSequence), 6)]
		IIfcProcess IIfcRelSequence.RelatedProcess 
		{ 
			get
			{
				return RelatedProcess;
			} 
			set
			{
				RelatedProcess = value as Kernel.IfcProcess;
				
			}
		}

		[CrossSchemaAttribute(typeof(IIfcRelSequence), 7)]
		IIfcLagTime IIfcRelSequence.TimeLag 
		{ 
			get
			{
				return TimeLag;
			} 
			set
			{
				TimeLag = value as DateTimeResource.IfcLagTime;
				
			}
		}

		[CrossSchemaAttribute(typeof(IIfcRelSequence), 8)]
		Ifc4.Interfaces.IfcSequenceEnum? IIfcRelSequence.SequenceType 
		{ 
			get
			{
				//## Custom code to handle enumeration of SequenceType
				//##
				switch (SequenceType)
				{
					case IfcSequenceEnum.FINISH_FINISH:
						return Ifc4.Interfaces.IfcSequenceEnum.FINISH_FINISH;
					case IfcSequenceEnum.FINISH_START:
						return Ifc4.Interfaces.IfcSequenceEnum.FINISH_START;
					case IfcSequenceEnum.START_FINISH:
						return Ifc4.Interfaces.IfcSequenceEnum.START_FINISH;
					case IfcSequenceEnum.START_START:
						return Ifc4.Interfaces.IfcSequenceEnum.START_START;
					case IfcSequenceEnum.USERDEFINED:
						//## Optional custom handling of SequenceType == .USERDEFINED. 
						//##
						return Ifc4.Interfaces.IfcSequenceEnum.USERDEFINED;
					case IfcSequenceEnum.NOTDEFINED:
						return Ifc4.Interfaces.IfcSequenceEnum.NOTDEFINED;
					case null: 
						return null;
					
					default:
						throw new System.ArgumentOutOfRangeException();
				}
			} 
			set
			{
				//## Custom code to handle setting of enumeration of SequenceType
				//##
				switch (value)
				{
					case Ifc4.Interfaces.IfcSequenceEnum.START_START:
						SequenceType = IfcSequenceEnum.START_START;
						return;
					case Ifc4.Interfaces.IfcSequenceEnum.START_FINISH:
						SequenceType = IfcSequenceEnum.START_FINISH;
						return;
					case Ifc4.Interfaces.IfcSequenceEnum.FINISH_START:
						SequenceType = IfcSequenceEnum.FINISH_START;
						return;
					case Ifc4.Interfaces.IfcSequenceEnum.FINISH_FINISH:
						SequenceType = IfcSequenceEnum.FINISH_FINISH;
						return;
					case Ifc4.Interfaces.IfcSequenceEnum.USERDEFINED:
						SequenceType = IfcSequenceEnum.USERDEFINED;
						return;
					case Ifc4.Interfaces.IfcSequenceEnum.NOTDEFINED:
						SequenceType = IfcSequenceEnum.NOTDEFINED;
						return;
					
					case null:
						SequenceType = null;
						return;
					default:
						throw new System.ArgumentOutOfRangeException();
				}
				
			}
		}

		[CrossSchemaAttribute(typeof(IIfcRelSequence), 9)]
		Ifc4.MeasureResource.IfcLabel? IIfcRelSequence.UserDefinedSequenceType 
		{ 
			get
			{
				if (!UserDefinedSequenceType.HasValue) return null;
				return new Ifc4.MeasureResource.IfcLabel(UserDefinedSequenceType.Value);
			} 
			set
			{
				UserDefinedSequenceType = value.HasValue ? 
					new MeasureResource.IfcLabel(value.Value) :  
					 new MeasureResource.IfcLabel?() ;
				
			}
		}
	//## Custom code
	//##
	}
}