私は vb.net の初心者なので、ご容赦ください。Visual Basic (私は Visual Basic 2005 を使用しています) でクラスのプロパティ (または属性) を作成できますか? メタプログラミングに関するすべての Web 検索は、私をどこにも導きませんでした。これが私の言いたいことを明確にするための例です。
public class GenericProps
public sub new()
' ???
end sub
public sub addProp(byval propname as string)
' ???
end sub
end class
sub main()
dim gp as GenericProps = New GenericProps()
gp.addProp("foo")
gp.foo = "Bar" ' we can assume the type of the property as string for now
console.writeln("New property = " & gp.foo)
end sub
関数 addProp を定義することは可能ですか?
ありがとう!アミット