4 overrides of RemoveMethod
Microsoft.CodeAnalysis.CSharp (4)
Symbols\Metadata\PE\PEEventSymbol.cs (1)
342
public override MethodSymbol
RemoveMethod
Symbols\Retargeting\RetargetingEventSymbol.cs (1)
67
public override MethodSymbol?
RemoveMethod
Symbols\Source\SourceEventSymbol.cs (1)
92
public abstract override MethodSymbol?
RemoveMethod
{ get; }
Symbols\SubstitutedEventSymbol.cs (1)
68
public override MethodSymbol?
RemoveMethod
385 references to RemoveMethod
Microsoft.CodeAnalysis.CSharp (24)
Binder\Binder_Expressions.cs (2)
9398
(eventSymbol.
RemoveMethod
is null || eventSymbol.
RemoveMethod
.CallerUnsafeMode == eventSymbol.CallerUnsafeMode));
Binder\Binder_Lookup.cs (1)
1610
method2 = @event.
RemoveMethod
;
Binder\Binder_Operators.cs (1)
716
MethodSymbol method = isAddition ? eventSymbol.AddMethod : eventSymbol.
RemoveMethod
;
Compilation\CSharpSemanticModel.cs (1)
3512
var methodSymbol = eventAssignment.IsAddition ? eventSymbol.AddMethod : eventSymbol.
RemoveMethod
;
Emitter\Model\EventSymbolAdapter.cs (2)
38
var removeMethod = AdaptedEventSymbol.
RemoveMethod
?.GetCciAdapter();
62
var removeMethod = AdaptedEventSymbol.
RemoveMethod
?.GetCciAdapter();
Emitter\NoPia\EmbeddedTypesManager.cs (1)
625
var removeMethod = @event.AdaptedEventSymbol.
RemoveMethod
?.GetCciAdapter();
Lowering\LocalRewriter\LocalRewriter_Event.cs (2)
56
MethodSymbol? method = node.IsAddition ? node.Event.AddMethod : node.Event.
RemoveMethod
;
109
methodOpt: eventSymbol.
RemoveMethod
,
Symbols\EventSymbol.cs (1)
163
MethodSymbol? accessor = AddMethod ??
RemoveMethod
;
Symbols\MemberSymbolExtensions.cs (2)
385
return isImplementableAndNotPublic(eventSymbol.AddMethod) || isImplementableAndNotPublic(eventSymbol.
RemoveMethod
);
767
MethodSymbol removeMethod = @event.
RemoveMethod
;
Symbols\OverriddenOrHiddenMembersHelpers.cs (1)
352
MethodSymbol correspondingAccessor = accessorIsAdder ? eventHiddenByEvent.AddMethod : eventHiddenByEvent.
RemoveMethod
;
Symbols\PublicModel\EventSymbol.cs (1)
52
return _underlying.
RemoveMethod
.GetPublicSymbol();
Symbols\Retargeting\RetargetingEventSymbol.cs (2)
71
return (object?)_underlyingEvent.
RemoveMethod
== null
73
: this.RetargetingTranslator.Retarget(_underlyingEvent.
RemoveMethod
);
Symbols\Source\ExplicitInterfaceHelpers.cs (1)
361
checkAccessorIsAccessibleIfImplementable(eventSymbol.
RemoveMethod
);
Symbols\Source\SourceEventAccessorSymbol.cs (1)
60
MethodSymbol implementedAccessor = isAdder ? explicitlyImplementedEventOpt.AddMethod : explicitlyImplementedEventOpt.
RemoveMethod
;
Symbols\Source\SourceEventSymbol.cs (1)
885
CheckExplicitImplementationAccessor(RemoveMethod, explicitlyImplementedEvent.
RemoveMethod
, explicitlyImplementedEvent, diagnostics);
Symbols\Source\SourceMemberContainerSymbol.cs (1)
4517
var locationFrom = (Symbol?)(isAdder ? propertySymbol.AddMethod : propertySymbol.
RemoveMethod
) ?? propertySymbol;
Symbols\Source\SourceMemberContainerSymbol_ImplementationChecks.cs (1)
629
var removeMethod = @event.
RemoveMethod
;
Symbols\SubstitutedEventSymbol.cs (1)
72
MethodSymbol? originalRemoveMethod = OriginalDefinition.
RemoveMethod
;
Symbols\TypeSymbol.cs (1)
1424
interfaceAccessor2 = interfaceEvent.
RemoveMethod
;
Microsoft.CodeAnalysis.CSharp.Emit.UnitTests (11)
CodeGen\CodeGenReadonlyStructTests.cs (3)
1613
verifyReadOnly(s1.GetEvent("E").
RemoveMethod
, true, RefKind.RefReadOnly);
1627
verifyReadOnly(s2.GetEvent("E").
RemoveMethod
, true, RefKind.RefReadOnly);
2627
Assert.True(peModule.Module.HasIsReadOnlyAttribute(((PEMethodSymbol)testStruct.GetEvent("E").
RemoveMethod
).Handle));
CodeGen\CodeGenTupleTest.cs (5)
13277
Assert.True(m10I1E1.
RemoveMethod
.IsExplicitInterfaceImplementation);
13278
Assert.Equal("void I1.E1.remove", m10I1E1.
RemoveMethod
.ExplicitInterfaceImplementations.Single().ToTestDisplayString());
16063
Assert.True(m1E1Remove.Equals(m1E1.
RemoveMethod
, TypeCompareKind.ConsiderEverything));
16095
Assert.NotSame(m1E2Remove, m1E2.
RemoveMethod
);
16096
Assert.True(m1E2Remove.Equals(m1E2.
RemoveMethod
, TypeCompareKind.ConsiderEverything));
CodeGen\EventTests.cs (3)
221
var removeMethod = @event.
RemoveMethod
;
721
var removeMethod = @event.
RemoveMethod
;
793
var removeMethod = @event.
RemoveMethod
;
Microsoft.CodeAnalysis.CSharp.Emit3.UnitTests (37)
Attributes\AttributeTests.cs (10)
2636
AssertEx.SetEqual(accessorsExpected, GetAttributeNames(event1.
RemoveMethod
.GetAttributes()));
2646
AssertEx.SetEqual(accessorsExpected, GetAttributeNames(event2.
RemoveMethod
.GetAttributes()));
2655
AssertEx.SetEqual(accessorsExpected.Concat(new[] { "CC" }), GetAttributeNames(event3.
RemoveMethod
.GetAttributes()));
2664
AssertEx.SetEqual(accessorsExpected, GetAttributeNames(event4.
RemoveMethod
.GetAttributes()));
2673
AssertNoAttributes(event5.
RemoveMethod
);
2677
AssertNoAttributes(event6.
RemoveMethod
);
2681
AssertNoAttributes(event7.
RemoveMethod
);
2685
AssertNoAttributes(event8.
RemoveMethod
);
2689
AssertNoAttributes(event9.
RemoveMethod
);
2694
AssertNoAttributes(event10.
RemoveMethod
);
Attributes\AttributeTests_Conditional.cs (1)
181
attributesArrayBuilder.Add(eventE.
RemoveMethod
.GetAttributes());
Attributes\AttributeTests_Synthesized.cs (1)
253
Assert.Equal("CompilerGeneratedAttribute", peModule.GetCustomAttributesForToken(((PEMethodSymbol)e.
RemoveMethod
).Handle).Single().AttributeClass.Name);
OverloadResolutionPriorityTests.cs (1)
1651
Assert.Equal(0, indexer!.
RemoveMethod
!.OverloadResolutionPriority);
PartialEventsAndConstructorsTests.cs (24)
1140
validateAccessor(e.
RemoveMethod
!);
1298
validateAccessor(e.
RemoveMethod
!);
1752
Assert.True(ev.PartialImplementationPart!.
RemoveMethod
!.GetPublicSymbol().IsExtern);
1776
Assert.False(ev.
RemoveMethod
!.GetPublicSymbol().IsExtern);
1883
verifyAccessor(e.
RemoveMethod
!, "remove_E", "remove_E");
1891
verifyAccessor(eImpl.
RemoveMethod
!, "remove_E", "remove_E");
1963
Assert.False(ev.
RemoveMethod
!.GetPublicSymbol().IsExtern);
1964
Assert.Null(ev.
RemoveMethod
!.GetDllImportData());
1965
Assert.Equal(MethodImplAttributes.InternalCall, ev.
RemoveMethod
.ImplementationAttributes);
1966
Assert.False(ev.
RemoveMethod
.ImplementationAttributes.HasFlag(MethodImplAttributes.Synchronized));
2083
Assert.True(e.
RemoveMethod
!.ImplementationAttributes.HasFlag(MethodImplAttributes.Synchronized));
2144
var removeMethod = e.
RemoveMethod
!;
3567
AssertEx.Equal(["A(4)", "A(14)"], e.
RemoveMethod
!.GetAttributes().ToStrings());
3568
AssertEx.Equal(["A(24)"], e.
RemoveMethod
.Parameters.Single().GetAttributes().ToStrings());
3569
AssertEx.Equal(["A(34)"], e.
RemoveMethod
.GetReturnTypeAttributes().ToStrings());
3578
AssertEx.Equal(["A(4)", "A(14)"], eImpl.
RemoveMethod
!.GetAttributes().ToStrings());
3579
AssertEx.Equal(["A(24)"], eImpl.
RemoveMethod
.Parameters.Single().GetAttributes().ToStrings());
3580
AssertEx.Equal(["A(34)"], eImpl.
RemoveMethod
.GetReturnTypeAttributes().ToStrings());
3588
AssertEx.Equal([.. compiledGeneratedAttr, "A(11)", "A(12)"], f.
RemoveMethod
!.GetAttributes().ToStrings());
3589
AssertEx.Equal(["A(22)", "A(21)"], f.
RemoveMethod
.Parameters.Single().GetAttributes().ToStrings());
3590
AssertEx.Equal([], f.
RemoveMethod
.GetReturnTypeAttributes().ToStrings());
3599
AssertEx.Equal([.. compiledGeneratedAttr, "A(11)", "A(12)"], fImpl.
RemoveMethod
!.GetAttributes().ToStrings());
3600
AssertEx.Equal(["A(22)", "A(21)"], fImpl.
RemoveMethod
.Parameters.Single().GetAttributes().ToStrings());
3601
AssertEx.Equal([], fImpl.
RemoveMethod
.GetReturnTypeAttributes().ToStrings());
Microsoft.CodeAnalysis.CSharp.Semantic.UnitTests (7)
Semantics\InheritanceBindingTests.cs (3)
6651
Assert.Equal(classEvent.
RemoveMethod
, @class.FindImplementationForInterfaceMember(interfaceEvent.
RemoveMethod
));
6654
Assert.True(classEvent.
RemoveMethod
.IsMetadataVirtual());
Semantics\InitOnlyMemberTests.cs (1)
2454
Assert.False(eventSymbol.
RemoveMethod
.IsInitOnly);
Semantics\NullableReferenceTypesTests.cs (3)
12352
Assert.True(ev.TypeWithAnnotations.Equals(ev.
RemoveMethod
.Parameters.Last().TypeWithAnnotations, TypeCompareKind.ConsiderEverything));
12720
Assert.True(ev.TypeWithAnnotations.Equals(ev.
RemoveMethod
.Parameters.Last().TypeWithAnnotations, TypeCompareKind.ConsiderEverything));
12808
Assert.True(ev.TypeWithAnnotations.Equals(ev.
RemoveMethod
.Parameters.Last().TypeWithAnnotations, TypeCompareKind.ConsiderEverything));
Microsoft.CodeAnalysis.CSharp.Symbol.UnitTests (300)
DocumentationComments\EventDocumentationCommentTests.cs (2)
44
Assert.Equal("M:Acme.Widget.remove_E(System.Action)", eventSymbol.
RemoveMethod
.GetDocumentationCommentId());
53
Assert.Equal("M:Acme.Widget.remove_F(System.Action)", eventSymbol.
RemoveMethod
.GetDocumentationCommentId());
SymbolDisplay\SymbolDisplayTests.cs (1)
5018
eventSymbol.
RemoveMethod
.ToDisplayParts(format),
Symbols\CovariantReturnTests.cs (2)
334
if (eventSymbol.
RemoveMethod
is MethodSymbol removeMethod && overriddenEvent.
RemoveMethod
is MethodSymbol overriddenRemoveMethod)
Symbols\CSharpCompilerFeatureRequiredTests.cs (2)
193
Assert.False(onEventAdderEvent.
RemoveMethod
!.HasUnsupportedMetadata);
200
Assert.True(onEventRemoverEvent.
RemoveMethod
!.HasUnsupportedMetadata);
Symbols\DefaultInterfaceImplementationTests.cs (151)
6430
var rmvE1 = e1.
RemoveMethod
;
6522
var rmvP1 = e1.
RemoveMethod
;
7024
Assert.Same(e7.
RemoveMethod
, derived.FindImplementationForInterfaceMember(e7.
RemoveMethod
));
7025
Assert.Same(e8.
RemoveMethod
, derived.FindImplementationForInterfaceMember(e8.
RemoveMethod
));
7200
Assert.Equal("void Test.I1.E7.remove", derived.FindImplementationForInterfaceMember(e7.
RemoveMethod
).ToTestDisplayString());
7201
Assert.Equal("void Test.I1.E8.remove", derived.FindImplementationForInterfaceMember(e8.
RemoveMethod
).ToTestDisplayString());
7307
Assert.Equal("void Test.E7.remove", derived.FindImplementationForInterfaceMember(e7.
RemoveMethod
).ToTestDisplayString());
7308
Assert.Equal("void Test.E8.remove", derived.FindImplementationForInterfaceMember(e8.
RemoveMethod
).ToTestDisplayString());
7428
Assert.True(e7.
RemoveMethod
.IsVirtual);
7431
Assert.True(e7.
RemoveMethod
.IsMetadataVirtual());
7434
Assert.False(e7.
RemoveMethod
.IsAbstract);
7437
Assert.Same(e7.
RemoveMethod
, derived.FindImplementationForInterfaceMember(e7.
RemoveMethod
));
7550
Assert.Null(test2.FindImplementationForInterfaceMember(e7.
RemoveMethod
));
7825
Assert.False(e7.
RemoveMethod
.IsVirtual);
7828
Assert.False(e7.
RemoveMethod
.IsMetadataVirtual());
7831
Assert.False(e7.
RemoveMethod
.IsAbstract);
7834
Assert.True(e7.
RemoveMethod
.IsStatic);
7837
Assert.Null(derived.FindImplementationForInterfaceMember(e7.
RemoveMethod
));
27119
ValidateP01Accessor(p01.
RemoveMethod
);
27155
var p03set = p03.
RemoveMethod
;
27197
var p05set = p05.
RemoveMethod
;
27239
var p07set = p07.
RemoveMethod
;
27281
var p09set = p09.
RemoveMethod
;
27335
ValidateP11Accessor(p11.
RemoveMethod
);
27361
ValidateP14Accessor(p14.
RemoveMethod
);
28019
ValidateAccessor(p1.
RemoveMethod
, test1P1.
RemoveMethod
);
28092
ValidateAccessor(p1.
RemoveMethod
);
28195
ValidateAccessor(p1.
RemoveMethod
);
28407
ValidateAccessor1(p1.
RemoveMethod
);
28434
ValidateAccessor2(p2.
RemoveMethod
);
28461
ValidateAccessor3(p3.
RemoveMethod
);
28568
ValidateAccessor(p1.
RemoveMethod
);
28664
ValidateP1Accessor(p1.
RemoveMethod
);
28691
ValidateP2Accessor(p2.
RemoveMethod
);
28718
ValidateP3Accessor(p3.
RemoveMethod
);
28745
ValidateP4Accessor(p4.
RemoveMethod
);
28860
var p1remove = p1.
RemoveMethod
;
28867
Assert.Same(test1P1.
RemoveMethod
, test1.FindImplementationForInterfaceMember(p1remove));
28905
ValidateMethod(p1.
RemoveMethod
);
28961
Assert.Null(test2.FindImplementationForInterfaceMember(p1.
RemoveMethod
));
29103
var p1Remove = p1.
RemoveMethod
;
29108
Assert.Same(test1P1.
RemoveMethod
, test1.FindImplementationForInterfaceMember(p1Remove));
29111
Assert.True(test1P1.
RemoveMethod
.IsMetadataVirtual());
29930
Assert.Null(test1.FindImplementationForInterfaceMember(p1.
RemoveMethod
));
30017
ValidateAccessor(p1.
RemoveMethod
);
30133
Validate1(p1.
RemoveMethod
);
30163
Validate2(p2.
RemoveMethod
);
30193
Validate3(p3.
RemoveMethod
);
30439
ValidateAccessor(p2.
RemoveMethod
, test1P2.
RemoveMethod
);
30444
Assert.Null(p2.
RemoveMethod
);
30449
ValidateAccessor(p2.
RemoveMethod
, test1P2.
RemoveMethod
);
30546
ValidateP1Accessor(p1.
RemoveMethod
, test2P1.
RemoveMethod
);
30576
ValidateP2Accessor(p2.
RemoveMethod
, test2P2.
RemoveMethod
);
30606
ValidateP3Accessor(p3.
RemoveMethod
);
30635
ValidateP4Accessor(p4.
RemoveMethod
);
30664
ValidateP5Accessor(p5.
RemoveMethod
);
30867
ValidateP1Accessor(p1.
RemoveMethod
, test2P1.
RemoveMethod
);
30897
ValidateP2Accessor(p2.
RemoveMethod
, test2P2.
RemoveMethod
);
30927
ValidateP3Accessor(p3.
RemoveMethod
);
30956
ValidateP4Accessor(p4.
RemoveMethod
);
31088
ValidateP1Accessor(p1.
RemoveMethod
, test2P1.
RemoveMethod
);
31118
ValidateP2Accessor(p2.
RemoveMethod
, test2P2.
RemoveMethod
);
31148
ValidateP3Accessor(p3.
RemoveMethod
);
31178
ValidateP4Accessor(p4.
RemoveMethod
);
31207
ValidateP5Accessor(p5.
RemoveMethod
);
31288
var p1remove = p1.
RemoveMethod
;
31334
ValidateMethod(p1.
RemoveMethod
);
31649
ValidateAccessor(p1.
RemoveMethod
);
40525
ValidateAccessor(expected?.
RemoveMethod
, interfaceEvent.
RemoveMethod
);
40544
ValidateAccessor(expected?.
RemoveMethod
, interfaceEvent.
RemoveMethod
);
40570
ValidateAccessor(m1.
RemoveMethod
, isAbstract);
58352
Assert.Same(i1p1.
RemoveMethod
, i2p1.
RemoveMethod
.ExplicitInterfaceImplementations.Single());
58353
Assert.Null(i2.FindImplementationForInterfaceMember(i1p1.
RemoveMethod
));
58354
Assert.Null(test1.FindImplementationForInterfaceMember(i1p1.
RemoveMethod
));
58373
if (reabstracting.
RemoveMethod
is object)
58375
ValidateReabstraction(reabstracting.
RemoveMethod
, isStatic);
58530
Assert.Null(i2.FindImplementationForInterfaceMember(i1p1.
RemoveMethod
));
58531
Assert.Same(test12p1.
RemoveMethod
, test1.FindImplementationForInterfaceMember(i1p1.
RemoveMethod
));
58678
Assert.Null(i3.FindImplementationForInterfaceMember(i1p1.
RemoveMethod
));
58679
Assert.Null(test1.FindImplementationForInterfaceMember(i1p1.
RemoveMethod
));
58838
Assert.Same(i3p1.
RemoveMethod
, i3.FindImplementationForInterfaceMember(i1p1.
RemoveMethod
));
58839
Assert.Same(i3p1.
RemoveMethod
, test1.FindImplementationForInterfaceMember(i1p1.
RemoveMethod
));
58985
Assert.Null(test1.FindImplementationForInterfaceMember(i1p1.
RemoveMethod
));
59140
Assert.Null(i4.FindImplementationForInterfaceMember(i1p1.
RemoveMethod
));
59141
Assert.Null(test1.FindImplementationForInterfaceMember(i1p1.
RemoveMethod
));
59270
Assert.Same(i4p1.
RemoveMethod
, i4.FindImplementationForInterfaceMember(i1p1.
RemoveMethod
));
59271
Assert.Same(i4p1.
RemoveMethod
, test1.FindImplementationForInterfaceMember(i1p1.
RemoveMethod
));
59355
if (i1p1.
RemoveMethod
is object)
59357
if (i2p1.
RemoveMethod
is object)
59359
Assert.Same(i1p1.
RemoveMethod
, i2p1.
RemoveMethod
.ExplicitInterfaceImplementations.Single());
59362
Assert.Null(i2.FindImplementationForInterfaceMember(i1p1.
RemoveMethod
));
59363
Assert.Null(test1.FindImplementationForInterfaceMember(i1p1.
RemoveMethod
));
59365
else if (i2p1.
RemoveMethod
is object)
59367
Assert.Empty(i2p1.
RemoveMethod
.ExplicitInterfaceImplementations);
59546
var c2p1Remove = c2p1.
RemoveMethod
;
59553
Assert.Same(i1p1.
RemoveMethod
, c2p1Remove.ExplicitInterfaceImplementations.Single());
59554
Assert.Same(c2p1Remove, c2.FindImplementationForInterfaceMember(i1p1.
RemoveMethod
));
59558
Assert.Null(c2.FindImplementationForInterfaceMember(i1p1.
RemoveMethod
));
60116
Assert.Same(i1p1.
RemoveMethod
, i2p1.
RemoveMethod
.ExplicitInterfaceImplementations.Single());
60117
Assert.Null(i2.FindImplementationForInterfaceMember(i1p1.
RemoveMethod
));
60118
Assert.Null(test1.FindImplementationForInterfaceMember(i1p1.
RemoveMethod
));
60169
Assert.Empty(i2p1.
RemoveMethod
.ExplicitInterfaceImplementations);
63570
Assert.Same(i1Normal.
RemoveMethod
, i1.FindImplementationForInterfaceMember(baseInterfaceNormal.
RemoveMethod
));
63573
Assert.Same(i1WinRT.
RemoveMethod
, i1.FindImplementationForInterfaceMember(baseInterfaceWinRT.
RemoveMethod
));
63577
Assert.Same(i1Normal.
RemoveMethod
, c1.FindImplementationForInterfaceMember(baseInterfaceNormal.
RemoveMethod
));
63580
Assert.Same(i1WinRT.
RemoveMethod
, c1.FindImplementationForInterfaceMember(baseInterfaceWinRT.
RemoveMethod
));
63583
Assert.Equal("void I1.Interface<System.Int32>.Normal.remove", i1Normal.
RemoveMethod
.ToTestDisplayString());
63585
Assert.Equal("void I1.Interface<System.Int32>.WinRT.remove", i1WinRT.
RemoveMethod
.ToTestDisplayString());
63632
Assert.Same(i1WinRT.
RemoveMethod
, c1.FindImplementationForInterfaceMember(i1WinRT.
RemoveMethod
));
63635
Assert.Equal("void I1.WinRT.remove", i1WinRT.
RemoveMethod
.ToTestDisplayString());
63692
Assert.Same(i1WinRT.
RemoveMethod
, i1.FindImplementationForInterfaceMember(baseInterfaceWinRT.
RemoveMethod
));
63696
Assert.Same(i1WinRT.
RemoveMethod
, c1.FindImplementationForInterfaceMember(baseInterfaceWinRT.
RemoveMethod
));
63699
Assert.Equal("void I1.Interface.WinRT.remove", i1WinRT.
RemoveMethod
.ToTestDisplayString());
64002
Assert.Same(i2i1E1remove, test2.FindImplementationForInterfaceMember(i1E1.
RemoveMethod
));
64013
Assert.Same(c1i1E1remove, test1.FindImplementationForInterfaceMember(i1E1.
RemoveMethod
));
64024
Assert.Same(c1i1E1remove, test4.FindImplementationForInterfaceMember(i1E1.
RemoveMethod
));
64035
Assert.Same(i2i1E1remove, test3.FindImplementationForInterfaceMember(i1E1.
RemoveMethod
));
64937
Assert.Same(i2i1E1remove, test2.FindImplementationForInterfaceMember(i1E1.
RemoveMethod
));
64948
Assert.Same(i2i1E1remove, test3.FindImplementationForInterfaceMember(i1E1.
RemoveMethod
));
68360
Assert.Empty(m.
RemoveMethod
.ExplicitInterfaceImplementations);
68432
Assert.Same(m2.
RemoveMethod
, m1.
RemoveMethod
.ExplicitInterfaceImplementations.Single());
Symbols\Metadata\PE\LoadingEvents.cs (6)
80
CheckAccessorShape(instanceEvent.
RemoveMethod
, instanceEvent);
89
CheckAccessorShape(staticEvent.
RemoveMethod
, staticEvent);
102
Assert.Same(@event.
RemoveMethod
, accessor);
138
Assert.NotEqual(mismatchedRemoveEvent.Type, mismatchedRemoveEvent.
RemoveMethod
.Parameters.Single().Type);
161
Assert.Equal(0, noParamRemoveEvent.
RemoveMethod
.Parameters.Length);
447
var removeMethod = @event.
RemoveMethod
;
Symbols\Source\EventTests.cs (30)
93
var removeMethod = @event.
RemoveMethod
;
131
var removeMethod = @event.
RemoveMethod
;
170
var removeMethod = @event.
RemoveMethod
;
205
var removeMethod = @event.
RemoveMethod
;
329
Assert.True(fevent.
RemoveMethod
.IsImplicitlyDeclared, "FieldLikeEvent RemoveAccessor");
357
Assert.Equal(1, e1.
RemoveMethod
.ParameterTypesWithAnnotations.Length);
358
Assert.Equal("System.Action<dynamic>", e1.
RemoveMethod
.ParameterTypesWithAnnotations[0].ToTestDisplayString());
363
Assert.Equal(1, e2.
RemoveMethod
.ParameterTypesWithAnnotations.Length);
364
Assert.Equal("System.Action<dynamic>", e2.
RemoveMethod
.ParameterTypesWithAnnotations[0].ToTestDisplayString());
1869
Assert.NotNull(event1.
RemoveMethod
);
1870
Assert.Equal(Accessibility.Public, event1.
RemoveMethod
.DeclaredAccessibility);
1874
Assert.NotNull(event2.
RemoveMethod
);
1875
Assert.Equal(Accessibility.Public, event2.
RemoveMethod
.DeclaredAccessibility);
1879
Assert.NotNull(event3.
RemoveMethod
);
1880
Assert.Equal(Accessibility.Public, event3.
RemoveMethod
.DeclaredAccessibility);
2270
Assert.Equal(baseEventType, event1.
RemoveMethod
.ParameterTypesWithAnnotations.Single().Type);
2277
Assert.Equal(baseEventType, event2.
RemoveMethod
.ParameterTypesWithAnnotations.Single().Type);
2343
Assert.Equal("myRemove", event1.
RemoveMethod
.Name);
2348
Assert.Equal("myRemove", event2.
RemoveMethod
.Name);
2389
Assert.Equal("remove_E", event1.
RemoveMethod
.Name);
2394
Assert.Equal("remove_E", event2.
RemoveMethod
.Name);
2862
AssertEx.Equal([.. compiledGeneratedAttr, "A(2)"], e.
RemoveMethod
!.GetAttributes().ToStrings());
2863
AssertEx.Equal(["A(3)"], e.
RemoveMethod
.Parameters.Single().GetAttributes().ToStrings());
2864
AssertEx.Equal([], e.
RemoveMethod
.GetReturnTypeAttributes().ToStrings());
2872
AssertEx.Equal([.. compiledGeneratedAttr, "A(2)"], f.
RemoveMethod
!.GetAttributes().ToStrings());
2873
AssertEx.Equal(["A(3)"], f.
RemoveMethod
.Parameters.Single().GetAttributes().ToStrings());
2874
AssertEx.Equal([], f.
RemoveMethod
.GetReturnTypeAttributes().ToStrings());
2881
AssertEx.Equal(["A(31)", "A(32)"], g.
RemoveMethod
!.GetAttributes().ToStrings());
2882
AssertEx.Equal(["A(33)"], g.
RemoveMethod
.Parameters.Single().GetAttributes().ToStrings());
2883
AssertEx.Equal(["A(34)"], g.
RemoveMethod
.GetReturnTypeAttributes().ToStrings());
Symbols\StaticAbstractMembersInInterfacesTests.cs (106)
2748
return addAccessor ? e.AddMethod : e.
RemoveMethod
;
25870
Assert.Same(i6m.
RemoveMethod
, ((EventSymbol)i6.FindImplementationForInterfaceMember(m)).
RemoveMethod
);
25959
Assert.Same(i6m.
RemoveMethod
, ((EventSymbol)i6.FindImplementationForInterfaceMember(m)).
RemoveMethod
);
26172
var m01Remove = m01.
RemoveMethod
;
26201
var cM01Remove = cM01.
RemoveMethod
;
26267
var m01Remove = m01.
RemoveMethod
;
26296
var cM01Remove = cM01.
RemoveMethod
;
26379
Assert.Same(cM01.
RemoveMethod
, c3.FindImplementationForInterfaceMember(m01.
RemoveMethod
));
26383
Assert.Same(m01.
RemoveMethod
, cM01.
RemoveMethod
.ExplicitInterfaceImplementations.Single());
26540
Assert.Same(c1M01.
RemoveMethod
, c1.FindImplementationForInterfaceMember(m01.
RemoveMethod
));
26543
Assert.Same(m01.
RemoveMethod
, c1M01.
RemoveMethod
.ExplicitInterfaceImplementations.Single());
26548
Assert.Same(c1M01.
RemoveMethod
, c2.FindImplementationForInterfaceMember(m01.
RemoveMethod
));
26553
Assert.Same(c1M01.
RemoveMethod
, c3.FindImplementationForInterfaceMember(m01.
RemoveMethod
));
26558
Assert.Same(c1M01.
RemoveMethod
, c4.FindImplementationForInterfaceMember(m01.
RemoveMethod
));
26565
Assert.Same(c2M01.
RemoveMethod
, c5.FindImplementationForInterfaceMember(m01.
RemoveMethod
));
26642
Assert.Same(m01.
RemoveMethod
, c1.FindImplementationForInterfaceMember(m01.
RemoveMethod
));
26643
Assert.Same(m01.
RemoveMethod
, i1.FindImplementationForInterfaceMember(m01.
RemoveMethod
));
26681
Assert.Same(c1m01.
RemoveMethod
, c1.FindImplementationForInterfaceMember(m01.
RemoveMethod
));
26682
Assert.Same(m01.
RemoveMethod
, i1.FindImplementationForInterfaceMember(m01.
RemoveMethod
));
26708
Assert.Same(c1m01.
RemoveMethod
, c.FindImplementationForInterfaceMember(m01.
RemoveMethod
));
26765
Assert.Same(m01.
RemoveMethod
, c1.FindImplementationForInterfaceMember(m01.
RemoveMethod
));
26766
Assert.Same(m01.
RemoveMethod
, i1.FindImplementationForInterfaceMember(m01.
RemoveMethod
));
26793
Assert.Same(m01.
RemoveMethod
, c1.FindImplementationForInterfaceMember(m01.
RemoveMethod
));
26842
var cM01Remove = cM01.
RemoveMethod
;
26854
Assert.Same(cM01Remove, c.FindImplementationForInterfaceMember(m01.
RemoveMethod
));
26860
Assert.Same(m01.
RemoveMethod
, cM01Remove.ExplicitInterfaceImplementations.Single());
26891
Assert.Same(c1M01.
RemoveMethod
, c1.FindImplementationForInterfaceMember(m01.
RemoveMethod
));
26894
Assert.Same(m01.
RemoveMethod
, c1M01.
RemoveMethod
.ExplicitInterfaceImplementations.Single());
26921
Assert.Same(m01.
RemoveMethod
, c1.FindImplementationForInterfaceMember(m01.
RemoveMethod
));
26951
Assert.Same(c1M01.
RemoveMethod
, c1.FindImplementationForInterfaceMember(m01.
RemoveMethod
));
26981
Assert.Same(c1M01.
RemoveMethod
, c1.FindImplementationForInterfaceMember(m01.
RemoveMethod
));
26983
Assert.Same(m01.
RemoveMethod
, c1M01.
RemoveMethod
.ExplicitInterfaceImplementations.Single());
27037
Assert.Null(c1.FindImplementationForInterfaceMember(m01.
RemoveMethod
));
27038
Assert.Null(i1.FindImplementationForInterfaceMember(m01.
RemoveMethod
));
27066
Assert.Same(c1M01.
RemoveMethod
, c1.FindImplementationForInterfaceMember(m01.
RemoveMethod
));
27069
Assert.Same(m01.
RemoveMethod
, c1M01.
RemoveMethod
.ExplicitInterfaceImplementations.Single());
27090
var m01Remove = m01.
RemoveMethod
;
27103
var cM01Remove = cM01.
RemoveMethod
;
27164
Assert.Same(c1M01.
RemoveMethod
, c1.FindImplementationForInterfaceMember(m01.
RemoveMethod
));
27167
Assert.Same(m01.
RemoveMethod
, c1M01.
RemoveMethod
.ExplicitInterfaceImplementations.Single());
27194
Assert.Same(c1M01.
RemoveMethod
, c1.FindImplementationForInterfaceMember(m01.
RemoveMethod
));
27225
Assert.Null(c1.FindImplementationForInterfaceMember(m01.
RemoveMethod
));
27255
Assert.Null(c1.FindImplementationForInterfaceMember(m01.
RemoveMethod
));
27342
Assert.Same(i2M01.
RemoveMethod
, c1.FindImplementationForInterfaceMember(m01.
RemoveMethod
));
27343
Assert.Same(i2M01.
RemoveMethod
, i2.FindImplementationForInterfaceMember(m01.
RemoveMethod
));
27347
Assert.Same(m01.
RemoveMethod
, i2M01.
RemoveMethod
.ExplicitInterfaceImplementations.Single());
27387
var c2M01Remove = (MethodSymbol)c2.FindImplementationForInterfaceMember(m01.
RemoveMethod
);
27415
Assert.Same(m01.
RemoveMethod
, c2M01Remove.ExplicitInterfaceImplementations.Single());
27422
var c1M01Remove = c1M01.
RemoveMethod
;
27469
Assert.Same(c2M01.
RemoveMethod
, c2M01Remove);
27588
var c1M01Remove = c1M01.
RemoveMethod
;
27632
c1M01Remove = (MethodSymbol)c1.FindImplementationForInterfaceMember(m01.
RemoveMethod
);
27635
Assert.Same(m01.
RemoveMethod
, c1M01Remove.ExplicitInterfaceImplementations.Single());
27651
Assert.Same(c1M01Remove, c1.FindImplementationForInterfaceMember(m01.
RemoveMethod
));
27658
var c2M01Remove = c2M01.
RemoveMethod
;
27688
Assert.Same(m01.
RemoveMethod
, c2M01Remove.ExplicitInterfaceImplementations.Single());
27689
Assert.Same(c2M01Remove, c2.FindImplementationForInterfaceMember(m01.
RemoveMethod
));
27699
var c3M02Remove = c3M02.
RemoveMethod
;
27743
c3M02Remove = (MethodSymbol)c3.FindImplementationForInterfaceMember(m02.
RemoveMethod
);
27746
Assert.Same(m02.
RemoveMethod
, c3M02Remove.ExplicitInterfaceImplementations.Single());
27762
Assert.Same(c3M02Remove, c3.FindImplementationForInterfaceMember(m02.
RemoveMethod
));
27769
var c4M02Remove = c4M02.
RemoveMethod
;
27803
Assert.Same(m02.
RemoveMethod
, c4M02Remove.ExplicitInterfaceImplementations.Single());
27804
Assert.Same(c4M02Remove, c4.FindImplementationForInterfaceMember(m02.
RemoveMethod
));
27933
var c1M01Remove = c1M01.
RemoveMethod
;
27948
var c2M01Remove = c3.FindImplementationForInterfaceMember(m01.
RemoveMethod
);
27958
Assert.Same(c1M01.
RemoveMethod
, c3.FindImplementationForInterfaceMember(m01.
RemoveMethod
));
27967
Assert.Same(c2M02.
RemoveMethod
, c3.FindImplementationForInterfaceMember(m02.
RemoveMethod
));
28047
var c2M01Remove = c2M01.
RemoveMethod
;
28081
var c3M01Remove = (MethodSymbol)c3.FindImplementationForInterfaceMember(m01.
RemoveMethod
);
28083
Assert.Same(m01.
RemoveMethod
, c3M01Remove.ExplicitInterfaceImplementations.Single());
28089
Assert.Same(c2M01Remove, c3.FindImplementationForInterfaceMember(m01.
RemoveMethod
));
Microsoft.CodeAnalysis.CSharp.Test.Utilities (2)
LifetimeAnnotationAttributesVisitor.cs (1)
64
Visit(@event.
RemoveMethod
);
TestAttributesVisitor.cs (1)
64
Visit(@event.
RemoveMethod
);
Microsoft.CodeAnalysis.CSharp.WinRT.UnitTests (4)
Metadata\WinMdEventTests.cs (4)
3507
Assert.True(instanceEvent.
RemoveMethod
.IsStatic);
3512
Assert.False(staticEvent.
RemoveMethod
.IsStatic);
3585
var removeMethod = @event.
RemoveMethod
;
3616
var removeMethod = @event.
RemoveMethod
;