// ------------------------------------------------------------------------------
// <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.UtilityResource
{
	public partial class @IfcTableColumn : IIfcTableColumn
	{

		[CrossSchemaAttribute(typeof(IIfcTableColumn), 1)]
		Ifc4.MeasureResource.IfcIdentifier? IIfcTableColumn.Identifier 
		{ 
			get
			{
				if (!Identifier.HasValue) return null;
				return new Ifc4.MeasureResource.IfcIdentifier(Identifier.Value);
			} 
			set
			{
				Identifier = value.HasValue ? 
					new MeasureResource.IfcIdentifier(value.Value) :  
					 new MeasureResource.IfcIdentifier?() ;
				
			}
		}

		[CrossSchemaAttribute(typeof(IIfcTableColumn), 2)]
		Ifc4.MeasureResource.IfcLabel? IIfcTableColumn.Name 
		{ 
			get
			{
				if (!Name.HasValue) return null;
				return new Ifc4.MeasureResource.IfcLabel(Name.Value);
			} 
			set
			{
				Name = value.HasValue ? 
					new MeasureResource.IfcLabel(value.Value) :  
					 new MeasureResource.IfcLabel?() ;
				
			}
		}

		[CrossSchemaAttribute(typeof(IIfcTableColumn), 3)]
		Ifc4.MeasureResource.IfcText? IIfcTableColumn.Description 
		{ 
			get
			{
				if (!Description.HasValue) return null;
				return new Ifc4.MeasureResource.IfcText(Description.Value);
			} 
			set
			{
				Description = value.HasValue ? 
					new MeasureResource.IfcText(value.Value) :  
					 new MeasureResource.IfcText?() ;
				
			}
		}

		[CrossSchemaAttribute(typeof(IIfcTableColumn), 4)]
		IIfcUnit IIfcTableColumn.Unit 
		{ 
			get
			{
				if (Unit == null) return null;
				var ifcderivedunit = Unit as MeasureResource.IfcDerivedUnit;
				if (ifcderivedunit != null) 
					return ifcderivedunit;
				var ifcmonetaryunit = Unit as MeasureResource.IfcMonetaryUnit;
				if (ifcmonetaryunit != null) 
					return ifcmonetaryunit;
				var ifcnamedunit = Unit as MeasureResource.IfcNamedUnit;
				if (ifcnamedunit != null) 
					return ifcnamedunit;
				return null;
			} 
			set
			{
				if (value == null)
				{
					Unit = null;
					return;
				}	
				var ifcderivedunit = value as MeasureResource.IfcDerivedUnit;
				if (ifcderivedunit != null) 
				{
					Unit = ifcderivedunit;
					return;
				}
				var ifcmonetaryunit = value as MeasureResource.IfcMonetaryUnit;
				if (ifcmonetaryunit != null) 
				{
					Unit = ifcmonetaryunit;
					return;
				}
				var ifcnamedunit = value as MeasureResource.IfcNamedUnit;
				if (ifcnamedunit != null) 
				{
					Unit = ifcnamedunit;
					return;
				}
				
			}
		}

		[CrossSchemaAttribute(typeof(IIfcTableColumn), 5)]
		IIfcReference IIfcTableColumn.ReferencePath 
		{ 
			get
			{
				return ReferencePath;
			} 
			set
			{
				ReferencePath = value as ConstraintResource.IfcReference;
				
			}
		}
	//## Custom code
	//##
	}
}