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

		[CrossSchemaAttribute(typeof(IIfcTextStyleTextModel), 1)]
		IIfcSizeSelect IIfcTextStyleTextModel.TextIndent 
		{ 
			get
			{
				if (TextIndent == null) return null;
				if (TextIndent is MeasureResource.IfcRatioMeasure) 
					return new Ifc4.MeasureResource.IfcRatioMeasure((MeasureResource.IfcRatioMeasure)TextIndent);
				if (TextIndent is MeasureResource.IfcLengthMeasure) 
					return new Ifc4.MeasureResource.IfcLengthMeasure((MeasureResource.IfcLengthMeasure)TextIndent);
				if (TextIndent is MeasureResource.IfcDescriptiveMeasure) 
					return new Ifc4.MeasureResource.IfcDescriptiveMeasure((MeasureResource.IfcDescriptiveMeasure)TextIndent);
				if (TextIndent is MeasureResource.IfcPositiveLengthMeasure) 
					return new Ifc4.MeasureResource.IfcPositiveLengthMeasure((MeasureResource.IfcPositiveLengthMeasure)TextIndent);
				if (TextIndent is MeasureResource.IfcNormalisedRatioMeasure) 
					return new Ifc4.MeasureResource.IfcNormalisedRatioMeasure((MeasureResource.IfcNormalisedRatioMeasure)TextIndent);
				if (TextIndent is MeasureResource.IfcPositiveRatioMeasure) 
					return new Ifc4.MeasureResource.IfcPositiveRatioMeasure((MeasureResource.IfcPositiveRatioMeasure)TextIndent);
				return null;
			} 
			set
			{
				if (value == null)
				{
					TextIndent = null;
					return;
				}	
				if (value is Ifc4.MeasureResource.IfcDescriptiveMeasure) 
				{
					TextIndent = new MeasureResource.IfcDescriptiveMeasure((Ifc4.MeasureResource.IfcDescriptiveMeasure)value);
					return;
				}
				if (value is Ifc4.MeasureResource.IfcLengthMeasure) 
				{
					TextIndent = new MeasureResource.IfcLengthMeasure((Ifc4.MeasureResource.IfcLengthMeasure)value);
					return;
				}
				if (value is Ifc4.MeasureResource.IfcNormalisedRatioMeasure) 
				{
					TextIndent = new MeasureResource.IfcNormalisedRatioMeasure((Ifc4.MeasureResource.IfcNormalisedRatioMeasure)value);
					return;
				}
				if (value is Ifc4.MeasureResource.IfcPositiveLengthMeasure) 
				{
					TextIndent = new MeasureResource.IfcPositiveLengthMeasure((Ifc4.MeasureResource.IfcPositiveLengthMeasure)value);
					return;
				}
				if (value is Ifc4.MeasureResource.IfcPositiveRatioMeasure) 
				{
					TextIndent = new MeasureResource.IfcPositiveRatioMeasure((Ifc4.MeasureResource.IfcPositiveRatioMeasure)value);
					return;
				}
				if (value is Ifc4.MeasureResource.IfcRatioMeasure) 
				{
					TextIndent = new MeasureResource.IfcRatioMeasure((Ifc4.MeasureResource.IfcRatioMeasure)value);
					return;
				}
				
			}
		}

		[CrossSchemaAttribute(typeof(IIfcTextStyleTextModel), 2)]
		Ifc4.PresentationAppearanceResource.IfcTextAlignment? IIfcTextStyleTextModel.TextAlign 
		{ 
			get
			{
				if (!TextAlign.HasValue) return null;
				return new Ifc4.PresentationAppearanceResource.IfcTextAlignment(TextAlign.Value);
			} 
			set
			{
				TextAlign = value.HasValue ? 
					new IfcTextAlignment(value.Value) :  
					 new IfcTextAlignment?() ;
				
			}
		}

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

		[CrossSchemaAttribute(typeof(IIfcTextStyleTextModel), 4)]
		IIfcSizeSelect IIfcTextStyleTextModel.LetterSpacing 
		{ 
			get
			{
				if (LetterSpacing == null) return null;
				if (LetterSpacing is MeasureResource.IfcRatioMeasure) 
					return new Ifc4.MeasureResource.IfcRatioMeasure((MeasureResource.IfcRatioMeasure)LetterSpacing);
				if (LetterSpacing is MeasureResource.IfcLengthMeasure) 
					return new Ifc4.MeasureResource.IfcLengthMeasure((MeasureResource.IfcLengthMeasure)LetterSpacing);
				if (LetterSpacing is MeasureResource.IfcDescriptiveMeasure) 
					return new Ifc4.MeasureResource.IfcDescriptiveMeasure((MeasureResource.IfcDescriptiveMeasure)LetterSpacing);
				if (LetterSpacing is MeasureResource.IfcPositiveLengthMeasure) 
					return new Ifc4.MeasureResource.IfcPositiveLengthMeasure((MeasureResource.IfcPositiveLengthMeasure)LetterSpacing);
				if (LetterSpacing is MeasureResource.IfcNormalisedRatioMeasure) 
					return new Ifc4.MeasureResource.IfcNormalisedRatioMeasure((MeasureResource.IfcNormalisedRatioMeasure)LetterSpacing);
				if (LetterSpacing is MeasureResource.IfcPositiveRatioMeasure) 
					return new Ifc4.MeasureResource.IfcPositiveRatioMeasure((MeasureResource.IfcPositiveRatioMeasure)LetterSpacing);
				return null;
			} 
			set
			{
				if (value == null)
				{
					LetterSpacing = null;
					return;
				}	
				if (value is Ifc4.MeasureResource.IfcDescriptiveMeasure) 
				{
					LetterSpacing = new MeasureResource.IfcDescriptiveMeasure((Ifc4.MeasureResource.IfcDescriptiveMeasure)value);
					return;
				}
				if (value is Ifc4.MeasureResource.IfcLengthMeasure) 
				{
					LetterSpacing = new MeasureResource.IfcLengthMeasure((Ifc4.MeasureResource.IfcLengthMeasure)value);
					return;
				}
				if (value is Ifc4.MeasureResource.IfcNormalisedRatioMeasure) 
				{
					LetterSpacing = new MeasureResource.IfcNormalisedRatioMeasure((Ifc4.MeasureResource.IfcNormalisedRatioMeasure)value);
					return;
				}
				if (value is Ifc4.MeasureResource.IfcPositiveLengthMeasure) 
				{
					LetterSpacing = new MeasureResource.IfcPositiveLengthMeasure((Ifc4.MeasureResource.IfcPositiveLengthMeasure)value);
					return;
				}
				if (value is Ifc4.MeasureResource.IfcPositiveRatioMeasure) 
				{
					LetterSpacing = new MeasureResource.IfcPositiveRatioMeasure((Ifc4.MeasureResource.IfcPositiveRatioMeasure)value);
					return;
				}
				if (value is Ifc4.MeasureResource.IfcRatioMeasure) 
				{
					LetterSpacing = new MeasureResource.IfcRatioMeasure((Ifc4.MeasureResource.IfcRatioMeasure)value);
					return;
				}
				
			}
		}

		[CrossSchemaAttribute(typeof(IIfcTextStyleTextModel), 5)]
		IIfcSizeSelect IIfcTextStyleTextModel.WordSpacing 
		{ 
			get
			{
				if (WordSpacing == null) return null;
				if (WordSpacing is MeasureResource.IfcRatioMeasure) 
					return new Ifc4.MeasureResource.IfcRatioMeasure((MeasureResource.IfcRatioMeasure)WordSpacing);
				if (WordSpacing is MeasureResource.IfcLengthMeasure) 
					return new Ifc4.MeasureResource.IfcLengthMeasure((MeasureResource.IfcLengthMeasure)WordSpacing);
				if (WordSpacing is MeasureResource.IfcDescriptiveMeasure) 
					return new Ifc4.MeasureResource.IfcDescriptiveMeasure((MeasureResource.IfcDescriptiveMeasure)WordSpacing);
				if (WordSpacing is MeasureResource.IfcPositiveLengthMeasure) 
					return new Ifc4.MeasureResource.IfcPositiveLengthMeasure((MeasureResource.IfcPositiveLengthMeasure)WordSpacing);
				if (WordSpacing is MeasureResource.IfcNormalisedRatioMeasure) 
					return new Ifc4.MeasureResource.IfcNormalisedRatioMeasure((MeasureResource.IfcNormalisedRatioMeasure)WordSpacing);
				if (WordSpacing is MeasureResource.IfcPositiveRatioMeasure) 
					return new Ifc4.MeasureResource.IfcPositiveRatioMeasure((MeasureResource.IfcPositiveRatioMeasure)WordSpacing);
				return null;
			} 
			set
			{
				if (value == null)
				{
					WordSpacing = null;
					return;
				}	
				if (value is Ifc4.MeasureResource.IfcDescriptiveMeasure) 
				{
					WordSpacing = new MeasureResource.IfcDescriptiveMeasure((Ifc4.MeasureResource.IfcDescriptiveMeasure)value);
					return;
				}
				if (value is Ifc4.MeasureResource.IfcLengthMeasure) 
				{
					WordSpacing = new MeasureResource.IfcLengthMeasure((Ifc4.MeasureResource.IfcLengthMeasure)value);
					return;
				}
				if (value is Ifc4.MeasureResource.IfcNormalisedRatioMeasure) 
				{
					WordSpacing = new MeasureResource.IfcNormalisedRatioMeasure((Ifc4.MeasureResource.IfcNormalisedRatioMeasure)value);
					return;
				}
				if (value is Ifc4.MeasureResource.IfcPositiveLengthMeasure) 
				{
					WordSpacing = new MeasureResource.IfcPositiveLengthMeasure((Ifc4.MeasureResource.IfcPositiveLengthMeasure)value);
					return;
				}
				if (value is Ifc4.MeasureResource.IfcPositiveRatioMeasure) 
				{
					WordSpacing = new MeasureResource.IfcPositiveRatioMeasure((Ifc4.MeasureResource.IfcPositiveRatioMeasure)value);
					return;
				}
				if (value is Ifc4.MeasureResource.IfcRatioMeasure) 
				{
					WordSpacing = new MeasureResource.IfcRatioMeasure((Ifc4.MeasureResource.IfcRatioMeasure)value);
					return;
				}
				
			}
		}

		[CrossSchemaAttribute(typeof(IIfcTextStyleTextModel), 6)]
		Ifc4.PresentationAppearanceResource.IfcTextTransformation? IIfcTextStyleTextModel.TextTransform 
		{ 
			get
			{
				if (!TextTransform.HasValue) return null;
				return new Ifc4.PresentationAppearanceResource.IfcTextTransformation(TextTransform.Value);
			} 
			set
			{
				TextTransform = value.HasValue ? 
					new IfcTextTransformation(value.Value) :  
					 new IfcTextTransformation?() ;
				
			}
		}

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