CaptureFilePathHook .cs 547 B

123456789101112131415161718192021
  1. using Serilog.Sinks.File;
  2. using System;
  3. using System.Collections.Generic;
  4. using System.IO;
  5. using System.Linq;
  6. using System.Text;
  7. using System.Threading.Tasks;
  8. namespace VeloeMinecraftLauncher.Utils
  9. {
  10. internal class CaptureFilePathHook : FileLifecycleHooks
  11. {
  12. public string? Path { get; private set; }
  13. public override Stream OnFileOpened(string path, Stream underlyingStream, Encoding encoding)
  14. {
  15. Path = path;
  16. return base.OnFileOpened(path, underlyingStream, encoding);
  17. }
  18. }
  19. }