0
我想构建一个嵌套类层次结构。一些有助于分类,比方说组对象(主要是属性)按类型使用智能感知。嵌套类(或如何“组”属性)
即从:
Class MyHouse
[+] Property Tv
[+] Property Kitchen
[+] Property Radio
[+] Property Bathroom
[+] Property Computer
[+] Property Crib
[-] Property Bedroom
Get...
Set...
End Property
End class
要:
Class MyHouse
|
|-----Class Rooms
| [+] Property Bathroom
| [+] Property Bedroom
| [+] Property Kitchen
| ...
|
|-----Class Objects
| [+] Property Radio
| [+] Property Tv
| [+] Property Computer
| [+] Property Crib
| ...
|
End class
主要目的是有intellis使用层次结构。
Dim MyHouse_ as new MyHouse()
-------------
MyHouse_.| Rooms |
| Objects |
-------------
所以我嵌套类中的另一个,并共享它的成员:
Friend class MyHouse
|
| Friend class Rooms
| |
| | Private shared kitchen_ as clsRoom
| | Friend shared Property prop_kitchen
| | Get
| | Set
| | End Property
| | ...
| |
| End class
| ...
|
End Class
问题是,当我创建一个新的对象,并希望访问它的嵌套属性,我得到以下错误:
access of shared member constant member qualifying expression will not be evaluated
但我不想实例化子类。
我只是在寻找一种让层级“整理”整个班级,并直接访问其成员的好方法。
任何方式做到这一点?