4 overrides of AddMethod
Microsoft.CodeAnalysis.CSharp (4)
Symbols\Metadata\PE\PEEventSymbol.cs (1)
334public override MethodSymbol AddMethod
Symbols\Retargeting\RetargetingEventSymbol.cs (1)
57public override MethodSymbol? AddMethod
Symbols\Source\SourceEventSymbol.cs (1)
90public abstract override MethodSymbol? AddMethod { get; }
Symbols\SubstitutedEventSymbol.cs (1)
59public override MethodSymbol? AddMethod
389 references to AddMethod
Microsoft.CodeAnalysis.CSharp (22)
Binder\Binder_Lookup.cs (1)
1629method1 = @event.AddMethod;
Binder\Binder_Operators.cs (1)
683MethodSymbol method = isAddition ? eventSymbol.AddMethod : eventSymbol.RemoveMethod;
Compilation\CSharpSemanticModel.cs (1)
3511var methodSymbol = eventAssignment.IsAddition ? eventSymbol.AddMethod : eventSymbol.RemoveMethod;
Emitter\Model\EventSymbolAdapter.cs (2)
31var addMethod = AdaptedEventSymbol.AddMethod?.GetCciAdapter(); 51var addMethod = AdaptedEventSymbol.AddMethod?.GetCciAdapter();
Emitter\NoPia\EmbeddedTypesManager.cs (1)
571var addMethod = @event.AdaptedEventSymbol.AddMethod?.GetCciAdapter();
Lowering\LocalRewriter\LocalRewriter_Event.cs (2)
56MethodSymbol? method = node.IsAddition ? node.Event.AddMethod : node.Event.RemoveMethod; 146methodOpt: eventSymbol.AddMethod,
Symbols\EventSymbol.cs (1)
162MethodSymbol? accessor = AddMethod ?? RemoveMethod;
Symbols\MemberSymbolExtensions.cs (2)
373return isImplementableAndNotPublic(eventSymbol.AddMethod) || isImplementableAndNotPublic(eventSymbol.RemoveMethod); 731MethodSymbol addMethod = @event.AddMethod;
Symbols\OverriddenOrHiddenMembersHelpers.cs (1)
352MethodSymbol correspondingAccessor = accessorIsAdder ? eventHiddenByEvent.AddMethod : eventHiddenByEvent.RemoveMethod;
Symbols\PublicModel\EventSymbol.cs (1)
44return _underlying.AddMethod.GetPublicSymbol();
Symbols\Retargeting\RetargetingEventSymbol.cs (2)
61return (object?)_underlyingEvent.AddMethod == null 63: this.RetargetingTranslator.Retarget(_underlyingEvent.AddMethod);
Symbols\Source\ExplicitInterfaceHelpers.cs (1)
324checkAccessorIsAccessibleIfImplementable(eventSymbol.AddMethod);
Symbols\Source\SourceEventAccessorSymbol.cs (1)
60MethodSymbol implementedAccessor = isAdder ? explicitlyImplementedEventOpt.AddMethod : explicitlyImplementedEventOpt.RemoveMethod;
Symbols\Source\SourceEventSymbol.cs (1)
843CheckExplicitImplementationAccessor(AddMethod, explicitlyImplementedEvent.AddMethod, explicitlyImplementedEvent, diagnostics);
Symbols\Source\SourceMemberContainerSymbol.cs (1)
4501var locationFrom = (Symbol?)(isAdder ? propertySymbol.AddMethod : propertySymbol.RemoveMethod) ?? propertySymbol;
Symbols\Source\SourceMemberContainerSymbol_ImplementationChecks.cs (1)
613var addMethod = @event.AddMethod;
Symbols\SubstitutedEventSymbol.cs (1)
63MethodSymbol? originalAddMethod = OriginalDefinition.AddMethod;
Symbols\TypeSymbol.cs (1)
1431interfaceAccessor1 = interfaceEvent.AddMethod;
Microsoft.CodeAnalysis.CSharp.Emit.UnitTests (11)
CodeGen\CodeGenReadonlyStructTests.cs (3)
1588verifyReadOnly(s1.GetEvent("E").AddMethod, true, RefKind.RefReadOnly); 1602verifyReadOnly(s2.GetEvent("E").AddMethod, true, RefKind.RefReadOnly); 2602Assert.True(peModule.Module.HasIsReadOnlyAttribute(((PEMethodSymbol)testStruct.GetEvent("E").AddMethod).Handle));
CodeGen\CodeGenTupleTest.cs (5)
13274Assert.True(m10I1E1.AddMethod.IsExplicitInterfaceImplementation); 13275Assert.Equal("void I1.E1.add", m10I1E1.AddMethod.ExplicitInterfaceImplementations.Single().ToTestDisplayString()); 16061Assert.True(m1E1Add.Equals(m1E1.AddMethod, TypeCompareKind.ConsiderEverything)); 16092Assert.NotSame(m1E2Add, m1E2.AddMethod); 16093Assert.True(m1E2Add.Equals(m1E2.AddMethod, TypeCompareKind.ConsiderEverything));
CodeGen\EventTests.cs (3)
215var addMethod = @event.AddMethod; 718var addMethod = @event.AddMethod; 790var addMethod = @event.AddMethod;
Microsoft.CodeAnalysis.CSharp.Emit3.UnitTests (39)
Attributes\AttributeTests.cs (12)
2635AssertEx.SetEqual(accessorsExpected, GetAttributeNames(event1.AddMethod.GetAttributes())); 2645AssertEx.SetEqual(accessorsExpected, GetAttributeNames(event2.AddMethod.GetAttributes())); 2654AssertEx.SetEqual(accessorsExpected.Concat(new[] { "CC" }), GetAttributeNames(event3.AddMethod.GetAttributes())); 2663AssertEx.SetEqual(accessorsExpected, GetAttributeNames(event4.AddMethod.GetAttributes())); 2672AssertNoAttributes(event5.AddMethod); 2676AssertNoAttributes(event6.AddMethod); 2680Assert.Equal("GG", GetSingleAttributeName(event7.AddMethod)); 2684Assert.Equal("HH", GetSingleAttributeName(event8.AddMethod)); 2688AssertNoAttributes(event9.AddMethod); 2690Assert.Equal("II", GetSingleAttributeName(event9.AddMethod.Parameters.Single())); 2693AssertNoAttributes(event10.AddMethod); 2695Assert.Equal("JJ", event10.AddMethod.GetReturnTypeAttributes().Single().AttributeClass.Name);
Attributes\AttributeTests_Conditional.cs (1)
180attributesArrayBuilder.Add(eventE.AddMethod.GetAttributes());
Attributes\AttributeTests_Synthesized.cs (1)
238Assert.Equal("CompilerGeneratedAttribute", peModule.GetCustomAttributesForToken(((PEMethodSymbol)e.AddMethod).Handle).Single().AttributeClass.Name);
OverloadResolutionPriorityTests.cs (1)
1650Assert.Equal(0, indexer!.AddMethod!.OverloadResolutionPriority);
PartialEventsAndConstructorsTests.cs (24)
1081validateAccessor(e.AddMethod!); 1239validateAccessor(e.AddMethod!); 1571Assert.True(ev.PartialImplementationPart!.AddMethod!.GetPublicSymbol().IsExtern); 1595Assert.False(ev.AddMethod!.GetPublicSymbol().IsExtern); 1702verifyAccessor(e.AddMethod!, "add_E", "remove_E"); 1710verifyAccessor(eImpl.AddMethod!, "add_E", "remove_E"); 1779Assert.False(ev.AddMethod!.GetPublicSymbol().IsExtern); 1780Assert.Null(ev.AddMethod!.GetDllImportData()); 1781Assert.Equal(MethodImplAttributes.InternalCall, ev.AddMethod.ImplementationAttributes); 1782Assert.False(ev.AddMethod.ImplementationAttributes.HasFlag(MethodImplAttributes.Synchronized)); 1902Assert.True(e.AddMethod!.ImplementationAttributes.HasFlag(MethodImplAttributes.Synchronized)); 1962var addMethod = e.AddMethod!; 3381AssertEx.Equal(["A(3)", "A(13)"], e.AddMethod!.GetAttributes().ToStrings()); 3382AssertEx.Equal(["A(23)"], e.AddMethod.Parameters.Single().GetAttributes().ToStrings()); 3383AssertEx.Equal(["A(33)"], e.AddMethod.GetReturnTypeAttributes().ToStrings()); 3392AssertEx.Equal(["A(3)", "A(13)"], eImpl.AddMethod!.GetAttributes().ToStrings()); 3393AssertEx.Equal(["A(23)"], eImpl.AddMethod.Parameters.Single().GetAttributes().ToStrings()); 3394AssertEx.Equal(["A(33)"], eImpl.AddMethod.GetReturnTypeAttributes().ToStrings()); 3402AssertEx.Equal([.. compiledGeneratedAttr, "A(11)", "A(12)"], f.AddMethod!.GetAttributes().ToStrings()); 3403AssertEx.Equal(["A(22)", "A(21)"], f.AddMethod.Parameters.Single().GetAttributes().ToStrings()); 3404AssertEx.Equal([], f.AddMethod.GetReturnTypeAttributes().ToStrings()); 3413AssertEx.Equal([.. compiledGeneratedAttr, "A(11)", "A(12)"], fImpl.AddMethod!.GetAttributes().ToStrings()); 3414AssertEx.Equal(["A(22)", "A(21)"], fImpl.AddMethod.Parameters.Single().GetAttributes().ToStrings()); 3415AssertEx.Equal([], fImpl.AddMethod.GetReturnTypeAttributes().ToStrings());
Microsoft.CodeAnalysis.CSharp.Semantic.UnitTests (7)
Semantics\InheritanceBindingTests.cs (3)
6650Assert.Equal(classEvent.AddMethod, @class.FindImplementationForInterfaceMember(interfaceEvent.AddMethod)); 6653Assert.True(classEvent.AddMethod.IsMetadataVirtual());
Semantics\InitOnlyMemberTests.cs (1)
2452Assert.False(eventSymbol.AddMethod.IsInitOnly);
Semantics\NullableReferenceTypesTests.cs (3)
12347Assert.True(ev.TypeWithAnnotations.Equals(ev.AddMethod.Parameters.Last().TypeWithAnnotations, TypeCompareKind.ConsiderEverything)); 12715Assert.True(ev.TypeWithAnnotations.Equals(ev.AddMethod.Parameters.Last().TypeWithAnnotations, TypeCompareKind.ConsiderEverything)); 12803Assert.True(ev.TypeWithAnnotations.Equals(ev.AddMethod.Parameters.Last().TypeWithAnnotations, TypeCompareKind.ConsiderEverything));
Microsoft.CodeAnalysis.CSharp.Symbol.UnitTests (304)
DocumentationComments\EventDocumentationCommentTests.cs (2)
43Assert.Equal("M:Acme.Widget.add_E(System.Action)", eventSymbol.AddMethod.GetDocumentationCommentId()); 52Assert.Equal("M:Acme.Widget.add_F(System.Action)", eventSymbol.AddMethod.GetDocumentationCommentId());
SymbolDisplay\SymbolDisplayTests.cs (1)
5007eventSymbol.AddMethod.ToDisplayParts(format),
Symbols\CovariantReturnTests.cs (2)
330if (eventSymbol.AddMethod is MethodSymbol addMethod && overriddenEvent.AddMethod is MethodSymbol overriddenAddMethod)
Symbols\CSharpCompilerFeatureRequiredTests.cs (2)
192Assert.True(onEventAdderEvent.AddMethod!.HasUnsupportedMetadata); 199Assert.False(onEventRemoverEvent.AddMethod!.HasUnsupportedMetadata);
Symbols\DefaultInterfaceImplementationTests.cs (152)
6388var addE1 = e1.AddMethod; 6475var addP1 = e1.AddMethod; 6981Assert.Same(e7.AddMethod, derived.FindImplementationForInterfaceMember(e7.AddMethod)); 6982Assert.Same(e8.AddMethod, derived.FindImplementationForInterfaceMember(e8.AddMethod)); 7157Assert.Equal("void Test.I1.E7.add", derived.FindImplementationForInterfaceMember(e7.AddMethod).ToTestDisplayString()); 7158Assert.Equal("void Test.I1.E8.add", derived.FindImplementationForInterfaceMember(e8.AddMethod).ToTestDisplayString()); 7264Assert.Equal("void Test.E7.add", derived.FindImplementationForInterfaceMember(e7.AddMethod).ToTestDisplayString()); 7265Assert.Equal("void Test.E8.add", derived.FindImplementationForInterfaceMember(e8.AddMethod).ToTestDisplayString()); 7386Assert.True(e7.AddMethod.IsVirtual); 7389Assert.True(e7.AddMethod.IsMetadataVirtual()); 7392Assert.False(e7.AddMethod.IsAbstract); 7395Assert.Same(e7.AddMethod, derived.FindImplementationForInterfaceMember(e7.AddMethod)); 7508Assert.Null(test2.FindImplementationForInterfaceMember(e7.AddMethod)); 7783Assert.False(e7.AddMethod.IsVirtual); 7786Assert.False(e7.AddMethod.IsMetadataVirtual()); 7789Assert.False(e7.AddMethod.IsAbstract); 7792Assert.True(e7.AddMethod.IsStatic); 7795Assert.Null(derived.FindImplementationForInterfaceMember(e7.AddMethod)); 26849ValidateP01Accessor(p01.AddMethod); 26865var p02get = p02.AddMethod; 26907var p04get = p04.AddMethod; 26949var p06get = p06.AddMethod; 26991var p08get = p08.AddMethod; 27033var p10get = p10.AddMethod; 27065ValidateP11Accessor(p11.AddMethod); 27091ValidateP14Accessor(p14.AddMethod); 27648ValidateAccessor(p1.AddMethod, test1P1.AddMethod); 27721ValidateAccessor(p1.AddMethod); 27822ValidateAccessor(p1.AddMethod); 27990ValidateAccessor1(p1.AddMethod); 28017ValidateAccessor2(p2.AddMethod); 28044ValidateAccessor3(p3.AddMethod); 28151ValidateAccessor(p1.AddMethod); 28247ValidateP1Accessor(p1.AddMethod); 28274ValidateP2Accessor(p2.AddMethod); 28301ValidateP3Accessor(p3.AddMethod); 28328ValidateP4Accessor(p4.AddMethod); 28443var p1add = p1.AddMethod; 28450Assert.Same(test1P1.AddMethod, test1.FindImplementationForInterfaceMember(p1add)); 28488ValidateMethod(p1.AddMethod); 28544Assert.Null(test2.FindImplementationForInterfaceMember(p1.AddMethod)); 28686var p1Add = p1.AddMethod; 28691Assert.Same(test1P1.AddMethod, test1.FindImplementationForInterfaceMember(p1Add)); 28694Assert.True(test1P1.AddMethod.IsMetadataVirtual()); 29513Assert.Null(test1.FindImplementationForInterfaceMember(p1.AddMethod)); 29600ValidateAccessor(p1.AddMethod); 29716Validate1(p1.AddMethod); 29746Validate2(p2.AddMethod); 29776Validate3(p3.AddMethod); 30022Assert.Null(p2.AddMethod); 30029ValidateAccessor(p2.AddMethod, test1P2.AddMethod); 30032ValidateAccessor(p2.AddMethod, test1P2.AddMethod); 30129ValidateP1Accessor(p1.AddMethod, test2P1.AddMethod); 30159ValidateP2Accessor(p2.AddMethod, test2P2.AddMethod); 30189ValidateP3Accessor(p3.AddMethod); 30218ValidateP4Accessor(p4.AddMethod); 30247ValidateP5Accessor(p5.AddMethod); 30459ValidateP1Accessor(p1.AddMethod, test2P1.AddMethod); 30489ValidateP2Accessor(p2.AddMethod, test2P2.AddMethod); 30519ValidateP3Accessor(p3.AddMethod); 30548ValidateP4Accessor(p4.AddMethod); 30680ValidateP1Accessor(p1.AddMethod, test2P1.AddMethod); 30710ValidateP2Accessor(p2.AddMethod, test2P2.AddMethod); 30740ValidateP3Accessor(p3.AddMethod); 30770ValidateP4Accessor(p4.AddMethod); 30799ValidateP5Accessor(p5.AddMethod); 30880var p1add = p1.AddMethod; 30926ValidateMethod(p1.AddMethod); 31241ValidateAccessor(p1.AddMethod); 40117ValidateAccessor(expected?.AddMethod, interfaceEvent.AddMethod); 40136ValidateAccessor(expected?.AddMethod, interfaceEvent.AddMethod); 40162ValidateAccessor(m1.AddMethod, isAbstract); 57515Assert.Same(i1p1.AddMethod, i2p1.AddMethod.ExplicitInterfaceImplementations.Single()); 57516Assert.Null(i2.FindImplementationForInterfaceMember(i1p1.AddMethod)); 57517Assert.Null(test1.FindImplementationForInterfaceMember(i1p1.AddMethod)); 57535if (reabstracting.AddMethod is object) 57537ValidateReabstraction(reabstracting.AddMethod, isStatic); 57694Assert.Null(i2.FindImplementationForInterfaceMember(i1p1.AddMethod)); 57695Assert.Same(test12p1.AddMethod, test1.FindImplementationForInterfaceMember(i1p1.AddMethod)); 57842Assert.Null(i3.FindImplementationForInterfaceMember(i1p1.AddMethod)); 57843Assert.Null(test1.FindImplementationForInterfaceMember(i1p1.AddMethod)); 58002Assert.Same(i3p1.AddMethod, i3.FindImplementationForInterfaceMember(i1p1.AddMethod)); 58003Assert.Same(i3p1.AddMethod, test1.FindImplementationForInterfaceMember(i1p1.AddMethod)); 58151Assert.Null(test1.FindImplementationForInterfaceMember(i1p1.AddMethod)); 58304Assert.Null(i4.FindImplementationForInterfaceMember(i1p1.AddMethod)); 58305Assert.Null(test1.FindImplementationForInterfaceMember(i1p1.AddMethod)); 58434Assert.Same(i4p1.AddMethod, i4.FindImplementationForInterfaceMember(i1p1.AddMethod)); 58435Assert.Same(i4p1.AddMethod, test1.FindImplementationForInterfaceMember(i1p1.AddMethod)); 58507if (i1p1.AddMethod is object) 58509if (i2p1.AddMethod is object) 58511Assert.Same(i1p1.AddMethod, i2p1.AddMethod.ExplicitInterfaceImplementations.Single()); 58514Assert.Null(i2.FindImplementationForInterfaceMember(i1p1.AddMethod)); 58515Assert.Null(test1.FindImplementationForInterfaceMember(i1p1.AddMethod)); 58517else if (i2p1.AddMethod is object) 58519Assert.Empty(i2p1.AddMethod.ExplicitInterfaceImplementations); 58698var c2p1Add = c2p1.AddMethod; 58705Assert.Same(i1p1.AddMethod, c2p1Add.ExplicitInterfaceImplementations.Single()); 58706Assert.Same(c2p1Add, c2.FindImplementationForInterfaceMember(i1p1.AddMethod)); 58710Assert.Null(c2.FindImplementationForInterfaceMember(i1p1.AddMethod)); 59279Assert.Same(i1p1.AddMethod, i2p1.AddMethod.ExplicitInterfaceImplementations.Single()); 59280Assert.Null(i2.FindImplementationForInterfaceMember(i1p1.AddMethod)); 59281Assert.Null(test1.FindImplementationForInterfaceMember(i1p1.AddMethod)); 59335Assert.Empty(i2p1.AddMethod.ExplicitInterfaceImplementations); 62736Assert.Same(i1Normal.AddMethod, i1.FindImplementationForInterfaceMember(baseInterfaceNormal.AddMethod)); 62739Assert.Same(i1WinRT.AddMethod, i1.FindImplementationForInterfaceMember(baseInterfaceWinRT.AddMethod)); 62743Assert.Same(i1Normal.AddMethod, c1.FindImplementationForInterfaceMember(baseInterfaceNormal.AddMethod)); 62746Assert.Same(i1WinRT.AddMethod, c1.FindImplementationForInterfaceMember(baseInterfaceWinRT.AddMethod)); 62749Assert.Equal("void I1.Interface<System.Int32>.Normal.add", i1Normal.AddMethod.ToTestDisplayString()); 62751Assert.Equal("System.Runtime.InteropServices.WindowsRuntime.EventRegistrationToken I1.Interface<System.Int32>.WinRT.add", i1WinRT.AddMethod.ToTestDisplayString()); 62798Assert.Same(i1WinRT.AddMethod, c1.FindImplementationForInterfaceMember(i1WinRT.AddMethod)); 62801Assert.Equal("System.Runtime.InteropServices.WindowsRuntime.EventRegistrationToken I1.WinRT.add", i1WinRT.AddMethod.ToTestDisplayString()); 62858Assert.Same(i1WinRT.AddMethod, i1.FindImplementationForInterfaceMember(baseInterfaceWinRT.AddMethod)); 62862Assert.Same(i1WinRT.AddMethod, c1.FindImplementationForInterfaceMember(baseInterfaceWinRT.AddMethod)); 62865Assert.Equal("System.Runtime.InteropServices.WindowsRuntime.EventRegistrationToken I1.Interface.WinRT.add", i1WinRT.AddMethod.ToTestDisplayString()); 63168Assert.Same(i2i1E1add, test2.FindImplementationForInterfaceMember(i1E1.AddMethod)); 63179Assert.Same(c1i1E1add, test1.FindImplementationForInterfaceMember(i1E1.AddMethod)); 63190Assert.Same(c1i1E1add, test4.FindImplementationForInterfaceMember(i1E1.AddMethod)); 63201Assert.Same(i2i1E1add, test3.FindImplementationForInterfaceMember(i1E1.AddMethod)); 64103Assert.Same(i2i1E1add, test2.FindImplementationForInterfaceMember(i1E1.AddMethod)); 64114Assert.Same(i2i1E1add, test3.FindImplementationForInterfaceMember(i1E1.AddMethod)); 67526Assert.Empty(m.AddMethod.ExplicitInterfaceImplementations); 67598Assert.Same(m2.AddMethod, m1.AddMethod.ExplicitInterfaceImplementations.Single());
Symbols\InterfaceImplementationTests.cs (1)
2217var interfaceAdder = interfaceEvent.AddMethod;
Symbols\Metadata\PE\LoadingEvents.cs (6)
79CheckAccessorShape(instanceEvent.AddMethod, instanceEvent); 88CheckAccessorShape(staticEvent.AddMethod, staticEvent); 99Assert.Same(@event.AddMethod, accessor); 135Assert.NotEqual(mismatchedAddEvent.Type, mismatchedAddEvent.AddMethod.Parameters.Single().Type); 158Assert.Equal(0, noParamAddEvent.AddMethod.Parameters.Length); 446var addMethod = @event.AddMethod;
Symbols\Source\EventTests.cs (32)
88var addMethod = @event.AddMethod; 126var addMethod = @event.AddMethod; 165var addMethod = @event.AddMethod; 200var addMethod = @event.AddMethod; 326Assert.NotNull(fevent.AddMethod); 327Assert.True(fevent.AddMethod.IsImplicitlyDeclared, "FieldLikeEvent AddAccessor"); 328Assert.NotNull(fevent.AddMethod); 354Assert.Equal(1, e1.AddMethod.ParameterTypesWithAnnotations.Length); 355Assert.Equal("System.Action<dynamic>", e1.AddMethod.ParameterTypesWithAnnotations[0].ToTestDisplayString()); 360Assert.Equal(1, e2.AddMethod.ParameterTypesWithAnnotations.Length); 361Assert.Equal("System.Action<dynamic>", e2.AddMethod.ParameterTypesWithAnnotations[0].ToTestDisplayString()); 1867Assert.NotNull(event1.AddMethod); 1868Assert.Equal(Accessibility.Private, event1.AddMethod.DeclaredAccessibility); 1872Assert.NotNull(event2.AddMethod); 1873Assert.Equal(Accessibility.Protected, event2.AddMethod.DeclaredAccessibility); 1877Assert.NotNull(event3.AddMethod); 1878Assert.Equal(Accessibility.Internal, event3.AddMethod.DeclaredAccessibility); 2269Assert.Equal(baseEventType, event1.AddMethod.ParameterTypesWithAnnotations.Single().Type); 2276Assert.Equal(baseEventType, event2.AddMethod.ParameterTypesWithAnnotations.Single().Type); 2342Assert.Equal("myAdd", event1.AddMethod.Name); 2347Assert.Equal("myAdd", event2.AddMethod.Name); 2388Assert.Equal("add_E", event1.AddMethod.Name); 2393Assert.Equal("add_E", event2.AddMethod.Name); 2859AssertEx.Equal([.. compiledGeneratedAttr, "A(2)"], e.AddMethod!.GetAttributes().ToStrings()); 2860AssertEx.Equal(["A(3)"], e.AddMethod.Parameters.Single().GetAttributes().ToStrings()); 2861AssertEx.Equal([], e.AddMethod.GetReturnTypeAttributes().ToStrings()); 2869AssertEx.Equal([.. compiledGeneratedAttr, "A(2)"], f.AddMethod!.GetAttributes().ToStrings()); 2870AssertEx.Equal(["A(3)"], f.AddMethod.Parameters.Single().GetAttributes().ToStrings()); 2871AssertEx.Equal([], f.AddMethod.GetReturnTypeAttributes().ToStrings()); 2878AssertEx.Equal(["A(21)", "A(22)"], g.AddMethod!.GetAttributes().ToStrings()); 2879AssertEx.Equal(["A(23)"], g.AddMethod.Parameters.Single().GetAttributes().ToStrings()); 2880AssertEx.Equal(["A(24)"], g.AddMethod.GetReturnTypeAttributes().ToStrings());
Symbols\StaticAbstractMembersInInterfacesTests.cs (106)
2748return addAccessor ? e.AddMethod : e.RemoveMethod; 25947Assert.Same(i6m.AddMethod, ((EventSymbol)i6.FindImplementationForInterfaceMember(m)).AddMethod); 26036Assert.Same(i6m.AddMethod, ((EventSymbol)i6.FindImplementationForInterfaceMember(m)).AddMethod); 26249var m01Add = m01.AddMethod; 26264var cM01Add = cM01.AddMethod; 26344var m01Add = m01.AddMethod; 26359var cM01Add = cM01.AddMethod; 26456Assert.Same(cM01.AddMethod, c3.FindImplementationForInterfaceMember(m01.AddMethod)); 26460Assert.Same(m01.AddMethod, cM01.AddMethod.ExplicitInterfaceImplementations.Single()); 26617Assert.Same(c1M01.AddMethod, c1.FindImplementationForInterfaceMember(m01.AddMethod)); 26620Assert.Same(m01.AddMethod, c1M01.AddMethod.ExplicitInterfaceImplementations.Single()); 26625Assert.Same(c1M01.AddMethod, c2.FindImplementationForInterfaceMember(m01.AddMethod)); 26630Assert.Same(c1M01.AddMethod, c3.FindImplementationForInterfaceMember(m01.AddMethod)); 26635Assert.Same(c1M01.AddMethod, c4.FindImplementationForInterfaceMember(m01.AddMethod)); 26642Assert.Same(c2M01.AddMethod, c5.FindImplementationForInterfaceMember(m01.AddMethod)); 26718Assert.Same(m01.AddMethod, c1.FindImplementationForInterfaceMember(m01.AddMethod)); 26719Assert.Same(m01.AddMethod, i1.FindImplementationForInterfaceMember(m01.AddMethod)); 26757Assert.Same(c1m01.AddMethod, c1.FindImplementationForInterfaceMember(m01.AddMethod)); 26758Assert.Same(m01.AddMethod, i1.FindImplementationForInterfaceMember(m01.AddMethod)); 26785Assert.Same(c1m01.AddMethod, c.FindImplementationForInterfaceMember(m01.AddMethod)); 26841Assert.Null(c1.FindImplementationForInterfaceMember(m01.AddMethod)); 26842Assert.Null(i1.FindImplementationForInterfaceMember(m01.AddMethod)); 26870Assert.Same(c1M01.AddMethod, c1.FindImplementationForInterfaceMember(m01.AddMethod)); 26873Assert.Same(m01.AddMethod, c1M01.AddMethod.ExplicitInterfaceImplementations.Single()); 26894var m01Add = m01.AddMethod; 26907var cM01Add = cM01.AddMethod; 26968Assert.Same(c1M01.AddMethod, c1.FindImplementationForInterfaceMember(m01.AddMethod)); 26971Assert.Same(m01.AddMethod, c1M01.AddMethod.ExplicitInterfaceImplementations.Single()); 26998Assert.Same(c1M01.AddMethod, c1.FindImplementationForInterfaceMember(m01.AddMethod)); 27028Assert.Null(c1.FindImplementationForInterfaceMember(m01.AddMethod)); 27058Assert.Null(c1.FindImplementationForInterfaceMember(m01.AddMethod)); 27117Assert.Same(m01.AddMethod, c1.FindImplementationForInterfaceMember(m01.AddMethod)); 27118Assert.Same(m01.AddMethod, i1.FindImplementationForInterfaceMember(m01.AddMethod)); 27145Assert.Same(m01.AddMethod, c1.FindImplementationForInterfaceMember(m01.AddMethod)); 27194var cM01Add = cM01.AddMethod; 27206Assert.Same(cM01Add, c.FindImplementationForInterfaceMember(m01.AddMethod)); 27212Assert.Same(m01.AddMethod, cM01Add.ExplicitInterfaceImplementations.Single()); 27243Assert.Same(c1M01.AddMethod, c1.FindImplementationForInterfaceMember(m01.AddMethod)); 27246Assert.Same(m01.AddMethod, c1M01.AddMethod.ExplicitInterfaceImplementations.Single()); 27273Assert.Same(m01.AddMethod, c1.FindImplementationForInterfaceMember(m01.AddMethod)); 27302Assert.Same(c1M01.AddMethod, c1.FindImplementationForInterfaceMember(m01.AddMethod)); 27332Assert.Same(c1M01.AddMethod, c1.FindImplementationForInterfaceMember(m01.AddMethod)); 27335Assert.Same(m01.AddMethod, c1M01.AddMethod.ExplicitInterfaceImplementations.Single()); 27418Assert.Same(i2M01.AddMethod, c1.FindImplementationForInterfaceMember(m01.AddMethod)); 27419Assert.Same(i2M01.AddMethod, i2.FindImplementationForInterfaceMember(m01.AddMethod)); 27424Assert.Same(m01.AddMethod, i2M01.AddMethod.ExplicitInterfaceImplementations.Single()); 27464var c2M01Add = (MethodSymbol)c2.FindImplementationForInterfaceMember(m01.AddMethod); 27487Assert.Same(m01.AddMethod, c2M01Add.ExplicitInterfaceImplementations.Single()); 27499var c1M01Add = c1M01.AddMethod; 27541Assert.Same(c2M01.AddMethod, c2M01Add); 27665var c1M01Add = c1M01.AddMethod; 27698c1M01Add = (MethodSymbol)c1.FindImplementationForInterfaceMember(m01.AddMethod); 27701Assert.Same(m01.AddMethod, c1M01Add.ExplicitInterfaceImplementations.Single()); 27728Assert.Same(c1M01Add, c1.FindImplementationForInterfaceMember(m01.AddMethod)); 27735var c2M01Add = c2M01.AddMethod; 27754Assert.Same(m01.AddMethod, c2M01Add.ExplicitInterfaceImplementations.Single()); 27755Assert.Same(c2M01Add, c2.FindImplementationForInterfaceMember(m01.AddMethod)); 27776var c3M02Add = c3M02.AddMethod; 27809c3M02Add = (MethodSymbol)c3.FindImplementationForInterfaceMember(m02.AddMethod); 27812Assert.Same(m02.AddMethod, c3M02Add.ExplicitInterfaceImplementations.Single()); 27839Assert.Same(c3M02Add, c3.FindImplementationForInterfaceMember(m02.AddMethod)); 27846var c4M02Add = c4M02.AddMethod; 27868Assert.Same(m02.AddMethod, c4M02Add.ExplicitInterfaceImplementations.Single()); 27869Assert.Same(c4M02Add, c4.FindImplementationForInterfaceMember(m02.AddMethod)); 28001var c1M01Add = c1M01.AddMethod; 28023var c2M01Add = c3.FindImplementationForInterfaceMember(m01.AddMethod); 28035Assert.Same(c1M01.AddMethod, c3.FindImplementationForInterfaceMember(m01.AddMethod)); 28044Assert.Same(c2M02.AddMethod, c3.FindImplementationForInterfaceMember(m02.AddMethod)); 28124var c2M01Add = c2M01.AddMethod; 28155var c3M01Add = (MethodSymbol)c3.FindImplementationForInterfaceMember(m01.AddMethod); 28157Assert.Same(m01.AddMethod, c3M01Add.ExplicitInterfaceImplementations.Single()); 28166Assert.Same(c2M01Add, c3.FindImplementationForInterfaceMember(m01.AddMethod));
Microsoft.CodeAnalysis.CSharp.Test.Utilities (2)
LifetimeAnnotationAttributesVisitor.cs (1)
63Visit(@event.AddMethod);
TestAttributesVisitor.cs (1)
63Visit(@event.AddMethod);
Microsoft.CodeAnalysis.CSharp.WinRT.UnitTests (4)
Metadata\WinMdEventTests.cs (4)
3506Assert.False(instanceEvent.AddMethod.IsStatic); 3511Assert.True(staticEvent.AddMethod.IsStatic); 3579var addMethod = @event.AddMethod; 3610var addMethod = @event.AddMethod;