// ------------------------------------------------------------------------------
// <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.SharedBldgElements
{
	public partial class @IfcDoor : IIfcDoor
	{

		[CrossSchemaAttribute(typeof(IIfcDoor), 9)]
		Ifc4.MeasureResource.IfcPositiveLengthMeasure? IIfcDoor.OverallHeight 
		{ 
			get
			{
				if (!OverallHeight.HasValue) return null;
				return new Ifc4.MeasureResource.IfcPositiveLengthMeasure(OverallHeight.Value);
			} 
			set
			{
				OverallHeight = value.HasValue ? 
					new MeasureResource.IfcPositiveLengthMeasure(value.Value) :  
					 new MeasureResource.IfcPositiveLengthMeasure?() ;
				
			}
		}

		[CrossSchemaAttribute(typeof(IIfcDoor), 10)]
		Ifc4.MeasureResource.IfcPositiveLengthMeasure? IIfcDoor.OverallWidth 
		{ 
			get
			{
				if (!OverallWidth.HasValue) return null;
				return new Ifc4.MeasureResource.IfcPositiveLengthMeasure(OverallWidth.Value);
			} 
			set
			{
				OverallWidth = value.HasValue ? 
					new MeasureResource.IfcPositiveLengthMeasure(value.Value) :  
					 new MeasureResource.IfcPositiveLengthMeasure?() ;
				
			}
		}

		private  Ifc4.Interfaces.IfcDoorTypeEnum? _predefinedType;


		[CrossSchemaAttribute(typeof(IIfcDoor), 11)]
		Ifc4.Interfaces.IfcDoorTypeEnum? IIfcDoor.PredefinedType 
		{ 
			get
			{
				return _predefinedType;
			} 
			set
			{
				SetValue(v => _predefinedType = v, _predefinedType, value, "PredefinedType", -11);
				
			}
		}

		private  Ifc4.Interfaces.IfcDoorTypeOperationEnum? _operationType;


		[CrossSchemaAttribute(typeof(IIfcDoor), 12)]
		Ifc4.Interfaces.IfcDoorTypeOperationEnum? IIfcDoor.OperationType 
		{ 
			get
			{
				return _operationType;
			} 
			set
			{
				SetValue(v => _operationType = v, _operationType, value, "OperationType", -12);
				
			}
		}

		private  Ifc4.MeasureResource.IfcLabel? _userDefinedOperationType;


		[CrossSchemaAttribute(typeof(IIfcDoor), 13)]
		Ifc4.MeasureResource.IfcLabel? IIfcDoor.UserDefinedOperationType 
		{ 
			get
			{
				return _userDefinedOperationType;
			} 
			set
			{
				SetValue(v => _userDefinedOperationType = v, _userDefinedOperationType, value, "UserDefinedOperationType", -13);
				
			}
		}
	//## Custom code
        /// <summary>
	    /// Returns the Reference ID for this specified type in this project (e.g. type 'A-1'), if known
	    /// </summary>
	    /// <returns></returns>
	    public Ifc4.MeasureResource.IfcIdentifier? Reference
        {
            get
            {
                var val = GetPropertySingleNominalValue("Pset_DoorCommon", "Reference ");
                if (val is MeasureResource.IfcIdentifier)
                    return new Ifc4.MeasureResource.IfcIdentifier((MeasureResource.IfcIdentifier)val);
                return null;
            }
        }


	    /// <summary>
	    /// Returns if the door is external
	    /// </summary>
	    /// <returns></returns>
	    public Ifc4.MeasureResource.IfcBoolean? IsExternal
        {
            get
            {
                var val = GetPropertySingleNominalValue("Pset_DoorCommon", "IsExternal");
                if (val is MeasureResource.IfcBoolean)
                    return new Ifc4.MeasureResource.IfcBoolean((MeasureResource.IfcBoolean)val);
                return null; //default is to return false
            }
        }

	    /// <summary>
	    /// Returns whether the door is a Fire Exit or not, null if not known
	    /// </summary>
	    /// <returns></returns>
	    public Ifc4.MeasureResource.IfcBoolean? FireExit
        {
            get
            {
                var val = GetPropertySingleNominalValue("Pset_DoorCommon", "FireExit ");
                if (val is MeasureResource.IfcBoolean)
                    return new Ifc4.MeasureResource.IfcBoolean((MeasureResource.IfcBoolean)val);
                return null;
            }
        }

	    /// <summary>
	    /// Returns the fire rating if defined
	    /// </summary>
	    /// <returns></returns>
	    public  Ifc4.MeasureResource.IfcLabel? FireRating
        {
            get
            {
                var val = GetPropertySingleNominalValue("Pset_DoorCommon", "FireRating ");
                if (val is MeasureResource.IfcLabel)
                    return new Ifc4.MeasureResource.IfcLabel((MeasureResource.IfcLabel)val);
                return null;
            }
        }
	//##
	}
}