PageRenderTime 49ms CodeModel.GetById 25ms RepoModel.GetById 0ms app.codeStats 0ms

/src/NUnit/util/IAssemblyWatcher.cs

#
C# | 57 lines | 18 code | 7 blank | 32 comment | 1 complexity | 7ac046f0452e53e9910f95cdebd168c4 MD5 | raw file
Possible License(s): GPL-2.0
  1. using System;
  2. namespace NUnit.Util
  3. {
  4. public delegate void AssemblyChangedHandler(string fullPath);
  5. /// <summary>
  6. /// AssemblyWatcher keeps track of one or more assemblies to
  7. /// see if they have changed. It incorporates a delayed notification
  8. /// and uses a standard event to notify any interested parties
  9. /// about the change. The path to the assembly is provided as
  10. /// an argument to the event handler so that one routine can
  11. /// be used to handle events from multiple watchers.
  12. /// </summary>
  13. public interface IAssemblyWatcher
  14. {
  15. /// <summary>
  16. /// Stops watching for changes.
  17. /// To release resources call FreeResources.
  18. /// </summary>
  19. void Stop();
  20. /// <summary>
  21. /// Starts watching for assembly changes.
  22. /// You need to call Setup before start watching.
  23. /// </summary>
  24. void Start();
  25. /// <summary>
  26. /// Initializes the watcher with assemblies to observe for changes.
  27. /// </summary>
  28. /// <param name="delayInMs">The delay in ms.</param>
  29. /// <param name="assemblies">The assemblies.</param>
  30. #if NET_2_0 || NET_4_0
  31. void Setup(int delayInMs, System.Collections.Generic.IList<string> assemblies);
  32. #else
  33. void Setup(int delayInMs, System.Collections.IList assemblies);
  34. #endif
  35. /// <summary>
  36. /// Initializes the watcher with assemblies to observe for changes.
  37. /// </summary>
  38. /// <param name="delayInMs">The delay in ms.</param>
  39. /// <param name="assemblyFileName">Name of the assembly file.</param>
  40. void Setup(int delayInMs, string assemblyFileName);
  41. /// <summary>
  42. /// Releases all resources held by the watcher.
  43. /// </summary>
  44. void FreeResources();
  45. /// <summary>
  46. /// Occurs when an assembly being watched has changed.
  47. /// </summary>
  48. event AssemblyChangedHandler AssemblyChanged;
  49. }
  50. }