/// <summary>
        /// Creates a new instance of <see cref="GenerateAssemblersParams"/>.
        /// </summary>
        /// <param name="targetProject">Project where the Assemblers are going to be generated.</param>
        /// <param name="targetProjectFolder">Project folder where Assemblers are going to be generated. 
        /// Null value indicates to generate at project level.</param>
        /// <param name="sourceFileHeaderComment">Source File Header Comment (optional).</param>
        /// <param name="useProjectDefaultNamespace">Indicates if Target Project default namespace is going to be used.</param>
        /// <param name="sourceNamespace">Namespace used for the Assemblers.</param>
        /// <param name="classIdentifierUse">Indicates use of identifier in class names.</param>
        /// <param name="classIdentifierWord">Identifier to use in class names.</param>
        /// <param name="sourceFileGenerationType">Specifies the Source File Generation Type desired.</param>
        /// <param name="sourceFileName">Source File Name to use if the Source File Generation Type is OneSourceFile.</param>
        /// <param name="isServiceReady">Specifies if the DTOs are Service-Ready (this means if they can be serialized or not).</param>
        /// <param name="dtosNamespace">DTO's namespace.</param>
        /// <param name="dtosTargetProject">DTO's target Project.</param>
        /// <param name="edmxProjectItem">EDMX ProjectItem.</param>
        public GenerateAssemblersParams(Project targetProject, ProjectItem targetProjectFolder, 
            string sourceFileHeaderComment, bool useProjectDefaultNamespace, string sourceNamespace, 
            ClassIdentifierUse classIdentifierUse, string classIdentifierWord,
            SourceFileGenerationType sourceFileGenerationType, string sourceFileName, bool isServiceReady, 
            string dtosNamespace, Project dtosTargetProject, ProjectItem edmxProjectItem)
        {
            this.TargetProject = targetProject;
            this.TargetProjectFolder = targetProjectFolder;

            // Indicate target type
            this.TargetType = (this.TargetProjectFolder == null ? TargetType.Project : TargetType.ProjectFolder);

            this.SourceFileHeaderComment = sourceFileHeaderComment;
            this.UseProjectDefaultNamespace = useProjectDefaultNamespace;
            this.SourceNamespace = sourceNamespace;

            this.ClassIdentifierUse = classIdentifierUse;
            this.ClassIdentifierWord = classIdentifierWord;

            if (this.ClassIdentifierUse == ClassIdentifierUse.None)
            {
                this.ClassIdentifierWord = string.Empty;
            }

            this.SourceFileGenerationType = sourceFileGenerationType;
            this.SourceFileName = sourceFileName;
            this.IsServiceReady = isServiceReady;
            this.DTOsNamespace = dtosNamespace;
            this.DTOsTargetProject = dtosTargetProject;
            this.EDMXProject = edmxProjectItem.ContainingProject;

            this.EntitiesNamespace = EdmxHelper.GetEntitiesNamespace(edmxProjectItem);
        }
        /// <summary>
        /// Creates a new instance of <see cref="GenerateAssemblersParams"/>.
        /// </summary>
        /// <param name="targetProject">Project where the Assemblers are going to be generated.</param>
        /// <param name="targetProjectFolder">Project folder where Assemblers are going to be generated.
        /// Null value indicates to generate at project level.</param>
        /// <param name="sourceFileHeaderComment">Source File Header Comment (optional).</param>
        /// <param name="useProjectDefaultNamespace">Indicates if Target Project default namespace is going to be used.</param>
        /// <param name="sourceNamespace">Namespace used for the Assemblers.</param>
        /// <param name="classIdentifierUse">Indicates use of identifier in class names.</param>
        /// <param name="classIdentifierWord">Identifier to use in class names.</param>
        /// <param name="sourceFileGenerationType">Specifies the Source File Generation Type desired.</param>
        /// <param name="sourceFileName">Source File Name to use if the Source File Generation Type is OneSourceFile.</param>
        /// <param name="isServiceReady">Specifies if the DTOs are Service-Ready (this means if they can be serialized or not).</param>
        /// <param name="dtosNamespace">DTO's namespace.</param>
        /// <param name="dtosTargetProject">DTO's target Project.</param>
        /// <param name="edmxProjectItem">EDMX ProjectItem.</param>
        public GenerateAssemblersParams(Project targetProject, ProjectItem targetProjectFolder,
                                        string sourceFileHeaderComment, bool useProjectDefaultNamespace, string sourceNamespace,
                                        ClassIdentifierUse classIdentifierUse, string classIdentifierWord,
                                        SourceFileGenerationType sourceFileGenerationType, string sourceFileName, bool isServiceReady,
                                        string dtosNamespace, Project dtosTargetProject, ProjectItem edmxProjectItem)
        {
            this.TargetProject       = targetProject;
            this.TargetProjectFolder = targetProjectFolder;

            // Indicate target type
            this.TargetType = (this.TargetProjectFolder == null ? TargetType.Project : TargetType.ProjectFolder);

            this.SourceFileHeaderComment    = sourceFileHeaderComment;
            this.UseProjectDefaultNamespace = useProjectDefaultNamespace;
            this.SourceNamespace            = sourceNamespace;

            this.ClassIdentifierUse  = classIdentifierUse;
            this.ClassIdentifierWord = classIdentifierWord;

            if (this.ClassIdentifierUse == ClassIdentifierUse.None)
            {
                this.ClassIdentifierWord = string.Empty;
            }

            this.SourceFileGenerationType = sourceFileGenerationType;
            this.SourceFileName           = sourceFileName;
            this.IsServiceReady           = isServiceReady;
            this.DTOsNamespace            = dtosNamespace;
            this.DTOsTargetProject        = dtosTargetProject;
            this.EDMXProject = edmxProjectItem.ContainingProject;

            this.EntitiesNamespace = EdmxHelper.GetEntitiesNamespace(edmxProjectItem);
        }
