source: branches/eraser6/Manager/Manager.cs @ 554

Revision 554, 2.8 KB checked in by lowjoel, 5 years ago (diff)

Fixed the language manager

  • Property svn:keywords set to Id
Line 
1/*
2 * $Id$
3 * Copyright 2008 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;
25
26namespace Eraser.Manager
27{
28    /// <summary>
29    /// The library instance which initializes and cleans up data required for the
30    /// library to function.
31    /// </summary>
32    public class ManagerLibrary : IDisposable
33    {
34        public ManagerLibrary(Settings settings)
35        {
36            Instance = this;
37            Settings = settings;
38
39            EntropySourceManager = new EntropySourceManager();
40            LanguageManager = new LanguageManager(); 
41            PRNGManager = new PRNGManager();
42            ErasureMethodManager = new ErasureMethodManager();
43            Host = new Plugin.DefaultHost();
44        }
45
46        public void Dispose()
47        {
48            EntropySourceManager.Poller.Abort();
49            Host.Dispose();
50            Settings.Save();
51            Instance = null;
52        }
53
54        /// <summary>
55        /// The global library instance.
56        /// </summary>
57        public static ManagerLibrary Instance = null;
58
59        /// <summary>
60        /// The global instance of the EntropySource Manager
61        /// </summary>
62        internal EntropySourceManager EntropySourceManager;
63
64        /// <summary>
65        /// The global instance of the PRNG Manager.
66        /// </summary>
67        internal PRNGManager PRNGManager;
68
69        /// <summary>
70        /// Entropy source manager global instance.
71        /// </summary>
72        internal EntropySourceManager EntropySourceManager;
73
74        /// <summary>
75        /// Global instance of the Language Manager.
76        /// </summary>
77        internal LanguageManager LanguageManager;
78
79        /// <summary>
80        /// The global instance of the Erasure method manager.
81        /// </summary>
82        internal ErasureMethodManager ErasureMethodManager;
83
84        /// <summary>
85        /// Global instance of the Settings object.
86        /// </summary>
87        public Settings Settings;
88
89        /// <summary>
90        /// The global instance of the Plugin host.
91        /// </summary>
92        internal Plugin.DefaultHost Host;
93    }
94
95    /// <summary>
96    /// Fatal exception class.
97    /// </summary>
98    internal class FatalException : Exception
99    {
100        public FatalException(string message)
101            : base(message)
102        {
103        }
104
105        public FatalException(string message, Exception innerException)
106            : base(message, innerException)
107        {
108        }
109    }
110}
Note: See TracBrowser for help on using the repository browser.