コード例 #1
0
 public ThreadMarshalledLogMessageProcessor([NotNull] IEventMarshaller eventMarshaller,
     [NotNull] ILogMessageProcessor logMessageProcessor)
 {
     if (eventMarshaller == null) throw new ArgumentNullException("eventMarshaller");
     if (logMessageProcessor == null) throw new ArgumentNullException("logMessageProcessor");
     this.eventMarshaller = eventMarshaller;
     this.logMessageProcessor = logMessageProcessor;
 }
コード例 #2
0
        void ConstructWurmApi(IWurmAssistantConfig config, LoggerFactory loggerFactory, IEventMarshaller eventMarshaller)
        {
            IWurmInstallDirectory wurmInstallDirectory = null;
            if (!string.IsNullOrWhiteSpace(config.WurmGameClientInstallDirectory))
            {
                wurmInstallDirectory = new WurmInstallDirectoryOverride()
                {
                    FullPath = config.WurmGameClientInstallDirectory
                };
            }

            WurmApiConfig wurmApiConfig = null;
            if (config.RunningPlatform != Platform.Unknown)
            {
                wurmApiConfig = new WurmApiConfig {Platform = config.RunningPlatform};
            }

            wurmApi = WurmApiFactory.Create(Path.Combine(config.DataDirectoryFullPath, "WurmApi"),
                loggerFactory.CreateWithGuiThreadMarshaller("WurmApi"),
                eventMarshaller,
                wurmInstallDirectory,
                wurmApiConfig);
            kernel.Bind<IWurmApi>().ToConstant(wurmApi);
        }