public GetNamespace ( string name, bool create ) : |
||
name | string | |
create | bool | |
Résultat |
protected void ImportTypes (MetaType[] types, Namespace targetNamespace, bool importExtensionTypes) { Namespace ns = targetNamespace; string prev_namespace = null; foreach (var t in types) { if (t == null) continue; // Be careful not to trigger full parent type loading if (t.MemberType == MemberTypes.NestedType) continue; if (t.Name[0] == '<') continue; var it = CreateType (t, null, new DynamicTypeReader (t), true); if (it == null) continue; if (prev_namespace != t.Namespace) { ns = t.Namespace == null ? targetNamespace : targetNamespace.GetNamespace (t.Namespace, true); prev_namespace = t.Namespace; } // Cannot rely on assembly level Extension attribute or static modifier because they // are not followed by other compilers (e.g. F#). if (it.IsClass && it.Arity == 0 && importExtensionTypes && HasAttribute (CustomAttributeData.GetCustomAttributes (t), "ExtensionAttribute", CompilerServicesNamespace)) { it.SetExtensionMethodContainer (); } ns.AddType (module, it); } }
protected void ImportTypes (MetaType[] types, Namespace targetNamespace, bool hasExtensionTypes) { Namespace ns = targetNamespace; string prev_namespace = null; foreach (var t in types) { if (t == null) continue; // Be careful not to trigger full parent type loading if (t.MemberType == MemberTypes.NestedType) continue; if (t.Name[0] == '<') continue; var it = CreateType (t, null, new DynamicTypeReader (t), true); if (it == null) continue; if (prev_namespace != t.Namespace) { ns = t.Namespace == null ? targetNamespace : targetNamespace.GetNamespace (t.Namespace, true); prev_namespace = t.Namespace; } ns.AddType (module, it); if (it.IsStatic && hasExtensionTypes && HasAttribute (CustomAttributeData.GetCustomAttributes (t), "ExtensionAttribute", CompilerServicesNamespace)) { it.SetExtensionMethodContainer (); } } }
void ImportTypes (Type[] types, Namespace targetNamespace, Type extension_type) { Namespace ns = targetNamespace; string prev_namespace = null; foreach (var t in types) { if (t == null) continue; // Be careful not to trigger full parent type loading if (t.MemberType == MemberTypes.NestedType) continue; if (t.Name[0] == '<') continue; var it = CreateType (t, null, t, 0, true); if (it == null) continue; if (prev_namespace != t.Namespace) { ns = t.Namespace == null ? targetNamespace : targetNamespace.GetNamespace (t.Namespace, true); prev_namespace = t.Namespace; } ns.AddType (it); if (it.IsStatic && extension_type != null && t.IsDefined (extension_type, false)) { it.SetExtensionMethodContainer (); } } }