Esempio n. 1
0
 public static ModelCodeGenerationOptions Create(ModelCodegenerationOptionsBase.SupportedLanguages CodeLanguageIn,
                                                 ModelCodegenerationOptionsBase.ConstructorPreferenceSetting ConstructorPreferenceIn,
                                                 System.IO.DirectoryInfo DirectoryRootIn,
                                                 bool SeparateFolderPerModelIn,
                                                 bool SeparateFolderPerAggregateIn)
 {
     return(new ModelCodeGenerationOptions(CodeLanguageIn,
                                           ConstructorPreferenceIn,
                                           DirectoryRootIn,
                                           SeparateFolderPerModelIn,
                                           SeparateFolderPerAggregateIn));
 }
Esempio n. 2
0
 private ModelCodeGenerationOptions(
     ModelCodegenerationOptionsBase.SupportedLanguages CodeLanguageIn,
     ModelCodegenerationOptionsBase.ConstructorPreferenceSetting ConstructorPreferenceIn,
     System.IO.DirectoryInfo DirectoryRootIn,
     bool SeparateFolderPerModelIn,
     bool SeparateFolderPerAggregateIn)
 {
     _codelanguage               = CodeLanguageIn;
     _constructorPreference      = ConstructorPreferenceIn;
     _directoryRoot              = DirectoryRootIn;
     _separateFolderPerModel     = SeparateFolderPerModelIn;
     _separateFolderPerAggregate = SeparateFolderPerAggregateIn;
 }
Esempio n. 3
0
        /// <summary>
        /// Get the code generation options that have been set at the model level
        /// </summary>
        /// <remarks>
        /// Thers emay be overridden on a per-user basis as part of the build process
        /// </remarks>
        public IModelCodeGenerationOptions GetCodeGenerationOptions()
        {
            ModelCodegenerationOptionsBase.SupportedLanguages           CodeLanguageIn          = ModelCodegenerationOptionsBase.SupportedLanguages.VBNet;
            ModelCodegenerationOptionsBase.ConstructorPreferenceSetting ConstructorPreferenceIn = ModelCodegenerationOptionsBase.ConstructorPreferenceSetting.GenerateBoth;
            System.IO.DirectoryInfo DirectoryRootIn = null;
            bool SeparateFolderPerModelIn           = true;
            bool SeparateFolderPerAggregateIn       = true;

            // Read the model properties that affect code generation


            return(ModelCodeGenerationOptions.Create(CodeLanguageIn,
                                                     ConstructorPreferenceIn,
                                                     DirectoryRootIn,
                                                     SeparateFolderPerModelIn,
                                                     SeparateFolderPerAggregateIn));
        }
        public static IModelCodeGenerationOptions Create(ModelCodegenerationOptionsBase.SupportedLanguages CodeLanguageIn,
                    ModelCodegenerationOptionsBase.ConstructorPreferenceSetting ConstructorPreferenceIn,
                    ModelCodegenerationOptionsBase.TypedCodeGenerationSetting TypeSettingIn, 
                    System.IO.DirectoryInfo DirectoryRootIn,
                    bool SeparateFolderPerModelIn,
                    bool SeparateFolderPerAggregateIn,
                    bool GenerateEntityFrameworkClassesIn = false,
                    bool GenerateEventGridSupportingCodeIn = false )
        {

            return new ModelCodeGenerationOptions(CodeLanguageIn,
                ConstructorPreferenceIn,
                TypeSettingIn,
                DirectoryRootIn,
                SeparateFolderPerModelIn,
                SeparateFolderPerAggregateIn,
                GenerateEntityFrameworkClassesIn,
                GenerateEventGridSupportingCodeIn);

        }
        private ModelCodeGenerationOptions(
                    ModelCodegenerationOptionsBase.SupportedLanguages CodeLanguageIn,
                    ModelCodegenerationOptionsBase.ConstructorPreferenceSetting ConstructorPreferenceIn,
                    ModelCodegenerationOptionsBase.TypedCodeGenerationSetting TypeSettingIn,
                    System.IO.DirectoryInfo DirectoryRootIn,
                    bool SeparateFolderPerModelIn,
                    bool SeparateFolderPerAggregateIn,
                    bool GenerateEntityFrameworkClassesIn = false ,
                    bool GenerateEventGridSupportingCodeIn = false )
        {

            _codelanguage = CodeLanguageIn;
            _constructorPreference = ConstructorPreferenceIn;
            _typeSetting = TypeSettingIn;
            _directoryRoot = DirectoryRootIn;
            _separateFolderPerModel = SeparateFolderPerModelIn;
            _separateFolderPerAggregate = SeparateFolderPerAggregateIn;

            _generateEntityFrameworkClasses = GenerateEntityFrameworkClassesIn;
            _generateEventGridSupportingCode = GenerateEventGridSupportingCodeIn;

        }
Esempio n. 6
0
        /// <summary>
        /// Get the code generation options that have been set at the model level
        /// </summary>
        /// <remarks>
        /// These may be overridden on a per-user basis as part of the build process
        /// </remarks>
        public IModelCodeGenerationOptions GetCodeGenerationOptions()
        {
            ModelCodegenerationOptionsBase.SupportedLanguages           CodeLanguageIn          = ModelCodegenerationOptionsBase.SupportedLanguages.VBNet;
            ModelCodegenerationOptionsBase.ConstructorPreferenceSetting ConstructorPreferenceIn = ModelCodegenerationOptionsBase.ConstructorPreferenceSetting.GenerateBoth;
            System.IO.DirectoryInfo DirectoryRootIn = null;
            bool SeparateFolderPerModelIn           = true;
            bool SeparateFolderPerAggregateIn       = true;
            bool GenerateEntityFrameworkClassesIn   = false;

            // Read the model properties that affect code generation
            if (this.DefaultCodeGenerationLanguage == TargetLanguage.CSharp)
            {
                CodeLanguageIn = ModelCodegenerationOptionsBase.SupportedLanguages.CSharp;
            }
            if (!this.SubfolderPerDomain)
            {
                SeparateFolderPerModelIn = false;
            }
            if (!this.SubfolderPerAggregate)
            {
                SeparateFolderPerAggregateIn = false;
            }

            if (!string.IsNullOrWhiteSpace(this.CodeRootFolder))
            {
                if (System.IO.Directory.Exists(this.CodeRootFolder))
                {
                    DirectoryRootIn = new System.IO.DirectoryInfo(this.CodeRootFolder);
                }
                else
                {
                    // Can you make this into a relative path??
                    if (!System.IO.Path.IsPathRooted(this.DocumentationRootFolder))
                    {
                        DirectoryRootIn = new System.IO.DirectoryInfo(
                            System.IO.Path.Combine(System.AppDomain.CurrentDomain.BaseDirectory
                                                   , this.CodeRootFolder));
                    }
                }
            }
            else
            {
                DirectoryRootIn = new System.IO.DirectoryInfo(System.IO.Path.Combine(System.IO.Path.GetTempPath(),
                                                                                     this.Name,
                                                                                     "Code"));
            }

            if (this.GenerateEntityFrameworkClasses)
            {
                GenerateEntityFrameworkClassesIn = true;
            }

            // Read any per-user overrides ??

            return(ModelCodeGenerationOptions.Create(CodeLanguageIn,
                                                     ConstructorPreferenceIn,
                                                     DirectoryRootIn,
                                                     SeparateFolderPerModelIn,
                                                     SeparateFolderPerAggregateIn,
                                                     GenerateEntityFrameworkClassesIn));
        }