Public Enum Number As Integer
One = 1
Two = 2
Three = 3
Four = 4
End Enum
Public Function MyFunction(ByVal TEST As String, Optional ByVal Value As Number = Number.One)
Return TEST
End Function
Public Function MyFunction(ByVal TEST As String, ByVal Value As Integer) As String
Dim _return As String = ""
If Value = 1 Or Value = 2 Or Value = 5 Or Value = 10 Then
_return = TEST
Else
_return = "Error"
End If
Return _return
End Function
Private Sub Form1_Load(sender As Object, e As EventArgs) Handles MyBase.Load
MessageBox.Show(MyFunction("Test 5655", 3))
End Sub
VS 2018-2020 น่าจะทำได้ (ผมมั่นใจ Validator UnCompile Parameter)
Code (VB.NET)
Imports System.ComponentModel
Public Class paramCodeDesigetimeValidator
Implements INotifyPropertyChanged
Private _FuckMe As String = String.Empty
Public Event PropertyChanged(sender As Object, e As PropertyChangedEventArgs) Implements INotifyPropertyChanged.PropertyChanged
Private Sub NotifyPropertyChanged(ByVal info As String)
RaiseEvent PropertyChanged(Me, New PropertyChangedEventArgs(info))
End Sub
Sub New()
_FuckMe= "No Hair"
End Sub
Public Property FuckMe() As String
Get
Return Me._FuckMe
End Get
Set(value As String)
If value <> Me._FuckMeThen
Me._FuckMe= value
NotifyPropertyChanged("Fuck me change.")
End If
End Set
End Property
End Class