// ------------------------------------------------------------------------------
// <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.ExternalReferenceResource
{
	public partial class @IfcLibraryReference : IIfcLibraryReference
	{

		[CrossSchemaAttribute(typeof(IIfcLibraryReference), 4)]
		Ifc4.MeasureResource.IfcText? IIfcLibraryReference.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(IIfcLibraryReference), 5)]
		Ifc4.ExternalReferenceResource.IfcLanguageId? IIfcLibraryReference.Language 
		{ 
			get
			{
				if (!Language.HasValue) return null;
				return new Ifc4.ExternalReferenceResource.IfcLanguageId(Language.Value);
			} 
			set
			{
				Language = value.HasValue ? 
					new IfcLanguageId(value.Value) :  
					 new IfcLanguageId?() ;
				
			}
		}

		[CrossSchemaAttribute(typeof(IIfcLibraryReference), 6)]
		IIfcLibraryInformation IIfcLibraryReference.ReferencedLibrary 
		{ 
			get
			{
				return ReferencedLibrary;
			} 
			set
			{
				ReferencedLibrary = value as IfcLibraryInformation;
				
			}
		}
		IEnumerable<IIfcRelAssociatesLibrary> IIfcLibraryReference.LibraryRefForObjects 
		{ 
			get
			{
				return Model.Instances.Where<IIfcRelAssociatesLibrary>(e => (e.RelatingLibrary as IfcLibraryReference) == this, "RelatingLibrary", this);
			} 
		}
	//## Custom code
	//##
	}
}