static void Main() { var _reader = new PilotJournalReader(ConfigurationManager.AppSettings["EliteDangerousJournalPath"]); Application.EnableVisualStyles(); Application.SetCompatibleTextRenderingDefault(false); Application.Run(new frmMain(AutofacConfig.BuildContainer())); }
public frmMain(IContainer container) { InitializeComponent(); _marketData = container.Resolve <TradeData>(); _missionData = container.Resolve <MissionData>(); _reader = container.Resolve <PilotJournalReader>(); SetupFileSystemWatch(); UpdateLabels(null, null); }
public static IContainer BuildContainer() { var builder = new ContainerBuilder(); var reader = new PilotJournalReader(ConfigurationManager.AppSettings["EliteDangerousJournalPath"]); builder.RegisterInstance(reader).SingleInstance(); builder.Register(c => new TradeData(reader)); builder.Register(c => new MissionData(reader)); return(builder.Build()); }