を使用してプロパティ値をクラスに割り当てていますForEach statement
。出力は次のようになります...
Startingpoint | length
-----------------------
0 | 1
1 | 54.47
55.47 | 47.98
長さは次のように計算されます...
length = *next item starting point - current item starting point
疑似コード風の外観でやりたいことは次のとおりです。
foreach (DefectMap obj in dm)
{
mdmList.Add(new ModifiedDefectMap()
{
StartingPoint = obj.Start,
Length = ValueOfNext().obj.Start - obj.Start
問題は、ループ"ValueOfNext().obj.Start"
の現在の反復にいるため、何が起こるかを知る方法がないことです。foreach