2010-05-27 Jb Evain <jbevain@novell.com>
[mcs.git] / tools / genxs / genxs.cs
blob7bbc38d59e9a2187e3a58281edc0b2003b7510d8
1 //
2 // genxs.cs
3 //
4 // Author:
5 // Lluis Sanchez Gual (lluis@ximian.com)
6 //
7 // Copyright (C) 2003 Ximian, Inc.
8 //
10 using System;
11 using System.Xml.Serialization;
12 using System.IO;
13 using System.Reflection;
15 public class Driver
17 static void Main (string[] args)
19 if (args.Length == 0 || args[0] == "--help")
21 Console.WriteLine ("Mono Xml Serializer Generator Tool");
22 Console.WriteLine ("Usage: genxs ConfigFileName [DestinationPath]");
23 Console.WriteLine ();
24 return;
27 try
29 Type t = Type.GetType ("System.Xml.Serialization.SerializationCodeGenerator, System.Xml");
30 if (t == null) throw new Exception ("This runtime does not support generation of serializers");
32 MethodInfo met = t.GetMethod ("Generate", BindingFlags.Static | BindingFlags.Public | BindingFlags.NonPublic);
33 met.Invoke (null, new object[] {args[0], (args.Length > 1) ? args[1] : null} );
35 catch (Exception ex)
37 Console.WriteLine ("An error occurred while generating serializers: " + ex);