// ------------------------------------------------------------------------------
// <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.UtilityResource
{
	public partial class @IfcOwnerHistory : IIfcOwnerHistory
	{

		[CrossSchemaAttribute(typeof(IIfcOwnerHistory), 1)]
		IIfcPersonAndOrganization IIfcOwnerHistory.OwningUser 
		{ 
			get
			{
				return OwningUser;
			} 
			set
			{
				OwningUser = value as ActorResource.IfcPersonAndOrganization;
				
			}
		}

		[CrossSchemaAttribute(typeof(IIfcOwnerHistory), 2)]
		IIfcApplication IIfcOwnerHistory.OwningApplication 
		{ 
			get
			{
				return OwningApplication;
			} 
			set
			{
				OwningApplication = value as IfcApplication;
				
			}
		}

		[CrossSchemaAttribute(typeof(IIfcOwnerHistory), 3)]
		Ifc4.Interfaces.IfcStateEnum? IIfcOwnerHistory.State 
		{ 
			get
			{
				//## Custom code to handle enumeration of State
				//##
				switch (State)
				{
					case IfcStateEnum.LOCKED:
						return Ifc4.Interfaces.IfcStateEnum.LOCKED;
					case IfcStateEnum.READONLY:
						return Ifc4.Interfaces.IfcStateEnum.READONLY;
					case IfcStateEnum.READONLYLOCKED:
						return Ifc4.Interfaces.IfcStateEnum.READONLYLOCKED;
					case IfcStateEnum.READWRITE:
						return Ifc4.Interfaces.IfcStateEnum.READWRITE;
					case IfcStateEnum.READWRITELOCKED:
						return Ifc4.Interfaces.IfcStateEnum.READWRITELOCKED;
					case null: 
						return null;
					
					default:
						throw new System.ArgumentOutOfRangeException();
				}
			} 
			set
			{
				//## Custom code to handle setting of enumeration of State
				//##
				switch (value)
				{
					case Ifc4.Interfaces.IfcStateEnum.READWRITE:
						State = IfcStateEnum.READWRITE;
						return;
					case Ifc4.Interfaces.IfcStateEnum.READONLY:
						State = IfcStateEnum.READONLY;
						return;
					case Ifc4.Interfaces.IfcStateEnum.LOCKED:
						State = IfcStateEnum.LOCKED;
						return;
					case Ifc4.Interfaces.IfcStateEnum.READWRITELOCKED:
						State = IfcStateEnum.READWRITELOCKED;
						return;
					case Ifc4.Interfaces.IfcStateEnum.READONLYLOCKED:
						State = IfcStateEnum.READONLYLOCKED;
						return;
					
					case null:
						State = null;
						return;
					default:
						throw new System.ArgumentOutOfRangeException();
				}
				
			}
		}

		[CrossSchemaAttribute(typeof(IIfcOwnerHistory), 4)]
		Ifc4.Interfaces.IfcChangeActionEnum? IIfcOwnerHistory.ChangeAction 
		{ 
			get
			{
				//## Custom code to handle enumeration of ChangeAction
				//##
				switch (ChangeAction)
				{
					case IfcChangeActionEnum.ADDED:
						return Ifc4.Interfaces.IfcChangeActionEnum.ADDED;
					case IfcChangeActionEnum.DELETED:
						return Ifc4.Interfaces.IfcChangeActionEnum.DELETED;
					case IfcChangeActionEnum.MODIFIED:
						return Ifc4.Interfaces.IfcChangeActionEnum.MODIFIED;
					case IfcChangeActionEnum.NOCHANGE:
						return Ifc4.Interfaces.IfcChangeActionEnum.NOCHANGE;
					case IfcChangeActionEnum.NOTDEFINED:
						return Ifc4.Interfaces.IfcChangeActionEnum.NOTDEFINED;
					case null: 
						return null;
					
					default:
						throw new System.ArgumentOutOfRangeException();
				}
			} 
			set
			{
				//## Custom code to handle setting of enumeration of ChangeAction
				//##
				switch (value)
				{
					case Ifc4.Interfaces.IfcChangeActionEnum.NOCHANGE:
						ChangeAction = IfcChangeActionEnum.NOCHANGE;
						return;
					case Ifc4.Interfaces.IfcChangeActionEnum.MODIFIED:
						ChangeAction = IfcChangeActionEnum.MODIFIED;
						return;
					case Ifc4.Interfaces.IfcChangeActionEnum.ADDED:
						ChangeAction = IfcChangeActionEnum.ADDED;
						return;
					case Ifc4.Interfaces.IfcChangeActionEnum.DELETED:
						ChangeAction = IfcChangeActionEnum.DELETED;
						return;
					case Ifc4.Interfaces.IfcChangeActionEnum.NOTDEFINED:
						ChangeAction = IfcChangeActionEnum.NOTDEFINED;
						return;
					
					case null:
						ChangeAction = null;
						return;
					default:
						throw new System.ArgumentOutOfRangeException();
				}
				
			}
		}

		[CrossSchemaAttribute(typeof(IIfcOwnerHistory), 5)]
		Ifc4.DateTimeResource.IfcTimeStamp? IIfcOwnerHistory.LastModifiedDate 
		{ 
			get
			{
				if (!LastModifiedDate.HasValue) return null;
				return new Ifc4.DateTimeResource.IfcTimeStamp(LastModifiedDate.Value);
			} 
			set
			{
				LastModifiedDate = value.HasValue ? 
					new DateTimeResource.IfcTimeStamp(value.Value) :  
					 new DateTimeResource.IfcTimeStamp?() ;
				
			}
		}

		[CrossSchemaAttribute(typeof(IIfcOwnerHistory), 6)]
		IIfcPersonAndOrganization IIfcOwnerHistory.LastModifyingUser 
		{ 
			get
			{
				return LastModifyingUser;
			} 
			set
			{
				LastModifyingUser = value as ActorResource.IfcPersonAndOrganization;
				
			}
		}

		[CrossSchemaAttribute(typeof(IIfcOwnerHistory), 7)]
		IIfcApplication IIfcOwnerHistory.LastModifyingApplication 
		{ 
			get
			{
				return LastModifyingApplication;
			} 
			set
			{
				LastModifyingApplication = value as IfcApplication;
				
			}
		}

		[CrossSchemaAttribute(typeof(IIfcOwnerHistory), 8)]
		Ifc4.DateTimeResource.IfcTimeStamp IIfcOwnerHistory.CreationDate 
		{ 
			get
			{
				return new Ifc4.DateTimeResource.IfcTimeStamp(CreationDate);
			} 
			set
			{
				CreationDate = new DateTimeResource.IfcTimeStamp(value);
				
			}
		}
	//## Custom code
	//##
	}
}