Exemple #1
0
        private void RefreshStatusList()
        {
            if (asyncOpManager.Count == 0)
            {
                this.Close();
            }
            else
            {
                // show the newer thread.

                AsyncOperationStatus operation = asyncOpManager.GetLastAsyncOperation();

                lblCurrent.Text = operation.Message;

                pbCurrent.Value = operation.Percentage;
            }
            // the list of details is shown.

            pnlDetails.Controls.Clear();

            foreach (AsyncOperationStatus op in asyncOpManager)
            {
                UCProgressStatus pStatus = new UCProgressStatus(  );

                pStatus.lblMessage.Text = op.Message;

                pStatus.pbStatus.Value = op.Percentage;

                pStatus.BackColor = SystemColors.ControlLightLight;

                if (asyncOpManager.Count > 0)
                {
                    pStatus.Location = new Point(2, pStatus.Size.Height * pnlDetails.Controls.Count + 2);
                }

                pnlDetails.Controls.Add(pStatus);
            }

            if (pnlDetails.Controls.Count > 0)
            {
                pnlDetails.Controls[0].BackColor = Color.GhostWhite;
            }
        }
Exemple #2
0
        private void FormStatus_Load(object sender, EventArgs e)
        {
            try
            {
                if (asyncOpManager.Count == 0)
                {
                    lblCurrent.Text = Messages.NoOperation;

                    pbCurrent.Value = 0;
                }
                else
                {
                    // show the newer thread.

                    AsyncOperationStatus operation = asyncOpManager.GetLastAsyncOperation();

                    lblCurrent.Text = operation.Message;

                    pbCurrent.Value = operation.Percentage;
                }

                this.Location = new Point(Utils.FormContainer.Left + (Utils.FormContainer.Width - this.Width) / 2,
                                          Utils.FormContainer.Top + (Utils.FormContainer.Height - this.Height) / 2);


                this.borderColor = Color.DeepSkyBlue;

                FormStatus.SetBorderColorForPanel(pnlDetails, borderColor);
            }
            catch (Exception ex)
            {
                MyLogger.Write(ex, "FormStatus_Load", LoggingCategory.Exception);

                MessageBox.Show(this, ex.Message, Messages.Error, MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }
 public AsyncOperationEventArgs(AsyncOperationStatus opStatus)
 {
     _asyncOpStatus = opStatus;
 }