Example #3
0
        /// <summary>
        /// Creates a new instance of <see cref="GenerateDTOsParams"/>.
        /// </summary>
        /// <param name="targetProject">Project where the DTOs are going to be generated.</param>
        /// <param name="targetProjectFolder">Project folder where DTO's are going to be generated.
        /// Null value indicates to generate at project level.</param>
        /// <param name="entitySource">Entity source (can be a Project or a ProjectItem representing an EDMX).</param>
        /// <param name="typesToGenerateFilter">Types from which to generate the DTOs.</param>
        /// <param name="generateAllTypes">Indicates if all types must be generated.</param>
        /// <param name="generateAllComplexTypes">Indicates if all complex types must be generated.</param>
        /// <param name="generateAllEntityTypes">Indicates if all complex types must be generated.</param>
        /// <param name="sourceFileHeaderComment">Source File Header Comment (optional).</param>
        /// <param name="useProjectDefaultNamespace">Indicates if Target Project default namespace is going to be used.</param>
        /// <param name="sourceNamespace">Namespace used for the DTOs.</param>
        /// <param name="dtosServiceReady">Specifies if the DTOs are Service-Ready (this means if they can be serialized or not).</param>
        /// <param name="classIdentifierUse">Indicates use of identifier in class names.</param>
        /// <param name="classIdentifierWord">Identifier to use in class names.</param>
        /// <param name="sourceFileGenerationType">Specifies the Source File Generation Type desired.</param>
        /// <param name="sourceFileName">Source File Name to use if the Source File Generation Type is OneSourceFile.</param>
        /// <param name="associationType">Class Association Type desired.</param>
        /// <param name="generateDTOConstructors">Indicates if DTO's Constructor methods should be created.</param>
        public GenerateDTOsParams(Project targetProject, ProjectItem targetProjectFolder, dynamic entitySource,
                                  List <string> typesToGenerateFilter, bool generateAllTypes, bool generateAllComplexTypes,
                                  bool generateAllEntityTypes, string sourceFileHeaderComment, bool useProjectDefaultNamespace,
                                  string sourceNamespace, bool dtosServiceReady, ClassIdentifierUse classIdentifierUse,
                                  string classIdentifierWord, SourceFileGenerationType sourceFileGenerationType, string sourceFileName,
                                  AssociationType associationType, bool generateDTOConstructors)
        {
            this.TargetProject       = targetProject;
            this.TargetProjectFolder = targetProjectFolder;

            this.TargetType = (this.TargetProjectFolder == null ? TargetType.Project : TargetType.ProjectFolder);

            this.EDMXProject = (entitySource is ProjectItem ? entitySource.ContainingProject : null);

            // TODO: ffernandez, use EntitySource (enum), add new property for the type and for Project
            this.EDMXProjectItem = entitySource;

            this.EDMXDocument = EdmxHelper.GetEdmxDocument(this.EDMXProjectItem);

            // TODO: ffernandez, review Project case
            this.EntitiesNamespace = EdmxHelper.GetEntitiesNamespace(entitySource);

            this.TypesToGenerateFilter   = typesToGenerateFilter;
            this.GenerateAllTypes        = generateAllTypes;
            this.GenerateAllComplexTypes = generateAllComplexTypes;
            this.GenerateAllEntityTypes  = generateAllEntityTypes;

            this.SourceFileHeaderComment    = sourceFileHeaderComment;
            this.UseProjectDefaultNamespace = useProjectDefaultNamespace;
            this.SourceNamespace            = sourceNamespace;
            this.DTOsServiceReady           = dtosServiceReady;

            this.ClassIdentifierUse  = classIdentifierUse;
            this.ClassIdentifierWord = classIdentifierWord;

            if (this.ClassIdentifierUse == ClassIdentifierUse.None)
            {
                this.ClassIdentifierWord = string.Empty;
            }

            this.SourceFileGenerationType = sourceFileGenerationType;
            this.SourceFileName           = sourceFileName;
            this.AssociationType          = associationType;
            this.GenerateDTOConstructors  = generateDTOConstructors;
        }
        /// <summary>
        /// Creates a new instance of <see cref="GenerateDTOsParams"/>.
        /// </summary>
        /// <param name="targetProject">Project where the DTOs are going to be generated.</param>
        /// <param name="targetProjectFolder">Project folder where DTO's are going to be generated. 
        /// Null value indicates to generate at project level.</param>
        /// <param name="entitySource">Entity source (can be a Project or a ProjectItem representing an EDMX).</param>
        /// <param name="typesToGenerateFilter">Types from which to generate the DTOs.</param>
        /// <param name="generateAllTypes">Indicates if all types must be generated.</param>
        /// <param name="generateAllComplexTypes">Indicates if all complex types must be generated.</param>
        /// <param name="generateAllEntityTypes">Indicates if all complex types must be generated.</param>
        /// <param name="sourceFileHeaderComment">Source File Header Comment (optional).</param>
        /// <param name="useProjectDefaultNamespace">Indicates if Target Project default namespace is going to be used.</param>
        /// <param name="sourceNamespace">Namespace used for the DTOs.</param>
        /// <param name="dtosServiceReady">Specifies if the DTOs are Service-Ready (this means if they can be serialized or not).</param>
        /// <param name="classIdentifierUse">Indicates use of identifier in class names.</param>
        /// <param name="classIdentifierWord">Identifier to use in class names.</param>
        /// <param name="sourceFileGenerationType">Specifies the Source File Generation Type desired.</param>
        /// <param name="sourceFileName">Source File Name to use if the Source File Generation Type is OneSourceFile.</param>
        /// <param name="associationType">Class Association Type desired.</param>
        /// <param name="generateDTOConstructors">Indicates if DTO's Constructor methods should be created.</param>
        public GenerateDTOsParams(Project targetProject, ProjectItem targetProjectFolder, dynamic entitySource, 
            List<string> typesToGenerateFilter, bool generateAllTypes, bool generateAllComplexTypes, 
            bool generateAllEntityTypes, string sourceFileHeaderComment, bool useProjectDefaultNamespace, 
            string sourceNamespace, bool dtosServiceReady, ClassIdentifierUse classIdentifierUse,
            string classIdentifierWord, SourceFileGenerationType sourceFileGenerationType, string sourceFileName,
            AssociationType associationType, bool generateDTOConstructors)
        {
            this.TargetProject = targetProject;
            this.TargetProjectFolder = targetProjectFolder;

            this.TargetType = (this.TargetProjectFolder == null ? TargetType.Project : TargetType.ProjectFolder);

            this.EDMXProject = (entitySource is ProjectItem ? entitySource.ContainingProject : null);

            // TODO: ffernandez, use EntitySource (enum), add new property for the type and for Project
            this.EDMXProjectItem = entitySource;

            this.EDMXDocument = EdmxHelper.GetEdmxDocument(this.EDMXProjectItem);

            // TODO: ffernandez, review Project case
            this.EntitiesNamespace = EdmxHelper.GetEntitiesNamespace(entitySource);

            this.TypesToGenerateFilter = typesToGenerateFilter;
            this.GenerateAllTypes = generateAllTypes;
            this.GenerateAllComplexTypes = generateAllComplexTypes;
            this.GenerateAllEntityTypes = generateAllEntityTypes;

            this.SourceFileHeaderComment = sourceFileHeaderComment;
            this.UseProjectDefaultNamespace = useProjectDefaultNamespace;
            this.SourceNamespace = sourceNamespace;
            this.DTOsServiceReady = dtosServiceReady;

            this.ClassIdentifierUse = classIdentifierUse;
            this.ClassIdentifierWord = classIdentifierWord;

            if (this.ClassIdentifierUse == ClassIdentifierUse.None)
            {
                this.ClassIdentifierWord = string.Empty;
            }

            this.SourceFileGenerationType = sourceFileGenerationType;
            this.SourceFileName = sourceFileName;
            this.AssociationType = associationType;
            this.GenerateDTOConstructors = generateDTOConstructors;
        }