source: trunk/eraser/Eraser.BlackBox/Plugin.cs @ 2678

Revision 2678, 1.9 KB checked in by lowjoel, 2 years ago (diff)

Implement a Client Tool plugin to show the BlackBox? Report Manager in the Tools menu.

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Rev URL
Line 
1/*
2 * $Id$
3 * Copyright 2008-2012 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
22using System;
23using System.Collections.Generic;
24using System.Text;
25using System.Windows.Forms;
26
27using Eraser.Plugins;
28
29namespace Eraser.BlackBox
30{
31    public sealed class Plugin : IPlugin
32    {
33        public void Initialize(PluginInfo info)
34        {
35            //Initialise our crash handler
36            BlackBox blackBox = BlackBox.Get();
37
38            //Register our client tools
39            Host.Instance.ClientTools.Add(new BlackBoxClientTool());
40
41            bool allSubmitted = true;
42            foreach (BlackBoxReport report in blackBox.GetDumps())
43                if (!report.Submitted)
44                {
45                    allSubmitted = false;
46                    break;
47                }
48
49            if (!allSubmitted)
50            {
51                Host.Instance.Notifiers.Add(new BlackBoxNotifier());
52            }
53        }
54
55        public void Dispose()
56        {
57            GC.SuppressFinalize(this);
58        }
59
60        public string Name
61        {
62            get { return "Eraser BlackBox"; }
63        }
64
65        public string Author
66        {
67            get { return "The Eraser Project <eraser-development@lists.sourceforge.net>"; }
68        }
69
70        public bool Configurable
71        {
72            get { return false; }
73        }
74
75        public void DisplaySettings(Control parent)
76        {
77            throw new NotImplementedException();
78        }
79
80        public static void OnGUIIdle(object sender, EventArgs e)
81        {
82            Application.Idle -= OnGUIIdle;
83           
84        }
85    }
86}
Note: See TracBrowser for help on using the repository browser.