File tree Expand file tree Collapse file tree
SysML2.NET.CodeGenerator/Generators
EcoreHandleBarsGenerators Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -24,6 +24,7 @@ namespace SysML2.NET.CodeGenerator.Generators.HandleBarsGenerators
2424 using System . Threading . Tasks ;
2525
2626 using ECoreNetto ;
27+
2728 using SysML2 . NET . CodeGenerator . Generators ;
2829
2930 /// <summary>
@@ -33,11 +34,12 @@ namespace SysML2.NET.CodeGenerator.Generators.HandleBarsGenerators
3334 public abstract class EcoreHandleBarsGenerator : HandleBarsGenerator
3435 {
3536 /// <summary>
36- /// Initializes a new instance of the <see cref="HandleBarsGenerator"/> class/
37+ /// Gets an optional subfolder location path to locate templates
3738 /// </summary>
38- protected EcoreHandleBarsGenerator ( )
39+ /// <returns>An optional subfolder name</returns>
40+ protected override string GetOptionalSubfolderTemplateLocation ( )
3941 {
40- this . TemplateFolderPath = Path . Combine ( this . TemplateFolderPath , "Ecore" ) ;
42+ return "ecore" ;
4143 }
4244
4345 /// <summary>
Original file line number Diff line number Diff line change @@ -39,9 +39,33 @@ public abstract class Generator
3939 /// Initializes a new instance of the <see cref="Generator"/> class.
4040 /// </summary>
4141 protected Generator ( )
42+ {
43+ this . AssignTemplateFolderPath ( ) ;
44+ }
45+
46+ /// <summary>
47+ /// Assigns the value of the <see cref="TemplateFolderPath"/>
48+ /// </summary>
49+ private void AssignTemplateFolderPath ( )
4250 {
4351 var assemblyFolder = Path . GetDirectoryName ( Assembly . GetExecutingAssembly ( ) . Location ) ;
4452 this . TemplateFolderPath = Path . Combine ( assemblyFolder , "Templates" ) ;
53+
54+ var subfolderLocation = this . GetOptionalSubfolderTemplateLocation ( ) ;
55+
56+ if ( ! string . IsNullOrWhiteSpace ( subfolderLocation ) )
57+ {
58+ this . TemplateFolderPath = Path . Combine ( this . TemplateFolderPath , subfolderLocation ) ;
59+ }
60+ }
61+
62+ /// <summary>
63+ /// Gets an optional subfolder location path to locate templates
64+ /// </summary>
65+ /// <returns>An optional subfolder name</returns>
66+ protected virtual string GetOptionalSubfolderTemplateLocation ( )
67+ {
68+ return null ;
4569 }
4670
4771 /// <summary>
You can’t perform that action at this time.
0 commit comments