using System.Linq.Expressions; using System.Runtime.CompilerServices; using System.Xml.Serialization; using Microsoft.CSharp.RuntimeBinder; namespace ShrlAlgoToolkit.RevitAddins.RvIndependent.MetroGauges.LandXMLData { [XmlType("Line")] [Serializable] public class Line : Interval { public Line() { _points = new List(2); _points.Add(new TextPoint2D()); _points.Add(new TextPoint2D()); } public Line(Line entity) : this() { Dir = entity.Dir; Length = entity.Length; Start = entity.Start; End = entity.End; } public Line(dynamic entity, dynamic baseline, dynamic profile) : this() { if (Constructor.p__Site1 == null) { Constructor.p__Site1 = CallSite>.Create(Binder.Convert(CSharpBinderFlags.None, typeof(double), typeof(Line))); } Func target = Constructor.p__Site1.Target; CallSite p__Site = Constructor.p__Site1; if (Constructor.p__Site2 == null) { Constructor.p__Site2 = CallSite>.Create( Binder.BinaryOperation( CSharpBinderFlags.None, ExpressionType.Divide, typeof(Line), new[] { CSharpArgumentInfo.Create(CSharpArgumentInfoFlags.None, null), CSharpArgumentInfo.Create(CSharpArgumentInfoFlags.UseCompileTimeType | CSharpArgumentInfoFlags.Constant, null) } ) ); } Func target2 = Constructor.p__Site2.Target; CallSite p__Site2 = Constructor.p__Site2; if (Constructor.p__Site3 == null) { Constructor.p__Site3 = CallSite>.Create( Binder.BinaryOperation( CSharpBinderFlags.None, ExpressionType.Multiply, typeof(Line), new[] { CSharpArgumentInfo.Create(CSharpArgumentInfoFlags.None, null), CSharpArgumentInfo.Create(CSharpArgumentInfoFlags.UseCompileTimeType | CSharpArgumentInfoFlags.Constant, null) } ) ); } Func target3 = Constructor.p__Site3.Target; CallSite p__Site3 = Constructor.p__Site3; if (Constructor.p__Site4 == null) { Constructor.p__Site4 = CallSite>.Create( Binder.GetMember( CSharpBinderFlags.None, "Direction", typeof(Line), new[] { CSharpArgumentInfo.Create(CSharpArgumentInfoFlags.None, null) } ) ); } Dir = target(p__Site, target2(p__Site2, target3(p__Site3, Constructor.p__Site4.Target(Constructor.p__Site4, entity), 180.0), 3.1415926535897931)); if (Constructor.p__Site5 == null) { Constructor.p__Site5 = CallSite>.Create(Binder.Convert(CSharpBinderFlags.None, typeof(double), typeof(Line))); } Func target4 = Constructor.p__Site5.Target; CallSite p__Site4 = Constructor.p__Site5; if (Constructor.p__Site6 == null) { Constructor.p__Site6 = CallSite>.Create( Binder.GetMember( CSharpBinderFlags.None, "Length", typeof(Line), new[] { CSharpArgumentInfo.Create(CSharpArgumentInfoFlags.None, null) } ) ); } Length = target4(p__Site4, Constructor.p__Site6.Target(Constructor.p__Site6, entity)); double num = 0.0; double num2 = 0.0; try { if (Constructor.p__Site7 == null) { Constructor.p__Site7 = CallSite>.Create( Binder.Convert(CSharpBinderFlags.None, typeof(double), typeof(Line)) ); } Func target5 = Constructor.p__Site7.Target; CallSite p__Site5 = Constructor.p__Site7; if (Constructor.p__Site8 == null) { Constructor.p__Site8 = CallSite>.Create( Binder.InvokeMember( CSharpBinderFlags.None, "ElevationAt", null, typeof(Line), new[] { CSharpArgumentInfo.Create(CSharpArgumentInfoFlags.None, null), CSharpArgumentInfo.Create(CSharpArgumentInfoFlags.None, null) } ) ); } Func target6 = Constructor.p__Site8.Target; CallSite p__Site6 = Constructor.p__Site8; if (Constructor.p__Site9 == null) { Constructor.p__Site9 = CallSite>.Create( Binder.GetMember( CSharpBinderFlags.None, "StartingStation", typeof(Line), new[] { CSharpArgumentInfo.Create(CSharpArgumentInfoFlags.None, null) } ) ); } num = target5(p__Site5, target6(p__Site6, profile, Constructor.p__Site9.Target(Constructor.p__Site9, entity))); } catch { } try { if (Constructor.p__Sitea == null) { Constructor.p__Sitea = CallSite>.Create( Binder.Convert(CSharpBinderFlags.None, typeof(double), typeof(Line)) ); } Func target7 = Constructor.p__Sitea.Target; CallSite p__Sitea = Constructor.p__Sitea; if (Constructor.p__Siteb == null) { Constructor.p__Siteb = CallSite>.Create( Binder.InvokeMember( CSharpBinderFlags.None, "ElevationAt", null, typeof(Line), new[] { CSharpArgumentInfo.Create(CSharpArgumentInfoFlags.None, null), CSharpArgumentInfo.Create(CSharpArgumentInfoFlags.None, null) } ) ); } Func target8 = Constructor.p__Siteb.Target; CallSite p__Siteb = Constructor.p__Siteb; if (Constructor.p__Sitec == null) { Constructor.p__Sitec = CallSite>.Create( Binder.GetMember( CSharpBinderFlags.None, "EndingStation", typeof(Line), new[] { CSharpArgumentInfo.Create(CSharpArgumentInfoFlags.None, null) } ) ); } num2 = target7(p__Sitea, target8(p__Siteb, profile, Constructor.p__Sitec.Target(Constructor.p__Sitec, entity))); } catch { } if (Constructor.p__Sited == null) { Constructor.p__Sited = CallSite>.Create( Binder.InvokeConstructor( CSharpBinderFlags.None, typeof(Line), new[] { CSharpArgumentInfo.Create(CSharpArgumentInfoFlags.UseCompileTimeType | CSharpArgumentInfoFlags.IsStaticType, null), CSharpArgumentInfo.Create(CSharpArgumentInfoFlags.None, null), CSharpArgumentInfo.Create(CSharpArgumentInfoFlags.UseCompileTimeType, null) } ) ); } Func target9 = Constructor.p__Sited.Target; CallSite p__Sited = Constructor.p__Sited; Type typeFromHandle = typeof(TextPoint2D); if (Constructor.p__Sitee == null) { Constructor.p__Sitee = CallSite>.Create( Binder.InvokeMember( CSharpBinderFlags.None, "StationOffsetElevationToXYZ", null, typeof(Line), new[] { CSharpArgumentInfo.Create(CSharpArgumentInfoFlags.None, null), CSharpArgumentInfo.Create(CSharpArgumentInfoFlags.UseCompileTimeType, null) } ) ); } Func target10 = Constructor.p__Sitee.Target; CallSite p__Sitee = Constructor.p__Sitee; double[] array = new double[3]; double[] array2 = array; int num3 = 0; if (Constructor.p__Sitef == null) { Constructor.p__Sitef = CallSite>.Create(Binder.Convert(CSharpBinderFlags.None, typeof(double), typeof(Line))); } Func target11 = Constructor.p__Sitef.Target; CallSite p__Sitef = Constructor.p__Sitef; if (Constructor.p__Site10 == null) { Constructor.p__Site10 = CallSite>.Create( Binder.GetMember( CSharpBinderFlags.None, "StartingStation", typeof(Line), new[] { CSharpArgumentInfo.Create(CSharpArgumentInfoFlags.None, null) } ) ); } array2[num3] = target11(p__Sitef, Constructor.p__Site10.Target(Constructor.p__Site10, entity)); array[2] = num; object arg = target10(p__Sitee, baseline, array); double[] array3 = new double[2]; double[] array4 = array3; int num4 = 0; if (Constructor.p__Site11 == null) { Constructor.p__Site11 = CallSite>.Create( Binder.Convert(CSharpBinderFlags.None, typeof(double), typeof(Line)) ); } Func target12 = Constructor.p__Site11.Target; CallSite p__Site7 = Constructor.p__Site11; if (Constructor.p__Site12 == null) { Constructor.p__Site12 = CallSite>.Create( Binder.GetMember( CSharpBinderFlags.None, "StartEasting", typeof(Line), new[] { CSharpArgumentInfo.Create(CSharpArgumentInfoFlags.None, null) } ) ); } array4[num4] = target12(p__Site7, Constructor.p__Site12.Target(Constructor.p__Site12, entity)); double[] array5 = array3; int num5 = 1; if (Constructor.p__Site13 == null) { Constructor.p__Site13 = CallSite>.Create( Binder.Convert(CSharpBinderFlags.None, typeof(double), typeof(Line)) ); } Func target13 = Constructor.p__Site13.Target; CallSite p__Site8 = Constructor.p__Site13; if (Constructor.p__Site14 == null) { Constructor.p__Site14 = CallSite>.Create( Binder.GetMember( CSharpBinderFlags.None, "StartNorthing", typeof(Line), new[] { CSharpArgumentInfo.Create(CSharpArgumentInfoFlags.None, null) } ) ); } array5[num5] = target13(p__Site8, Constructor.p__Site14.Target(Constructor.p__Site14, entity)); Start = target9(p__Sited, typeFromHandle, arg, array3); if (Constructor.p__Site15 == null) { Constructor.p__Site15 = CallSite>.Create( Binder.InvokeConstructor( CSharpBinderFlags.None, typeof(Line), new[] { CSharpArgumentInfo.Create(CSharpArgumentInfoFlags.UseCompileTimeType | CSharpArgumentInfoFlags.IsStaticType, null), CSharpArgumentInfo.Create(CSharpArgumentInfoFlags.None, null), CSharpArgumentInfo.Create(CSharpArgumentInfoFlags.UseCompileTimeType, null) } ) ); } Func target14 = Constructor.p__Site15.Target; CallSite p__Site9 = Constructor.p__Site15; Type typeFromHandle2 = typeof(TextPoint2D); if (Constructor.p__Site16 == null) { Constructor.p__Site16 = CallSite>.Create( Binder.InvokeMember( CSharpBinderFlags.None, "StationOffsetElevationToXYZ", null, typeof(Line), new[] { CSharpArgumentInfo.Create(CSharpArgumentInfoFlags.None, null), CSharpArgumentInfo.Create(CSharpArgumentInfoFlags.UseCompileTimeType, null) } ) ); } Func target15 = Constructor.p__Site16.Target; CallSite p__Site10 = Constructor.p__Site16; double[] array6 = new double[3]; double[] array7 = array6; int num6 = 0; if (Constructor.p__Site17 == null) { Constructor.p__Site17 = CallSite>.Create( Binder.Convert(CSharpBinderFlags.None, typeof(double), typeof(Line)) ); } Func target16 = Constructor.p__Site17.Target; CallSite p__Site11 = Constructor.p__Site17; if (Constructor.p__Site18 == null) { Constructor.p__Site18 = CallSite>.Create( Binder.GetMember( CSharpBinderFlags.None, "EndingStation", typeof(Line), new[] { CSharpArgumentInfo.Create(CSharpArgumentInfoFlags.None, null) } ) ); } array7[num6] = target16(p__Site11, Constructor.p__Site18.Target(Constructor.p__Site18, entity)); array6[2] = num2; object arg2 = target15(p__Site10, baseline, array6); double[] array8 = new double[2]; double[] array9 = array8; int num7 = 0; if (Constructor.p__Site19 == null) { Constructor.p__Site19 = CallSite>.Create( Binder.Convert(CSharpBinderFlags.None, typeof(double), typeof(Line)) ); } Func target17 = Constructor.p__Site19.Target; CallSite p__Site12 = Constructor.p__Site19; if (Constructor.p__Site1a == null) { Constructor.p__Site1a = CallSite>.Create( Binder.GetMember( CSharpBinderFlags.None, "EndEasting", typeof(Line), new[] { CSharpArgumentInfo.Create(CSharpArgumentInfoFlags.None, null) } ) ); } array9[num7] = target17(p__Site12, Constructor.p__Site1a.Target(Constructor.p__Site1a, entity)); double[] array10 = array8; int num8 = 1; if (Constructor.p__Site1b == null) { Constructor.p__Site1b = CallSite>.Create( Binder.Convert(CSharpBinderFlags.None, typeof(double), typeof(Line)) ); } Func target18 = Constructor.p__Site1b.Target; CallSite p__Site1b = Constructor.p__Site1b; if (Constructor.p__Site1c == null) { Constructor.p__Site1c = CallSite>.Create( Binder.GetMember( CSharpBinderFlags.None, "EndNorthing", typeof(Line), new[] { CSharpArgumentInfo.Create(CSharpArgumentInfoFlags.None, null) } ) ); } array10[num8] = target18(p__Site1b, Constructor.p__Site1c.Target(Constructor.p__Site1c, entity)); End = target14(p__Site9, typeFromHandle2, arg2, array8); while (Dir < 0.0) { Dir += 360.0; } while (Dir >= 360.0) { Dir -= 360.0; } } [XmlAttribute("dir")] public double Dir { get; set; } public override double GetDirectionAtPoint(double station) { return Dir; } [CompilerGenerated] private static class Constructor { public static CallSite> p__Site1; public static CallSite> p__Site10; public static CallSite> p__Site11; public static CallSite> p__Site12; public static CallSite> p__Site13; public static CallSite> p__Site14; public static CallSite> p__Site15; public static CallSite> p__Site16; public static CallSite> p__Site17; public static CallSite> p__Site18; public static CallSite> p__Site19; public static CallSite> p__Site1a; public static CallSite> p__Site1b; public static CallSite> p__Site1c; public static CallSite> p__Site2; public static CallSite> p__Site3; public static CallSite> p__Site4; public static CallSite> p__Site5; public static CallSite> p__Site6; public static CallSite> p__Site7; public static CallSite> p__Site8; public static CallSite> p__Site9; public static CallSite> p__Sitea; public static CallSite> p__Siteb; public static CallSite> p__Sitec; public static CallSite> p__Sited; public static CallSite> p__Sitee; public static CallSite> p__Sitef; } } }