public void AddDefaults() { Grid grid_0 = new Grid { t_begin = 0f, t_step = 0f, count = 0 }; V1DataOnGrid tmp_0 = new V1DataOnGrid("information", DateTime.Now, grid_0); Add(tmp_0); V1DataCollection tmp_1 = new V1DataCollection("information", DateTime.Now); Add(tmp_1); Random rand = new Random(); int k = 2; for (int i = 0; i < k; i++) { string info = "information"; DateTime date = DateTime.Now; Grid grid = new Grid { t_begin = 0f, t_step = 5f, count = 2 }; float rand_minValue = (float)(-rand.NextDouble() * 20f); float rand_maxValue = (float)(rand.NextDouble() * 30f); V1DataOnGrid tmp = new V1DataOnGrid(info, date, grid); tmp.InitRandom(rand_minValue, rand_maxValue); Add(tmp); V1DataCollection tmp2 = new V1DataCollection(info, date); float rand_minValue2 = (float)(-rand.NextDouble() * 20f); float rand_maxValue2 = (float)(rand.NextDouble() * 30f); float rand_tmin = (float)(rand.NextDouble() * 10f); float rand_tmax = rand_tmin + (float)(rand.NextDouble() * 30f); tmp2.InitRandom(2, rand_tmin, rand_tmax, rand_minValue2, rand_maxValue2); Add(tmp2); } }
static void Main(string[] args) { //Console.WriteLine("Start"); V1DataOnGrid Obj1 = new V1DataOnGrid("input.txt"); V1MainCollection Obj2 = new V1MainCollection(); Obj2.DataChanged += DataChangedInList; Obj2.AddDefaults(); Obj2.Add(Obj1); Obj2[2] = Obj1; Obj1.info = "new_information"; Obj2.Remove(Obj1.info, Obj1.date); }