// ------------------------------------------------------------------------------
// <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.PresentationDefinitionResource
{
	public partial class @IfcTextLiteral : IIfcTextLiteral
	{

		[CrossSchemaAttribute(typeof(IIfcTextLiteral), 1)]
		Ifc4.PresentationAppearanceResource.IfcPresentableText IIfcTextLiteral.Literal 
		{ 
			get
			{
				return new Ifc4.PresentationAppearanceResource.IfcPresentableText(Literal);
			} 
			set
			{
				Literal = new PresentationResource.IfcPresentableText(value);
				
			}
		}

		[CrossSchemaAttribute(typeof(IIfcTextLiteral), 2)]
		IIfcAxis2Placement IIfcTextLiteral.Placement 
		{ 
			get
			{
				if (Placement == null) return null;
				var ifcaxis2placement2d = Placement as GeometryResource.IfcAxis2Placement2D;
				if (ifcaxis2placement2d != null) 
					return ifcaxis2placement2d;
				var ifcaxis2placement3d = Placement as GeometryResource.IfcAxis2Placement3D;
				if (ifcaxis2placement3d != null) 
					return ifcaxis2placement3d;
				return null;
			} 
			set
			{
				if (value == null)
				{
					Placement = null;
					return;
				}	
				var ifcaxis2placement2d = value as GeometryResource.IfcAxis2Placement2D;
				if (ifcaxis2placement2d != null) 
				{
					Placement = ifcaxis2placement2d;
					return;
				}
				var ifcaxis2placement3d = value as GeometryResource.IfcAxis2Placement3D;
				if (ifcaxis2placement3d != null) 
				{
					Placement = ifcaxis2placement3d;
					return;
				}
				
			}
		}

		[CrossSchemaAttribute(typeof(IIfcTextLiteral), 3)]
		Ifc4.Interfaces.IfcTextPath IIfcTextLiteral.Path 
		{ 
			get
			{
				//## Custom code to handle enumeration of Path
				//##
				switch (Path)
				{
					case IfcTextPath.LEFT:
						return Ifc4.Interfaces.IfcTextPath.LEFT;
					case IfcTextPath.RIGHT:
						return Ifc4.Interfaces.IfcTextPath.RIGHT;
					case IfcTextPath.UP:
						return Ifc4.Interfaces.IfcTextPath.UP;
					case IfcTextPath.DOWN:
						return Ifc4.Interfaces.IfcTextPath.DOWN;
					
					default:
						throw new System.ArgumentOutOfRangeException();
				}
			} 
			set
			{
				//## Custom code to handle setting of enumeration of Path
				//##
				switch (value)
				{
					case Ifc4.Interfaces.IfcTextPath.LEFT:
						Path = IfcTextPath.LEFT;
						return;
					case Ifc4.Interfaces.IfcTextPath.RIGHT:
						Path = IfcTextPath.RIGHT;
						return;
					case Ifc4.Interfaces.IfcTextPath.UP:
						Path = IfcTextPath.UP;
						return;
					case Ifc4.Interfaces.IfcTextPath.DOWN:
						Path = IfcTextPath.DOWN;
						return;
					default:
						throw new System.ArgumentOutOfRangeException();
				}
				
			}
		}
	//## Custom code
	//##
	}
}