Esempio n. 1
0
		public static void Main(string[] args_in) {

			#region Console.WriteLine("Copyright (C) 2002 Francisco Monteiro");
			Console.WriteLine(
				@"

OGen
Copyright (C) 2002 Francisco Monteiro

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the ""Software""), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED ""AS IS"", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

"
			);
			#endregion
			if (args_in.Length >= 1) {
				if (File.Exists(args_in[0])) {
					#region string[] _templateTypes = ...;
					string[] _templateTypes = new string[args_in.Length - 1];
					for (int a = 1; a < args_in.Length; a++) {
						_templateTypes[a - 1] = args_in[a];
					}
					#endregion
					DoIt(
						args_in[0],
						null,
						_templateTypes
					);
				} else {
					Console.WriteLine("file doesn't exist");
				}
			} else {
				#if DEBUG
					try {
						long _begin_ticks = DateTime.Now.Ticks;
						Statistics _statistics 
							= new Statistics(
								true, 
								true,
								true
							);
						DoIt(
							System.IO.Path.Combine(
								#if !NET_1_1
								System.Configuration.ConfigurationManager.AppSettings
								#else
								System.Configuration.ConfigurationSettings.AppSettings
								#endif
									["ogenPath"],

								//@"..\..\OGen-NTier_UTs\OGen-metadatas\MD_OGen-NTier_UTs.OGen-metadata.xml"
								//@"..\..\OGen-NTier_UTs-newTest\OGen-metadatas\MD_OGen-NTier_UTs.OGenXSD-metadata.xml"
								//@"..\..\OGen-NTier_UTs\OGen-metadatas\MD_OGen-NTier_UTs.OGenXSD-metadata.xml"
								@"..\..\OGen-Kick\OGen-metadatas\MD_Kick.OGenXSD-metadata.xml"
							),
							_statistics
							//,
							//new string[] { 
							//	"business", 
							//	"data"
							//}
						);
						Console.WriteLine(
							"time: {0}", 
							new DateTime(DateTime.Now.Ticks - _begin_ticks).ToString(
								"HH'H' mm'm' ss's' fff",
								System.Globalization.CultureInfo.CurrentCulture
							)
						);

						Console.WriteLine(
							"lines: {0}\nbytes: {1}  ~ {2}",
							_statistics.Lines,
							_statistics.Bytes_ToString(false),
							_statistics.Bytes_ToString(true)
						);

					} catch (Exception _ex) {
						Console.WriteLine(_ex.ToString());
					}

					Console.WriteLine("Press any key to continue...");
					#if !NET_1_1
						Console.ReadKey();
					#else
						Console.ReadLine();
					#endif
				#else
					Console.WriteLine("must provide xml file");
				#endif
			}
		}