private static void SearchCompilation(ISearchProgressMonitor monitor, ICompilation comp, ITypeDefinition cls, IMember member, Action <ISearchProgressMonitor, IEntity> reportFunction) { ITypeDefinition typeDefinition = TypeSystemExtensions.Import(comp, cls); if (typeDefinition != null) { IMember member2 = null; if (member != null) { member2 = TypeSystemExtensions.Import(comp, member); if (member2 == null) { return; } } foreach (ITypeDefinition current in TypeSystemExtensions.GetAllTypeDefinitions(comp.MainAssembly)) { if (TypeSystemExtensions.IsDerivedFrom(current, typeDefinition)) { IEntity entity; if (member != null) { entity = FindDerivedSymbolsHelper.FindDerivedMember(member2, current); if (entity == null) { continue; } } else { entity = current; } //at this point we can jump to the first one reportFunction(monitor, entity); } } } }
public IParameterDataProvider CreateDelegateDataProvider(int startOffset, IType type) { return(CreateMethodDataProvider(startOffset, new[] { TypeSystemExtensions.GetDelegateInvokeMethod(type) })); }
/// <summary> /// Returns true if given type is a primitive type, String, or enum. /// </summary> public static bool IsAtomic(this IType type) { return(TypeSystemExtensions.IsPrimitiveType(type) || type.IsKnownType(KnownTypeCode.String) || type.Kind == TypeKind.Enum); }