PageRenderTime 122ms CodeModel.GetById 80ms app.highlight 3ms RepoModel.GetById 38ms app.codeStats 0ms

/src/LinFu.Reflection/Interfaces/ILoader.cs

http://github.com/philiplaureano/LinFu
C# | 69 lines | 16 code | 8 blank | 45 comment | 0 complexity | c382285f9384f55a1426855957b1aef9 MD5 | raw file
 1using System;
 2using System.Collections.Generic;
 3
 4namespace LinFu.Reflection
 5{
 6    /// <summary>
 7    ///     Represents a generic interface for an abstract loader
 8    ///     that can read configuration information from disk
 9    ///     and apply it to a <typeparamref name="TTarget" /> instance.
10    /// </summary>
11    /// <typeparam name="TTarget">The class type being configured.</typeparam>
12    public interface ILoader<TTarget>
13    {
14        /// <summary>
15        ///     The list of <see cref="ILoaderPlugin{TTarget}" />
16        ///     instances that will be used to
17        ///     signal the beginning and end of the
18        ///     load sequence.
19        /// </summary>
20        IList<ILoaderPlugin<TTarget>> Plugins { get; }
21
22        /// <summary>
23        ///     The list of <see cref="IActionLoader{TTarget, TInput}" />
24        ///     instances responsible for configuring the <typeparamref name="TTarget" /> instance.
25        /// </summary>
26        IList<IActionLoader<TTarget, string>> FileLoaders { get; }
27
28        /// <summary>
29        ///     Gets or sets the <see cref="IDirectoryListing" /> instance
30        ///     responsible for returning a list of filenames
31        ///     to the loader for processing.
32        /// </summary>
33        IDirectoryListing DirectoryLister { get; set; }
34
35        /// <summary>
36        ///     The custom list of actions that will be
37        ///     performed prior to the beginning of a load operation.
38        /// </summary>
39        IList<Action<ILoader<TTarget>>> CustomLoaderActions { get; }
40
41        /// <summary>
42        ///     The list of actions that will execute
43        ///     every time a target instance is configured.
44        /// </summary>
45        IList<Action<TTarget>> QueuedActions { get; }
46
47        /// <summary>
48        ///     Loads the configuration using the files listed in
49        ///     the target <paramref name="directory" /> that match
50        ///     the given <paramref name="filespec">file pattern</paramref>.
51        /// </summary>
52        /// <param name="directory">The full path of the location to scan.</param>
53        /// <param name="filespec">The wildcard file pattern string to use when specifying the target files.</param>
54        void LoadDirectory(string directory, string filespec);
55
56        /// <summary>
57        ///     Configures the <paramref name="target" /> instance
58        ///     using the configuration currently loaded from disk.
59        /// </summary>
60        /// <param name="target">The <typeparamref name="TTarget" /> instance to be configured.</param>
61        void LoadInto(TTarget target);
62
63        /// <summary>
64        ///     Clears the currently loaded configuration
65        ///     and resets the loader back to its defaults.
66        /// </summary>
67        void Reset();
68    }
69}