コード例 #1
0
ファイル: Program.cs プロジェクト: i-e-b/XsdToObject
        public static void Main(string[] args)
        {
            string progName = AppDomain.CurrentDomain.FriendlyName;

            if (args.Length < 3)
            {
                Console.WriteLine("Usage:\n {0} [output.cs] [namespace] [input.xsd ...]", progName);
                Environment.Exit(-1);
            }

            Console.WriteLine("Running {0}...", progName);

            var    generator = new ClassGenerator();
            string output    = args[0];
            string ns        = args[1];

            foreach (string file in args.Skip(2))
            {
                Console.WriteLine(" Parsing {0}...", file);
                using (Stream stream = File.OpenRead(file))
                    generator.Generate(stream);
            }

            Console.WriteLine(" Writing classes to {0}...", output);
            using (Stream stream = File.Open(output, FileMode.Create, FileAccess.Write))
                WriteClasses(stream, generator.Create(), ns);
        }
コード例 #2
0
ファイル: Program.cs プロジェクト: i-e-b/XsdToObject
        public static void Main(string[] args)
        {
            string progName = AppDomain.CurrentDomain.FriendlyName;
            if (args.Length < 3)
            {
                Console.WriteLine("Usage:\n {0} [output.cs] [namespace] [input.xsd ...]", progName);
                Environment.Exit(-1);
            }

            Console.WriteLine("Running {0}...", progName);

            var generator = new ClassGenerator();
            string output = args[0];
            string ns = args[1];

            foreach (string file in args.Skip(2))
            {
                Console.WriteLine(" Parsing {0}...", file);
                using (Stream stream = File.OpenRead(file))
                    generator.Generate(stream);
            }

            Console.WriteLine(" Writing classes to {0}...", output);
            using (Stream stream = File.Open(output, FileMode.Create, FileAccess.Write))
                WriteClasses(stream, generator.Create(), ns);
        }