Ejemplo n.º 1
0
 /// <summary>
 /// Dependency injected constructor, mainly to support unit testing.
 /// </summary>
 /// <param name="paths">Paths to key items. Will not be used as heavily as in null constructor, as most config is provided.</param>
 /// <param name="attributes">A list of valid attributes to use in place of loading directly from config.</param>
 /// <param name="macroProviders">A list of macro providers to use instead of default.</param>
 public Orchestrator(
     Config.Paths paths, 
     AttributeSet attributes, 
     IList<IMacroProvider> macroProviders)
 {
     this.paths = paths;
     this.validAttributes = attributes;
     this.macroProviders = macroProviders;
 }
Ejemplo n.º 2
0
 public Orchestrator(
     Config.Paths paths, 
     AttributeSet attributes)
     : this(paths, attributes, getDefaultMacroProviders(paths, attributes))
 {
 }
Ejemplo n.º 3
0
        /// <summary>
        /// Sets up all known macro providers for use.
        /// </summary>
        /// <param name="paths"></param>
        /// <returns></returns>
        private static IList<IMacroProvider> getDefaultMacroProviders(Config.Paths paths, AttributeSet validAttributes)
        {
            List<IMacroProvider> macroProviders = new List<IMacroProvider>();
            if (paths == null) return macroProviders;

            macroProviders.Add(new MarkdownMacroProvider(paths.MacrosRootDir));
            macroProviders.Add(new BasicTextMacroProvider(paths.MacrosRootDir));
            macroProviders.Add(new XslMacroProvider(paths.MacrosRootDir, validAttributes));
            return macroProviders;
        }