Changeset 384 for binary-improvements2/MapRendering/Web/Handlers
- Timestamp:
- Aug 3, 2022, 9:10:12 PM (2 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
binary-improvements2/MapRendering/Web/Handlers/ApiHandler.cs
r382 r384 11 11 private readonly Dictionary<string, WebAPI> apis = new CaseInsensitiveStringDictionary<WebAPI> (); 12 12 13 public ApiHandler ( string _moduleName = null) : base (_moduleName) {13 public ApiHandler () : base (null) { 14 14 15 } 16 17 public override void SetBasePathAndParent (Web _parent, string _relativePath) { 18 base.SetBasePathAndParent (_parent, _relativePath); 19 20 Type[] apiWithParentCtorTypes = { typeof (Web) }; 21 Object[] apiWithParentCtorArgs = { _parent }; 22 23 Type[] apiEmptyCtorTypes = { }; 24 Object[] apiEmptyCtorArgs = { }; 25 15 26 foreach (Type t in Assembly.GetExecutingAssembly ().GetTypes ()) { 16 27 if (!t.IsAbstract && t.IsSubclassOf (typeof (WebAPI))) { 17 ConstructorInfo ctor = t.GetConstructor ( new Type [0]);28 ConstructorInfo ctor = t.GetConstructor (apiWithParentCtorTypes); 18 29 if (ctor != null) { 19 WebAPI apiInstance = (WebAPI) ctor.Invoke (new object [0]); 30 WebAPI apiInstance = (WebAPI) ctor.Invoke (apiWithParentCtorArgs); 31 addApi (apiInstance); 32 continue; 33 } 34 35 ctor = t.GetConstructor (apiEmptyCtorTypes); 36 if (ctor != null) { 37 WebAPI apiInstance = (WebAPI) ctor.Invoke (apiEmptyCtorArgs); 20 38 addApi (apiInstance); 21 39 }
Note:
See TracChangeset
for help on using the changeset viewer.