Beispiel #1
0
            private SymbolKeyResolution ReadWorker(SymbolKeyType type)
            {
                switch (type)
                {
                case SymbolKeyType.Alias: return(AliasSymbolKey.Resolve(this));

                case SymbolKeyType.BodyLevel: return(BodyLevelSymbolKey.Resolve(this));

                case SymbolKeyType.ConstructedMethod: return(ConstructedMethodSymbolKey.Resolve(this));

                case SymbolKeyType.NamedType: return(NamedTypeSymbolKey.Resolve(this));

                case SymbolKeyType.ErrorType: return(ErrorTypeSymbolKey.Resolve(this));

                case SymbolKeyType.Field: return(FieldSymbolKey.Resolve(this));

                case SymbolKeyType.DynamicType: return(DynamicTypeSymbolKey.Resolve(this));

                case SymbolKeyType.Method: return(MethodSymbolKey.Resolve(this));

                case SymbolKeyType.Namespace: return(NamespaceSymbolKey.Resolve(this));

                case SymbolKeyType.PointerType: return(PointerTypeSymbolKey.Resolve(this));

                case SymbolKeyType.Parameter: return(ParameterSymbolKey.Resolve(this));

                case SymbolKeyType.Property: return(PropertySymbolKey.Resolve(this));

                case SymbolKeyType.ArrayType: return(ArrayTypeSymbolKey.Resolve(this));

                case SymbolKeyType.Assembly: return(AssemblySymbolKey.Resolve(this));

                case SymbolKeyType.TupleType: return(TupleTypeSymbolKey.Resolve(this));

                case SymbolKeyType.Module: return(ModuleSymbolKey.Resolve(this));

                case SymbolKeyType.Event: return(EventSymbolKey.Resolve(this));

                case SymbolKeyType.ReducedExtensionMethod: return(ReducedExtensionMethodSymbolKey.Resolve(this));

                case SymbolKeyType.TypeParameter: return(TypeParameterSymbolKey.Resolve(this));

                case SymbolKeyType.AnonymousType: return(AnonymousTypeSymbolKey.Resolve(this));

                case SymbolKeyType.AnonymousFunctionOrDelegate: return(AnonymousFunctionOrDelegateSymbolKey.Resolve(this));

                case SymbolKeyType.TypeParameterOrdinal: return(TypeParameterOrdinalSymbolKey.Resolve(this));
                }

                throw new NotImplementedException();
            }
Beispiel #2
0
            protected override int ReadWorker(SymbolKeyType type)
            {
                switch (type)
                {
                case SymbolKeyType.Alias: return(AliasSymbolKey.GetHashCode(this));

                case SymbolKeyType.BodyLevel: return(BodyLevelSymbolKey.GetHashCode(this));

                case SymbolKeyType.ConstructedMethod: return(ConstructedMethodSymbolKey.GetHashCode(this));

                case SymbolKeyType.NamedType: return(NamedTypeSymbolKey.GetHashCode(this));

                case SymbolKeyType.ErrorType: return(ErrorTypeSymbolKey.GetHashCode(this));

                case SymbolKeyType.Field: return(FieldSymbolKey.GetHashCode(this));

                case SymbolKeyType.DynamicType: return(DynamicTypeSymbolKey.GetHashCode(this));

                case SymbolKeyType.Method: return(MethodSymbolKey.GetHashCode(this));

                case SymbolKeyType.Namespace: return(NamespaceSymbolKey.GetHashCode(this));

                case SymbolKeyType.PointerType: return(PointerTypeSymbolKey.GetHashCode(this));

                case SymbolKeyType.Parameter: return(ParameterSymbolKey.GetHashCode(this));

                case SymbolKeyType.Property: return(PropertySymbolKey.GetHashCode(this));

                case SymbolKeyType.ArrayType: return(ArrayTypeSymbolKey.GetHashCode(this));

                case SymbolKeyType.Assembly: return(AssemblySymbolKey.GetHashCode(this));

                case SymbolKeyType.TupleType: return(TupleTypeSymbolKey.GetHashCode(this));

                case SymbolKeyType.Module: return(ModuleSymbolKey.GetHashCode(this));

                case SymbolKeyType.Event: return(EventSymbolKey.GetHashCode(this));

                case SymbolKeyType.ReducedExtensionMethod: return(ReducedExtensionMethodSymbolKey.GetHashCode(this));

                case SymbolKeyType.TypeParameter: return(TypeParameterSymbolKey.GetHashCode(this));

                case SymbolKeyType.TypeParameterOrdinal: return(TypeParameterOrdinalSymbolKey.GetHashCode(this));
                }

                throw new NotImplementedException();
            }
 public override object VisitProperty(IPropertySymbol propertySymbol)
 {
     WriteType(SymbolKeyType.Property);
     PropertySymbolKey.Create(propertySymbol, this);
     return(null);
 }