void OverallProgress(GraphProgressEventArgs e)
 {
     if (calculationStatusGrd.Rows.Count != 0)
     {
         GraphProgressStatus status = e.Progress;
         DataGridViewRow row = calculationStatusGrd.Rows[status.ID];
         row.Cells[0].Value = status.ID + 1;
         row.Cells[1].Value = status.GraphProgress;
         row.Cells[2].Value = status.Percent;
         row.Cells[3].Value = status.TargetName;
         row.Cells[4].Value = status.HostName;
     }
 }
 /// <summary>
 /// ???.
 /// </summary>
 protected void OnModelProgress(GraphProgressEventArgs args)
 {
     if (Progress != null)
     {
         CurrentStatus = args.Progress;
         args.Progress.ID = ID;
         Progress(this, args);
     }
 }
        void OnSeparateModelProgress(object sender, GraphProgressEventArgs e)
        {
            AbstractGraphModel senderModel = (AbstractGraphModel)sender;
            senderModel.CurrentStatus.HostName = hostname;
            try
            {
                AnalizeResult tempResult = senderModel.Result;
                object graph = senderModel.Graph;
                if (e.Progress.GraphProgress != GraphProgress.Done)
                {
                    senderModel.Result = null;
                }
                senderModel.Graph = null;
                lock (this)
                {
                    if (context.Channel.State != CommunicationState.Opened)
                    {
                       //context.Channel.Open(TimeSpan.FromSeconds(5));
                        //
                    }

                    try
                    {
                        context.GetCallbackChannel<IDuplexCallback>().ProgressReport(senderModel, e);
                    }
                    catch (SystemException) { }
                }
                senderModel.Result = tempResult;
                senderModel.Graph = graph;
            }
            catch (CommunicationException) { }
            catch (TimeoutException) {}
        }
 private void manager_OverallProgress(object sender, GraphProgressEventArgs e)
 {
     if (calculationStatusGrd.InvokeRequired)
     {
         OverallCallback d = new OverallCallback(OverallProgress);
         this.Invoke(d, new object[] { e });
     }
     else
     {
         OverallProgress(e);
     }
 }
 protected void OnOverallProgress(GraphProgressEventArgs args)
 {
     if (OverallProgress != null)
     {
         OverallProgress(this, args);
     }
 }
 /// <summary>
 /// Event handler for monitoring processes for separate generation.
 /// Calls analyze method of model when its generation is finished.
 /// Also saves results of fully processed model.
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 void OnSeparateModelProgress(object sender, GraphProgressEventArgs e)
 {
     AbstractGraphModel senderModel = (AbstractGraphModel)sender;
     invokeOverallProgress(senderModel);
     if (e.Progress.GraphProgress == GraphProgress.Done)
     {
         Assembly.Results.Add(senderModel.Result);
     }
 }
 public void ProgressReport(AbstractGraphModel model, GraphProgressEventArgs args)
 {
     manager.OnSeparateModelProgress(model, args);
 }
 public IAsyncResult BeginProgressReport(AbstractGraphModel model, GraphProgressEventArgs args, AsyncCallback callback, object asyncState)
 {
     throw new NotImplementedException();
 }
 public void OnSeparateModelProgress(AbstractGraphModel model, GraphProgressEventArgs args)
 {
     invokeOverallProgress(model);
     if (args.Progress.GraphProgress == GraphProgress.Done)
     {
         Assembly.Results.Add(model.Result);
         if (Assembly.Results.Count == iterations)
         {
             OnExecutionStatusChange(new ExecutionStatusEventArgs(ExecutionStatus.Success));
         }
     }
     else if (args.Progress.GraphProgress == GraphProgress.Failed)
     {
         OnExecutionStatusChange(new ExecutionStatusEventArgs(ExecutionStatus.Failed));
     }
 }