ICSharpCode.NRefactory.CSharp.Resolver.FindReferences.FindTypeDefinitionReferences C# (CSharp) Méthode

FindTypeDefinitionReferences() private méthode

private FindTypeDefinitionReferences ( ITypeDefinition typeDefinition, bool findTypeReferencesEvenIfAliased, SearchScope &additionalScope ) : SearchScope
typeDefinition ITypeDefinition
findTypeReferencesEvenIfAliased bool
additionalScope SearchScope
Résultat SearchScope
		SearchScope FindTypeDefinitionReferences(ITypeDefinition typeDefinition, bool findTypeReferencesEvenIfAliased, out SearchScope additionalScope)
		{
			string searchTerm = null;
			additionalScope = null;
			if (!findTypeReferencesEvenIfAliased && KnownTypeReference.GetCSharpNameByTypeCode(typeDefinition.KnownTypeCode) == null) {
				// We can optimize the search by looking only for the type references with the right identifier,
				// but only if it's not a primitive type and we're not looking for indirect references (through an alias)
				searchTerm = typeDefinition.Name;
				if (searchTerm.Length > 9 && searchTerm.EndsWith("Attribute", StringComparison.Ordinal)) {
					// The type might be an attribute, so we also need to look for the short form:
					string shortForm = searchTerm.Substring(0, searchTerm.Length - 9);
					additionalScope = FindTypeDefinitionReferences(typeDefinition, shortForm);
				}
			}
			return FindTypeDefinitionReferences(typeDefinition, searchTerm);
		}
		

Same methods

FindReferences::FindTypeDefinitionReferences ( ITypeDefinition typeDefinition, string searchTerm ) : SearchScope