Parse() public method

public Parse ( Stream stream ) : void
stream System.IO.Stream
return void
Ejemplo n.º 1
0
        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.Parse(stream);
            }

            Console.WriteLine(" Writing classes to {0}...", output);
            using (Stream stream = File.Open(output, FileMode.Create, FileAccess.Write))
                WriteClasses(stream, generator.Generate(), ns);
        }
Ejemplo n.º 2
0
        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.Parse(stream);
            }

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