// ------------------------------------------------------------------------------
// <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.Kernel
{
	public partial class @IfcProject : IIfcProject
	{

		[CrossSchemaAttribute(typeof(IIfcProject), 5)]
		Ifc4.MeasureResource.IfcLabel? IIfcContext.ObjectType 
		{ 
			get
			{
				if (!ObjectType.HasValue) return null;
				return new Ifc4.MeasureResource.IfcLabel(ObjectType.Value);
			} 
			set
			{
				ObjectType = value.HasValue ? 
					new MeasureResource.IfcLabel(value.Value) :  
					 new MeasureResource.IfcLabel?() ;
				
			}
		}

		[CrossSchemaAttribute(typeof(IIfcProject), 6)]
		Ifc4.MeasureResource.IfcLabel? IIfcContext.LongName 
		{ 
			get
			{
				if (!LongName.HasValue) return null;
				return new Ifc4.MeasureResource.IfcLabel(LongName.Value);
			} 
			set
			{
				LongName = value.HasValue ? 
					new MeasureResource.IfcLabel(value.Value) :  
					 new MeasureResource.IfcLabel?() ;
				
			}
		}

		[CrossSchemaAttribute(typeof(IIfcProject), 7)]
		Ifc4.MeasureResource.IfcLabel? IIfcContext.Phase 
		{ 
			get
			{
				if (!Phase.HasValue) return null;
				return new Ifc4.MeasureResource.IfcLabel(Phase.Value);
			} 
			set
			{
				Phase = value.HasValue ? 
					new MeasureResource.IfcLabel(value.Value) :  
					 new MeasureResource.IfcLabel?() ;
				
			}
		}

		[CrossSchemaAttribute(typeof(IIfcProject), 8)]
		IItemSet<IIfcRepresentationContext> IIfcContext.RepresentationContexts 
		{ 
			get
			{
			
				return new Common.Collections.ProxyItemSet<RepresentationResource.IfcRepresentationContext, IIfcRepresentationContext>(RepresentationContexts);
			} 
		}

		[CrossSchemaAttribute(typeof(IIfcProject), 9)]
		IIfcUnitAssignment IIfcContext.UnitsInContext 
		{ 
			get
			{
				return UnitsInContext;
			} 
			set
			{
				UnitsInContext = value as MeasureResource.IfcUnitAssignment;
				
			}
		}
		IEnumerable<IIfcRelDefinesByProperties> IIfcContext.IsDefinedBy 
		{ 
			get
			{
				return Model.Instances.Where<IIfcRelDefinesByProperties>(e => e.RelatedObjects != null &&  e.RelatedObjects.Contains(this), "RelatedObjects", this);
			} 
		}
		IEnumerable<IIfcRelDeclares> IIfcContext.Declares 
		{ 
			get
			{
				return Model.Instances.Where<IIfcRelDeclares>(e => (e.RelatingContext as IfcProject) == this, "RelatingContext", this);
			} 
		}
	//## Custom code
	//##
	}
}