// ------------------------------------------------------------------------------
// <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.ProfilePropertyResource
{
	public partial class @IfcSectionProperties : IIfcSectionProperties
	{

		[CrossSchemaAttribute(typeof(IIfcSectionProperties), 1)]
		Ifc4.Interfaces.IfcSectionTypeEnum IIfcSectionProperties.SectionType 
		{ 
			get
			{
				//## Custom code to handle enumeration of SectionType
				//##
				switch (SectionType)
				{
					case IfcSectionTypeEnum.UNIFORM:
						return Ifc4.Interfaces.IfcSectionTypeEnum.UNIFORM;
					case IfcSectionTypeEnum.TAPERED:
						return Ifc4.Interfaces.IfcSectionTypeEnum.TAPERED;
					
					default:
						throw new System.ArgumentOutOfRangeException();
				}
			} 
			set
			{
				//## Custom code to handle setting of enumeration of SectionType
				//##
				switch (value)
				{
					case Ifc4.Interfaces.IfcSectionTypeEnum.UNIFORM:
						SectionType = IfcSectionTypeEnum.UNIFORM;
						return;
					case Ifc4.Interfaces.IfcSectionTypeEnum.TAPERED:
						SectionType = IfcSectionTypeEnum.TAPERED;
						return;
					default:
						throw new System.ArgumentOutOfRangeException();
				}
				
			}
		}

		[CrossSchemaAttribute(typeof(IIfcSectionProperties), 2)]
		IIfcProfileDef IIfcSectionProperties.StartProfile 
		{ 
			get
			{
				return StartProfile;
			} 
			set
			{
				StartProfile = value as ProfileResource.IfcProfileDef;
				
			}
		}

		[CrossSchemaAttribute(typeof(IIfcSectionProperties), 3)]
		IIfcProfileDef IIfcSectionProperties.EndProfile 
		{ 
			get
			{
				return EndProfile;
			} 
			set
			{
				EndProfile = value as ProfileResource.IfcProfileDef;
				
			}
		}
		IEnumerable<IIfcExternalReferenceRelationship> IIfcPropertyAbstraction.HasExternalReferences 
		{ 
			get
			{
				return Model.Instances.Where<IIfcExternalReferenceRelationship>(e => e.RelatedResourceObjects != null &&  e.RelatedResourceObjects.Contains(this), "RelatedResourceObjects", this);
			} 
		}
	//## Custom code
	//##
	}
}