// ------------------------------------------------------------------------------
// <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 @IfcCondenserType : IIfcCondenserType
	{

		[CrossSchemaAttribute(typeof(IIfcCondenserType), 10)]
		Ifc4.Interfaces.IfcCondenserTypeEnum IIfcCondenserType.PredefinedType 
		{ 
			get
			{
				//## Custom code to handle enumeration of PredefinedType
				//##
				switch (PredefinedType)
				{
					case IfcCondenserTypeEnum.WATERCOOLEDSHELLTUBE:
						return Ifc4.Interfaces.IfcCondenserTypeEnum.WATERCOOLEDSHELLTUBE;
					case IfcCondenserTypeEnum.WATERCOOLEDSHELLCOIL:
						return Ifc4.Interfaces.IfcCondenserTypeEnum.WATERCOOLEDSHELLCOIL;
					case IfcCondenserTypeEnum.WATERCOOLEDTUBEINTUBE:
						return Ifc4.Interfaces.IfcCondenserTypeEnum.WATERCOOLEDTUBEINTUBE;
					case IfcCondenserTypeEnum.WATERCOOLEDBRAZEDPLATE:
						return Ifc4.Interfaces.IfcCondenserTypeEnum.WATERCOOLEDBRAZEDPLATE;
					case IfcCondenserTypeEnum.AIRCOOLED:
						return Ifc4.Interfaces.IfcCondenserTypeEnum.AIRCOOLED;
					case IfcCondenserTypeEnum.EVAPORATIVECOOLED:
						return Ifc4.Interfaces.IfcCondenserTypeEnum.EVAPORATIVECOOLED;
					case IfcCondenserTypeEnum.USERDEFINED:
						//## Optional custom handling of PredefinedType == .USERDEFINED. 
                        if (ElementType.HasValue)
                        {
                            Ifc4.Interfaces.IfcCondenserTypeEnum result;
                            if (System.Enum.TryParse(ElementType.Value, false, out result))
                                return result;
                        }
						//##
						return Ifc4.Interfaces.IfcCondenserTypeEnum.USERDEFINED;
					case IfcCondenserTypeEnum.NOTDEFINED:
						return Ifc4.Interfaces.IfcCondenserTypeEnum.NOTDEFINED;
					
					default:
						throw new System.ArgumentOutOfRangeException();
				}
			} 
			set
			{
				//## Custom code to handle setting of enumeration of PredefinedType
				//##
				switch (value)
				{
					case Ifc4.Interfaces.IfcCondenserTypeEnum.AIRCOOLED:
						PredefinedType = IfcCondenserTypeEnum.AIRCOOLED;
						return;
					case Ifc4.Interfaces.IfcCondenserTypeEnum.EVAPORATIVECOOLED:
						PredefinedType = IfcCondenserTypeEnum.EVAPORATIVECOOLED;
						return;
					case Ifc4.Interfaces.IfcCondenserTypeEnum.WATERCOOLED:
						//## Handle setting of WATERCOOLED member from IfcCondenserTypeEnum in property PredefinedType
						ElementType = value.ToString();
                        PredefinedType = IfcCondenserTypeEnum.USERDEFINED;
				        return;
						//##
										case Ifc4.Interfaces.IfcCondenserTypeEnum.WATERCOOLEDBRAZEDPLATE:
						PredefinedType = IfcCondenserTypeEnum.WATERCOOLEDBRAZEDPLATE;
						return;
					case Ifc4.Interfaces.IfcCondenserTypeEnum.WATERCOOLEDSHELLCOIL:
						PredefinedType = IfcCondenserTypeEnum.WATERCOOLEDSHELLCOIL;
						return;
					case Ifc4.Interfaces.IfcCondenserTypeEnum.WATERCOOLEDSHELLTUBE:
						PredefinedType = IfcCondenserTypeEnum.WATERCOOLEDSHELLTUBE;
						return;
					case Ifc4.Interfaces.IfcCondenserTypeEnum.WATERCOOLEDTUBEINTUBE:
						PredefinedType = IfcCondenserTypeEnum.WATERCOOLEDTUBEINTUBE;
						return;
					case Ifc4.Interfaces.IfcCondenserTypeEnum.USERDEFINED:
						PredefinedType = IfcCondenserTypeEnum.USERDEFINED;
						return;
					case Ifc4.Interfaces.IfcCondenserTypeEnum.NOTDEFINED:
						PredefinedType = IfcCondenserTypeEnum.NOTDEFINED;
						return;
					default:
						throw new System.ArgumentOutOfRangeException();
				}
				
			}
		}
	//## Custom code
	//##
	}
}