// ------------------------------------------------------------------------------
// <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.SharedMgmtElements
{
	public partial class @IfcCostSchedule : IIfcCostSchedule
	{

		[CrossSchemaAttribute(typeof(IIfcCostSchedule), 7)]
		Ifc4.Interfaces.IfcCostScheduleTypeEnum? IIfcCostSchedule.PredefinedType 
		{ 
			get
			{
				//## Custom code to handle enumeration of PredefinedType
				//##
				switch (PredefinedType)
				{
					case IfcCostScheduleTypeEnum.BUDGET:
						return Ifc4.Interfaces.IfcCostScheduleTypeEnum.BUDGET;
					case IfcCostScheduleTypeEnum.COSTPLAN:
						return Ifc4.Interfaces.IfcCostScheduleTypeEnum.COSTPLAN;
					case IfcCostScheduleTypeEnum.ESTIMATE:
						return Ifc4.Interfaces.IfcCostScheduleTypeEnum.ESTIMATE;
					case IfcCostScheduleTypeEnum.PRICEDBILLOFQUANTITIES:
						return Ifc4.Interfaces.IfcCostScheduleTypeEnum.PRICEDBILLOFQUANTITIES;
					case IfcCostScheduleTypeEnum.SCHEDULEOFRATES:
						return Ifc4.Interfaces.IfcCostScheduleTypeEnum.SCHEDULEOFRATES;
					case IfcCostScheduleTypeEnum.TENDER:
						return Ifc4.Interfaces.IfcCostScheduleTypeEnum.TENDER;
					case IfcCostScheduleTypeEnum.UNPRICEDBILLOFQUANTITIES:
						return Ifc4.Interfaces.IfcCostScheduleTypeEnum.UNPRICEDBILLOFQUANTITIES;
					case IfcCostScheduleTypeEnum.USERDEFINED:
						//## Optional custom handling of PredefinedType == .USERDEFINED. 
						//##
						return Ifc4.Interfaces.IfcCostScheduleTypeEnum.USERDEFINED;
					case IfcCostScheduleTypeEnum.NOTDEFINED:
						return Ifc4.Interfaces.IfcCostScheduleTypeEnum.NOTDEFINED;
					case null: 
						return null;
					
					default:
						throw new System.ArgumentOutOfRangeException();
				}
			} 
			set
			{
				//## Custom code to handle setting of enumeration of PredefinedType
				//##
				switch (value)
				{
					case Ifc4.Interfaces.IfcCostScheduleTypeEnum.BUDGET:
						PredefinedType = IfcCostScheduleTypeEnum.BUDGET;
						return;
					case Ifc4.Interfaces.IfcCostScheduleTypeEnum.COSTPLAN:
						PredefinedType = IfcCostScheduleTypeEnum.COSTPLAN;
						return;
					case Ifc4.Interfaces.IfcCostScheduleTypeEnum.ESTIMATE:
						PredefinedType = IfcCostScheduleTypeEnum.ESTIMATE;
						return;
					case Ifc4.Interfaces.IfcCostScheduleTypeEnum.TENDER:
						PredefinedType = IfcCostScheduleTypeEnum.TENDER;
						return;
					case Ifc4.Interfaces.IfcCostScheduleTypeEnum.PRICEDBILLOFQUANTITIES:
						PredefinedType = IfcCostScheduleTypeEnum.PRICEDBILLOFQUANTITIES;
						return;
					case Ifc4.Interfaces.IfcCostScheduleTypeEnum.UNPRICEDBILLOFQUANTITIES:
						PredefinedType = IfcCostScheduleTypeEnum.UNPRICEDBILLOFQUANTITIES;
						return;
					case Ifc4.Interfaces.IfcCostScheduleTypeEnum.SCHEDULEOFRATES:
						PredefinedType = IfcCostScheduleTypeEnum.SCHEDULEOFRATES;
						return;
					case Ifc4.Interfaces.IfcCostScheduleTypeEnum.USERDEFINED:
						PredefinedType = IfcCostScheduleTypeEnum.USERDEFINED;
						return;
					case Ifc4.Interfaces.IfcCostScheduleTypeEnum.NOTDEFINED:
						PredefinedType = IfcCostScheduleTypeEnum.NOTDEFINED;
						return;
					
					case null:
						PredefinedType = null;
						return;
					default:
						throw new System.ArgumentOutOfRangeException();
				}
				
			}
		}

		[CrossSchemaAttribute(typeof(IIfcCostSchedule), 8)]
		Ifc4.MeasureResource.IfcLabel? IIfcCostSchedule.Status 
		{ 
			get
			{
				if (!Status.HasValue) return null;
				return new Ifc4.MeasureResource.IfcLabel(Status.Value);
			} 
			set
			{
				Status = value.HasValue ? 
					new MeasureResource.IfcLabel(value.Value) :  
					 new MeasureResource.IfcLabel?() ;
				
			}
		}

		[CrossSchemaAttribute(typeof(IIfcCostSchedule), 9)]
		Ifc4.DateTimeResource.IfcDateTime? IIfcCostSchedule.SubmittedOn 
		{ 
			get
			{
				if (!SubmittedOn.HasValue) return null;
				return new Ifc4.DateTimeResource.IfcDateTime(SubmittedOn.Value);
			} 
			set
			{
				SubmittedOn = value.HasValue ? 
					new DateTimeResource.IfcDateTime(value.Value) :  
					 new DateTimeResource.IfcDateTime?() ;
				
			}
		}

		[CrossSchemaAttribute(typeof(IIfcCostSchedule), 10)]
		Ifc4.DateTimeResource.IfcDateTime? IIfcCostSchedule.UpdateDate 
		{ 
			get
			{
				if (!UpdateDate.HasValue) return null;
				return new Ifc4.DateTimeResource.IfcDateTime(UpdateDate.Value);
			} 
			set
			{
				UpdateDate = value.HasValue ? 
					new DateTimeResource.IfcDateTime(value.Value) :  
					 new DateTimeResource.IfcDateTime?() ;
				
			}
		}
	//## Custom code
	//##
	}
}