Non so se ti può essere utile ho buttato giù una classe veloce di nome MioDato che ho implementato solo la funzione che Verifica , restituisce TRUE se il valore è >=1 e <=100 altrimenti FALSE.
Linguaggio Visual Studio VB.NET :
Public Class Form1
Private Sub Form1_Load(sender As System.Object, e As System.EventArgs) Handles MyBase.Load
Dim prova As New MioDato
Dim esito As Boolean
esito = prova.Verifica(1000)
MsgBox("FALSE = " & esito)
esito = prova.Verifica(500)
MsgBox("FALSE = " & esito)
esito = prova.Verifica(10)
MsgBox("TRUE = " & esito)
End Sub
Private Class MioDato
Dim _valore As Integer
Property Valore() As Integer
Get
Return _valore
End Get
Set(ByVal value As Integer)
_valore = value
End Set
End Property
Dim _valueVerifica As Integer
Property Verifica(ByVal _valore As Integer) As Boolean
Get
If (_valore >= 1) And (_valore <= 100) Then
Return True
Else
Return False
End If
End Get
Set(value As Boolean)
value = False
End Set
End Property
Public Sub New()
End Sub
Public Sub New(ByVal nn As Integer)
Me.Valore = nn
End Sub
End Class
End Class
Blog ImaginSystems
http://blogs.dotnethell.it/imaginsystems
http://www.alpacasrl.it