예제 #1
0
        private void GenerateClass(ConfigurationItem item, GenerationContext context)
        {
            var classContext = new ClassGenerationContext
            {
                configurationName = item.Name,
                target            = new ClassModel
                {
                    Name = item.Name.Name,
                    ConfigurationScope = item.Name.Scope
                },
                comObject         = item.ComObject,
                generationContext = context,
                descriptor        = MetadataHelpers.GetDescriptor(item.Name.Scope)
            };

            EmitClass(classContext);
            var fileTemplate = new ClassFileTemplate
            {
                Model = new ClassFileModel
                {
                    Namespace = GetNamespaceName(item.Name.Scope),
                    MainClass = classContext.target
                }
            };

            context.Write(item.Name, fileTemplate.TransformText());
        }