// ------------------------------------------------------------------------------
// <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 @IfcTaskType : IIfcTaskType
	{

		[CrossSchemaAttribute(typeof(IIfcTaskType), 10)]
		Ifc4.Interfaces.IfcTaskTypeEnum IIfcTaskType.PredefinedType 
		{ 
			get
			{
				//## Custom code to handle enumeration of PredefinedType
				//##
				switch (PredefinedType)
				{
					case IfcTaskTypeEnum.ADJUSTMENT:
						//## Handle translation of ADJUSTMENT member from IfcTaskTypeEnum in property PredefinedType
						return this.GetUserDefined<Ifc4.Interfaces.IfcTaskTypeEnum>();
						//##
					case IfcTaskTypeEnum.ATTENDANCE:
						return Ifc4.Interfaces.IfcTaskTypeEnum.ATTENDANCE;
					case IfcTaskTypeEnum.CALIBRATION:
						//## Handle translation of CALIBRATION member from IfcTaskTypeEnum in property PredefinedType
						return this.GetUserDefined<Ifc4.Interfaces.IfcTaskTypeEnum>();
						//##
					case IfcTaskTypeEnum.CONSTRUCTION:
						return Ifc4.Interfaces.IfcTaskTypeEnum.CONSTRUCTION;
					case IfcTaskTypeEnum.DEMOLITION:
						return Ifc4.Interfaces.IfcTaskTypeEnum.DEMOLITION;
					case IfcTaskTypeEnum.DISMANTLE:
						return Ifc4.Interfaces.IfcTaskTypeEnum.DISMANTLE;
					case IfcTaskTypeEnum.DISPOSAL:
						return Ifc4.Interfaces.IfcTaskTypeEnum.DISPOSAL;
					case IfcTaskTypeEnum.EMERGENCY:
						//## Handle translation of EMERGENCY member from IfcTaskTypeEnum in property PredefinedType
						return this.GetUserDefined<Ifc4.Interfaces.IfcTaskTypeEnum>();
						//##
					case IfcTaskTypeEnum.INSPECTION:
						//## Handle translation of INSPECTION member from IfcTaskTypeEnum in property PredefinedType
						return this.GetUserDefined<Ifc4.Interfaces.IfcTaskTypeEnum>();
						//##
					case IfcTaskTypeEnum.INSTALLATION:
						return Ifc4.Interfaces.IfcTaskTypeEnum.INSTALLATION;
					case IfcTaskTypeEnum.LOGISTIC:
						return Ifc4.Interfaces.IfcTaskTypeEnum.LOGISTIC;
					case IfcTaskTypeEnum.MAINTENANCE:
						return Ifc4.Interfaces.IfcTaskTypeEnum.MAINTENANCE;
					case IfcTaskTypeEnum.MOVE:
						return Ifc4.Interfaces.IfcTaskTypeEnum.MOVE;
					case IfcTaskTypeEnum.OPERATION:
						return Ifc4.Interfaces.IfcTaskTypeEnum.OPERATION;
					case IfcTaskTypeEnum.REMOVAL:
						return Ifc4.Interfaces.IfcTaskTypeEnum.REMOVAL;
					case IfcTaskTypeEnum.RENOVATION:
						return Ifc4.Interfaces.IfcTaskTypeEnum.RENOVATION;
					case IfcTaskTypeEnum.SAFETY:
						//## Handle translation of SAFETY member from IfcTaskTypeEnum in property PredefinedType
						return this.GetUserDefined<Ifc4.Interfaces.IfcTaskTypeEnum>();
						//##
					case IfcTaskTypeEnum.SHUTDOWN:
						//## Handle translation of SHUTDOWN member from IfcTaskTypeEnum in property PredefinedType
						return this.GetUserDefined<Ifc4.Interfaces.IfcTaskTypeEnum>();
						//##
					case IfcTaskTypeEnum.STARTUP:
						//## Handle translation of STARTUP member from IfcTaskTypeEnum in property PredefinedType
						return this.GetUserDefined<Ifc4.Interfaces.IfcTaskTypeEnum>();
						//##
					case IfcTaskTypeEnum.TESTING:
						//## Handle translation of TESTING member from IfcTaskTypeEnum in property PredefinedType
						return this.GetUserDefined<Ifc4.Interfaces.IfcTaskTypeEnum>();
						//##
					case IfcTaskTypeEnum.TROUBLESHOOTING:
						//## Handle translation of TROUBLESHOOTING member from IfcTaskTypeEnum in property PredefinedType
						return this.GetUserDefined<Ifc4.Interfaces.IfcTaskTypeEnum>();
						//##
					case IfcTaskTypeEnum.USERDEFINED:
						//## Optional custom handling of PredefinedType == .USERDEFINED. 
						//##
						return Ifc4.Interfaces.IfcTaskTypeEnum.USERDEFINED;
					case IfcTaskTypeEnum.NOTDEFINED:
						return Ifc4.Interfaces.IfcTaskTypeEnum.NOTDEFINED;
					
					default:
						throw new System.ArgumentOutOfRangeException();
				}
			} 
			set
			{
				//## Custom code to handle setting of enumeration of PredefinedType
				//##
				switch (value)
				{
					case Ifc4.Interfaces.IfcTaskTypeEnum.ATTENDANCE:
						PredefinedType = IfcTaskTypeEnum.ATTENDANCE;
						return;
					case Ifc4.Interfaces.IfcTaskTypeEnum.CONSTRUCTION:
						PredefinedType = IfcTaskTypeEnum.CONSTRUCTION;
						return;
					case Ifc4.Interfaces.IfcTaskTypeEnum.DEMOLITION:
						PredefinedType = IfcTaskTypeEnum.DEMOLITION;
						return;
					case Ifc4.Interfaces.IfcTaskTypeEnum.DISMANTLE:
						PredefinedType = IfcTaskTypeEnum.DISMANTLE;
						return;
					case Ifc4.Interfaces.IfcTaskTypeEnum.DISPOSAL:
						PredefinedType = IfcTaskTypeEnum.DISPOSAL;
						return;
					case Ifc4.Interfaces.IfcTaskTypeEnum.INSTALLATION:
						PredefinedType = IfcTaskTypeEnum.INSTALLATION;
						return;
					case Ifc4.Interfaces.IfcTaskTypeEnum.LOGISTIC:
						PredefinedType = IfcTaskTypeEnum.LOGISTIC;
						return;
					case Ifc4.Interfaces.IfcTaskTypeEnum.MAINTENANCE:
						PredefinedType = IfcTaskTypeEnum.MAINTENANCE;
						return;
					case Ifc4.Interfaces.IfcTaskTypeEnum.MOVE:
						PredefinedType = IfcTaskTypeEnum.MOVE;
						return;
					case Ifc4.Interfaces.IfcTaskTypeEnum.OPERATION:
						PredefinedType = IfcTaskTypeEnum.OPERATION;
						return;
					case Ifc4.Interfaces.IfcTaskTypeEnum.REMOVAL:
						PredefinedType = IfcTaskTypeEnum.REMOVAL;
						return;
					case Ifc4.Interfaces.IfcTaskTypeEnum.RENOVATION:
						PredefinedType = IfcTaskTypeEnum.RENOVATION;
						return;
					case Ifc4.Interfaces.IfcTaskTypeEnum.USERDEFINED:
						PredefinedType = IfcTaskTypeEnum.USERDEFINED;
						return;
					case Ifc4.Interfaces.IfcTaskTypeEnum.NOTDEFINED:
						PredefinedType = IfcTaskTypeEnum.NOTDEFINED;
						return;
					default:
						throw new System.ArgumentOutOfRangeException();
				}
				
			}
		}

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