1
- <# // Load types in current assembly. #>
1
+ <#@ template debug="true" language="C#" hostspecific="true" #>
2
2
<#@ assembly name="$(TargetPath)" #>
3
- <#@ assembly name="System.Core" #>
4
- <#@ import namespace="System.Linq" #>
5
- <#@ import namespace="System.Text" #>
6
- <#@ import namespace="System.Collections.Generic" #>
7
- <#@ import namespace="UnitsNet" #>
8
- <#@ import namespace="UnitsNet.Attributes" #>
9
- <#@ import namespace="UnitsNet.Extensions" #>
10
-
11
- <#/* Uncomment below for intellisense/ReSharper support,
12
- but this will give an error when trying to run __Regenerate.tt template
13
- since they are included multiple times and once="true" does not
14
- seem to work as it should. */#>
15
-
16
- <#//@ include file="MultipleOutputHelper.ttinclude" once="true"#>
17
- <#//@ include file="Shared.ttinclude" once="true"#><#+
18
-
19
- private void GenerateUnitConverter(Manager m)
20
- {
3
+ <#@ include file="Includes\Shared.ttinclude" once="true"#>
4
+ <#@ output extension=".g.cs" #>
5
+ <#
6
+
7
+ GenerateUnitConverter();
21
8
9
+ #><#+
10
+
11
+ private void GenerateUnitConverter()
12
+ {
22
13
List<Type> unitAttributeTypes = GetUnitAttributeTypes();
23
14
List<string> unitClassNames = GetUnitClassNamesFromUnitAttributeImplementations();
24
15
Dictionary<Unit, UnitAttribute> unitToAttribute = GetUnitToAttributeDictionary<UnitAttribute>();
25
16
26
- using (m.StartNewFile(@"UnitConverter.g.cs"))
27
- {
28
17
#>
29
18
// Copyright © 2007 by Initial Force AS. All rights reserved.
30
19
// https://github.com/InitialForce/SIUnits
@@ -248,7 +237,6 @@ namespace UnitsNet
248
237
}
249
238
250
239
<#+
251
- } // using (m.StartNewFile(@"..\UnitConverter.g.cs"))
252
240
} // private void GenerateUnitConverter(Manager m)
253
241
254
242
#>
0 commit comments