For this example (Figure 4), you will model a read-only indexer (thus it has only a get accessor) in the DrawingSurface class.
对于本实例(图4),您将对drawingsurface类中的只读索引器建模(因而它只有get存取器)。
Then expose these through set and get accessor functions, making sure that the set functions publish their changes to the property change support mechanism.
然后通过set和get存取器函数公开这些字段,确保set函数将其更改发布到属性更改支持机制中。
In general, you put demands for less restrictive permissions on the get accessor rather than on the set accessor, unless the property holds sensitive information, such as a password.
一般而言,放入取得存取子的需求其使用权限限制会少于设定存取子,含有敏感资讯的属性除外,如密码。
应用推荐