2 implementations of IEventSymbol
Microsoft.CodeAnalysis.CSharp (1)
Symbols\PublicModel\EventSymbol.cs (1)
11internal sealed class EventSymbol : Symbol, IEventSymbol
Microsoft.CodeAnalysis.VisualBasic (1)
Symbols\EventSymbol.vb (1)
23Implements IEventSymbol
444 references to IEventSymbol
ILLink.RoslynAnalyzer (11)
DataFlow\DynamicallyAccessedMembersBinder.cs (6)
98 foreach (var e in typeDefinition.GetEventsOnTypeHierarchy (filter: null, bindingFlags: BindingFlags.NonPublic | declaredOnlyFlags)) 103 foreach (var e in typeDefinition.GetEventsOnTypeHierarchy (filter: null, bindingFlags: BindingFlags.Public | declaredOnlyFlags)) 289 public static IEnumerable<IEventSymbol> GetEventsOnTypeHierarchy (this ITypeSymbol thisType, Func<IEventSymbol, bool>? filter, BindingFlags? bindingFlags = BindingFlags.Default) 294 foreach (var @event in type.GetMembers ().OfType<IEventSymbol> ()) {
ISymbolExtensions.cs (1)
111 IEventSymbol @event => @event.OverriddenEvent,
RequiresAnalyzerBase.cs (1)
132 IEventSymbol @event => @event.ContainingType,
TrimAnalysis\ReflectionAccessAnalyzer.cs (3)
49 case IEventSymbol @event: 58 foreach (var @event in typeSymbol.GetEventsOnTypeHierarchy (e => e.Name == name, bindingFlags)) 174 void GetDiagnosticsForEvent (Location location, IEventSymbol eventSymbol)
Microsoft.AspNetCore.Components.Analyzers (1)
InternalUsageAnalyzer.cs (1)
120case IEventSymbol @event:
Microsoft.AspNetCore.Components.SdkAnalyzers (1)
InternalUsageAnalyzer.cs (1)
120case IEventSymbol @event:
Microsoft.CodeAnalysis (15)
Compilation\SemanticModel.cs (2)
843public bool IsEventUsableAsField(int position, IEventSymbol eventSymbol) 855protected abstract bool IsEventUsableAsFieldCore(int position, IEventSymbol eventSymbol);
DocumentationCommentId.cs (2)
351public override void VisitEvent(IEventSymbol symbol) 418public override bool VisitEvent(IEventSymbol symbol)
Emit\EditAndContinue\SymbolChanges.cs (1)
381Debug.Assert(edit.OldSymbol is IMethodSymbol or IPropertySymbol or IEventSymbol);
Emit\SemanticEdit.cs (1)
155if (kind == SemanticEditKind.Delete && oldSymbol is not (IMethodSymbol or IPropertySymbol or IEventSymbol))
Generated\Operations.Generated.cs (3)
1031IEventSymbol Event { get; } 5525internal EventReferenceOperation(IEventSymbol @event, ITypeSymbol? constrainedToType, IOperation? instance, SemanticModel? semanticModel, SyntaxNode syntax, ITypeSymbol? type, bool isImplicit) 5532public IEventSymbol Event { get; }
Symbols\IEventSymbol.cs (3)
54new IEventSymbol OriginalDefinition { get; } 59IEventSymbol? OverriddenEvent { get; } 67ImmutableArray<IEventSymbol> ExplicitInterfaceImplementations { get; }
Symbols\SymbolVisitor.cs (1)
43public virtual void VisitEvent(IEventSymbol symbol)
Symbols\SymbolVisitor`1.cs (1)
46public virtual TResult? VisitEvent(IEventSymbol symbol)
Symbols\SymbolVisitor`2.cs (1)
51public virtual TResult VisitEvent(IEventSymbol symbol, TArgument argument)
Microsoft.CodeAnalysis.CodeStyle (32)
src\Analyzers\Core\Analyzers\RemoveUnusedMembers\AbstractRemoveUnusedMembersDiagnosticAnalyzer.cs (1)
838return ((IEventSymbol)memberSymbol).ExplicitInterfaceImplementations.IsEmpty;
src\Workspaces\Core\Portable\Editing\DeclarationModifiers.cs (1)
71IEventSymbol)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\INamedTypeSymbolExtensions.cs (3)
169IEventSymbol @event => @event.ExplicitInterfaceImplementations.Length > 0, 419case IEventSymbol ev: 636IEventSymbol => true,
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\ISymbolExtensions.cs (3)
80IEventSymbol @event => @event.OverriddenEvent, 87IEventSymbol @event => ImmutableArray<ISymbol>.CastUp(@event.ExplicitInterfaceImplementations), 281IEventSymbol eventSymbol => eventSymbol.Type,
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\ISymbolExtensions.RequiresUnsafeModifierVisitor.cs (1)
129public override bool VisitEvent(IEventSymbol symbol)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\SymbolKey\SymbolKey.cs (1)
29/// <item>Two <see cref="IEventSymbol"/>s are the "same" if they have
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\SymbolKey\SymbolKey.EventSymbolKey.cs (4)
9private sealed class EventSymbolKey : AbstractSymbolKey<IEventSymbol> 13public sealed override void Create(IEventSymbol symbol, SymbolKeyWriter visitor) 20SymbolKeyReader reader, IEventSymbol? contextualSymbol, out string? failureReason) 31using var result = GetMembersOfNamedType<IEventSymbol>(containingTypeResolution, metadataName);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\SymbolKey\SymbolKey.ParameterSymbolKey.cs (1)
52case IEventSymbol eventSymbol:
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\SymbolKey\SymbolKey.SymbolKeyWriter.cs (1)
467public override void VisitEvent(IEventSymbol eventSymbol)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\SignatureComparer.cs (10)
43SymbolKind.Event => HaveSameSignature((IEventSymbol)symbol1, (IEventSymbol)symbol2, caseSensitive), 48private static bool HaveSameSignature(IEventSymbol event1, IEventSymbol event2, bool caseSensitive) 164var ev1 = (IEventSymbol)symbol1; 165var ev2 = (IEventSymbol)symbol2; 241private bool HaveSameReturnType(IEventSymbol ev1, IEventSymbol ev2)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\SymbolEquivalenceComparer.EquivalenceVisitor.cs (4)
119SymbolKind.Event => EventsAreEquivalent((IEventSymbol)x, (IEventSymbol)y, equivalentTypesWithDifferingAssemblies), 608private bool EventsAreEquivalent(IEventSymbol x, IEventSymbol y, Dictionary<INamedTypeSymbol, INamedTypeSymbol>? equivalentTypesWithDifferingAssemblies)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\SymbolEquivalenceComparer.GetHashCodeVisitor.cs (2)
61SymbolKind.Event => CombineHashCodes((IEventSymbol)x, currentHash), 252private int CombineHashCodes(IEventSymbol x, int currentHash)
Microsoft.CodeAnalysis.CodeStyle.Fixes (34)
src\Analyzers\Core\CodeFixes\AddAccessibilityModifiers\AddAccessibilityModifiersHelpers.cs (1)
50if (symbol is IMethodSymbol or IPropertySymbol or IEventSymbol)
src\Analyzers\Core\CodeFixes\ImplementAbstractClass\ImplementAbstractClassData.cs (4)
171IEventSymbol @event => GenerateEvent(@event, throughMember, accessibility, modifiers), 238private IEventSymbol GenerateEvent( 239IEventSymbol @event, ISymbol? throughMember, Accessibility accessibility, DeclarationModifiers modifiers) 249IEventSymbol @event, IMethodSymbol? accessor, ISymbol? throughMember,
src\Analyzers\Core\CodeFixes\ImplementInterface\ImplementHelpers.cs (1)
165case IEventSymbol eventSymbol:
src\Analyzers\Core\CodeFixes\ImplementInterface\ImplementInterfaceGenerator.cs (3)
304else if (member is IEventSymbol @event) 310private ISymbol GenerateEvent(Compilation compilation, string memberName, bool generateInvisibly, SyntaxGenerator factory, DeclarationModifiers modifiers, bool useExplicitInterfaceSymbol, Accessibility accessibility, IEventSymbol @event) 328IEventSymbol @event, bool generateInvisibly, IMethodSymbol accessor, string memberName,
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeGeneration\AbstractCodeGenerationService.cs (7)
48public TDeclarationNode AddEvent<TDeclarationNode>(TDeclarationNode destination, IEventSymbol @event, CodeGenerationContextInfo info, CancellationToken cancellationToken) where TDeclarationNode : SyntaxNode 77public SyntaxNode CreateEventDeclaration(IEventSymbol @event, CodeGenerationDestination destination, CodeGenerationContextInfo info, CancellationToken cancellationToken) 124protected abstract TDeclarationNode AddEvent<TDeclarationNode>(TDeclarationNode destination, IEventSymbol @event, TCodeGenerationContextInfo info, IList<bool>? availableIndices, CancellationToken cancellationToken) where TDeclarationNode : SyntaxNode; 144public abstract SyntaxNode CreateEventDeclaration(IEventSymbol @event, CodeGenerationDestination destination, TCodeGenerationContextInfo info, CancellationToken cancellationToken); 346IEventSymbol @event => CreateEventDeclaration(@event, codeGenerationDestination, info, cancellationToken), 364IEventSymbol @event => AddEvent(currentDestination, @event, info, availableIndices, cancellationToken), 393CodeGenerationSolutionContext context, INamedTypeSymbol destination, IEventSymbol @event, CancellationToken cancellationToken)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeGeneration\CodeGenerationSymbolFactory.cs (5)
33public static IEventSymbol CreateEventSymbol( 36ImmutableArray<IEventSymbol> explicitInterfaceImplementations, 570internal static IEventSymbol CreateEventSymbol( 571IEventSymbol @event, 575ImmutableArray<IEventSymbol> explicitInterfaceImplementations = default,
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeGeneration\CodeGenerator.cs (1)
30public static Task<Document> AddEventDeclarationAsync(CodeGenerationSolutionContext context, INamedTypeSymbol destination, IEventSymbol @event, CancellationToken cancellationToken)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeGeneration\ICodeGenerationService.cs (3)
23SyntaxNode CreateEventDeclaration(IEventSymbol @event, CodeGenerationDestination destination, CodeGenerationContextInfo info, CancellationToken cancellationToken); 54TDeclarationNode AddEvent<TDeclarationNode>(TDeclarationNode destination, IEventSymbol @event, CodeGenerationContextInfo info, CancellationToken cancellationToken) where TDeclarationNode : SyntaxNode; 134Task<Document> AddEventAsync(CodeGenerationSolutionContext context, INamedTypeSymbol destination, IEventSymbol @event, CancellationToken cancellationToken);
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeGeneration\Symbols\CodeGenerationEventInfo.cs (4)
13private static readonly ConditionalWeakTable<IEventSymbol, CodeGenerationEventInfo> s_eventToInfoMap = new(); 19public static void Attach(IEventSymbol @event, bool isUnsafe) 25private static CodeGenerationEventInfo GetInfo(IEventSymbol @event) 31public static bool GetIsUnsafe(IEventSymbol @event)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeGeneration\Symbols\CodeGenerationEventSymbol.cs (5)
21ImmutableArray<IEventSymbol> explicitInterfaceImplementations, 25IMethodSymbol? raiseMethod) : CodeGenerationSymbol(containingType?.ContainingAssembly, containingType, attributes, declaredAccessibility, modifiers, name), IEventSymbol 30public ImmutableArray<IEventSymbol> ExplicitInterfaceImplementations { get; } = explicitInterfaceImplementations.NullToEmpty(); 56public new IEventSymbol OriginalDefinition => this; 60public IEventSymbol? OverriddenEvent => null;
Microsoft.CodeAnalysis.CSharp (29)
Compilation\CSharpSemanticModel.cs (2)
3040public abstract IEventSymbol GetDeclaredSymbol(EventDeclarationSyntax declarationSyntax, CancellationToken cancellationToken = default(CancellationToken)); 5427protected sealed override bool IsEventUsableAsFieldCore(int position, IEventSymbol symbol)
Compilation\MemberSemanticModel.cs (1)
662public override IEventSymbol GetDeclaredSymbol(EventDeclarationSyntax declarationSyntax, CancellationToken cancellationToken = default(CancellationToken))
Compilation\SpeculativeSemanticModelWithMemberModel.cs (1)
315public override IEventSymbol GetDeclaredSymbol(EventDeclarationSyntax declarationSyntax, CancellationToken cancellationToken = default(CancellationToken))
Compilation\SyntaxTreeSemanticModel.cs (1)
1552public override IEventSymbol GetDeclaredSymbol(EventDeclarationSyntax declarationSyntax, CancellationToken cancellationToken = default(CancellationToken))
CSharpExtensions.cs (1)
1445public static IEventSymbol? GetDeclaredSymbol(this SemanticModel? semanticModel, EventDeclarationSyntax declarationSyntax, CancellationToken cancellationToken = default(CancellationToken))
Operations\CSharpOperationFactory.cs (1)
645IEventSymbol @event = boundEventAccess.EventSymbol.GetPublicSymbol();
Operations\CSharpOperationFactory_Methods.cs (1)
132IEventSymbol @event = boundEventAssignmentOperator.Event.GetPublicSymbol();
SymbolDisplay\SymbolDisplayVisitor.Members.cs (4)
222public override void VisitEvent(IEventSymbol symbol) 255private void AddEventName(IEventSymbol symbol) 449var associatedEvent = (IEventSymbol?)symbol.AssociatedSymbol;
Symbols\PublicModel\EventSymbol.cs (12)
25ITypeSymbol IEventSymbol.Type 38CodeAnalysis.NullableAnnotation IEventSymbol.NullableAnnotation => _underlying.TypeWithAnnotations.ToPublicAnnotation(); 40IMethodSymbol? IEventSymbol.AddMethod 48IMethodSymbol? IEventSymbol.RemoveMethod 56IMethodSymbol? IEventSymbol.RaiseMethod 65IEventSymbol IEventSymbol.OriginalDefinition 73IEventSymbol? IEventSymbol.OverriddenEvent 81ImmutableArray<IEventSymbol> IEventSymbol.ExplicitInterfaceImplementations 89bool IEventSymbol.IsWindowsRuntimeEvent => _underlying.IsWindowsRuntimeEvent;
Symbols\SymbolExtensions.cs (5)
438internal static EventSymbol? EnsureCSharpSymbolOrNull(this IEventSymbol? symbol, string paramName) 683internal static IEventSymbol? GetPublicSymbol(this EventSymbol? symbol) 685return symbol.GetPublicSymbol<IEventSymbol>(); 729internal static ImmutableArray<IEventSymbol> GetPublicSymbols(this ImmutableArray<EventSymbol> symbols) 731return GetPublicSymbols<IEventSymbol>(StaticCast<Symbol>.From(symbols));
Microsoft.CodeAnalysis.CSharp.CodeStyle (1)
src\Analyzers\CSharp\Analyzers\MakeStructReadOnly\CSharpMakeStructReadOnlyDiagnosticAnalyzer.cs (1)
110else if (member is IEventSymbol ev)
Microsoft.CodeAnalysis.CSharp.CodeStyle.Fixes (15)
src\Analyzers\CSharp\CodeFixes\UsePrimaryConstructor\CSharpUsePrimaryConstructorCodeFixProvider.cs (1)
278IMethodSymbol or IPropertySymbol or IEventSymbol or IFieldSymbol =>
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\CodeGeneration\CSharpCodeGenerationService.cs (5)
63CodeGenerationSolutionContext context, INamedTypeSymbol destination, IEventSymbol @event, CancellationToken cancellationToken) 90protected override TDeclarationNode AddEvent<TDeclarationNode>(TDeclarationNode destination, IEventSymbol @event, CSharpCodeGenerationContextInfo info, IList<bool>? availableIndices, CancellationToken cancellationToken) 127if (method.AssociatedSymbol is IEventSymbol) 635IEventSymbol @event, CodeGenerationDestination destination, CSharpCodeGenerationContextInfo info, CancellationToken cancellationToken) 653if (method.AssociatedSymbol is IEventSymbol)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\CodeGeneration\EventGenerator.cs (9)
64IEventSymbol @event, 80IEventSymbol @event, 98IEventSymbol @event, CodeGenerationDestination destination, CSharpCodeGenerationContextInfo info, CancellationToken cancellationToken) 114IEventSymbol @event, CodeGenerationDestination destination, CSharpCodeGenerationContextInfo info) 127IEventSymbol @event, CodeGenerationDestination destination, CSharpCodeGenerationContextInfo info) 141IEventSymbol @event, CodeGenerationDestination destination, CSharpCodeGenerationContextInfo info) 153IEventSymbol @event, 182IEventSymbol @event, 193IEventSymbol @event, CodeGenerationDestination destination, CSharpCodeGenerationContextInfo info)
Microsoft.CodeAnalysis.CSharp.EditorFeatures (5)
EventHookup\EventHookupSessionManager_EventHookupSession.cs (5)
169var eventSymbol = GetEventSymbol(semanticModel, plusEqualsToken.Value, cancellationToken); 206private IEventSymbol? GetEventSymbol(SemanticModel semanticModel, SyntaxToken plusEqualsToken, CancellationToken cancellationToken) 214return semanticModel.GetSymbolInfo(parentToken.Left, cancellationToken).Symbol as IEventSymbol; 218IEventSymbol eventSymbol, SyntaxToken plusEqualsToken, SemanticModel semanticModel, 241private string? GetNameObjectPart(IEventSymbol eventSymbol, SyntaxToken plusEqualsToken, SemanticModel semanticModel, ISyntaxFactsService syntaxFactsService)
Microsoft.CodeAnalysis.CSharp.EditorFeatures.UnitTests (3)
SymbolKey\SymbolKeyMetadataVsSourceTests.cs (3)
74var member01 = (typesym.GetMembers("myEvent").Single() as IEventSymbol).Type; 355ResolveAndVerifyTypeSymbol(list[0], (originalSymbols[2] as IEventSymbol).Type, model, comp20); 358ResolveAndVerifyTypeSymbol(list[1], (originalSymbols[2] as IEventSymbol).Type, model, comp20);
Microsoft.CodeAnalysis.CSharp.Emit.UnitTests (4)
CodeGen\CodeGenDeconstructTests.cs (2)
7867Assert.True(comp2.Compilation.GetMember<IEventSymbol>("C.E").IsWindowsRuntimeEvent); 7930Assert.True(comp2.Compilation.GetMember<IEventSymbol>("S.E").IsWindowsRuntimeEvent);
CodeGen\CodeGenTupleTest.cs (2)
14425var e1Tuple = (INamedTypeSymbol)test.GetMember<IEventSymbol>("E1").Type; 14435e1Tuple = (INamedTypeSymbol)((IEventSymbol)symbolInfo.CandidateSymbols.Single()).Type;
Microsoft.CodeAnalysis.CSharp.Features (8)
Completion\CompletionProviders\ExplicitInterfaceMemberCompletionProvider.CompletionSymbolDisplay.cs (2)
20IEventSymbol eventSymbol => ToDisplayString(eventSymbol), 26private static string ToDisplayString(IEventSymbol symbol)
EditAndContinue\CSharpEditAndContinueAnalyzer.cs (3)
1234if (oldSymbol is IEventSymbol oldEventSymbol && newSymbol is IEventSymbol newEventSymbol) 1975internal override string GetDisplayName(IEventSymbol symbol)
ExtractMethod\CSharpSelectionResult.StatementResult.cs (1)
80IEventSymbol eventSymbol => (eventSymbol.Type, false),
src\Analyzers\CSharp\Analyzers\MakeStructReadOnly\CSharpMakeStructReadOnlyDiagnosticAnalyzer.cs (1)
110else if (member is IEventSymbol ev)
src\Analyzers\CSharp\CodeFixes\UsePrimaryConstructor\CSharpUsePrimaryConstructorCodeFixProvider.cs (1)
278IMethodSymbol or IPropertySymbol or IEventSymbol or IFieldSymbol =>
Microsoft.CodeAnalysis.CSharp.Features.UnitTests (17)
EditAndContinue\LineEditTests.cs (3)
2109semanticEdits: [SemanticEdit(SemanticEditKind.Update, c => c.GetMember<IEventSymbol>("C.E").RemoveMethod)]); 2131semanticEdits: [SemanticEdit(SemanticEditKind.Update, c => c.GetMember<IEventSymbol>("C.E").RemoveMethod)]); 2153semanticEdits: [SemanticEdit(SemanticEditKind.Update, c => c.GetMember<IEventSymbol>("C.E").RemoveMethod)]);
EditAndContinue\TopLevelEditingTests.cs (14)
6984SemanticEdit(SemanticEditKind.Update, c => c.GetMember<IEventSymbol>("C.E").AddMethod), 6985SemanticEdit(SemanticEditKind.Update, c => c.GetMember<IEventSymbol>("C.E").RemoveMethod), 20964SemanticEdit(SemanticEditKind.Update, c => c.GetMember<INamedTypeSymbol>("C").GetMember<IEventSymbol>("E").AddMethod), 20965SemanticEdit(SemanticEditKind.Update, c => c.GetMember<INamedTypeSymbol>("C").GetMember<IEventSymbol>("E").RemoveMethod) 21047SemanticEdit(SemanticEditKind.Update, c => c.GetMember<IEventSymbol>("C.F")) 21077SemanticEdit(SemanticEditKind.Update, c => c.GetMember<IEventSymbol>("C.F")), 21078SemanticEdit(SemanticEditKind.Update, c => c.GetMember<IEventSymbol>("C.F").AddMethod), 21079SemanticEdit(SemanticEditKind.Update, c => c.GetMember<IEventSymbol>("C.F").RemoveMethod) 21108[SemanticEdit(SemanticEditKind.Update, c => c.GetMember<IEventSymbol>("C.F").RemoveMethod)], 21136[SemanticEdit(SemanticEditKind.Update, c => c.GetMember<IEventSymbol>("C.F"))], 21165SemanticEdit(SemanticEditKind.Update, c => c.GetMember<IEventSymbol>("C.F")), 21166SemanticEdit(SemanticEditKind.Update, c => c.GetMember<IEventSymbol>("C.F").AddMethod), 21167SemanticEdit(SemanticEditKind.Update, c => c.GetMember<IEventSymbol>("C.F").RemoveMethod) 21197SemanticEdit(SemanticEditKind.Update, c => c.GetMember<IEventSymbol>("C.F").RemoveMethod)
Microsoft.CodeAnalysis.CSharp.Semantic.UnitTests (2)
Semantics\ReadOnlyStructsTests.cs (2)
1229static IEventSymbol getEvent(INamedTypeSymbol symbol, string name) => (IEventSymbol)symbol.GetMembers(name).Single();
Microsoft.CodeAnalysis.CSharp.Symbol.UnitTests (35)
Compilation\GetSemanticInfoTests.cs (4)
1272var eventSymbol = comp.GlobalNamespace.GetMember<INamedTypeSymbol>("C").GetMember<IEventSymbol>("E"); 1300var eventSymbol = comp.GlobalNamespace.GetMember<INamedTypeSymbol>("C").GetMember<IEventSymbol>("E"); 1327var eventSymbol = comp.GlobalNamespace.GetMember<INamedTypeSymbol>("C").GetMember<IEventSymbol>("E"); 1354var eventSymbol = comp.GlobalNamespace.GetMember<INamedTypeSymbol>("C").GetMember<IEventSymbol>("E");
Compilation\SemanticModelGetDeclaredSymbolAPITests.cs (5)
383var eventSymbol = model.GetDeclaredSymbol(eventDecl); 500var symbol = model.GetDeclaredSymbol(node); 4660var fieldLikeEvent = declaringType.GetMember<IEventSymbol>("E"); 4661var customEvent = declaringType.GetMember<IEventSymbol>("F"); 4750var eventSymbol = model.GetDeclaredSymbol(eventDecl);
Compilation\SymbolVisitorTests.cs (3)
74public override void VisitEvent(IEventSymbol symbol) 248public override string VisitEvent(IEventSymbol symbol) 439public override int VisitEvent(IEventSymbol symbol, StringBuilder argument)
Symbols\Source\DeclaringSyntaxNodeTests.cs (2)
529var ev1 = c1.GetMembers("ev1").Single() as IEventSymbol;
Symbols\Source\EventTests.cs (4)
305var eventSymbol1 = semanticModel.LookupSymbols(text.IndexOf("/*anchorE_1*/", StringComparison.Ordinal), name: "E1").SingleOrDefault() as IEventSymbol; 308var eventSymbol2 = semanticModel.LookupSymbols(text.IndexOf("/*anchorE_2*/", StringComparison.Ordinal), name: "E1").SingleOrDefault() as IEventSymbol;
Symbols\Source\NullablePublicAPITests.cs (9)
637return c.GetMembers().OfType<IEventSymbol>().ToArray(); 2829Assert.Equal(PublicNullableAnnotation.Annotated, ((IEventSymbol)symInfo.Symbol).NullableAnnotation); 2830Assert.Equal(PublicNullableAnnotation.Annotated, ((IEventSymbol)symInfo.Symbol).Type.NullableAnnotation); 2834Assert.Equal(PublicNullableAnnotation.Annotated, ((IEventSymbol)symInfo.Symbol).NullableAnnotation); 2835Assert.Equal(PublicNullableAnnotation.Annotated, ((IEventSymbol)symInfo.Symbol).Type.NullableAnnotation); 2878Assert.Equal(PublicNullableAnnotation.Annotated, ((IEventSymbol)symInfo.Symbol).NullableAnnotation); 2879Assert.Equal(PublicNullableAnnotation.Annotated, ((IEventSymbol)symInfo.Symbol).Type.NullableAnnotation); 2883Assert.Equal(PublicNullableAnnotation.Annotated, ((IEventSymbol)symInfo.Symbol).NullableAnnotation); 2884Assert.Equal(PublicNullableAnnotation.Annotated, ((IEventSymbol)symInfo.Symbol).Type.NullableAnnotation);
Symbols\SymbolEqualityTests.cs (8)
738var event1 = (IEventSymbol)type1.GetMembers()[2]; 739var event2 = (IEventSymbol)type2.GetMembers()[2]; 893var event1 = (IEventSymbol)((INamedTypeSymbol)model.GetDeclaredSymbol(member1Syntax)).GetMembers("MyEvent").Single(); // System.EventHandler<T!>! A<T>.MyEvent 894var event2 = (IEventSymbol)model.GetSymbolInfo(member2Syntax).Symbol; // System.EventHandler<T!>! A<T!>.MyEvent
Microsoft.CodeAnalysis.CSharp.Test.Utilities (1)
Extensions.cs (1)
821return ((IEventSymbol)symbol).Type;
Microsoft.CodeAnalysis.CSharp.Workspaces (16)
Classification\SyntaxClassification\NameSyntaxClassifier.cs (1)
207case IEventSymbol:
Recommendations\CSharpRecommendationServiceRunner.cs (1)
732if (symbol is IEventSymbol ev &&
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\CodeGeneration\CSharpCodeGenerationService.cs (5)
63CodeGenerationSolutionContext context, INamedTypeSymbol destination, IEventSymbol @event, CancellationToken cancellationToken) 90protected override TDeclarationNode AddEvent<TDeclarationNode>(TDeclarationNode destination, IEventSymbol @event, CSharpCodeGenerationContextInfo info, IList<bool>? availableIndices, CancellationToken cancellationToken) 127if (method.AssociatedSymbol is IEventSymbol) 635IEventSymbol @event, CodeGenerationDestination destination, CSharpCodeGenerationContextInfo info, CancellationToken cancellationToken) 653if (method.AssociatedSymbol is IEventSymbol)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\CodeGeneration\EventGenerator.cs (9)
64IEventSymbol @event, 80IEventSymbol @event, 98IEventSymbol @event, CodeGenerationDestination destination, CSharpCodeGenerationContextInfo info, CancellationToken cancellationToken) 114IEventSymbol @event, CodeGenerationDestination destination, CSharpCodeGenerationContextInfo info) 127IEventSymbol @event, CodeGenerationDestination destination, CSharpCodeGenerationContextInfo info) 141IEventSymbol @event, CodeGenerationDestination destination, CSharpCodeGenerationContextInfo info) 153IEventSymbol @event, 182IEventSymbol @event, 193IEventSymbol @event, CodeGenerationDestination destination, CSharpCodeGenerationContextInfo info)
Microsoft.CodeAnalysis.CSharp.Workspaces.UnitTests (1)
CodeGeneration\SyntaxGeneratorTests.cs (1)
2498var ev = type.GetMembers().Single(m => m is IEventSymbol);
Microsoft.CodeAnalysis.EditorFeatures.UnitTests (4)
CodeGeneration\CodeGenerationTests.cs (2)
376Func<SemanticModel, ImmutableArray<IEventSymbol>> getExplicitInterfaceImplementations = null, 387var @event = CodeGenerationSymbolFactory.CreateEventSymbol(
CodeGeneration\CodeGenerationTests.VisualBasic.cs (2)
409static ImmutableArray<IEventSymbol> GetExplicitInterfaceEvent(SemanticModel semanticModel) 411return ImmutableArray.Create<IEventSymbol>(
Microsoft.CodeAnalysis.ExpressionEvaluator.ExpressionCompiler (1)
AbstractTypeParameterChecker.cs (1)
73public sealed override void VisitEvent(IEventSymbol symbol)
Microsoft.CodeAnalysis.Features (49)
ChangeSignature\AbstractChangeSignatureService.cs (2)
129if (symbol is IEventSymbol ev) 298if (symbolWithSyntacticParameters is IEventSymbol eventSymbol)
Completion\Providers\AbstractMemberInsertingCompletionProvider.cs (1)
159memberContainingDocument = await codeGenService.AddEventAsync(context, containingType, (IEventSymbol)generatedMember, cancellationToken).ConfigureAwait(false);
Completion\Providers\AbstractOverrideCompletionProvider.cs (1)
73SymbolKind.Event => ((IEventSymbol)symbol).Type,
EditAndContinue\AbstractEditAndContinueAnalyzer.cs (6)
322SymbolKind.Event => GetDisplayName((IEventSymbol)symbol), 333internal virtual string GetDisplayName(IEventSymbol symbol) 2391protected static bool ReturnTypesEquivalent(IEventSymbol oldEvent, IEventSymbol newEvent, bool exact) 2443return ReturnTypesEquivalent((IEventSymbol)oldMember, (IEventSymbol)newMember, exact);
ExtractInterface\AbstractExtractInterfaceService.cs (2)
379var @event = member as IEventSymbol;
InheritanceMargin\AbstractInheritanceMarginService.cs (1)
75if (symbol is IEventSymbol or IPropertySymbol
InheritanceMargin\AbstractInheritanceMarginService_Helpers.cs (3)
67if (symbol is IEventSymbol or IPropertySymbol or IMethodSymbol) 590if (memberSymbol is IMethodSymbol or IEventSymbol or IPropertySymbol) 623if (memberSymbol is IMethodSymbol or IEventSymbol or IPropertySymbol
LanguageServices\AnonymousTypeDisplayService\AbstractStructuralTypeDisplayService.StructuralTypeCollectorVisitor.cs (1)
127public override void VisitEvent(IEventSymbol symbol)
MetadataAsSource\AbstractMetadataAsSourceService.WrappedEventSymbol.cs (6)
12private sealed class WrappedEventSymbol(IEventSymbol eventSymbol, bool canImplementImplicitly, IDocumentationCommentFormattingService docCommentFormattingService) : AbstractWrappedSymbol(eventSymbol, canImplementImplicitly, docCommentFormattingService), IEventSymbol 14private readonly IEventSymbol _symbol = eventSymbol; 16public ImmutableArray<IEventSymbol> ExplicitInterfaceImplementations 26public new IEventSymbol OriginalDefinition => this; 30public IEventSymbol? OverriddenEvent => _symbol.OverriddenEvent;
MetadataAsSource\AbstractMetadataAsSourceService.WrappedNamedTypeSymbol.cs (1)
48SymbolKind.Event => new WrappedEventSymbol((IEventSymbol)m, canImplementImplicitly, docCommentFormattingService),
PullMemberUp\MembersPuller.cs (5)
181else if (member is IEventSymbol eventSymbol) 204if (member is IEventSymbol eventSymbol) 225IEventSymbol eventSymbol, 245var publicAndNonStaticSymbol = CodeGenerationSymbolFactory.CreateEventSymbol( 457else if (member is IEventSymbol eventSymbol)
QuickInfo\CommonSemanticQuickInfoProvider.ErrorVisitor.cs (1)
29public override bool VisitEvent(IEventSymbol symbol)
RQName\RQNodeBuilder.cs (2)
26IEventSymbol eventSymbol => BuildEvent(eventSymbol), 169private static RQEvent? BuildEvent(IEventSymbol symbol)
Shared\Extensions\ISymbolExtensions_Sorting.cs (5)
121private static int CompareEvents(IEventSymbol xEvent, string[] xTypeNames, IEventSymbol yEvent, string[] yTypeNames) 142if (symbol is IEventSymbol ev) 189? CompareEvents((IEventSymbol)s1, symbol1ParameterTypeNames, (IEventSymbol)s2, symbol2ParameterTypeNames)
Shared\Utilities\ExtractTypeHelpers.cs (2)
203var @event = member as IEventSymbol;
src\Analyzers\Core\Analyzers\RemoveUnusedMembers\AbstractRemoveUnusedMembersDiagnosticAnalyzer.cs (1)
838return ((IEventSymbol)memberSymbol).ExplicitInterfaceImplementations.IsEmpty;
src\Analyzers\Core\CodeFixes\AddAccessibilityModifiers\AddAccessibilityModifiersHelpers.cs (1)
50if (symbol is IMethodSymbol or IPropertySymbol or IEventSymbol)
src\Analyzers\Core\CodeFixes\ImplementAbstractClass\ImplementAbstractClassData.cs (4)
171IEventSymbol @event => GenerateEvent(@event, throughMember, accessibility, modifiers), 238private IEventSymbol GenerateEvent( 239IEventSymbol @event, ISymbol? throughMember, Accessibility accessibility, DeclarationModifiers modifiers) 249IEventSymbol @event, IMethodSymbol? accessor, ISymbol? throughMember,
src\Analyzers\Core\CodeFixes\ImplementInterface\ImplementHelpers.cs (1)
165case IEventSymbol eventSymbol:
src\Analyzers\Core\CodeFixes\ImplementInterface\ImplementInterfaceGenerator.cs (3)
304else if (member is IEventSymbol @event) 310private ISymbol GenerateEvent(Compilation compilation, string memberName, bool generateInvisibly, SyntaxGenerator factory, DeclarationModifiers modifiers, bool useExplicitInterfaceSymbol, Accessibility accessibility, IEventSymbol @event) 328IEventSymbol @event, bool generateInvisibly, IMethodSymbol accessor, string memberName,
Microsoft.CodeAnalysis.VisualBasic (25)
Compilation\SemanticModel.vb (3)
2686Public Overloads Function GetDeclaredSymbol(declarationSyntax As EventStatementSyntax, Optional cancellationToken As CancellationToken = Nothing) As IEventSymbol 2704Public Overloads Function GetDeclaredSymbol(declarationSyntax As EventBlockSyntax, Optional cancellationToken As CancellationToken = Nothing) As IEventSymbol 3515Protected NotOverridable Overrides Function IsEventUsableAsFieldCore(position As Integer, symbol As IEventSymbol) As Boolean
Operations\VisualBasicOperationFactory.vb (1)
909Dim [event] As IEventSymbol = boundEventAccess.EventSymbol
SymbolDisplay\SymbolDisplayVisitor.Members.vb (1)
124Public Overrides Sub VisitEvent(symbol As IEventSymbol)
Symbols\EventSymbol.vb (13)
52Public MustOverride ReadOnly Property IsWindowsRuntimeEvent As Boolean Implements IEventSymbol.IsWindowsRuntimeEvent 278Private ReadOnly Property IEventSymbol_Type As ITypeSymbol Implements IEventSymbol.Type 284Private ReadOnly Property IEventSymbol_NullableAnnotation As NullableAnnotation Implements IEventSymbol.NullableAnnotation 290Private ReadOnly Property IEventSymbol_AddMethod As IMethodSymbol Implements IEventSymbol.AddMethod 296Private ReadOnly Property IEventSymbol_RemoveMethod As IMethodSymbol Implements IEventSymbol.RemoveMethod 302Private ReadOnly Property IEventSymbol_RaiseMethod As IMethodSymbol Implements IEventSymbol.RaiseMethod 308Private ReadOnly Property IEventSymbol_OriginalDefinition As IEventSymbol Implements IEventSymbol.OriginalDefinition 314Private ReadOnly Property IEventSymbol_OverriddenEvent As IEventSymbol Implements IEventSymbol.OverriddenEvent 320Private ReadOnly Property IEventSymbol_ExplicitInterfaceImplementations As ImmutableArray(Of IEventSymbol) Implements IEventSymbol.ExplicitInterfaceImplementations 322Return StaticCast(Of IEventSymbol).From(Me.ExplicitInterfaceImplementations)
Symbols\HandledEvent.vb (1)
64Public ReadOnly Property EventSymbol As IEventSymbol
VisualBasicExtensions.vb (6)
599Public Function AssociatedField(eventSymbol As IEventSymbol) As IFieldSymbol 605Public Function HasAssociatedField(eventSymbol As IEventSymbol) As Boolean 611Public Function GetFieldAttributes(eventSymbol As IEventSymbol) As ImmutableArray(Of AttributeData) 621Public Function IsImplicitlyDeclared(eventSymbol As IEventSymbol) As Boolean 1162Public Function GetDeclaredSymbol(semanticModel As SemanticModel, declarationSyntax As EventStatementSyntax, Optional cancellationToken As CancellationToken = Nothing) As IEventSymbol 1188Public Function GetDeclaredSymbol(semanticModel As SemanticModel, declarationSyntax As EventBlockSyntax, Optional cancellationToken As CancellationToken = Nothing) As IEventSymbol
Microsoft.CodeAnalysis.VisualBasic.CodeStyle.Fixes (11)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\VisualBasic\CodeGeneration\EventGenerator.vb (7)
49[event] As IEventSymbol, 64[event] As IEventSymbol, 78[event] As IEventSymbol, 91[event] As IEventSymbol, 137[event] As IEventSymbol, 163Private Function GenerateModifiers([event] As IEventSymbol, 185Private Function GenerateAsClause([event] As IEventSymbol) As SimpleAsClauseSyntax
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\VisualBasic\CodeGeneration\VisualBasicCodeGenerationService.vb (2)
94[event] As IEventSymbol, 548Public Overrides Function CreateEventDeclaration([event] As IEventSymbol,
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\VisualBasic\Extensions\ContextQuery\VisualBasicSyntaxContextExtensions.vb (2)
28Return container.BaseType.GetAccessibleMembersInThisAndBaseTypes(Of IEventSymbol)(container).Any() 31Return container.GetAccessibleMembersInThisAndBaseTypes(Of IEventSymbol)(container).Any()
Microsoft.CodeAnalysis.VisualBasic.EditorFeatures (1)
NavigationBar\VisualBasicEditorNavigationBarItemService_CodeGeneration.vb (1)
159Dim eventSymbol = TryCast(generateCodeItem.EventSymbolKey.Resolve(compilation, cancellationToken:=cancellationToken).GetAnySymbol(), IEventSymbol)
Microsoft.CodeAnalysis.VisualBasic.Features (15)
ChangeSignature\VisualBasicChangeSignatureService.vb (1)
337Dim delegateInvokeMethod = DirectCast(DirectCast(semanticModel.GetSymbolInfo(raiseEventStatement.Name, cancellationToken).Symbol, IEventSymbol).Type, INamedTypeSymbol).DelegateInvokeMethod
CodeFixes\GenerateEvent\GenerateEventCodeFixProvider.CodeAction.vb (2)
16Private ReadOnly _generatedEvent As IEventSymbol 21generatedEvent As IEventSymbol,
CodeFixes\GenerateEvent\GenerateEventCodeFixProvider.vb (1)
264Dim boundEvent = TryCast(semanticModel.GetDeclaredSymbol(node.Parent.Parent, cancellationToken), IEventSymbol)
Completion\CompletionProviders\HandlesClauseCompletionProvider.vb (4)
117Dim result = ImmutableArray(Of IEventSymbol).Empty 123OfType(Of IEventSymbol)(). 127OfType(Of IEventSymbol)(). 136OfType(Of IEventSymbol)().
EditAndContinue\VisualBasicEditAndContinueAnalyzer.vb (2)
847Dim oldEventSymbol = TryCast(oldSymbol, IEventSymbol) 848Dim newEventSymbol = TryCast(newSymbol, IEventSymbol)
NavigationBar\VisualBasicNavigationBarItemService.vb (2)
322Dim accessibleEvents = semanticModel.LookupSymbols(position, eventType).OfType(Of IEventSymbol).OrderBy(Function(e) e.Name) 327Dim eventToImplementingMethods As New Dictionary(Of IEventSymbol, List(Of IMethodSymbol))
SignatureHelp\RaiseEventStatementSignatureHelpProvider.vb (3)
88OfType(Of IEventSymbol)(). 104eventSymbol As IEventSymbol, 129eventSymbol As IEventSymbol,
Microsoft.CodeAnalysis.VisualBasic.Semantic.UnitTests (3)
Compilation\SemanticModelAPITests.vb (2)
4744Dim symbol = DirectCast(semanticModel.GetSymbolInfo(node).Symbol, IEventSymbol) 4879Dim symbol = DirectCast(semanticModel.GetSymbolInfo(node).Symbol, IEventSymbol)
Semantics\GetSemanticInfoTests.vb (1)
3108Dim commonEventSymbol As IEventSymbol = handledEvent0.EventSymbol
Microsoft.CodeAnalysis.VisualBasic.Workspaces (12)
Recommendations\VisualBasicRecommendationServiceRunner.vb (1)
371Return Not TypeOf DirectCast(s, INamedTypeSymbol).AssociatedSymbol Is IEventSymbol
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\VisualBasic\CodeGeneration\EventGenerator.vb (7)
49[event] As IEventSymbol, 64[event] As IEventSymbol, 78[event] As IEventSymbol, 91[event] As IEventSymbol, 137[event] As IEventSymbol, 163Private Function GenerateModifiers([event] As IEventSymbol, 185Private Function GenerateAsClause([event] As IEventSymbol) As SimpleAsClauseSyntax
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\VisualBasic\CodeGeneration\VisualBasicCodeGenerationService.vb (2)
94[event] As IEventSymbol, 548Public Overrides Function CreateEventDeclaration([event] As IEventSymbol,
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\VisualBasic\Extensions\ContextQuery\VisualBasicSyntaxContextExtensions.vb (2)
28Return container.BaseType.GetAccessibleMembersInThisAndBaseTypes(Of IEventSymbol)(container).Any() 31Return container.GetAccessibleMembersInThisAndBaseTypes(Of IEventSymbol)(container).Any()
Microsoft.CodeAnalysis.Workspaces (71)
Editing\DeclarationModifiers.cs (1)
71IEventSymbol)
Editing\SyntaxGenerator.cs (4)
491public SyntaxNode EventDeclaration(IEventSymbol symbol) 524IEventSymbol symbol, 730var ev = (IEventSymbol)symbol;
FindSymbols\FindReferences\Finders\EventSymbolReferenceFinder.cs (5)
15internal sealed class EventSymbolReferenceFinder : AbstractMethodOrPropertyOrEventSymbolReferenceFinder<IEventSymbol> 17protected override bool CanFind(IEventSymbol symbol) 21IEventSymbol symbol, 39IEventSymbol symbol, 53IEventSymbol symbol,
FindSymbols\FindReferences\FindReferencesSearchEngine.cs (1)
370=> symbol is IMethodSymbol or IPropertySymbol or IEventSymbol;
FindSymbols\SymbolFinder_Hierarchy.cs (1)
111if (symbol is IMethodSymbol or IPropertySymbol or IEventSymbol)
Shared\Extensions\ITypeSymbolExtensions.cs (1)
130IEventSymbol eventSymbol => typeSymbol.FindImplementations(eventSymbol, services),
Shared\Extensions\SyntaxGeneratorExtensions.cs (3)
184public static IEventSymbol OverrideEvent( 185IEventSymbol overriddenEvent, 218else if (symbol is IEventSymbol ev)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\INamedTypeSymbolExtensions.cs (3)
169IEventSymbol @event => @event.ExplicitInterfaceImplementations.Length > 0, 419case IEventSymbol ev: 636IEventSymbol => true,
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\ISymbolExtensions.cs (3)
80IEventSymbol @event => @event.OverriddenEvent, 87IEventSymbol @event => ImmutableArray<ISymbol>.CastUp(@event.ExplicitInterfaceImplementations), 281IEventSymbol eventSymbol => eventSymbol.Type,
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\ISymbolExtensions.RequiresUnsafeModifierVisitor.cs (1)
129public override bool VisitEvent(IEventSymbol symbol)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\SymbolKey\SymbolKey.cs (1)
29/// <item>Two <see cref="IEventSymbol"/>s are the "same" if they have
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\SymbolKey\SymbolKey.EventSymbolKey.cs (4)
9private sealed class EventSymbolKey : AbstractSymbolKey<IEventSymbol> 13public sealed override void Create(IEventSymbol symbol, SymbolKeyWriter visitor) 20SymbolKeyReader reader, IEventSymbol? contextualSymbol, out string? failureReason) 31using var result = GetMembersOfNamedType<IEventSymbol>(containingTypeResolution, metadataName);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\SymbolKey\SymbolKey.ParameterSymbolKey.cs (1)
52case IEventSymbol eventSymbol:
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\SymbolKey\SymbolKey.SymbolKeyWriter.cs (1)
467public override void VisitEvent(IEventSymbol eventSymbol)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\SignatureComparer.cs (10)
43SymbolKind.Event => HaveSameSignature((IEventSymbol)symbol1, (IEventSymbol)symbol2, caseSensitive), 48private static bool HaveSameSignature(IEventSymbol event1, IEventSymbol event2, bool caseSensitive) 164var ev1 = (IEventSymbol)symbol1; 165var ev2 = (IEventSymbol)symbol2; 241private bool HaveSameReturnType(IEventSymbol ev1, IEventSymbol ev2)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\SymbolEquivalenceComparer.EquivalenceVisitor.cs (4)
119SymbolKind.Event => EventsAreEquivalent((IEventSymbol)x, (IEventSymbol)y, equivalentTypesWithDifferingAssemblies), 608private bool EventsAreEquivalent(IEventSymbol x, IEventSymbol y, Dictionary<INamedTypeSymbol, INamedTypeSymbol>? equivalentTypesWithDifferingAssemblies)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\SymbolEquivalenceComparer.GetHashCodeVisitor.cs (2)
61SymbolKind.Event => CombineHashCodes((IEventSymbol)x, currentHash), 252private int CombineHashCodes(IEventSymbol x, int currentHash)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeGeneration\AbstractCodeGenerationService.cs (7)
48public TDeclarationNode AddEvent<TDeclarationNode>(TDeclarationNode destination, IEventSymbol @event, CodeGenerationContextInfo info, CancellationToken cancellationToken) where TDeclarationNode : SyntaxNode 77public SyntaxNode CreateEventDeclaration(IEventSymbol @event, CodeGenerationDestination destination, CodeGenerationContextInfo info, CancellationToken cancellationToken) 124protected abstract TDeclarationNode AddEvent<TDeclarationNode>(TDeclarationNode destination, IEventSymbol @event, TCodeGenerationContextInfo info, IList<bool>? availableIndices, CancellationToken cancellationToken) where TDeclarationNode : SyntaxNode; 144public abstract SyntaxNode CreateEventDeclaration(IEventSymbol @event, CodeGenerationDestination destination, TCodeGenerationContextInfo info, CancellationToken cancellationToken); 346IEventSymbol @event => CreateEventDeclaration(@event, codeGenerationDestination, info, cancellationToken), 364IEventSymbol @event => AddEvent(currentDestination, @event, info, availableIndices, cancellationToken), 393CodeGenerationSolutionContext context, INamedTypeSymbol destination, IEventSymbol @event, CancellationToken cancellationToken)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeGeneration\CodeGenerationSymbolFactory.cs (5)
33public static IEventSymbol CreateEventSymbol( 36ImmutableArray<IEventSymbol> explicitInterfaceImplementations, 570internal static IEventSymbol CreateEventSymbol( 571IEventSymbol @event, 575ImmutableArray<IEventSymbol> explicitInterfaceImplementations = default,
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeGeneration\CodeGenerator.cs (1)
30public static Task<Document> AddEventDeclarationAsync(CodeGenerationSolutionContext context, INamedTypeSymbol destination, IEventSymbol @event, CancellationToken cancellationToken)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeGeneration\ICodeGenerationService.cs (3)
23SyntaxNode CreateEventDeclaration(IEventSymbol @event, CodeGenerationDestination destination, CodeGenerationContextInfo info, CancellationToken cancellationToken); 54TDeclarationNode AddEvent<TDeclarationNode>(TDeclarationNode destination, IEventSymbol @event, CodeGenerationContextInfo info, CancellationToken cancellationToken) where TDeclarationNode : SyntaxNode; 134Task<Document> AddEventAsync(CodeGenerationSolutionContext context, INamedTypeSymbol destination, IEventSymbol @event, CancellationToken cancellationToken);
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeGeneration\Symbols\CodeGenerationEventInfo.cs (4)
13private static readonly ConditionalWeakTable<IEventSymbol, CodeGenerationEventInfo> s_eventToInfoMap = new(); 19public static void Attach(IEventSymbol @event, bool isUnsafe) 25private static CodeGenerationEventInfo GetInfo(IEventSymbol @event) 31public static bool GetIsUnsafe(IEventSymbol @event)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeGeneration\Symbols\CodeGenerationEventSymbol.cs (5)
21ImmutableArray<IEventSymbol> explicitInterfaceImplementations, 25IMethodSymbol? raiseMethod) : CodeGenerationSymbol(containingType?.ContainingAssembly, containingType, attributes, declaredAccessibility, modifiers, name), IEventSymbol 30public ImmutableArray<IEventSymbol> ExplicitInterfaceImplementations { get; } = explicitInterfaceImplementations.NullToEmpty(); 56public new IEventSymbol OriginalDefinition => this; 60public IEventSymbol? OverriddenEvent => null;
Microsoft.CodeAnalysis.Workspaces.UnitTests (3)
SymbolKeyTests.cs (2)
289Assert.True(symbols.Any(s => s is IEventSymbol { MetadataName: "" })); 305Assert.True(symbols.Any(s => s is IEventSymbol { MetadataName: "" }));
UtilityTest\DocumentationCommentIdTests.cs (1)
265CheckDeclarationId<IEventSymbol>("E:Acme.Widget.AnEvent", compilation, e => e.Name == "AnEvent");
Microsoft.VisualStudio.LanguageServices (9)
Library\ObjectBrowser\AbstractDescriptionBuilder.cs (2)
223BuildEventDeclaration((IEventSymbol)symbol, options); 243protected abstract void BuildEventDeclaration(IEventSymbol eventSymbol, _VSOBJDESCOPTIONS options);
Progression\GraphBuilder.cs (2)
288node = await GetOrCreateNodeForEventAsync(graph, (IEventSymbol)symbol, solution, cancellationToken).ConfigureAwait(false); 667private static async Task<GraphNode> GetOrCreateNodeForEventAsync(Graph graph, IEventSymbol eventSymbol, Solution solution, CancellationToken cancellationToken)
Progression\GraphQueries\ImplementedByGraphQuery.cs (1)
31IEventSymbol)
Progression\GraphQueries\ImplementsGraphQuery.cs (1)
37IEventSymbol)
Progression\GraphQueries\OverridesGraphQuery.cs (1)
29IEventSymbol)
Venus\ContainedLanguageCodeSupport.cs (2)
103var eventType = ((IEventSymbol)eventMember).Type; 177var eventType = ((IEventSymbol)eventMember).Type;
Microsoft.VisualStudio.LanguageServices.CSharp (5)
CodeModel\CSharpCodeModelService_Prototype.cs (3)
37return GetEventPrototype((IEventSymbol)symbol, flags); 118private string GetEventPrototype(IEventSymbol symbol, PrototypeFlags flags) 357private void AppendEventPrototype(StringBuilder builder, IEventSymbol symbol, PrototypeFlags flags, string baseName)
ObjectBrowser\DescriptionBuilder.cs (1)
531protected override void BuildEventDeclaration(IEventSymbol eventSymbol, _VSOBJDESCOPTIONS options)
Progression\CSharpProgressionLanguageService.cs (1)
117case IEventSymbol f: return f.Type;
Microsoft.VisualStudio.LanguageServices.VisualBasic (4)
CodeModel\MethodXML\MethodXmlBuilder.vb (1)
125Dim eventSymbol = TryCast(SemanticModel.GetSymbolInfo(eventExpression).Symbol, IEventSymbol)
CodeModel\VisualBasicCodeModelService_Prototype.vb (2)
49Dim eventSymbol = DirectCast(symbol, IEventSymbol) 62Private Shared Function GetEventPrototype(symbol As IEventSymbol, parameters As ImmutableArray(Of IParameterSymbol), flags As PrototypeFlags) As String
ObjectBrowser\DescriptionBuilder.vb (1)
269Protected Overrides Sub BuildEventDeclaration(eventSymbol As IEventSymbol, options As _VSOBJDESCOPTIONS)