コード例 #1
0
        private void InitializeComponent()
        {
            SuspendLayout();

            // quitButton
            quitButton.Anchor    = AnchorStyles.Bottom | AnchorStyles.Right;
            quitButton.FlatStyle = FlatStyle.System;
            quitButton.Size      = new Size(Localization.QuitButtonWidth, 24);
            quitButton.Location  = new Point(408 - quitButton.Width, 188);
            quitButton.TabIndex  = 0;
            quitButton.Text      = Localization.QuitButton;
            quitButton.Click    += new EventHandler(OnQuitClick);

            // continueButton
            continueButton.Anchor    = AnchorStyles.Bottom | AnchorStyles.Right;
            continueButton.FlatStyle = FlatStyle.System;
            continueButton.Size      = new Size(Localization.ContinueButtonWidth, 24);
            continueButton.Location  = new Point(quitButton.Left - continueButton.Width - 6, 188);
            continueButton.TabIndex  = 1;
            continueButton.Text      = Localization.ContinueButton;
            continueButton.Click    += new EventHandler(OnContinueClick);

            // powered
            powered.Anchor = AnchorStyles.Bottom | AnchorStyles.Left;
            powered.SetBounds(6, 186, 120, 32);

            // headerControl
            headerControl.IconState = IconState.Warning;

            // errorMessage
            errorMessage.Anchor   = AnchorStyles.Top | AnchorStyles.Left | AnchorStyles.Right;
            errorMessage.Location = new Point(20, 72);
            errorMessage.Size     = new Size(382, 13);

            // SecurityExceptionForm
            AutoScaleBaseSize = new Size(5, 13);
            ClientSize        = new Size(418, 224);
            ControlBox        = false;
            Controls.AddRange(new Control[] { powered, continueButton, quitButton, headerControl, errorMessage });
            FormBorderStyle = FormBorderStyle.FixedSingle;
            MaximizeBox     = false;
            MinimizeBox     = false;
            ShowInTaskbar   = false;
            StartPosition   = FormStartPosition.CenterScreen;

            ResumeLayout(false);
        }
