コード例 #1
0
        private void btnDetails_Click(object sender, EventArgs e)
        {
            try
            {
                if (btnDetails.Text == Resources.Text_Details)
                {
                    // details

                    this.Size = formSizeMax;

                    pnlDetails.Location = locPnlCommand;

                    pnlCommands.Location = new Point(locPnlDetails.X, locPnlDetails.Y + pnlDetails.Size.Height - pnlCommands.Size.Height);

                    btnDetails.Text = Resources.Text_Hide;

                    RefreshStatusList();

                    FormStatus.SetBorderColorForPanel(pnlDetails, borderColor);
                }
                else
                {
                    // hide

                    this.Size = formSizeMin;

                    pnlCommands.Location = locPnlCommand;

                    pnlDetails.Location = locPnlDetails;

                    btnDetails.Text = Resources.Text_Details;
                }
            }
            catch (Exception ex)
            {
                MyLogger.Write(ex, "btnDetails_Click", LoggingCategory.Exception);

                MessageBox.Show(this, ex.Message, Messages.Error, MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }
コード例 #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);
            }
        }