view Tools/DocGen/Program.cs @ 5:f7d63a092920

Исправлено условие Where в тех случаях, когда репозитарий не является генериком
author cin
date Tue, 10 Mar 2015 16:02:11 +0300
parents f990fcb411a9
children
line wrap: on
line source

using System;
using System.IO;

namespace DocGen
{
	partial class Program
	{
		public static string rss      = Path.GetFullPath(@"..\..\content\rss.xml");
		public static string destPath = @"c:\temp\bltoolkit\";

		static void Main()
		{
			var root = new FileItem();

			new Generator().Generate(
				root,
				_template, new string[] {}, destPath, @"..\..\content", true, false,
				fileName =>
				{
					var name = Path.GetFileName(fileName).ToLower();

					switch (name)
					{
						case "rss.xml"         : return FileAction.Copy;
						case "chmtemplate.html": return FileAction.Skip;
						case "webtemplate.html": return FileAction.Skip;
					}

					var fileAction = FilterFile(fileName);

					if (fileAction != FileAction.Process)
						return fileAction;

					var ext = Path.GetExtension(fileName).ToLower();

					switch (ext)
					{
						case ".cs":
						case ".config":
						case ".xml":
						case ".sql": return FileAction.Skip;
						case ".htm": return FileAction.Process;
						default    : return FileAction.Copy;
					}
				});

			root.Prepare();

			CreateTarget(root);
		}
	}
}