使用 VB.Net。
我已经声明了这样的属性:
Private _name as String
Private _address as String
Public Property Name as String
Get
Return _name
End Get
Set(value as String)
_name = value
End Set
End Property
Public Property Address as String
Get
Return _address
End Get
Set(value as String)
_address= value
End Set
End Property
我想最小化声明另一个将处理获取和设置的变量。此变量或函数将被所有属性使用,并将处理所有属性的所有获取和设置值。
例如:
Public Property Address as String
Get
Return address /*Insert function here that can be use by all property*/
End Get
Set(value as String)
address = value /*Insert function here that can be use by all property*/
End Set
End Property
提前致谢。