Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public class CanBeReadOnly<T>
- {
- private T _value;
- public CanBeReadOnly(T value)
- {
- _value = value;
- }
- public T Value
- {
- get { return _value; }
- set
- {
- if (!IsReadOnly)
- {
- _value = value;
- }
- }
- }
- public bool IsReadOnly { get; set; }
- }
Add Comment
Please, Sign In to add comment