oop - How to make property overrides of C# classes during runtime -


consider c# classes representing application data. instance class a properties:

public class {     public bool p1 { set; get; }     public string p2 { set; get; }     public int p3 { set; get; } } 

further have different time ranges in application. lets time range 1 , 2. @ first application set time range 1. instances of a exist in time ranges alike. switch time range 2 , set new value p2 of instance of a. new value should effect time range 2. upon switching time range 1, p2 should have old value. switching time range 2, p2 new value again.

whenever set value in data model should specific current time range , not effect others. on other hand values not changed should shared on time ranges. there no requirements whatsoever on how these time ranges should represented. might timerange class, might else.

how design such scenario in c#?

i think must replace property method, because realted time range. or include time range class if possible.


Comments

Popular posts from this blog

html - How to style widget with post count different than without post count -

How to remove text and logo OR add Overflow on Android ActionBar using AppCompat on API 8? -

javascript - storing input from prompt in array and displaying the array -