예제 #1
0
        static ContainerStores()
        {
            try
            {
                GlobalContainer = ((IServiceCollection) new ServiceCollection())
                                  .AddQwackLogging()
                                  .AddCalendarsFromJson(GetCalendarFilename())
                                  .AddFutureSettingsFromJson(GetFutureSettingsFile())
                                  .AddCurrenciesFromJson(GetCurrenciesFilename())
                                  .AddSingleton(typeof(IObjectStore <>), typeof(ExcelObjectStore <>))
                                  .BuildServiceProvider();

                SessionContainer = GlobalContainer.CreateScope().ServiceProvider;

                SessionContainer.GetRequiredService <IFutureSettingsProvider>();

                PnLAttributor = new PnLAttributor();
            }
            catch (Exception ex)
            {
                if (Directory.Exists(@"C:\Temp"))
                {
                    File.WriteAllText($@"C:\Temp\QwackInitializationError_{DateTime.Now:yyyyMMdd_HHmmss}.txt", ex.ToString());
                }
            }
        }
예제 #2
0
        static ContainerStores()
        {
            GlobalContainer = ((IServiceCollection) new ServiceCollection())
                              .AddQwackLogging()
                              .AddCalendarsFromJson(GetCalendarFilename())
                              .BuildServiceProvider();

            _sessionContainer = GlobalContainer.CreateScope().ServiceProvider;
        }