public Job( ICurrencyListProvider currencyListProvider, IRateProviderFactory rateProviderFactory, IRepositoryFactory repositoryFactory, IUILogger uiLogger, ILogger logger) { _currencyListProvider = currencyListProvider; _rateProviderFactory = rateProviderFactory; _repositoryFactory = repositoryFactory; _uiLogger = uiLogger; _logger = logger; }
public void InitPlugin(PluginHostContext context, IUILogger logger) { if (logger == null) { throw new ArgumentNullException("logger"); } Logger = logger; _context = context; _pluginID = Context.GetUniquePluginID(); Context.RPCClient.Callbacks.PlayerManialinkPageAnswer += Callbacks_PlayerManialinkPageAnswer; RunCatchLogReThrow(Init, "Error initializing plugin.", true); }
public List <IDedimaniaPluginPlugin> GetPlugins(IUILogger logger) { List <IDedimaniaPluginPlugin> result = new List <IDedimaniaPluginPlugin>(); foreach (PluginConfigEntry pluginConfigEntry in Plugins.GetEnabledPlugins()) { if (logger != null) { logger.Debug(string.Format("Instantiating IDedimaniaPluginPlugin {0}", pluginConfigEntry.PluginClass)); } result.Add(Instancer.GetInstanceOfInterface <IDedimaniaPluginPlugin>(pluginConfigEntry.AssemblyName, pluginConfigEntry.PluginClass, pluginConfigEntry.PluginDirectory)); } return(result); }
protected static void RunCatchLogThrow(Action logic, string additionalMessage, bool msgToUI, bool rethrowException, IUILogger logger) { if (logger == null) { throw new ArgumentNullException("logger"); } try { logic(); } catch (Exception ex) { if (msgToUI && !additionalMessage.IsNullOrTimmedEmpty()) { logger.ErrorToUI(additionalMessage); } logger.Error(additionalMessage, ex); if (rethrowException) { throw; } } }
protected static void RunCatchLogReThrow(Action logic, string additionalMessage, bool msgToUI, IUILogger logger) { RunCatchLogThrow(logic, additionalMessage, msgToUI, true, logger); }
protected static void RunCatchLogReThrow(Action logic, string additionalMessage, IUILogger logger) { RunCatchLogReThrow(logic, additionalMessage, false, logger); }
protected static void RunCatchLogReThrow(Action logic, IUILogger logger) { RunCatchLogReThrow(logic, null, false, logger); }
static ConsoleUILogger() { UniqueInstance = new ConsoleUILogger("TMSPS", "CORE"); }