// ------------------------------------------------------------------------------
// <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 @IfcProxy : IIfcProxy
	{

		[CrossSchemaAttribute(typeof(IIfcProxy), 8)]
		Ifc4.Interfaces.IfcObjectTypeEnum IIfcProxy.ProxyType 
		{ 
			get
			{
				//## Custom code to handle enumeration of ProxyType
				//##
				switch (ProxyType)
				{
					case IfcObjectTypeEnum.PRODUCT:
						return Ifc4.Interfaces.IfcObjectTypeEnum.PRODUCT;
					case IfcObjectTypeEnum.PROCESS:
						return Ifc4.Interfaces.IfcObjectTypeEnum.PROCESS;
					case IfcObjectTypeEnum.CONTROL:
						return Ifc4.Interfaces.IfcObjectTypeEnum.CONTROL;
					case IfcObjectTypeEnum.RESOURCE:
						return Ifc4.Interfaces.IfcObjectTypeEnum.RESOURCE;
					case IfcObjectTypeEnum.ACTOR:
						return Ifc4.Interfaces.IfcObjectTypeEnum.ACTOR;
					case IfcObjectTypeEnum.GROUP:
						return Ifc4.Interfaces.IfcObjectTypeEnum.GROUP;
					case IfcObjectTypeEnum.PROJECT:
						return Ifc4.Interfaces.IfcObjectTypeEnum.PROJECT;
					case IfcObjectTypeEnum.NOTDEFINED:
						return Ifc4.Interfaces.IfcObjectTypeEnum.NOTDEFINED;
					
					default:
						throw new System.ArgumentOutOfRangeException();
				}
			} 
			set
			{
				//## Custom code to handle setting of enumeration of ProxyType
				//##
				switch (value)
				{
					case Ifc4.Interfaces.IfcObjectTypeEnum.PRODUCT:
						ProxyType = IfcObjectTypeEnum.PRODUCT;
						return;
					case Ifc4.Interfaces.IfcObjectTypeEnum.PROCESS:
						ProxyType = IfcObjectTypeEnum.PROCESS;
						return;
					case Ifc4.Interfaces.IfcObjectTypeEnum.CONTROL:
						ProxyType = IfcObjectTypeEnum.CONTROL;
						return;
					case Ifc4.Interfaces.IfcObjectTypeEnum.RESOURCE:
						ProxyType = IfcObjectTypeEnum.RESOURCE;
						return;
					case Ifc4.Interfaces.IfcObjectTypeEnum.ACTOR:
						ProxyType = IfcObjectTypeEnum.ACTOR;
						return;
					case Ifc4.Interfaces.IfcObjectTypeEnum.GROUP:
						ProxyType = IfcObjectTypeEnum.GROUP;
						return;
					case Ifc4.Interfaces.IfcObjectTypeEnum.PROJECT:
						ProxyType = IfcObjectTypeEnum.PROJECT;
						return;
					case Ifc4.Interfaces.IfcObjectTypeEnum.NOTDEFINED:
						ProxyType = IfcObjectTypeEnum.NOTDEFINED;
						return;
					default:
						throw new System.ArgumentOutOfRangeException();
				}
				
			}
		}

		[CrossSchemaAttribute(typeof(IIfcProxy), 9)]
		Ifc4.MeasureResource.IfcLabel? IIfcProxy.Tag 
		{ 
			get
			{
				if (!Tag.HasValue) return null;
				return new Ifc4.MeasureResource.IfcLabel(Tag.Value);
			} 
			set
			{
				Tag = value.HasValue ? 
					new MeasureResource.IfcLabel(value.Value) :  
					 new MeasureResource.IfcLabel?() ;
				
			}
		}
	//## Custom code
	//##
	}
}