You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

43 lines
1.1 KiB

3 years ago
  1. using Apewer.Internals;
  2. using System;
  3. using System.Collections.Generic;
  4. using System.Runtime.InteropServices;
  5. using System.Runtime.Serialization;
  6. using System.Text;
  7. namespace Apewer
  8. {
  9. /// <summary>冗余异常。</summary>
  10. public class RedundanceException : Exception
  11. {
  12. private string _name;
  13. private string _message;
  14. /// <summary></summary>
  15. public RedundanceException(string name)
  16. {
  17. _name = name ?? "";
  18. _message = "";
  19. }
  20. /// <summary></summary>
  21. public RedundanceException(string name, string message)
  22. {
  23. _name = name ?? "";
  24. _message = message ?? "";
  25. }
  26. /// <summary></summary>
  27. public string Name { get { return _name; } }
  28. /// <summary></summary>
  29. public override string Message { get { return _message; } }
  30. /// <summary>从 <see cref="RedundanceException"/> 到 Boolean 的隐式转换,判断 <see cref="RedundanceException"/> 有效。</summary>
  31. public static implicit operator bool(RedundanceException instance) => instance != null;
  32. }
  33. }