Exemplo n.º 1
0
        public static Task PrintType(JabberCompiler.Model.IReadOnlyType typeData)
        {
            FullFile fullFile = Composer.CreateFileForType(typeData);

            PrinterBuilder builder = new PrinterBuilder();
            string fileContents = builder.PrintFullFile(fullFile);

            return PrintToFile(fullFile.Name, fileContents);
        }
Exemplo n.º 2
0
        internal static FullFile CreateFileForType(JabberCompiler.Model.IReadOnlyType type)
        {
            if (type.IsSingleton)
                throw new NotImplementedException();

            string fileName = System.IO.Path.ChangeExtension(type.Name, "cs");
            FullFile file = new FullFile() { Name = fileName, Usings = UsingStatement.DefaultUsings };

            Namespace nspace = GetNamespace(DEFAULT_PROJECT_NAME);
            file.NamespaceContained = nspace;
            nspace.InnerClass = type;

            return file;
        }