private bool AreEventsEqual(EventSymbol @event, EventSymbol other)
 {
     Debug.Assert(StringOrdinalComparer.Equals(@event.Name, other.Name));
     return(_comparer.Equals(@event.Type.TypeSymbol, other.Type.TypeSymbol));
 }
Exemple #2
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);
            }
Exemple #3
0
 private bool AreNamespacesEqual(NamespaceSymbol @namespace, NamespaceSymbol other)
 {
     Debug.Assert(StringOrdinalComparer.Equals(@namespace.MetadataName, other.MetadataName));
     return(true);
 }
Exemple #4
0
 private bool AreFieldsEqual(FieldSymbol field, FieldSymbol other)
 {
     Debug.Assert(StringOrdinalComparer.Equals(field.Name, other.Name));
     return(_comparer.Equals(field.Type, other.Type));
 }
Exemple #5
0
 private bool ArePropertiesEqual(PropertySymbol property, PropertySymbol other)
 {
     Debug.Assert(StringOrdinalComparer.Equals(property.Name, other.Name));
     return(_comparer.Equals(property.Type, other.Type) &&
            property.Parameters.SequenceEqual(other.Parameters, AreParametersEqual));
 }