// ------------------------------------------------------------------------------
// <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.SharedBldgServiceElements
{
	public partial class @IfcDistributionPort : IIfcDistributionPort
	{

		[CrossSchemaAttribute(typeof(IIfcDistributionPort), 8)]
		Ifc4.Interfaces.IfcFlowDirectionEnum? IIfcDistributionPort.FlowDirection 
		{ 
			get
			{
				//## Custom code to handle enumeration of FlowDirection
				//##
				switch (FlowDirection)
				{
					case IfcFlowDirectionEnum.SINK:
						return Ifc4.Interfaces.IfcFlowDirectionEnum.SINK;
					case IfcFlowDirectionEnum.SOURCE:
						return Ifc4.Interfaces.IfcFlowDirectionEnum.SOURCE;
					case IfcFlowDirectionEnum.SOURCEANDSINK:
						return Ifc4.Interfaces.IfcFlowDirectionEnum.SOURCEANDSINK;
					case IfcFlowDirectionEnum.NOTDEFINED:
						return Ifc4.Interfaces.IfcFlowDirectionEnum.NOTDEFINED;
					case null: 
						return null;
					
					default:
						throw new System.ArgumentOutOfRangeException();
				}
			} 
			set
			{
				//## Custom code to handle setting of enumeration of FlowDirection
				//##
				switch (value)
				{
					case Ifc4.Interfaces.IfcFlowDirectionEnum.SOURCE:
						FlowDirection = IfcFlowDirectionEnum.SOURCE;
						return;
					case Ifc4.Interfaces.IfcFlowDirectionEnum.SINK:
						FlowDirection = IfcFlowDirectionEnum.SINK;
						return;
					case Ifc4.Interfaces.IfcFlowDirectionEnum.SOURCEANDSINK:
						FlowDirection = IfcFlowDirectionEnum.SOURCEANDSINK;
						return;
					case Ifc4.Interfaces.IfcFlowDirectionEnum.NOTDEFINED:
						FlowDirection = IfcFlowDirectionEnum.NOTDEFINED;
						return;
					
					case null:
						FlowDirection = null;
						return;
					default:
						throw new System.ArgumentOutOfRangeException();
				}
				
			}
		}

		[CrossSchemaAttribute(typeof(IIfcDistributionPort), 9)]
		Ifc4.Interfaces.IfcDistributionPortTypeEnum? IIfcDistributionPort.PredefinedType 
		{ 
			get
			{
				//## Custom code to handle enumeration of PredefinedType
				//##
				switch (PredefinedType)
				{
					case IfcDistributionPortTypeEnum.CABLE:
						return Ifc4.Interfaces.IfcDistributionPortTypeEnum.CABLE;
					case IfcDistributionPortTypeEnum.CABLECARRIER:
						return Ifc4.Interfaces.IfcDistributionPortTypeEnum.CABLECARRIER;
					case IfcDistributionPortTypeEnum.DUCT:
						return Ifc4.Interfaces.IfcDistributionPortTypeEnum.DUCT;
					case IfcDistributionPortTypeEnum.PIPE:
						return Ifc4.Interfaces.IfcDistributionPortTypeEnum.PIPE;
					case IfcDistributionPortTypeEnum.WIRELESS:
						//## Handle translation of WIRELESS member from IfcDistributionPortTypeEnum in property PredefinedType
						return this.GetUserDefined<Ifc4.Interfaces.IfcDistributionPortTypeEnum>();
						//##
					case IfcDistributionPortTypeEnum.USERDEFINED:
						//## Optional custom handling of PredefinedType == .USERDEFINED. 
						//##
						return Ifc4.Interfaces.IfcDistributionPortTypeEnum.USERDEFINED;
					case IfcDistributionPortTypeEnum.NOTDEFINED:
						return Ifc4.Interfaces.IfcDistributionPortTypeEnum.NOTDEFINED;
					case null: 
						return null;
					
					default:
						throw new System.ArgumentOutOfRangeException();
				}
			} 
			set
			{
				//## Custom code to handle setting of enumeration of PredefinedType
				//##
				switch (value)
				{
					case Ifc4.Interfaces.IfcDistributionPortTypeEnum.CABLE:
						PredefinedType = IfcDistributionPortTypeEnum.CABLE;
						return;
					case Ifc4.Interfaces.IfcDistributionPortTypeEnum.CABLECARRIER:
						PredefinedType = IfcDistributionPortTypeEnum.CABLECARRIER;
						return;
					case Ifc4.Interfaces.IfcDistributionPortTypeEnum.DUCT:
						PredefinedType = IfcDistributionPortTypeEnum.DUCT;
						return;
					case Ifc4.Interfaces.IfcDistributionPortTypeEnum.PIPE:
						PredefinedType = IfcDistributionPortTypeEnum.PIPE;
						return;
					case Ifc4.Interfaces.IfcDistributionPortTypeEnum.USERDEFINED:
						PredefinedType = IfcDistributionPortTypeEnum.USERDEFINED;
						return;
					case Ifc4.Interfaces.IfcDistributionPortTypeEnum.NOTDEFINED:
						PredefinedType = IfcDistributionPortTypeEnum.NOTDEFINED;
						return;
					
					case null:
						PredefinedType = null;
						return;
					default:
						throw new System.ArgumentOutOfRangeException();
				}
				
			}
		}

		[CrossSchemaAttribute(typeof(IIfcDistributionPort), 10)]
		Ifc4.Interfaces.IfcDistributionSystemEnum? IIfcDistributionPort.SystemType 
		{ 
			get
			{
				//## Custom code to handle enumeration of SystemType
				//##
				switch (SystemType)
				{
					case IfcDistributionSystemEnum.AIRCONDITIONING:
						return Ifc4.Interfaces.IfcDistributionSystemEnum.AIRCONDITIONING;
					case IfcDistributionSystemEnum.AUDIOVISUAL:
						return Ifc4.Interfaces.IfcDistributionSystemEnum.AUDIOVISUAL;
					case IfcDistributionSystemEnum.CATENARY_SYSTEM:
                        //## Handle translation of CATENARY_SYSTEM member from IfcDistributionSystemEnum in property SystemType
                        return this.GetUserDefined<Ifc4.Interfaces.IfcDistributionSystemEnum>();
                    //##
                    case IfcDistributionSystemEnum.CHEMICAL:
						return Ifc4.Interfaces.IfcDistributionSystemEnum.CHEMICAL;
					case IfcDistributionSystemEnum.CHILLEDWATER:
						return Ifc4.Interfaces.IfcDistributionSystemEnum.CHILLEDWATER;
					case IfcDistributionSystemEnum.COMMUNICATION:
						return Ifc4.Interfaces.IfcDistributionSystemEnum.COMMUNICATION;
					case IfcDistributionSystemEnum.COMPRESSEDAIR:
						return Ifc4.Interfaces.IfcDistributionSystemEnum.COMPRESSEDAIR;
					case IfcDistributionSystemEnum.CONDENSERWATER:
						return Ifc4.Interfaces.IfcDistributionSystemEnum.CONDENSERWATER;
					case IfcDistributionSystemEnum.CONTROL:
						return Ifc4.Interfaces.IfcDistributionSystemEnum.CONTROL;
					case IfcDistributionSystemEnum.CONVEYING:
						return Ifc4.Interfaces.IfcDistributionSystemEnum.CONVEYING;
					case IfcDistributionSystemEnum.DATA:
						return Ifc4.Interfaces.IfcDistributionSystemEnum.DATA;
					case IfcDistributionSystemEnum.DISPOSAL:
						return Ifc4.Interfaces.IfcDistributionSystemEnum.DISPOSAL;
					case IfcDistributionSystemEnum.DOMESTICCOLDWATER:
						return Ifc4.Interfaces.IfcDistributionSystemEnum.DOMESTICCOLDWATER;
					case IfcDistributionSystemEnum.DOMESTICHOTWATER:
						return Ifc4.Interfaces.IfcDistributionSystemEnum.DOMESTICHOTWATER;
					case IfcDistributionSystemEnum.DRAINAGE:
						return Ifc4.Interfaces.IfcDistributionSystemEnum.DRAINAGE;
					case IfcDistributionSystemEnum.EARTHING:
						return Ifc4.Interfaces.IfcDistributionSystemEnum.EARTHING;
					case IfcDistributionSystemEnum.ELECTRICAL:
						return Ifc4.Interfaces.IfcDistributionSystemEnum.ELECTRICAL;
					case IfcDistributionSystemEnum.ELECTROACOUSTIC:
						return Ifc4.Interfaces.IfcDistributionSystemEnum.ELECTROACOUSTIC;
					case IfcDistributionSystemEnum.EXHAUST:
						return Ifc4.Interfaces.IfcDistributionSystemEnum.EXHAUST;
					case IfcDistributionSystemEnum.FIREPROTECTION:
						return Ifc4.Interfaces.IfcDistributionSystemEnum.FIREPROTECTION;
					case IfcDistributionSystemEnum.FIXEDTRANSMISSIONNETWORK:
                        //## Handle translation of FIXEDTRANSMISSIONNETWORK member from IfcDistributionSystemEnum in property SystemType
                        return this.GetUserDefined<Ifc4.Interfaces.IfcDistributionSystemEnum>();
                    //##
                    case IfcDistributionSystemEnum.FUEL:
						return Ifc4.Interfaces.IfcDistributionSystemEnum.FUEL;
					case IfcDistributionSystemEnum.GAS:
						return Ifc4.Interfaces.IfcDistributionSystemEnum.GAS;
					case IfcDistributionSystemEnum.HAZARDOUS:
						return Ifc4.Interfaces.IfcDistributionSystemEnum.HAZARDOUS;
					case IfcDistributionSystemEnum.HEATING:
						return Ifc4.Interfaces.IfcDistributionSystemEnum.HEATING;
					case IfcDistributionSystemEnum.LIGHTING:
						return Ifc4.Interfaces.IfcDistributionSystemEnum.LIGHTING;
					case IfcDistributionSystemEnum.LIGHTNINGPROTECTION:
						return Ifc4.Interfaces.IfcDistributionSystemEnum.LIGHTNINGPROTECTION;
					case IfcDistributionSystemEnum.MOBILENETWORK:
                        //## Handle translation of MOBILENETWORK member from IfcDistributionSystemEnum in property SystemType
                        return this.GetUserDefined<Ifc4.Interfaces.IfcDistributionSystemEnum>();
                    //##
                    case IfcDistributionSystemEnum.MONITORINGSYSTEM:
                        //## Handle translation of MONITORINGSYSTEM member from IfcDistributionSystemEnum in property SystemType
                        return this.GetUserDefined<Ifc4.Interfaces.IfcDistributionSystemEnum>();
                    //##
                    case IfcDistributionSystemEnum.MUNICIPALSOLIDWASTE:
						return Ifc4.Interfaces.IfcDistributionSystemEnum.MUNICIPALSOLIDWASTE;
					case IfcDistributionSystemEnum.OIL:
						return Ifc4.Interfaces.IfcDistributionSystemEnum.OIL;
					case IfcDistributionSystemEnum.OPERATIONAL:
						return Ifc4.Interfaces.IfcDistributionSystemEnum.OPERATIONAL;
					case IfcDistributionSystemEnum.OPERATIONALTELEPHONYSYSTEM:
                        //## Handle translation of OPERATIONALTELEPHONYSYSTEM member from IfcDistributionSystemEnum in property SystemType
                        return this.GetUserDefined<Ifc4.Interfaces.IfcDistributionSystemEnum>();
                    //##
                    case IfcDistributionSystemEnum.OVERHEAD_CONTACTLINE_SYSTEM:
                        //## Handle translation of OVERHEAD_CONTACTLINE_SYSTEM member from IfcDistributionSystemEnum in property SystemType
                        return this.GetUserDefined<Ifc4.Interfaces.IfcDistributionSystemEnum>();
                    //##
                    case IfcDistributionSystemEnum.POWERGENERATION:
						return Ifc4.Interfaces.IfcDistributionSystemEnum.POWERGENERATION;
					case IfcDistributionSystemEnum.RAINWATER:
						return Ifc4.Interfaces.IfcDistributionSystemEnum.RAINWATER;
					case IfcDistributionSystemEnum.REFRIGERATION:
						return Ifc4.Interfaces.IfcDistributionSystemEnum.REFRIGERATION;
					case IfcDistributionSystemEnum.RETURN_CIRCUIT:
                        //## Handle translation of RETURN_CIRCUIT member from IfcDistributionSystemEnum in property SystemType
                        return this.GetUserDefined<Ifc4.Interfaces.IfcDistributionSystemEnum>();
                    //##
                    case IfcDistributionSystemEnum.SECURITY:
						return Ifc4.Interfaces.IfcDistributionSystemEnum.SECURITY;
					case IfcDistributionSystemEnum.SEWAGE:
						return Ifc4.Interfaces.IfcDistributionSystemEnum.SEWAGE;
					case IfcDistributionSystemEnum.SIGNAL:
						return Ifc4.Interfaces.IfcDistributionSystemEnum.SIGNAL;
					case IfcDistributionSystemEnum.STORMWATER:
						return Ifc4.Interfaces.IfcDistributionSystemEnum.STORMWATER;
					case IfcDistributionSystemEnum.TELEPHONE:
						return Ifc4.Interfaces.IfcDistributionSystemEnum.TELEPHONE;
					case IfcDistributionSystemEnum.TV:
						return Ifc4.Interfaces.IfcDistributionSystemEnum.TV;
					case IfcDistributionSystemEnum.VACUUM:
						return Ifc4.Interfaces.IfcDistributionSystemEnum.VACUUM;
					case IfcDistributionSystemEnum.VENT:
						return Ifc4.Interfaces.IfcDistributionSystemEnum.VENT;
					case IfcDistributionSystemEnum.VENTILATION:
						return Ifc4.Interfaces.IfcDistributionSystemEnum.VENTILATION;
					case IfcDistributionSystemEnum.WASTEWATER:
						return Ifc4.Interfaces.IfcDistributionSystemEnum.WASTEWATER;
					case IfcDistributionSystemEnum.WATERSUPPLY:
						return Ifc4.Interfaces.IfcDistributionSystemEnum.WATERSUPPLY;
					case IfcDistributionSystemEnum.USERDEFINED:
						//## Optional custom handling of SystemType == .USERDEFINED. 
						//##
						return Ifc4.Interfaces.IfcDistributionSystemEnum.USERDEFINED;
					case IfcDistributionSystemEnum.NOTDEFINED:
						return Ifc4.Interfaces.IfcDistributionSystemEnum.NOTDEFINED;
					case null: 
						return null;
					
					default:
						throw new System.ArgumentOutOfRangeException();
				}
			} 
			set
			{
				//## Custom code to handle setting of enumeration of SystemType
				//##
				switch (value)
				{
					case Ifc4.Interfaces.IfcDistributionSystemEnum.AIRCONDITIONING:
						SystemType = IfcDistributionSystemEnum.AIRCONDITIONING;
						return;
					case Ifc4.Interfaces.IfcDistributionSystemEnum.AUDIOVISUAL:
						SystemType = IfcDistributionSystemEnum.AUDIOVISUAL;
						return;
					case Ifc4.Interfaces.IfcDistributionSystemEnum.CHEMICAL:
						SystemType = IfcDistributionSystemEnum.CHEMICAL;
						return;
					case Ifc4.Interfaces.IfcDistributionSystemEnum.CHILLEDWATER:
						SystemType = IfcDistributionSystemEnum.CHILLEDWATER;
						return;
					case Ifc4.Interfaces.IfcDistributionSystemEnum.COMMUNICATION:
						SystemType = IfcDistributionSystemEnum.COMMUNICATION;
						return;
					case Ifc4.Interfaces.IfcDistributionSystemEnum.COMPRESSEDAIR:
						SystemType = IfcDistributionSystemEnum.COMPRESSEDAIR;
						return;
					case Ifc4.Interfaces.IfcDistributionSystemEnum.CONDENSERWATER:
						SystemType = IfcDistributionSystemEnum.CONDENSERWATER;
						return;
					case Ifc4.Interfaces.IfcDistributionSystemEnum.CONTROL:
						SystemType = IfcDistributionSystemEnum.CONTROL;
						return;
					case Ifc4.Interfaces.IfcDistributionSystemEnum.CONVEYING:
						SystemType = IfcDistributionSystemEnum.CONVEYING;
						return;
					case Ifc4.Interfaces.IfcDistributionSystemEnum.DATA:
						SystemType = IfcDistributionSystemEnum.DATA;
						return;
					case Ifc4.Interfaces.IfcDistributionSystemEnum.DISPOSAL:
						SystemType = IfcDistributionSystemEnum.DISPOSAL;
						return;
					case Ifc4.Interfaces.IfcDistributionSystemEnum.DOMESTICCOLDWATER:
						SystemType = IfcDistributionSystemEnum.DOMESTICCOLDWATER;
						return;
					case Ifc4.Interfaces.IfcDistributionSystemEnum.DOMESTICHOTWATER:
						SystemType = IfcDistributionSystemEnum.DOMESTICHOTWATER;
						return;
					case Ifc4.Interfaces.IfcDistributionSystemEnum.DRAINAGE:
						SystemType = IfcDistributionSystemEnum.DRAINAGE;
						return;
					case Ifc4.Interfaces.IfcDistributionSystemEnum.EARTHING:
						SystemType = IfcDistributionSystemEnum.EARTHING;
						return;
					case Ifc4.Interfaces.IfcDistributionSystemEnum.ELECTRICAL:
						SystemType = IfcDistributionSystemEnum.ELECTRICAL;
						return;
					case Ifc4.Interfaces.IfcDistributionSystemEnum.ELECTROACOUSTIC:
						SystemType = IfcDistributionSystemEnum.ELECTROACOUSTIC;
						return;
					case Ifc4.Interfaces.IfcDistributionSystemEnum.EXHAUST:
						SystemType = IfcDistributionSystemEnum.EXHAUST;
						return;
					case Ifc4.Interfaces.IfcDistributionSystemEnum.FIREPROTECTION:
						SystemType = IfcDistributionSystemEnum.FIREPROTECTION;
						return;
					case Ifc4.Interfaces.IfcDistributionSystemEnum.FUEL:
						SystemType = IfcDistributionSystemEnum.FUEL;
						return;
					case Ifc4.Interfaces.IfcDistributionSystemEnum.GAS:
						SystemType = IfcDistributionSystemEnum.GAS;
						return;
					case Ifc4.Interfaces.IfcDistributionSystemEnum.HAZARDOUS:
						SystemType = IfcDistributionSystemEnum.HAZARDOUS;
						return;
					case Ifc4.Interfaces.IfcDistributionSystemEnum.HEATING:
						SystemType = IfcDistributionSystemEnum.HEATING;
						return;
					case Ifc4.Interfaces.IfcDistributionSystemEnum.LIGHTING:
						SystemType = IfcDistributionSystemEnum.LIGHTING;
						return;
					case Ifc4.Interfaces.IfcDistributionSystemEnum.LIGHTNINGPROTECTION:
						SystemType = IfcDistributionSystemEnum.LIGHTNINGPROTECTION;
						return;
					case Ifc4.Interfaces.IfcDistributionSystemEnum.MUNICIPALSOLIDWASTE:
						SystemType = IfcDistributionSystemEnum.MUNICIPALSOLIDWASTE;
						return;
					case Ifc4.Interfaces.IfcDistributionSystemEnum.OIL:
						SystemType = IfcDistributionSystemEnum.OIL;
						return;
					case Ifc4.Interfaces.IfcDistributionSystemEnum.OPERATIONAL:
						SystemType = IfcDistributionSystemEnum.OPERATIONAL;
						return;
					case Ifc4.Interfaces.IfcDistributionSystemEnum.POWERGENERATION:
						SystemType = IfcDistributionSystemEnum.POWERGENERATION;
						return;
					case Ifc4.Interfaces.IfcDistributionSystemEnum.RAINWATER:
						SystemType = IfcDistributionSystemEnum.RAINWATER;
						return;
					case Ifc4.Interfaces.IfcDistributionSystemEnum.REFRIGERATION:
						SystemType = IfcDistributionSystemEnum.REFRIGERATION;
						return;
					case Ifc4.Interfaces.IfcDistributionSystemEnum.SECURITY:
						SystemType = IfcDistributionSystemEnum.SECURITY;
						return;
					case Ifc4.Interfaces.IfcDistributionSystemEnum.SEWAGE:
						SystemType = IfcDistributionSystemEnum.SEWAGE;
						return;
					case Ifc4.Interfaces.IfcDistributionSystemEnum.SIGNAL:
						SystemType = IfcDistributionSystemEnum.SIGNAL;
						return;
					case Ifc4.Interfaces.IfcDistributionSystemEnum.STORMWATER:
						SystemType = IfcDistributionSystemEnum.STORMWATER;
						return;
					case Ifc4.Interfaces.IfcDistributionSystemEnum.TELEPHONE:
						SystemType = IfcDistributionSystemEnum.TELEPHONE;
						return;
					case Ifc4.Interfaces.IfcDistributionSystemEnum.TV:
						SystemType = IfcDistributionSystemEnum.TV;
						return;
					case Ifc4.Interfaces.IfcDistributionSystemEnum.VACUUM:
						SystemType = IfcDistributionSystemEnum.VACUUM;
						return;
					case Ifc4.Interfaces.IfcDistributionSystemEnum.VENT:
						SystemType = IfcDistributionSystemEnum.VENT;
						return;
					case Ifc4.Interfaces.IfcDistributionSystemEnum.VENTILATION:
						SystemType = IfcDistributionSystemEnum.VENTILATION;
						return;
					case Ifc4.Interfaces.IfcDistributionSystemEnum.WASTEWATER:
						SystemType = IfcDistributionSystemEnum.WASTEWATER;
						return;
					case Ifc4.Interfaces.IfcDistributionSystemEnum.WATERSUPPLY:
						SystemType = IfcDistributionSystemEnum.WATERSUPPLY;
						return;
					case Ifc4.Interfaces.IfcDistributionSystemEnum.USERDEFINED:
						SystemType = IfcDistributionSystemEnum.USERDEFINED;
						return;
					case Ifc4.Interfaces.IfcDistributionSystemEnum.NOTDEFINED:
						SystemType = IfcDistributionSystemEnum.NOTDEFINED;
						return;
					
					case null:
						SystemType = null;
						return;
					default:
						throw new System.ArgumentOutOfRangeException();
				}
				
			}
		}
	//## Custom code
	//##
	}
}