コード例 #2
0
        private void InitializeComponent()
        {
            panelInformation.SuspendLayout();
            panelSending.SuspendLayout();
            SuspendLayout();

            // headerControl1
            headerControl1.IconState = IconState.Error;

            // headerControl2
            headerControl2.IconState = IconState.Error;

            // continueCheckBox
            continueCheckBox.Anchor          = AnchorStyles.Bottom | AnchorStyles.Left;
            continueCheckBox.FlatStyle       = FlatStyle.System;
            continueCheckBox.Location        = new Point(22, 98);
            continueCheckBox.Size            = new Size(Localization.ContinueCheckBoxWidth, 16);
            continueCheckBox.TabIndex        = 13;
            continueCheckBox.Text            = Localization.IgnoreThisError;
            continueCheckBox.CheckedChanged += new EventHandler(OnContinueCheckedChanged);

            // pleaseTellTitle
            pleaseTellTitle.Anchor    = AnchorStyles.Bottom | AnchorStyles.Left | AnchorStyles.Right;
            pleaseTellTitle.FlatStyle = FlatStyle.System;
            pleaseTellTitle.Font      = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((System.Byte)(0)));
            pleaseTellTitle.Location  = new Point(20, 124);
            pleaseTellTitle.Size      = new Size(381, 16);
            pleaseTellTitle.Text      = string.Format(Localization.PleaseTellCompany, UnhandledExceptionHandler.CompanyName);

            // dontSendReport
            dontSendReport.Anchor    = AnchorStyles.Bottom | AnchorStyles.Right;
            dontSendReport.FlatStyle = FlatStyle.System;
            dontSendReport.Size      = new Size(Localization.DontSendButtonWidth, 24);
            dontSendReport.Location  = new Point(400 - dontSendReport.Width, 205);
            dontSendReport.TabIndex  = 4;
            dontSendReport.Text      = Localization.DontSendButton;
            dontSendReport.Click    += new System.EventHandler(OnDontSendReportClick);

            // sendReport
            sendReport.Anchor    = AnchorStyles.Bottom | AnchorStyles.Right;
            sendReport.FlatStyle = FlatStyle.System;
            sendReport.Size      = new Size(Localization.SendReportButtonWidth, 24);
            sendReport.Location  = new Point(dontSendReport.Left - sendReport.Width - 6, 205);
            sendReport.TabIndex  = 3;
            sendReport.Text      = Localization.SendReportButton;
            sendReport.Click    += new System.EventHandler(OnSendReportClick);

            // debug
            debug.Anchor    = AnchorStyles.Bottom | AnchorStyles.Right;
            debug.FlatStyle = FlatStyle.System;
            debug.Size      = new Size(Localization.DebugButtonWidth, 24);
            debug.Location  = new Point(sendReport.Left - debug.Width - 6, 205);
            debug.TabIndex  = 14;
            debug.Text      = Localization.DebugButton;
            debug.Visible   = false;
            debug.Click    += new System.EventHandler(OnDebugClick);

            // pleaseTellMessage
            pleaseTellMessage.Anchor    = AnchorStyles.Bottom | AnchorStyles.Left | AnchorStyles.Right;
            pleaseTellMessage.FlatStyle = FlatStyle.System;
            pleaseTellMessage.Location  = new Point(20, 140);
            pleaseTellMessage.Size      = new Size(381, 55);
            pleaseTellMessage.Text      = string.Format(Localization.CompanyInterestedInLearning, UnhandledExceptionHandler.CompanyName);

            // errorMessage
            errorMessage.Anchor   = AnchorStyles.Top | AnchorStyles.Left | AnchorStyles.Right;
            errorMessage.Location = new Point(20, 69);
            errorMessage.Size     = new Size(381, 13);

            cancelSending.Anchor    = AnchorStyles.Bottom | AnchorStyles.Right;
            cancelSending.FlatStyle = FlatStyle.System;
            cancelSending.Size      = new Size(Localization.CancelButtonWidth, 24);
            cancelSending.Location  = new Point(400 - cancelSending.Width, 205);
            cancelSending.TabIndex  = 7;
            cancelSending.Text      = Localization.CancelButton;
            cancelSending.Click    += new System.EventHandler(OnCancelSending);

            // ok
            ok.Anchor    = AnchorStyles.Bottom | AnchorStyles.Right;
            ok.Enabled   = false;
            ok.FlatStyle = FlatStyle.System;
            ok.Size      = new Size(Localization.OKRetryButtonWidth, 24);
            ok.Location  = new Point(cancelSending.Left - ok.Width - 6, 205);
            ok.TabIndex  = 6;
            ok.Text      = Localization.OKButton;
            ok.Click    += new System.EventHandler(OnOK);

            // retrySending
            retrySending.Anchor    = AnchorStyles.Bottom | AnchorStyles.Right;
            retrySending.FlatStyle = FlatStyle.System;
            retrySending.Location  = ok.Location;
            retrySending.Size      = ok.Size;
            retrySending.TabIndex  = 5;
            retrySending.Text      = Localization.RetryButton;
            retrySending.Visible   = false;
            retrySending.Click    += new System.EventHandler(OnRetry);

            // saveReport
            saveReport.Anchor    = AnchorStyles.Bottom | AnchorStyles.Right;
            saveReport.FlatStyle = FlatStyle.System;
            saveReport.Location  = ok.Location;
            saveReport.Size      = ok.Size;
            saveReport.TabIndex  = 5;
            saveReport.Text      = Localization.SaveReportButton;
            saveReport.Visible   = false;
            saveReport.Click    += new System.EventHandler(OnSaveReport);

            // waitSendingReport
            waitSendingReport.Location = new Point(87, 146);
            waitSendingReport.Visible  = false;

            //feedback controls
            preparingFeedback.SetBounds(24, 72, 368, 16);
            connectingFeedback.SetBounds(24, 96, 368, 16);
            transferingFeedback.SetBounds(24, 120, 368, 16);
            completedFeedback.SetBounds(24, 144, 368, 16);

            // Powered by sa
            powered.Anchor = AnchorStyles.Bottom | AnchorStyles.Left;
            powered.SetBounds(20, 444, 120, 32);

            // panelInformation
            panelInformation.Controls.AddRange(new Control[] { debug, continueCheckBox, pleaseTellTitle, dontSendReport, sendReport, pleaseTellMessage, errorMessage, headerControl1 });
            panelInformation.Size     = new Size(413, 240);
            panelInformation.TabIndex = 0;

            // panelSending
            panelSending.Controls.AddRange(new Control[] { cancelSending, ok, retrySending, saveReport, waitSendingReport, headerControl2, preparingFeedback, connectingFeedback, transferingFeedback, completedFeedback });
            panelSending.Size     = new Size(413, 240);
            panelSending.TabIndex = 2;
            panelSending.Visible  = false;

            // ExceptionReportingForm
            AutoScaleBaseSize = new Size(5, 13);
            ClientSize        = new Size(434, 488);
            ControlBox        = false;
            Controls.AddRange(new Control[] { powered, panelInformation, panelSending });
            FormBorderStyle = FormBorderStyle.FixedSingle;
            ShowInTaskbar   = false;
            MinimizeBox     = false;
            MaximizeBox     = false;
            StartPosition   = FormStartPosition.CenterScreen;
            Text            = UnhandledExceptionHandler.ApplicationName;
            if (Text.Length == 0)
            {
                Text = Localization.ErrorReporting;
            }

            try
            {
                TopMost = true;
            }
            catch
            {
            }

            panelInformation.ResumeLayout(false);
            panelSending.ResumeLayout(false);
            ResumeLayout(false);

            retrySending.BringToFront();
            saveReport.BringToFront();
            Size = new Size(Localization.Width, Localization.Height);

            panelSending.Dock     = DockStyle.Fill;
            panelInformation.Dock = DockStyle.Fill;
        }