PatcherPlugin.cs 942 B

123456789101112131415161718192021222324252627282930313233343536
  1. using System;
  2. using System.Collections.Generic;
  3. namespace BepInEx.Preloader.Patcher
  4. {
  5. /// <summary>
  6. /// A single assembly patcher.
  7. /// </summary>
  8. internal class PatcherPlugin
  9. {
  10. /// <summary>
  11. /// Target assemblies to patch.
  12. /// </summary>
  13. public IEnumerable<string> TargetDLLs { get; set; } = null;
  14. /// <summary>
  15. /// Initializer method that is run before any patching occurs.
  16. /// </summary>
  17. public Action Initializer { get; set; } = null;
  18. /// <summary>
  19. /// Finalizer method that is run after all patching is done.
  20. /// </summary>
  21. public Action Finalizer { get; set; } = null;
  22. /// <summary>
  23. /// The main patcher method that is called on every DLL defined in <see cref="TargetDLLs" />.
  24. /// </summary>
  25. public AssemblyPatcherDelegate Patcher { get; set; } = null;
  26. /// <summary>
  27. /// Name of the patcher.
  28. /// </summary>
  29. public string Name { get; set; } = string.Empty;
  30. }
  31. }