internal static INamespaceTypeDefinition GetNamespaceType(IUnitNamespace unitNamespace, IName typeName) { foreach (INamespaceMember nm in unitNamespace.GetMembersNamed(typeName, false)) { if (nm is INamespaceTypeDefinition) { return(nm as INamespaceTypeDefinition); } } return(null); }
internal static IGlobalMethodDefinition GetGlobalMethod(IUnitNamespace unitNamespace, IName methodName) { foreach (INamespaceMember nm in unitNamespace.GetMembersNamed(methodName, false)) { if (nm is IGlobalMethodDefinition) { return(nm as IGlobalMethodDefinition); } } return(null); }
internal static IUnitNamespace GetNamespace(IUnit unit, params IName[] nameList) { IUnitNamespace unitNamespace = unit.UnitNamespaceRoot; for (int i = 0; i < nameList.Length; ++i) { foreach (INamespaceMember nsm in unitNamespace.GetMembersNamed(nameList[i], false)) { unitNamespace = nsm as IUnitNamespace; if (unitNamespace == null) { break; } } } return(unitNamespace); }
internal static IGlobalFieldDefinition GetGlobalField(IUnitNamespace unitNamespace, IName fieldName) { foreach (INamespaceMember nm in unitNamespace.GetMembersNamed(fieldName, false)) { if (nm is IGlobalFieldDefinition) return nm as IGlobalFieldDefinition; } return null; }
internal static INamespaceTypeDefinition GetNamespaceType(IUnitNamespace unitNamespace, IName typeName) { foreach (INamespaceMember nm in unitNamespace.GetMembersNamed(typeName, false)) { if (nm is INamespaceTypeDefinition) return nm as INamespaceTypeDefinition; } return null; }