コード例 #1
0
ファイル: Error.cs プロジェクト: radtek/vhddirector
        public bool Init()
        {
            if (showing)
            {
                this.InError = true;
                return(false);
            }
            showing = true;

            UnhandledExceptionManager.ExceptionToScreenshot();
            if (!String.IsNullOrEmpty(UnhandledExceptionManager._strScreenshotFullPath))
            {
                ScreenshotFullPath = UnhandledExceptionManager._strScreenshotFullPath;
            }
            InitializeComponent();

            Random r = new Random();

            authorTextBox.Text = App.Prefs.GetPreference("User.ExceptionAuthorName", "anonymous" + r.Next());
            App.Prefs.SetPreference("User.ExceptionAuthorName", authorTextBox.Text);

            int sw = Screen.PrimaryScreen.Bounds.Width;
            int sh = Screen.PrimaryScreen.Bounds.Height;
            int ww = this.Bounds.Width;
            int wh = this.Bounds.Height;

            this.Location = new Point((sw >> 1) - (ww >> 1), (sh >> 1) - (ww >> 1));
            Color bg = System.Drawing.SystemColors.Control;

            return(true);
        }