#Example:
Example:
#Example:
Example:
Later when you save the configuration (because there are other saveable setting) you don't want to override thechange this particular relative path but keep the original valueleave it untouched.
Later when you save the configuration you don't want to override the relative path but keep the original value.
Later when you save the configuration (because there are other saveable setting) you don't want to change this particular relative path but leave it untouched.
I solved this problem by creating a new type that I call Overrideable<T>
. It has two properties. Value
always returns the original value and gets serialized. Current
returns the updated value and can be used at runtime.Current
has no public setters. You use Value
to actually override it and under the hood it sets the new value
to Current
.
I solved this problem by creating a new type that I call Overrideable<T>
. It has two properties. Value
always returns the original value and gets serialized. Current
returns the updated value and can be used at runtime.
I solved this problem by creating a new type that I call Overrideable<T>
. It has two properties. Value
always returns the original value and gets serialized. Current
returns the updated value and can be used at runtime.Current
has no public setters. You use Value
to actually override it and under the hood it sets the new value
to Current
.