-
Notifications
You must be signed in to change notification settings - Fork 9
Expand file tree
/
Copy pathConfig.cs
More file actions
152 lines (104 loc) · 4.25 KB
/
Config.cs
File metadata and controls
152 lines (104 loc) · 4.25 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
using System.Collections.Generic;
namespace WebApiToTypeScript.Config
{
public class Config
{
public string WebApiModuleFileName { get; set; }
public string[] WebApiModuleFileNames { get; set; }
public bool GenerateEndpointsReturnTypes { get; set; }
= false;
public bool GenerateEndpoints { get; set; }
= false;
public bool GenerateMobileEndpoints { get; set; }
= false;
public string EndpointsOutputDirectory { get; set; }
= "Generated";
public string MobileEndpointsOutputDirectory { get; set; }
= "GeneratedMobile";
public bool EndpointsSupportCaching { get; set; }
= false;
public string EndpointsFileName { get; set; }
= "Endpoints.ts";
public string MobileEndpointsFileName { get; set; }
= "MobileEndpoints.ts";
public string EndpointsNamespace { get; set; }
= "Endpoints";
public string MobileEndpointsNamespace { get; set; }
= "MobileEndpoints";
public bool GenerateService { get; set; }
= false;
public string ServiceOutputDirectory { get; set; }
= "Generated";
public string ServiceFileName { get; set; }
= "Service.ts";
public string ServiceNamespace { get; set; }
= "Endpoints";
public string ServiceName { get; set; }
= "AngularEndpointsService";
public bool GenerateEnums { get; set; }
= true;
public bool GenerateEnumDescriptions { get; set; }
= false;
public string EnumsOutputDirectory { get; set; }
= "Generated";
public string EnumsFileName { get; set; }
= "Enums.ts";
public string EnumsNamespace { get; set; }
= "Enums";
public List<MatchConfig> EnumMatches { get; set; }
= new List<MatchConfig>();
public bool GenerateInterfaces { get; set; }
= true;
public bool GenerateInterfaceClasses { get; set; }
= true;
public string InterfacesOutputDirectory { get; set; }
= "Generated";
public string InterfacesFileName { get; set; }
= "Interfaces.ts";
public string InterfacesNamespace { get; set; }
= "Interfaces";
public bool InterfaceMembersInCamelCase { get; set; }
= true;
public string InterfaceCamelCaseCustomAttribute { get; set; }
= null;
public List<MatchConfig> InterfaceMatches { get; set; }
= new List<MatchConfig>();
public bool GenerateViews { get; set; }
= false;
public List<ViewConfig> ViewConfigs { get; set; }
= new List<ViewConfig>();
public string ViewsPattern { get; set; }
= ".view.";
public string[] ViewsIgnoredExtensions { get; set; }
= { };
public string ViewsOutputDirectory { get; set; }
= "Generated";
public bool UseViewsGroupingNamespace { get; set; }
= true;
public bool GenerateResources { get; set; }
= false;
public List<ResourceConfig> ResourceConfigs { get; set; }
= new List<ResourceConfig>();
public string ResourcesNamespace { get; set; }
= "Resources";
public string ResourcesOutputDirectory { get; set; }
= "Generated";
public bool ScanOtherModules { get; set; }
= true;
public bool WriteNamespaceAsModule { get; set; }
= false;
public string NamespaceOrModuleName
=> WriteNamespaceAsModule ? "module" : "namespace";
public List<TypeMapping> TypeMappings { get; set; }
= new List<TypeMapping>();
public string MobileEndpointAttributeName { get; set; }
= "MobileEndpointAttribute";
public void ApplyCommandLineConfiguration(CommandLineConfig commandLineConfig)
{
if (commandLineConfig == null)
return;
if (!string.IsNullOrEmpty(commandLineConfig.WebApiModuleFileNames))
this.WebApiModuleFileNames = commandLineConfig.WebApiModuleFileNames.Split(',');
}
}
}