NotInitializedException.cs 987 B

12345678910111213141516171819202122
  1. namespace Terminal.Gui;
  2. /// <summary>
  3. /// Thrown when user code attempts to access a property or perform a method
  4. /// that is only supported after Initialization e.g. of an <see cref="IMainLoop{T}"/>
  5. /// </summary>
  6. public class NotInitializedException : Exception
  7. {
  8. /// <summary>
  9. /// Creates a new instance of the exception indicating that the class
  10. /// <paramref name="memberName"/> cannot be used until owner is initialized.
  11. /// </summary>
  12. /// <param name="memberName">Property or method name</param>
  13. public NotInitializedException (string memberName) : base ($"{memberName} cannot be accessed before Initialization") { }
  14. /// <summary>
  15. /// Creates a new instance of the exception with the full message/inner exception.
  16. /// </summary>
  17. /// <param name="msg"></param>
  18. /// <param name="innerException"></param>
  19. public NotInitializedException (string msg, Exception innerException) : base (msg, innerException) { }
  20. }