예제 #1
0
 public Job(
     ICurrencyListProvider currencyListProvider,
     IRateProviderFactory rateProviderFactory,
     IRepositoryFactory repositoryFactory,
     IUILogger uiLogger,
     ILogger logger)
 {
     _currencyListProvider = currencyListProvider;
     _rateProviderFactory  = rateProviderFactory;
     _repositoryFactory    = repositoryFactory;
     _uiLogger             = uiLogger;
     _logger = logger;
 }
예제 #2
0
        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);
        }
예제 #3
0
        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);
        }
예제 #4
0
        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;
                }
            }
        }
예제 #5
0
 protected static void RunCatchLogReThrow(Action logic, string additionalMessage, bool msgToUI, IUILogger logger)
 {
     RunCatchLogThrow(logic, additionalMessage, msgToUI, true, logger);
 }
예제 #6
0
 protected static void RunCatchLogReThrow(Action logic, string additionalMessage, IUILogger logger)
 {
     RunCatchLogReThrow(logic, additionalMessage, false, logger);
 }
예제 #7
0
 protected static void RunCatchLogReThrow(Action logic, IUILogger logger)
 {
     RunCatchLogReThrow(logic, null, false, logger);
 }
예제 #8
0
 static ConsoleUILogger()
 {
     UniqueInstance = new ConsoleUILogger("TMSPS", "CORE");
 }