/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
- using System;
-
- namespace NUnit.Util
- {
- public delegate void AssemblyChangedHandler(string fullPath);
-
- /// <summary>
- /// AssemblyWatcher keeps track of one or more assemblies to
- /// see if they have changed. It incorporates a delayed notification
- /// and uses a standard event to notify any interested parties
- /// about the change. The path to the assembly is provided as
- /// an argument to the event handler so that one routine can
- /// be used to handle events from multiple watchers.
- /// </summary>
- public interface IAssemblyWatcher
- {
- /// <summary>
- /// Stops watching for changes.
- /// To release resources call FreeResources.
- /// </summary>
- void Stop();
-
- /// <summary>
- /// Starts watching for assembly changes.
- /// You need to call Setup before start watching.
- /// </summary>
- void Start();
-
- /// <summary>
- /// Initializes the watcher with assemblies to observe for changes.
- /// </summary>
- /// <param name="delayInMs">The delay in ms.</param>
- /// <param name="assemblies">The assemblies.</param>
- #if NET_2_0 || NET_4_0
- void Setup(int delayInMs, System.Collections.Generic.IList<string> assemblies);
- #else
- void Setup(int delayInMs, System.Collections.IList assemblies);
- #endif
-
- /// <summary>
- /// Initializes the watcher with assemblies to observe for changes.
- /// </summary>
- /// <param name="delayInMs">The delay in ms.</param>
- /// <param name="assemblyFileName">Name of the assembly file.</param>
- void Setup(int delayInMs, string assemblyFileName);
-
- /// <summary>
- /// Releases all resources held by the watcher.
- /// </summary>
- void FreeResources();
-
- /// <summary>
- /// Occurs when an assembly being watched has changed.
- /// </summary>
- event AssemblyChangedHandler AssemblyChanged;
- }
- }