Beispiel #1
0
        private void WriteGeneratorToFile(Type type, Generator gen)
        {
            if (string.IsNullOrEmpty(options.OutputDir))
                options.OutputDir = ".";

            var filePath = Path.GetFullPath(options.OutputDir);
            var fileName = string.Format("{0}.cs", type.Name);

            filePath = Path.Combine(filePath, fileName);
            File.WriteAllText(filePath, gen.ToString());

            Console.WriteLine("Generated '{0}'", fileName);
        }
Beispiel #2
0
        private void ProcessMessage(Type type)
        {
            if (options.OutputDebug)
            {
                Console.WriteLine("Message: {0}", type.Name);

                foreach (var field in type.GetFields())
                    Console.WriteLine("  Field: {0}", field.Name);
            }

            var gen = new Generator(options);
            gen.GenerateMessage(type);

            WriteGeneratorToFile(type, gen);
        }
Beispiel #3
0
        private void ProcessService(Type type)
        {
            if (options.OutputDebug)
            {
                Console.WriteLine("Service: {0}", type.Name);

                foreach (var method in type.GetMethods())
                    Console.WriteLine("  Method: {0}", method.Name);
            }

            var gen = new Generator(options);
            gen.GenerateService(type);

            WriteGeneratorToFile(type, gen);
        }