Ejemplo n.º 1
0
            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);
            }
Ejemplo n.º 2
0
 public Cci.IDefinition VisitDef(Cci.IDefinition def)
 {
     return(_matches.GetOrAdd(def, this.VisitDefInternal));
 }
Ejemplo n.º 3
0
 internal bool DefinitionExists(Cci.IDefinition definition)
 {
     return(MapDefinition(definition) != null);
 }
Ejemplo n.º 4
0
 internal abstract Cci.IDefinition MapDefinition(Cci.IDefinition definition);
Ejemplo n.º 5
0
 public abstract Cci.IDefinition MapDefinition(Cci.IDefinition reference);
Ejemplo n.º 6
0
 public abstract Cci.IDefinition?MapDefinition(Cci.IDefinition definition);
Ejemplo n.º 7
0
 internal abstract bool DefinitionExists(Cci.IDefinition def);
Ejemplo n.º 8
0
 internal Cci.IDefinition?MapDefinition(Cci.IDefinition definition)
 {
     return(MapToPreviousSymbolMatcher.MapDefinition(definition) ??
            (MapToMetadataSymbolMatcher != MapToPreviousSymbolMatcher ? MapToMetadataSymbolMatcher.MapDefinition(definition) : null));
 }
Ejemplo n.º 9
0
 internal bool DefinitionExists(Cci.IDefinition definition)
 => MapDefinition(definition) is object;
Ejemplo n.º 10
0
 public Cci.IDefinition?VisitDef(Cci.IDefinition def)
 => _matches.GetOrAdd(def, VisitDefInternal);
Ejemplo n.º 11
0
 internal Cci.IDefinition MapDefinition(Cci.IDefinition definition)
 {
     return(mapToPrevious.MapDefinition(definition) ??
            (mapToMetadata != mapToPrevious ? mapToMetadata.MapDefinition(definition) : null));
 }
Ejemplo n.º 12
0
        internal override bool DefinitionExists(Cci.IDefinition def)
        {
            var previous = this.mapToPrevious.MapDefinition(def);

            return(previous != null);
        }