MCPcopy Create free account
hub / github.com/NodeRT/NodeRT / TestAndAddRecursive

Method TestAndAddRecursive

src/NodeRTLib/ExternalTypesHelper.cs:40–71  ·  view source on GitHub ↗
(Type type, String declaringTypeNamespace, List<Type> valueTypes, List<String> namespaces)

Source from the content-addressed store, hash-verified

38 }
39
40 public static void TestAndAddRecursive(Type type, String declaringTypeNamespace, List<Type> valueTypes, List<String> namespaces)
41 {
42 if (type.IsGenericType)
43 {
44 if (type.GetGenericArguments() != null)
45 {
46 foreach (var genericArg in type.GetGenericArguments())
47 {
48 TestAndAddRecursive(genericArg, declaringTypeNamespace, valueTypes, namespaces);
49 }
50 }
51 return;
52 }
53
54 if (IsValueTypeNoEnumOrPrimitve(type) && !valueTypes.Contains(type) &&
55 type.Namespace != "System" && type.Namespace != declaringTypeNamespace)
56 {
57 valueTypes.Add(type);
58 }
59
60 if (!IsValueTypeNoEnumOrPrimitve(type) && type.Namespace != declaringTypeNamespace)
61 {
62 if (!ExcludedExternalNamespaces.Contains(type.Namespace) && !namespaces.Contains(type.Namespace))
63 {
64 namespaces.Add(type.Namespace);
65 }
66 else if (type.Namespace == "System" && type.Name == "Uri" && !namespaces.Contains("Windows.Foundation")) // Uri is special..
67 {
68 namespaces.Add("Windows.Foundation");
69 }
70 }
71 }
72
73 public static void TestAndAddNamespaceRecursive(Type type, List<String> namespaces, String declaringTypeNamespace)
74 {

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected