Пример #1
0
        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);

            V1Datalist.Add(tmp_0);
            V1DataCollection tmp_1 = new V1DataCollection("information", DateTime.Now);

            V1Datalist.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);
                V1Datalist.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);
                V1Datalist.Add(tmp2);
            }
        }
Пример #2
0
        static void Main(string[] args)
        {
            Console.WriteLine("Lab3");
            V1MainCollection element_collection = new V1MainCollection();

            element_collection.DataChanged += DataChangedCollector;

            element_collection.AddDefaults();
            V1DataCollection value2;
            DateTime         date = new DateTime(10, 10, 10);

            value2 = new V1DataCollection("ID6", date);
            value2.InitRandom(5, 1, 4, 3, 4);
            element_collection.Add(value2);
            element_collection[3]      = value2;
            element_collection[3].Data = "ChangeInformation";
            element_collection.Remove("ChangeInformation", date);
            Console.ReadLine();
        }