Beispiel #1
0
        private void GenerateClassEntity(String baseFolder, IList <FrameworkEntity> entities, Framework f, FrameworkEntity e, String sourcePath, String destinationPath)
        {
            String      file;
            ClassEntity entity = BaseEntity.LoadFrom <ClassEntity> (sourcePath);

            // Make sure that availability is ready
            entity.AdjustAvailability();

            this.Log(Level.Info, String.Format("Generating '{0}'...", e.name));

            this.LoadClassDependencies(baseFolder, entities, entity);

            if (entity.ExtendedClass == null)
            {
                if (entity.Generate)
                {
                    file = destinationPath + ".cs";
                    this.Generate <ClassDefinitionGenerator>(f, entity, file);
                }

                if (entity.Generate)
                {
                    file = destinationPath + ".Class.cs";
                    this.Generate <ClassMembersGenerator>(f, entity, file);
                }

                if (entity.Generate && entity.HasConstructors)
                {
                    file = destinationPath + ".Constructors.cs";
                    this.Generate <ClassConstructorsGenerator> (f, entity, file);
                }

                if (entity.HasConstants || entity.HasEnumerations)
                {
                    file = destinationPath + ".Constants.cs";
                    this.Generate <ClassConstantsGenerator> (f, entity, file);
                }

                if (entity.Generate && entity.Protocols != null && entity.Protocols.Count > 0)
                {
                    file = destinationPath + ".Protocols.cs";
                    this.Generate <ClassProtocolsGenerator> (f, entity, file);
                }
            }
            else
            {
                if (entity.Generate)
                {
                    file = destinationPath + ".cs";
                    this.Generate <ClassAdditionsGenerator>(f, entity, file);
                }

                if (entity.HasConstants || entity.HasEnumerations)
                {
                    file = destinationPath + ".Constants.cs";
                    this.Generate <ClassConstantsGenerator> (f, entity, file);
                }
            }
        }