Пример #1
0
        public void AssemblyStart(Assembly assembly, IAutoCodeGeneratorContext context)
        {
            var projectDir = _assemblyBaseDirectoryProvider.GetBaseDirectory(assembly);

            foreach (var item in ItemsToCreate)
            {
                if (item.TargetAssembly != assembly)
                {
                    continue;
                }
                var csFile = new CsFile();
                foreach (var ns in AllGenerators.GetFileImportNamespaces())
                {
                    csFile.AddImportNamespace(ns);
                }
                var privContext = new MyWrappedContext(csFile);
                SingleTaskEnumsGenerator.CreateCode(privContext, item);
                var fileToSave = item.GetFileName(projectDir);
                if (csFile.SaveIfDifferent(fileToSave.FullName))
                {
                    context.FileSaved(fileToSave);
                }
            }
        }
Пример #2
0
        public static void CreateCode(ISingleTaskEnumsGeneratorContext context, EnumsGeneratorItem item)
        {
            var stat = new SingleTaskEnumsGenerator(context, item);

            stat.CreateCode();
        }