c# - Make Hashtable immutable -
How can I create derivative classes from Hashtable, objects which can be added, but can not be removed or can not be changed?
P>
What to do to override me and especially how I override the [] operator Can i
At least, you clear
, remove
, property value
and index / code> item . You can override indexor item
using syntax:
override the public [of this object] {{Setup implementation} Set {// set Implementation}}
You need to override the clear
so that a user can not clean the hashteble. You need to override the remove
so that a user can not get hit from the hashtable, you need to override the value
because one user is Icoding
You can use that which has been returned to modify the value in the hashtable, you have to override the item
for a similar reason.