我有一个看起来像这样的类:
Public Class LumberPiece
Public boardLength As Double
Public currentLeftEndPosition As Double
Public currentRightEndPosition As Double
Public Sub New(ByVal bl As Double, ByVal clp As Double)
boardLength = clsDimension.ConvertInchesToMillimeters(bl)
currentLeftEndPosition = clsDimension.ConvertInchesToMillimeters(clp)
currentRightEndPosition = clsDimension.ConvertInchesToMillimeters(clp + bl)
End Sub
End Class
我想以某种方式有一个触发器,每次更改 currentLeftEndPosition 时计算 currentRightEndPosition(rightEnd 始终等于 leftend+ boardLength)。
我怎样才能做到这一点?