次のコードがあります。
Public Class Form1
Private Function Step1_Execute() As Boolean
Return Step1_Verify()
End Function
Private Function Step1_Verify() As Boolean
Return True
End Function
Private Function Step2_Execute() As Boolean
Return Step2_Verify()
End Function
Private Function Step2_Verify() As Boolean
Return True
End Function
End Class
私がやりたいことは、次のようなコードを分離できることです (これは明らかに機能しません)。
Public Class Form1
Namespace Step1
Private Function Step1_Execute() As Boolean
Return Step1_Verify()
End Function
Private Function Step1_Verify() As Boolean
Return True
End Function
End Namespace
Namespace Step2
Private Function Step2_Execute() As Boolean
Return Step2_Verify()
End Function
Private Function Step2_Verify() As Boolean
Return True
End Function
End Namespace
End Class
Step2_ を一連の関数の前に配置する代わりに、Step2.Execute() を呼び出すことができるような、クラス内の名前空間の機能が必要です。step1、step2などに個別のクラス/モジュールを作成する必要はありません。
クラス内から名前空間機能を実現する方法はありますか?