| [1979] | 1 | /* |
|---|
| 2 | * $Id$ |
|---|
| 3 | * Copyright 2008-2010 The Eraser Project |
|---|
| 4 | * Original Author: Joel Low <lowjoel@users.sourceforge.net> |
|---|
| 5 | * Modified By: |
|---|
| 6 | * |
|---|
| 7 | * This file is part of Eraser. |
|---|
| 8 | * |
|---|
| 9 | * Eraser is free software: you can redistribute it and/or modify it under the |
|---|
| 10 | * terms of the GNU General Public License as published by the Free Software |
|---|
| 11 | * Foundation, either version 3 of the License, or (at your option) any later |
|---|
| 12 | * version. |
|---|
| 13 | * |
|---|
| 14 | * Eraser is distributed in the hope that it will be useful, but WITHOUT ANY |
|---|
| 15 | * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR |
|---|
| 16 | * A PARTICULAR PURPOSE. See the GNU General Public License for more details. |
|---|
| 17 | * |
|---|
| 18 | * A copy of the GNU General Public License can be found at |
|---|
| 19 | * <http://www.gnu.org/licenses/>. |
|---|
| 20 | */ |
|---|
| 21 | |
|---|
| 22 | using System; |
|---|
| [1973] | 23 | using System.Collections.Generic; |
|---|
| 24 | using System.Text; |
|---|
| 25 | using System.Windows.Forms; |
|---|
| 26 | |
|---|
| [1979] | 27 | using Eraser.Manager.Plugin; |
|---|
| 28 | |
|---|
| [1973] | 29 | namespace Eraser.BlackBox |
|---|
| 30 | { |
|---|
| [1979] | 31 | public sealed class Plugin : IPlugin |
|---|
| [1973] | 32 | { |
|---|
| [1979] | 33 | public void Initialize(Host host) |
|---|
| [1973] | 34 | { |
|---|
| 35 | //Initialise our crash handler |
|---|
| 36 | BlackBox blackBox = BlackBox.Get(); |
|---|
| [1979] | 37 | |
|---|
| 38 | //Hook the Application's idle loop to display the form |
|---|
| 39 | Application.Idle += OnGUIIdle; |
|---|
| [1973] | 40 | } |
|---|
| 41 | |
|---|
| [1979] | 42 | public void Dispose() |
|---|
| 43 | { |
|---|
| 44 | GC.SuppressFinalize(this); |
|---|
| 45 | } |
|---|
| 46 | |
|---|
| 47 | public string Name |
|---|
| 48 | { |
|---|
| [1981] | 49 | get { return "Eraser BlackBox"; } |
|---|
| [1979] | 50 | } |
|---|
| 51 | |
|---|
| 52 | public string Author |
|---|
| 53 | { |
|---|
| [1981] | 54 | get { return "The Eraser Project <eraser-development@lists.sourceforge.net>"; } |
|---|
| [1979] | 55 | } |
|---|
| 56 | |
|---|
| 57 | public bool Configurable |
|---|
| 58 | { |
|---|
| [1981] | 59 | get { return false; } |
|---|
| [1979] | 60 | } |
|---|
| 61 | |
|---|
| 62 | public void DisplaySettings(Control parent) |
|---|
| 63 | { |
|---|
| 64 | throw new NotImplementedException(); |
|---|
| 65 | } |
|---|
| 66 | |
|---|
| [1973] | 67 | public static void OnGUIIdle(object sender, EventArgs e) |
|---|
| 68 | { |
|---|
| 69 | Application.Idle -= OnGUIIdle; |
|---|
| 70 | BlackBox blackBox = BlackBox.Get(); |
|---|
| 71 | |
|---|
| 72 | bool allSubmitted = true; |
|---|
| 73 | foreach (BlackBoxReport report in blackBox.GetDumps()) |
|---|
| 74 | if (!report.Submitted) |
|---|
| 75 | { |
|---|
| 76 | allSubmitted = false; |
|---|
| 77 | break; |
|---|
| 78 | } |
|---|
| 79 | |
|---|
| 80 | if (allSubmitted) |
|---|
| 81 | return; |
|---|
| 82 | |
|---|
| 83 | BlackBoxMainForm form = new BlackBoxMainForm(); |
|---|
| 84 | form.Show(); |
|---|
| 85 | } |
|---|
| 86 | } |
|---|
| 87 | } |
|---|