// ------------------------------------------------------------------------------
// <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 @IfcRelAssociatesLibrary : IIfcRelAssociatesLibrary
	{

		[CrossSchemaAttribute(typeof(IIfcRelAssociatesLibrary), 6)]
		IIfcLibrarySelect IIfcRelAssociatesLibrary.RelatingLibrary 
		{ 
			get
			{
				if (RelatingLibrary == null) return null;
				var ifclibraryreference = RelatingLibrary as ExternalReferenceResource.IfcLibraryReference;
				if (ifclibraryreference != null) 
					return ifclibraryreference;
				var ifclibraryinformation = RelatingLibrary as ExternalReferenceResource.IfcLibraryInformation;
				if (ifclibraryinformation != null) 
					return ifclibraryinformation;
				return null;
			} 
			set
			{
				if (value == null)
				{
					RelatingLibrary = null;
					return;
				}	
				var ifclibraryinformation = value as ExternalReferenceResource.IfcLibraryInformation;
				if (ifclibraryinformation != null) 
				{
					RelatingLibrary = ifclibraryinformation;
					return;
				}
				var ifclibraryreference = value as ExternalReferenceResource.IfcLibraryReference;
				if (ifclibraryreference != null) 
				{
					RelatingLibrary = ifclibraryreference;
					return;
				}
				
			}
		}
	//## Custom code
	//##
	}
}