private Cci.IDefinition VisitDefInternal(Cci.IDefinition def) { var type = def as Cci.ITypeDefinition; if (type != null) { var namespaceType = type.AsNamespaceTypeDefinition(_sourceContext); if (namespaceType != null) { return(VisitNamespaceType(namespaceType)); } var nestedType = type.AsNestedTypeDefinition(_sourceContext); Debug.Assert(nestedType != null); var otherContainer = (Cci.ITypeDefinition) this.VisitDef(nestedType.ContainingTypeDefinition); if (otherContainer == null) { return(null); } return(VisitTypeMembers(otherContainer, nestedType, GetNestedTypes, (a, b) => StringOrdinalComparer.Equals(a.Name, b.Name))); } var member = def as Cci.ITypeDefinitionMember; if (member != null) { var otherContainer = (Cci.ITypeDefinition) this.VisitDef(member.ContainingTypeDefinition); if (otherContainer == null) { return(null); } var field = def as Cci.IFieldDefinition; if (field != null) { return(VisitTypeMembers(otherContainer, field, GetFields, (a, b) => StringOrdinalComparer.Equals(a.Name, b.Name))); } } // We are only expecting types and fields currently. throw ExceptionUtilities.UnexpectedValue(def); }
public Cci.IDefinition VisitDef(Cci.IDefinition def) { return(_matches.GetOrAdd(def, this.VisitDefInternal)); }
internal bool DefinitionExists(Cci.IDefinition definition) { return(MapDefinition(definition) != null); }
internal abstract Cci.IDefinition MapDefinition(Cci.IDefinition definition);
public abstract Cci.IDefinition MapDefinition(Cci.IDefinition reference);
public abstract Cci.IDefinition?MapDefinition(Cci.IDefinition definition);
internal abstract bool DefinitionExists(Cci.IDefinition def);
internal Cci.IDefinition?MapDefinition(Cci.IDefinition definition) { return(MapToPreviousSymbolMatcher.MapDefinition(definition) ?? (MapToMetadataSymbolMatcher != MapToPreviousSymbolMatcher ? MapToMetadataSymbolMatcher.MapDefinition(definition) : null)); }
internal bool DefinitionExists(Cci.IDefinition definition) => MapDefinition(definition) is object;
public Cci.IDefinition?VisitDef(Cci.IDefinition def) => _matches.GetOrAdd(def, VisitDefInternal);
internal Cci.IDefinition MapDefinition(Cci.IDefinition definition) { return(mapToPrevious.MapDefinition(definition) ?? (mapToMetadata != mapToPrevious ? mapToMetadata.MapDefinition(definition) : null)); }
internal override bool DefinitionExists(Cci.IDefinition def) { var previous = this.mapToPrevious.MapDefinition(def); return(previous != null); }