Ejemplo n.º 1
0
        static void Main()
        {
            using (ContainerAccessor.RegisterComponents())
                using (var mutex = CreateApplicationSpecificMutex())
                {
                    Bootstrapper.BootstrapApplication();
                    ServicePointManager.SecurityProtocol |= SecurityProtocolType.Tls12;

                    Application.SetUnhandledExceptionMode(UnhandledExceptionMode.ThrowException);
                    AppDomain.CurrentDomain.UnhandledException +=
                        (sender, e) => LogManager.GetLogger("errorLog").Error((Exception)e.ExceptionObject);

                    CompileDefinitions();
                    ContainerAccessor.Resolve <IComicStore>().InitializeComicCache();

                    var mainForm = new MainForm();
                    //the synchronization context only becomes available after creating the form
                    SynchronizationContext = SynchronizationContext.Current;
                    //the DownloadSupervisor needs the SynchronizationContext, so I resolve it only after initializing the context
                    mainForm.Presenter = ContainerAccessor.Resolve <IMainPresenter>();

                    ContainerAccessor.Resolve <ITrayIconController>().DisplayIcon();
                    Application.Run(mainForm);

                    GC.KeepAlive(mutex);
                }
        }
 static When_expanding_meta_methods()
 {
     ContainerAccessor.RegisterComponents(new CustomKeywordModule());
 }
Ejemplo n.º 3
0
 static Visit()
 {
     ContainerAccessor.RegisterComponents(new TestModule());
 }