Windows Forms
  • Aplicatii winforms care ruleaza fara nici o forma principala
    • Am creat o clasa derivata din ApplicationContext.
    • In constructorul ei
      • am scris codul de bootstrapping
      • am instantiat o forma dummy, creata special pentru asta (pe care o pastrez intr-un membru static).
      • am salvat AsyncOperationManager.SynchronizationContext intr-un membru static si rau.
    • Din thread-urile non-ui apelez metoda Post a membrului static si rau din contextul custom.
Application.SetUnhandledExceptionMode(UnhandledExceptionMode.ThrowException);
AppDomain.CurrentDomain.UnhandledException += (sender, e) => logger.Error((Exception)e.ExceptionObject);
Unless otherwise stated, the content of this page is licensed under Creative Commons Attribution-ShareAlike 3.0 License