public async Task Test3() { SetupNlog.Initialize("bla"); MappingExtensions.Mapper = new MapperConfiguration(cfg => { cfg.AddProfile <ArmaServerProfile>(); }).CreateMapper(); var f = new SteamSession.SteamSessionFactory(); var id = (uint)SteamGameIds.Arma2Oa; LockedWrapper.callFactory = new SafeCallFactory(); // workaround for accessviolation errors var c = await f.Do(id, SteamHelper.Create().SteamPath, async() => { using (var scheduler = new EventLoopScheduler()) { using (var obs2 = new Subject <ArmaServerInfoModel>()) { var s = obs2.Synchronize() .ObserveOn(scheduler) .Buffer(24) //.Do(x => Console.WriteLine("r" + x.ToList<ServerInfoModel>())) .SelectMany(x => x) .Count() .ToTask(); var c2 = await SteamServers.GetServers(f, true, ServerFilterBuilder.Build().FilterByAppId(id).FilterByDedicated().Value, obs2.OnNext) .ConfigureAwait(false); obs2.OnCompleted(); return(new BatchResult(await s)); } } }).ConfigureAwait(false); }
// All shared initialization public static void Init() { SimpleConfigurator.ConfigureForConsoleLogging(LogLevel.Info); // Doesnt seem to work anymore?! SetupNlog.Initialize("Test Runner"); CommonBase.AssemblyLoader = GetAssemblyLoader(); // Use to Reset the various common instances // Normally the EA instance is created in the AppBootStrapper, and Dependency injected into ShellViewModel Common.App = new Common.AppCommon(); Common.Paths = new PathConfiguration(); // Must set AppPath to curdir, otherwise we end up somewhere in test heaven // Also keep the test configuration and temp data separate from production Common.App.InitLocalWithCleanup("Test Runner"); var ea = new EventAggregator(); Cheat.SetServices(new CheatImpl(ea, new Mediator(null, null))); DomainEvilGlobal.Settings = new UserSettings(); /* * Tools.RegisterServices(new ToolsServices(new ProcessManager(), * new Lazy<IWCFClient>(() => new WCFClient()), * new Lazy<IGeoIpService>(() => new GeoIpService()), new CompressionUtil())); */ ReSetupTools(); if (!SingleSetup) { new AssemblyHandler().Register(); SingleSetup = true; } }
public static void PreInit(string appName) { new SplashScreen(@"six_updater_splash.png").Show(false); new RuntimeCheckWpf().Check(); if (ConfigurationManager.AppSettings["Logentries.Token"] == null) { ConfigurationManager.AppSettings["Logentries.Token"] = "35fdcd29-36a5-4f66-a19f-fe9094d86f72"; } SetupNlog.Initialize(appName); new AssemblyHandler().Register(); Common.App.Init(appName); }
static void InitializeEnvironment(string appName) { if (ConfigurationManager.AppSettings["Logentries.Token"] == null) { ConfigurationManager.AppSettings["Logentries.Token"] = "35fdcd29-36a5-4f66-a19f-fe9094d86f72"; } SetupNlog.Initialize(appName); new SplashScreen(@"app.png").Show(true); new AssemblyHandler().Register(); Common.App.Init(appName); }
public void SetupLogging(string productTitle, string token = null) { if ((token != null) && (ConfigurationManager.AppSettings["Logentries.Token"] == null)) { ConfigurationManager.AppSettings["Logentries.Token"] = token; } SetupNlog.Initialize(productTitle); if (Common.Flags.Verbose) { var splatLogger = new NLogSplatLogger(); Locator.CurrentMutable.Register(() => splatLogger, typeof(ILogger)); } #if DEBUG LogHost.Default.Level = LogLevel.Debug; #endif }