// ------------------------------------------------------------------------------
// <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.MaterialResource
{
	public partial class @IfcMaterialProfile : IIfcMaterialProfile
	{

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

		[CrossSchemaAttribute(typeof(IIfcMaterialProfile), 2)]
		Ifc4.MeasureResource.IfcText? IIfcMaterialProfile.Description 
		{ 
			get
			{
				if (!Description.HasValue) return null;
				return new Ifc4.MeasureResource.IfcText(Description.Value);
			} 
			set
			{
				Description = value.HasValue ? 
					new MeasureResource.IfcText(value.Value) :  
					 new MeasureResource.IfcText?() ;
				
			}
		}

		[CrossSchemaAttribute(typeof(IIfcMaterialProfile), 3)]
		IIfcMaterial IIfcMaterialProfile.Material 
		{ 
			get
			{
				return Material;
			} 
			set
			{
				Material = value as IfcMaterial;
				
			}
		}

		[CrossSchemaAttribute(typeof(IIfcMaterialProfile), 4)]
		IIfcProfileDef IIfcMaterialProfile.Profile 
		{ 
			get
			{
				return Profile;
			} 
			set
			{
				Profile = value as ProfileResource.IfcProfileDef;
				
			}
		}

		[CrossSchemaAttribute(typeof(IIfcMaterialProfile), 5)]
		Ifc4.MeasureResource.IfcInteger? IIfcMaterialProfile.Priority 
		{ 
			get
			{
				if (!Priority.HasValue) return null;
				return new Ifc4.MeasureResource.IfcInteger(Priority.Value);
			} 
			set
			{
				Priority = value.HasValue ? 
					new MeasureResource.IfcInteger(value.Value) :  
					 new MeasureResource.IfcInteger?() ;
				
			}
		}

		[CrossSchemaAttribute(typeof(IIfcMaterialProfile), 6)]
		Ifc4.MeasureResource.IfcLabel? IIfcMaterialProfile.Category 
		{ 
			get
			{
				if (!Category.HasValue) return null;
				return new Ifc4.MeasureResource.IfcLabel(Category.Value);
			} 
			set
			{
				Category = value.HasValue ? 
					new MeasureResource.IfcLabel(value.Value) :  
					 new MeasureResource.IfcLabel?() ;
				
			}
		}
		IIfcMaterialProfileSet IIfcMaterialProfile.ToMaterialProfileSet 
		{ 
			get
			{
				return Model.Instances.FirstOrDefault<IIfcMaterialProfileSet>(e => e.MaterialProfiles != null &&  e.MaterialProfiles.Contains(this), "MaterialProfiles", this);
			} 
		}
	//## Custom code
	//##
	}
}