// ------------------------------------------------------------------------------
// <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.StructuralElementsDomain
{
	public partial class @IfcTendonType : IIfcTendonType
	{

		[CrossSchemaAttribute(typeof(IIfcTendonType), 10)]
		Ifc4.Interfaces.IfcTendonTypeEnum IIfcTendonType.PredefinedType 
		{ 
			get
			{
				//## Custom code to handle enumeration of PredefinedType
				//##
				switch (PredefinedType)
				{
					case IfcTendonTypeEnum.BAR:
						return Ifc4.Interfaces.IfcTendonTypeEnum.BAR;
					case IfcTendonTypeEnum.COATED:
						return Ifc4.Interfaces.IfcTendonTypeEnum.COATED;
					case IfcTendonTypeEnum.STRAND:
						return Ifc4.Interfaces.IfcTendonTypeEnum.STRAND;
					case IfcTendonTypeEnum.WIRE:
						return Ifc4.Interfaces.IfcTendonTypeEnum.WIRE;
					case IfcTendonTypeEnum.USERDEFINED:
						//## Optional custom handling of PredefinedType == .USERDEFINED. 
						//##
						return Ifc4.Interfaces.IfcTendonTypeEnum.USERDEFINED;
					case IfcTendonTypeEnum.NOTDEFINED:
						return Ifc4.Interfaces.IfcTendonTypeEnum.NOTDEFINED;
					
					default:
						throw new System.ArgumentOutOfRangeException();
				}
			} 
			set
			{
				//## Custom code to handle setting of enumeration of PredefinedType
				//##
				switch (value)
				{
					case Ifc4.Interfaces.IfcTendonTypeEnum.BAR:
						PredefinedType = IfcTendonTypeEnum.BAR;
						return;
					case Ifc4.Interfaces.IfcTendonTypeEnum.COATED:
						PredefinedType = IfcTendonTypeEnum.COATED;
						return;
					case Ifc4.Interfaces.IfcTendonTypeEnum.STRAND:
						PredefinedType = IfcTendonTypeEnum.STRAND;
						return;
					case Ifc4.Interfaces.IfcTendonTypeEnum.WIRE:
						PredefinedType = IfcTendonTypeEnum.WIRE;
						return;
					case Ifc4.Interfaces.IfcTendonTypeEnum.USERDEFINED:
						PredefinedType = IfcTendonTypeEnum.USERDEFINED;
						return;
					case Ifc4.Interfaces.IfcTendonTypeEnum.NOTDEFINED:
						PredefinedType = IfcTendonTypeEnum.NOTDEFINED;
						return;
					default:
						throw new System.ArgumentOutOfRangeException();
				}
				
			}
		}

		[CrossSchemaAttribute(typeof(IIfcTendonType), 11)]
		Ifc4.MeasureResource.IfcPositiveLengthMeasure? IIfcTendonType.NominalDiameter 
		{ 
			get
			{
				if (!NominalDiameter.HasValue) return null;
				return new Ifc4.MeasureResource.IfcPositiveLengthMeasure(NominalDiameter.Value);
			} 
			set
			{
				NominalDiameter = value.HasValue ? 
					new MeasureResource.IfcPositiveLengthMeasure(value.Value) :  
					 new MeasureResource.IfcPositiveLengthMeasure?() ;
				
			}
		}

		[CrossSchemaAttribute(typeof(IIfcTendonType), 12)]
		Ifc4.MeasureResource.IfcAreaMeasure? IIfcTendonType.CrossSectionArea 
		{ 
			get
			{
				if (!CrossSectionArea.HasValue) return null;
				return new Ifc4.MeasureResource.IfcAreaMeasure(CrossSectionArea.Value);
			} 
			set
			{
				CrossSectionArea = value.HasValue ? 
					new MeasureResource.IfcAreaMeasure(value.Value) :  
					 new MeasureResource.IfcAreaMeasure?() ;
				
			}
		}

		[CrossSchemaAttribute(typeof(IIfcTendonType), 13)]
		Ifc4.MeasureResource.IfcPositiveLengthMeasure? IIfcTendonType.SheathDiameter 
		{ 
			get
			{
				if (!SheathDiameter.HasValue) return null;
				return new Ifc4.MeasureResource.IfcPositiveLengthMeasure(SheathDiameter.Value);
			} 
			set
			{
				SheathDiameter = value.HasValue ? 
					new MeasureResource.IfcPositiveLengthMeasure(value.Value) :  
					 new MeasureResource.IfcPositiveLengthMeasure?() ;
				
			}
		}
	//## Custom code
	//##
	}
}