// ------------------------------------------------------------------------------
// <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;

// ReSharper disable once CheckNamespace
namespace Xbim.Ifc2x3.HVACDomain
{
	public partial class @IfcSpaceHeaterType : IIfcSpaceHeaterType
	{

		[CrossSchemaAttribute(typeof(IIfcSpaceHeaterType), 10)]
		Ifc4.Interfaces.IfcSpaceHeaterTypeEnum IIfcSpaceHeaterType.PredefinedType 
		{ 
			get
			{
				//## Custom code to handle enumeration of PredefinedType
				//##
				switch (PredefinedType)
				{
					case IfcSpaceHeaterTypeEnum.SECTIONALRADIATOR:
						//## Handle translation of SECTIONALRADIATOR member from IfcSpaceHeaterTypeEnum in property PredefinedType
                        return Ifc4.Interfaces.IfcSpaceHeaterTypeEnum.USERDEFINED;
						//##
					case IfcSpaceHeaterTypeEnum.PANELRADIATOR:
						//## Handle translation of PANELRADIATOR member from IfcSpaceHeaterTypeEnum in property PredefinedType
                        return Ifc4.Interfaces.IfcSpaceHeaterTypeEnum.USERDEFINED;
						//##
					case IfcSpaceHeaterTypeEnum.TUBULARRADIATOR:
						//## Handle translation of TUBULARRADIATOR member from IfcSpaceHeaterTypeEnum in property PredefinedType
                        return Ifc4.Interfaces.IfcSpaceHeaterTypeEnum.USERDEFINED;
						//##
					case IfcSpaceHeaterTypeEnum.CONVECTOR:
						return Ifc4.Interfaces.IfcSpaceHeaterTypeEnum.CONVECTOR;
					case IfcSpaceHeaterTypeEnum.BASEBOARDHEATER:
						//## Handle translation of BASEBOARDHEATER member from IfcSpaceHeaterTypeEnum in property PredefinedType
                        return Ifc4.Interfaces.IfcSpaceHeaterTypeEnum.USERDEFINED;
						//##
					case IfcSpaceHeaterTypeEnum.FINNEDTUBEUNIT:
						//## Handle translation of FINNEDTUBEUNIT member from IfcSpaceHeaterTypeEnum in property PredefinedType
                        return Ifc4.Interfaces.IfcSpaceHeaterTypeEnum.USERDEFINED;
						//##
					case IfcSpaceHeaterTypeEnum.UNITHEATER:
						//## Handle translation of UNITHEATER member from IfcSpaceHeaterTypeEnum in property PredefinedType
                        return Ifc4.Interfaces.IfcSpaceHeaterTypeEnum.USERDEFINED;
						//##
					case IfcSpaceHeaterTypeEnum.USERDEFINED:
						//## Optional custom handling of PredefinedType == .USERDEFINED. 
                        if (ElementType.HasValue)
                        {
                            Ifc4.Interfaces.IfcSpaceHeaterTypeEnum result;
                            if (System.Enum.TryParse(ElementType.Value, false, out result))
                                return result;
                        }
						//##
						return Ifc4.Interfaces.IfcSpaceHeaterTypeEnum.USERDEFINED;
					case IfcSpaceHeaterTypeEnum.NOTDEFINED:
						return Ifc4.Interfaces.IfcSpaceHeaterTypeEnum.NOTDEFINED;
					
					default:
						throw new System.ArgumentOutOfRangeException();
				}
			} 
			set
			{
				//## Custom code to handle setting of enumeration of PredefinedType
				//##
				switch (value)
				{
					case Ifc4.Interfaces.IfcSpaceHeaterTypeEnum.CONVECTOR:
						PredefinedType = IfcSpaceHeaterTypeEnum.CONVECTOR;
						return;
					case Ifc4.Interfaces.IfcSpaceHeaterTypeEnum.RADIATOR:
						//## Handle setting of RADIATOR member from IfcSpaceHeaterTypeEnum in property PredefinedType
						ElementType = value.ToString();
                        PredefinedType = IfcSpaceHeaterTypeEnum.USERDEFINED;
				        return;
						//##
										case Ifc4.Interfaces.IfcSpaceHeaterTypeEnum.USERDEFINED:
						PredefinedType = IfcSpaceHeaterTypeEnum.USERDEFINED;
						return;
					case Ifc4.Interfaces.IfcSpaceHeaterTypeEnum.NOTDEFINED:
						PredefinedType = IfcSpaceHeaterTypeEnum.NOTDEFINED;
						return;
					default:
						throw new System.ArgumentOutOfRangeException();
				}
				
			}
		}
	//## Custom code
	//##
	}
}