示例#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());
                }
            }
        }