private static ISet <ITypeDefinition> LookupTypesMatchingQuery(WholeProgramSearchQuery query, WholeProgram wholeProgram) { ISet <ITypeDefinition> types = wholeProgram.FindTypesMatchingWholeProgramQuery(query); if (types.Count() > 0) { return(types); } else { // Really should have function that turns query into a human readable string throw new Exception("Couldn't find any types matching query: " + query.AssemblySpecifier + "!" + query.DefinitionSpecifier); } }
private static ISet <ITypeDefinition> LookupTypesWithIdentifier(string identifier, WholeProgram wholeProgram) { WholeProgramSearchQuery query = CreateQueryForIdentifier(identifier); ISet <ITypeDefinition> types = wholeProgram.FindTypesMatchingWholeProgramQuery(query); if (types.Count() > 0) { return(types); } else { throw new Exception("Couldn't find type with identifier: " + identifier); } }