PageRenderTime 17ms CodeModel.GetById 8ms app.highlight 5ms RepoModel.GetById 1ms app.codeStats 0ms

/src/NUnit/util/IAssemblyWatcher.cs

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