private void OnCalculateCompleted(object sender, CalculateCompletedEventArgs e)
 {
     _resaults.Add(e.Result);
     if (_resaults.Count == IterationCount)
     {
         DrawChart();
     }
 }
        private void _proxy_CalculateCompleted(object sender, CalculateCompletedEventArgs e)
        {
            Result result = e.Result;

            var allowable = new List<ResultViewModel>();
            var optimal = new List<ResultViewModel>();

            foreach (Variation acceptable in result.Acceptables)
            {
                allowable.Add(new ResultViewModel
                {
                    G = Math.Round(acceptable.G,3),
                    Knapsacks = getLineKnapsacks(acceptable.Knapsacks),
                    Items = getLineItems(acceptable.Knapsacks)
                });
            }

            optimal.Add(new ResultViewModel
            {
                G = Math.Round(result.Optimal.G, 3),
                Knapsacks = getLineKnapsacks(result.Optimal.Knapsacks),
                Items = getLineItems(result.Optimal.Knapsacks)
            });

            OptimalGrid.DataSource = optimal;
            OptimalGrid.DataBind();

            AllowableGrid.DataSource = allowable;
            AllowableGrid.DataBind();

            new ExampleManager().UpdateExecuteTime(Convert.ToInt32(Request.QueryString["idExp"]),
                                                    Math.Round(result.RunTime));

            info.Text = "Время рассчета: " + Math.Round(result.RunTime) + " мс";
        }