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

		[CrossSchemaAttribute(typeof(IIfcRelAssociatesDocument), 6)]
		IIfcDocumentSelect IIfcRelAssociatesDocument.RelatingDocument 
		{ 
			get
			{
				if (RelatingDocument == null) return null;
				var ifcdocumentinformation = RelatingDocument as ExternalReferenceResource.IfcDocumentInformation;
				if (ifcdocumentinformation != null) 
					return ifcdocumentinformation;
				var ifcdocumentreference = RelatingDocument as ExternalReferenceResource.IfcDocumentReference;
				if (ifcdocumentreference != null) 
					return ifcdocumentreference;
				return null;
			} 
			set
			{
				if (value == null)
				{
					RelatingDocument = null;
					return;
				}	
				var ifcdocumentinformation = value as ExternalReferenceResource.IfcDocumentInformation;
				if (ifcdocumentinformation != null) 
				{
					RelatingDocument = ifcdocumentinformation;
					return;
				}
				var ifcdocumentreference = value as ExternalReferenceResource.IfcDocumentReference;
				if (ifcdocumentreference != null) 
				{
					RelatingDocument = ifcdocumentreference;
					return;
				}
				
			}
		}
	//## Custom code
	//##
	}
}