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.

37 lines
1.4 KiB

  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Text;
  5. using System.Threading.Tasks;
  6. namespace IPA.Loader
  7. {
  8. /// <summary>
  9. /// Indicates that a plugin cannot be disabled at runtime. Generally not considered an error, however.
  10. /// </summary>
  11. [Serializable]
  12. public class CannotRuntimeDisableException : Exception
  13. {
  14. /// <summary>
  15. /// The plugin that cannot be disabled at runtime.
  16. /// </summary>
  17. public PluginMetadata Plugin { get; }
  18. /// <summary>
  19. /// Creates an exception for the given plugin metadata.
  20. /// </summary>
  21. /// <param name="plugin">the plugin that cannot be disabled</param>
  22. public CannotRuntimeDisableException(PluginMetadata plugin) : base($"Cannot runtime disable plugin \"{plugin.Name}\" ({plugin.Id})")
  23. => Plugin = plugin;
  24. /// <summary>
  25. /// Creates an exception from a serialization context. Not currently implemented.
  26. /// </summary>
  27. /// <param name="serializationInfo"></param>
  28. /// <param name="streamingContext"></param>
  29. /// <exception cref="NotImplementedException"></exception>
  30. protected CannotRuntimeDisableException(System.Runtime.Serialization.SerializationInfo serializationInfo, System.Runtime.Serialization.StreamingContext streamingContext)
  31. {
  32. throw new NotImplementedException();
  33. }
  34. }
  35. }