// ------------------------------------------------------------------------------
// <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.PresentationResource
{
	public partial class @IfcTextStyleFontModel : IIfcTextStyleFontModel
	{

		[CrossSchemaAttribute(typeof(IIfcTextStyleFontModel), 2)]
		IItemSet<Xbim.Ifc4.PresentationAppearanceResource.IfcTextFontName> IIfcTextStyleFontModel.FontFamily 
		{ 
			get
			{
			
				return new Common.Collections.ProxyValueSet<IfcTextFontName, Ifc4.PresentationAppearanceResource.IfcTextFontName>(FontFamily, 
					s => new Ifc4.PresentationAppearanceResource.IfcTextFontName(s), 
					t => new IfcTextFontName(t));
			} 
		}

		[CrossSchemaAttribute(typeof(IIfcTextStyleFontModel), 3)]
		Ifc4.PresentationAppearanceResource.IfcFontStyle? IIfcTextStyleFontModel.FontStyle 
		{ 
			get
			{
				if (!FontStyle.HasValue) return null;
				return new Ifc4.PresentationAppearanceResource.IfcFontStyle(FontStyle.Value);
			} 
			set
			{
				FontStyle = value.HasValue ? 
					new IfcFontStyle(value.Value) :  
					 new IfcFontStyle?() ;
				
			}
		}

		[CrossSchemaAttribute(typeof(IIfcTextStyleFontModel), 4)]
		Ifc4.PresentationAppearanceResource.IfcFontVariant? IIfcTextStyleFontModel.FontVariant 
		{ 
			get
			{
				if (!FontVariant.HasValue) return null;
				return new Ifc4.PresentationAppearanceResource.IfcFontVariant(FontVariant.Value);
			} 
			set
			{
				FontVariant = value.HasValue ? 
					new IfcFontVariant(value.Value) :  
					 new IfcFontVariant?() ;
				
			}
		}

		[CrossSchemaAttribute(typeof(IIfcTextStyleFontModel), 5)]
		Ifc4.PresentationAppearanceResource.IfcFontWeight? IIfcTextStyleFontModel.FontWeight 
		{ 
			get
			{
				if (!FontWeight.HasValue) return null;
				return new Ifc4.PresentationAppearanceResource.IfcFontWeight(FontWeight.Value);
			} 
			set
			{
				FontWeight = value.HasValue ? 
					new IfcFontWeight(value.Value) :  
					 new IfcFontWeight?() ;
				
			}
		}

		[CrossSchemaAttribute(typeof(IIfcTextStyleFontModel), 6)]
		IIfcSizeSelect IIfcTextStyleFontModel.FontSize 
		{ 
			get
			{
				if (FontSize == null) return null;
				if (FontSize is MeasureResource.IfcRatioMeasure) 
					return new Ifc4.MeasureResource.IfcRatioMeasure((MeasureResource.IfcRatioMeasure)FontSize);
				if (FontSize is MeasureResource.IfcLengthMeasure) 
					return new Ifc4.MeasureResource.IfcLengthMeasure((MeasureResource.IfcLengthMeasure)FontSize);
				if (FontSize is MeasureResource.IfcDescriptiveMeasure) 
					return new Ifc4.MeasureResource.IfcDescriptiveMeasure((MeasureResource.IfcDescriptiveMeasure)FontSize);
				if (FontSize is MeasureResource.IfcPositiveLengthMeasure) 
					return new Ifc4.MeasureResource.IfcPositiveLengthMeasure((MeasureResource.IfcPositiveLengthMeasure)FontSize);
				if (FontSize is MeasureResource.IfcNormalisedRatioMeasure) 
					return new Ifc4.MeasureResource.IfcNormalisedRatioMeasure((MeasureResource.IfcNormalisedRatioMeasure)FontSize);
				if (FontSize is MeasureResource.IfcPositiveRatioMeasure) 
					return new Ifc4.MeasureResource.IfcPositiveRatioMeasure((MeasureResource.IfcPositiveRatioMeasure)FontSize);
				return null;
			} 
			set
			{
				if (value == null)
				{
					FontSize = null;
					return;
				}	
				if (value is Ifc4.MeasureResource.IfcDescriptiveMeasure) 
				{
					FontSize = new MeasureResource.IfcDescriptiveMeasure((Ifc4.MeasureResource.IfcDescriptiveMeasure)value);
					return;
				}
				if (value is Ifc4.MeasureResource.IfcLengthMeasure) 
				{
					FontSize = new MeasureResource.IfcLengthMeasure((Ifc4.MeasureResource.IfcLengthMeasure)value);
					return;
				}
				if (value is Ifc4.MeasureResource.IfcNormalisedRatioMeasure) 
				{
					FontSize = new MeasureResource.IfcNormalisedRatioMeasure((Ifc4.MeasureResource.IfcNormalisedRatioMeasure)value);
					return;
				}
				if (value is Ifc4.MeasureResource.IfcPositiveLengthMeasure) 
				{
					FontSize = new MeasureResource.IfcPositiveLengthMeasure((Ifc4.MeasureResource.IfcPositiveLengthMeasure)value);
					return;
				}
				if (value is Ifc4.MeasureResource.IfcPositiveRatioMeasure) 
				{
					FontSize = new MeasureResource.IfcPositiveRatioMeasure((Ifc4.MeasureResource.IfcPositiveRatioMeasure)value);
					return;
				}
				if (value is Ifc4.MeasureResource.IfcRatioMeasure) 
				{
					FontSize = new MeasureResource.IfcRatioMeasure((Ifc4.MeasureResource.IfcRatioMeasure)value);
					return;
				}
				
			}
		}
	//## Custom code
	//##
	}
}