// ------------------------------------------------------------------------------
// <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.GeometricConstraintResource
{
	public partial class @IfcConnectionCurveGeometry : IIfcConnectionCurveGeometry
	{

		[CrossSchemaAttribute(typeof(IIfcConnectionCurveGeometry), 1)]
		IIfcCurveOrEdgeCurve IIfcConnectionCurveGeometry.CurveOnRelatingElement 
		{ 
			get
			{
				if (CurveOnRelatingElement == null) return null;
				var ifcboundedcurve = CurveOnRelatingElement as GeometryResource.IfcBoundedCurve;
				if (ifcboundedcurve != null) 
					return ifcboundedcurve;
				var ifcedgecurve = CurveOnRelatingElement as TopologyResource.IfcEdgeCurve;
				if (ifcedgecurve != null) 
					return ifcedgecurve;
				return null;
			} 
			set
			{
				if (value == null)
				{
					CurveOnRelatingElement = null;
					return;
				}	
				var ifcboundedcurve = value as GeometryResource.IfcBoundedCurve;
				if (ifcboundedcurve != null) 
				{
					CurveOnRelatingElement = ifcboundedcurve;
					return;
				}
				var ifcedgecurve = value as TopologyResource.IfcEdgeCurve;
				if (ifcedgecurve != null) 
				{
					CurveOnRelatingElement = ifcedgecurve;
					return;
				}
				
			}
		}

		[CrossSchemaAttribute(typeof(IIfcConnectionCurveGeometry), 2)]
		IIfcCurveOrEdgeCurve IIfcConnectionCurveGeometry.CurveOnRelatedElement 
		{ 
			get
			{
				if (CurveOnRelatedElement == null) return null;
				var ifcboundedcurve = CurveOnRelatedElement as GeometryResource.IfcBoundedCurve;
				if (ifcboundedcurve != null) 
					return ifcboundedcurve;
				var ifcedgecurve = CurveOnRelatedElement as TopologyResource.IfcEdgeCurve;
				if (ifcedgecurve != null) 
					return ifcedgecurve;
				return null;
			} 
			set
			{
				if (value == null)
				{
					CurveOnRelatedElement = null;
					return;
				}	
				var ifcboundedcurve = value as GeometryResource.IfcBoundedCurve;
				if (ifcboundedcurve != null) 
				{
					CurveOnRelatedElement = ifcboundedcurve;
					return;
				}
				var ifcedgecurve = value as TopologyResource.IfcEdgeCurve;
				if (ifcedgecurve != null) 
				{
					CurveOnRelatedElement = ifcedgecurve;
					return;
				}
				
			}
		}
	//## Custom code
	//##
	}
}