// ------------------------------------------------------------------------------
// <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.PresentationAppearanceResource
{
	public partial class @IfcCurveStyleFontAndScaling : IIfcCurveStyleFontAndScaling
	{

		[CrossSchemaAttribute(typeof(IIfcCurveStyleFontAndScaling), 1)]
		Ifc4.MeasureResource.IfcLabel? IIfcCurveStyleFontAndScaling.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(IIfcCurveStyleFontAndScaling), 2)]
		IIfcCurveStyleFontSelect IIfcCurveStyleFontAndScaling.CurveFont 
		{ 
			get
			{
				if (CurveStyleFont == null) return null;
				var ifccurvestylefont = CurveStyleFont as IfcCurveStyleFont;
				if (ifccurvestylefont != null) 
					return ifccurvestylefont;
				var ifcpredefinedcurvefont = CurveStyleFont as IfcPreDefinedCurveFont;
				if (ifcpredefinedcurvefont != null) 
					return ifcpredefinedcurvefont;
				return null;
			} 
			set
			{
				if (value == null)
				{
					CurveStyleFont = null;
					return;
				}	
				var ifccurvestylefont = value as IfcCurveStyleFont;
				if (ifccurvestylefont != null) 
				{
					CurveStyleFont = ifccurvestylefont;
					return;
				}
				var ifcpredefinedcurvefont = value as IfcPreDefinedCurveFont;
				if (ifcpredefinedcurvefont != null) 
				{
					CurveStyleFont = ifcpredefinedcurvefont;
					return;
				}
				
			}
		}

		[CrossSchemaAttribute(typeof(IIfcCurveStyleFontAndScaling), 3)]
		Ifc4.MeasureResource.IfcPositiveRatioMeasure IIfcCurveStyleFontAndScaling.CurveFontScaling 
		{ 
			get
			{
				return new Ifc4.MeasureResource.IfcPositiveRatioMeasure(CurveFontScaling);
			} 
			set
			{
				CurveFontScaling = new MeasureResource.IfcPositiveRatioMeasure(value);
				
			}
		}
	//## Custom code
	//##
	}
}