Пример #1
0
        private void LoadPlugin(string name)
        {
            Logger.LogDebug(string.Format("{0} Loading plugin {1}.", brktname, name));

            if (plugins.ContainsKey(name)) {
                Logger.LogError(string.Format("{0} {1} plugin is already loaded.", brktname, name));
                throw new InvalidOperationException(string.Format("{0} {1} plugin is already loaded.", brktname, name));
            }

            try {
                String text = GetPluginScriptText(name);
                DirectoryInfo dir = new DirectoryInfo(Path.Combine(pluginDirectory.FullName, name));
                Plugin plugin = new Plugin(dir, name, text);
                plugin.InstallHooks();
                plugins[name] = plugin;

                Logger.Log(string.Format("{0} {1} plugin was loaded successfuly.", brktname, name));
            } catch (Exception ex) {
                Logger.LogError(string.Format("{0} {1} plugin could not be loaded.", brktname, name));
                Logger.LogException(ex);
            }
        }
Пример #2
0
 public AdvancedTimer(Plugin pl)
 {
     Plugin         = pl;
     Timers         = new Dictionary <string, MagmaTE>();
     ParallelTimers = new List <MagmaTE>();
 }