整理代码

This commit is contained in:
GG Z
2025-04-24 20:56:10 +08:00
parent 4d798e5d99
commit 155cef46f8
532 changed files with 1018 additions and 854 deletions

View File

@@ -0,0 +1,509 @@
using Microsoft.CSharp.RuntimeBinder;
using System.Linq.Expressions;
using System.Runtime.CompilerServices;
using System.Xml.Serialization;
namespace ShrlAlgo.RvKits.RvIndependent.MetroGauges.LandXMLData
{
[XmlType("Line")]
[Serializable]
public class Line : Interval
{
public Line()
{
_points = new List<TextPoint2D>(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<Func<CallSite, object, double>>.Create(Binder.Convert(CSharpBinderFlags.None, typeof(double), typeof(Line)));
}
Func<CallSite, object, double> target = Constructor.p__Site1.Target;
CallSite p__Site = Constructor.p__Site1;
if (Constructor.p__Site2 == null)
{
Constructor.p__Site2 = CallSite<Func<CallSite, object, double, object>>.Create(
Binder.BinaryOperation(
CSharpBinderFlags.None,
ExpressionType.Divide,
typeof(Line),
new[]
{
CSharpArgumentInfo.Create(CSharpArgumentInfoFlags.None, null),
CSharpArgumentInfo.Create(CSharpArgumentInfoFlags.UseCompileTimeType | CSharpArgumentInfoFlags.Constant, null)
}
)
);
}
Func<CallSite, object, double, object> target2 = Constructor.p__Site2.Target;
CallSite p__Site2 = Constructor.p__Site2;
if (Constructor.p__Site3 == null)
{
Constructor.p__Site3 = CallSite<Func<CallSite, object, double, object>>.Create(
Binder.BinaryOperation(
CSharpBinderFlags.None,
ExpressionType.Multiply,
typeof(Line),
new[]
{
CSharpArgumentInfo.Create(CSharpArgumentInfoFlags.None, null),
CSharpArgumentInfo.Create(CSharpArgumentInfoFlags.UseCompileTimeType | CSharpArgumentInfoFlags.Constant, null)
}
)
);
}
Func<CallSite, object, double, object> target3 = Constructor.p__Site3.Target;
CallSite p__Site3 = Constructor.p__Site3;
if (Constructor.p__Site4 == null)
{
Constructor.p__Site4 = CallSite<Func<CallSite, object, object>>.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<Func<CallSite, object, double>>.Create(Binder.Convert(CSharpBinderFlags.None, typeof(double), typeof(Line)));
}
Func<CallSite, object, double> target4 = Constructor.p__Site5.Target;
CallSite p__Site4 = Constructor.p__Site5;
if (Constructor.p__Site6 == null)
{
Constructor.p__Site6 = CallSite<Func<CallSite, object, object>>.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<Func<CallSite, object, double>>.Create(
Binder.Convert(CSharpBinderFlags.None, typeof(double), typeof(Line))
);
}
Func<CallSite, object, double> target5 = Constructor.p__Site7.Target;
CallSite p__Site5 = Constructor.p__Site7;
if (Constructor.p__Site8 == null)
{
Constructor.p__Site8 = CallSite<Func<CallSite, object, object, object>>.Create(
Binder.InvokeMember(
CSharpBinderFlags.None,
"ElevationAt",
null,
typeof(Line),
new[]
{
CSharpArgumentInfo.Create(CSharpArgumentInfoFlags.None, null),
CSharpArgumentInfo.Create(CSharpArgumentInfoFlags.None, null)
}
)
);
}
Func<CallSite, object, object, object> target6 = Constructor.p__Site8.Target;
CallSite p__Site6 = Constructor.p__Site8;
if (Constructor.p__Site9 == null)
{
Constructor.p__Site9 = CallSite<Func<CallSite, object, object>>.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<Func<CallSite, object, double>>.Create(
Binder.Convert(CSharpBinderFlags.None, typeof(double), typeof(Line))
);
}
Func<CallSite, object, double> target7 = Constructor.p__Sitea.Target;
CallSite p__Sitea = Constructor.p__Sitea;
if (Constructor.p__Siteb == null)
{
Constructor.p__Siteb = CallSite<Func<CallSite, object, object, object>>.Create(
Binder.InvokeMember(
CSharpBinderFlags.None,
"ElevationAt",
null,
typeof(Line),
new[]
{
CSharpArgumentInfo.Create(CSharpArgumentInfoFlags.None, null),
CSharpArgumentInfo.Create(CSharpArgumentInfoFlags.None, null)
}
)
);
}
Func<CallSite, object, object, object> target8 = Constructor.p__Siteb.Target;
CallSite p__Siteb = Constructor.p__Siteb;
if (Constructor.p__Sitec == null)
{
Constructor.p__Sitec = CallSite<Func<CallSite, object, object>>.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<Func<CallSite, Type, object, double[], TextPoint2D>>.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<CallSite, Type, object, double[], TextPoint2D> target9 = Constructor.p__Sited.Target;
CallSite p__Sited = Constructor.p__Sited;
Type typeFromHandle = typeof(TextPoint2D);
if (Constructor.p__Sitee == null)
{
Constructor.p__Sitee = CallSite<Func<CallSite, object, double[], object>>.Create(
Binder.InvokeMember(
CSharpBinderFlags.None,
"StationOffsetElevationToXYZ",
null,
typeof(Line),
new[]
{
CSharpArgumentInfo.Create(CSharpArgumentInfoFlags.None, null),
CSharpArgumentInfo.Create(CSharpArgumentInfoFlags.UseCompileTimeType, null)
}
)
);
}
Func<CallSite, object, double[], object> 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<Func<CallSite, object, double>>.Create(Binder.Convert(CSharpBinderFlags.None, typeof(double), typeof(Line)));
}
Func<CallSite, object, double> target11 = Constructor.p__Sitef.Target;
CallSite p__Sitef = Constructor.p__Sitef;
if (Constructor.p__Site10 == null)
{
Constructor.p__Site10 = CallSite<Func<CallSite, object, object>>.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<Func<CallSite, object, double>>.Create(
Binder.Convert(CSharpBinderFlags.None, typeof(double), typeof(Line))
);
}
Func<CallSite, object, double> target12 = Constructor.p__Site11.Target;
CallSite p__Site7 = Constructor.p__Site11;
if (Constructor.p__Site12 == null)
{
Constructor.p__Site12 = CallSite<Func<CallSite, object, object>>.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<Func<CallSite, object, double>>.Create(
Binder.Convert(CSharpBinderFlags.None, typeof(double), typeof(Line))
);
}
Func<CallSite, object, double> target13 = Constructor.p__Site13.Target;
CallSite p__Site8 = Constructor.p__Site13;
if (Constructor.p__Site14 == null)
{
Constructor.p__Site14 = CallSite<Func<CallSite, object, object>>.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<Func<CallSite, Type, object, double[], TextPoint2D>>.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<CallSite, Type, object, double[], TextPoint2D> target14 = Constructor.p__Site15.Target;
CallSite p__Site9 = Constructor.p__Site15;
Type typeFromHandle2 = typeof(TextPoint2D);
if (Constructor.p__Site16 == null)
{
Constructor.p__Site16 = CallSite<Func<CallSite, object, double[], object>>.Create(
Binder.InvokeMember(
CSharpBinderFlags.None,
"StationOffsetElevationToXYZ",
null,
typeof(Line),
new[]
{
CSharpArgumentInfo.Create(CSharpArgumentInfoFlags.None, null),
CSharpArgumentInfo.Create(CSharpArgumentInfoFlags.UseCompileTimeType, null)
}
)
);
}
Func<CallSite, object, double[], object> 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<Func<CallSite, object, double>>.Create(
Binder.Convert(CSharpBinderFlags.None, typeof(double), typeof(Line))
);
}
Func<CallSite, object, double> target16 = Constructor.p__Site17.Target;
CallSite p__Site11 = Constructor.p__Site17;
if (Constructor.p__Site18 == null)
{
Constructor.p__Site18 = CallSite<Func<CallSite, object, object>>.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<Func<CallSite, object, double>>.Create(
Binder.Convert(CSharpBinderFlags.None, typeof(double), typeof(Line))
);
}
Func<CallSite, object, double> target17 = Constructor.p__Site19.Target;
CallSite p__Site12 = Constructor.p__Site19;
if (Constructor.p__Site1a == null)
{
Constructor.p__Site1a = CallSite<Func<CallSite, object, object>>.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<Func<CallSite, object, double>>.Create(
Binder.Convert(CSharpBinderFlags.None, typeof(double), typeof(Line))
);
}
Func<CallSite, object, double> target18 = Constructor.p__Site1b.Target;
CallSite p__Site1b = Constructor.p__Site1b;
if (Constructor.p__Site1c == null)
{
Constructor.p__Site1c = CallSite<Func<CallSite, object, object>>.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<Func<CallSite, object, double>> p__Site1;
public static CallSite<Func<CallSite, object, object>> p__Site10;
public static CallSite<Func<CallSite, object, double>> p__Site11;
public static CallSite<Func<CallSite, object, object>> p__Site12;
public static CallSite<Func<CallSite, object, double>> p__Site13;
public static CallSite<Func<CallSite, object, object>> p__Site14;
public static CallSite<Func<CallSite, Type, object, double[], TextPoint2D>> p__Site15;
public static CallSite<Func<CallSite, object, double[], object>> p__Site16;
public static CallSite<Func<CallSite, object, double>> p__Site17;
public static CallSite<Func<CallSite, object, object>> p__Site18;
public static CallSite<Func<CallSite, object, double>> p__Site19;
public static CallSite<Func<CallSite, object, object>> p__Site1a;
public static CallSite<Func<CallSite, object, double>> p__Site1b;
public static CallSite<Func<CallSite, object, object>> p__Site1c;
public static CallSite<Func<CallSite, object, double, object>> p__Site2;
public static CallSite<Func<CallSite, object, double, object>> p__Site3;
public static CallSite<Func<CallSite, object, object>> p__Site4;
public static CallSite<Func<CallSite, object, double>> p__Site5;
public static CallSite<Func<CallSite, object, object>> p__Site6;
public static CallSite<Func<CallSite, object, double>> p__Site7;
public static CallSite<Func<CallSite, object, object, object>> p__Site8;
public static CallSite<Func<CallSite, object, object>> p__Site9;
public static CallSite<Func<CallSite, object, double>> p__Sitea;
public static CallSite<Func<CallSite, object, object, object>> p__Siteb;
public static CallSite<Func<CallSite, object, object>> p__Sitec;
public static CallSite<Func<CallSite, Type, object, double[], TextPoint2D>> p__Sited;
public static CallSite<Func<CallSite, object, double[], object>> p__Sitee;
public static CallSite<Func<CallSite, object, double>> p__Sitef;
}
}
}