Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
Class Alarm
Private ReadOnly Code As Integer
ReadOnly Property Status As String = "Disarmed"
Sub New(code As Integer)
Me.Code = code
End Sub
Sub Arm()
' I'm motifying the value of this externally read-only property here.
_Status = "Armed"
End Sub
Function Disarm(code As Integer) As Boolean
If code = Me.Code Then
' And here.
_Status = "Disarmed"
Return True
Return False
End If
End Function
End Class
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment