4 overrides of RemoveMethod
Microsoft.CodeAnalysis.CSharp (4)
Symbols\Metadata\PE\PEEventSymbol.cs (1)
339public override MethodSymbol RemoveMethod
Symbols\Retargeting\RetargetingEventSymbol.cs (1)
67public override MethodSymbol? RemoveMethod
Symbols\Source\SourceEventSymbol.cs (1)
92public abstract override MethodSymbol? RemoveMethod { get; }
Symbols\SubstitutedEventSymbol.cs (1)
68public override MethodSymbol? RemoveMethod
383 references to RemoveMethod
Microsoft.CodeAnalysis.CSharp (22)
Binder\Binder_Lookup.cs (1)
1630method2 = @event.RemoveMethod;
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)
38var removeMethod = AdaptedEventSymbol.RemoveMethod?.GetCciAdapter(); 62var removeMethod = AdaptedEventSymbol.RemoveMethod?.GetCciAdapter();
Emitter\NoPia\EmbeddedTypesManager.cs (1)
572var removeMethod = @event.AdaptedEventSymbol.RemoveMethod?.GetCciAdapter();
Lowering\LocalRewriter\LocalRewriter_Event.cs (2)
56MethodSymbol? method = node.IsAddition ? node.Event.AddMethod : node.Event.RemoveMethod; 109methodOpt: eventSymbol.RemoveMethod,
Symbols\EventSymbol.cs (1)
162MethodSymbol? accessor = AddMethod ?? RemoveMethod;
Symbols\MemberSymbolExtensions.cs (2)
373return isImplementableAndNotPublic(eventSymbol.AddMethod) || isImplementableAndNotPublic(eventSymbol.RemoveMethod); 755MethodSymbol removeMethod = @event.RemoveMethod;
Symbols\OverriddenOrHiddenMembersHelpers.cs (1)
352MethodSymbol correspondingAccessor = accessorIsAdder ? eventHiddenByEvent.AddMethod : eventHiddenByEvent.RemoveMethod;
Symbols\PublicModel\EventSymbol.cs (1)
52return _underlying.RemoveMethod.GetPublicSymbol();
Symbols\Retargeting\RetargetingEventSymbol.cs (2)
71return (object?)_underlyingEvent.RemoveMethod == null 73: this.RetargetingTranslator.Retarget(_underlyingEvent.RemoveMethod);
Symbols\Source\ExplicitInterfaceHelpers.cs (1)
325checkAccessorIsAccessibleIfImplementable(eventSymbol.RemoveMethod);
Symbols\Source\SourceEventAccessorSymbol.cs (1)
60MethodSymbol implementedAccessor = isAdder ? explicitlyImplementedEventOpt.AddMethod : explicitlyImplementedEventOpt.RemoveMethod;
Symbols\Source\SourceEventSymbol.cs (1)
844CheckExplicitImplementationAccessor(RemoveMethod, explicitlyImplementedEvent.RemoveMethod, explicitlyImplementedEvent, diagnostics);
Symbols\Source\SourceMemberContainerSymbol.cs (1)
4501var locationFrom = (Symbol?)(isAdder ? propertySymbol.AddMethod : propertySymbol.RemoveMethod) ?? propertySymbol;
Symbols\Source\SourceMemberContainerSymbol_ImplementationChecks.cs (1)
614var removeMethod = @event.RemoveMethod;
Symbols\SubstitutedEventSymbol.cs (1)
72MethodSymbol? originalRemoveMethod = OriginalDefinition.RemoveMethod;
Symbols\TypeSymbol.cs (1)
1432interfaceAccessor2 = interfaceEvent.RemoveMethod;
Microsoft.CodeAnalysis.CSharp.Emit.UnitTests (11)
CodeGen\CodeGenReadonlyStructTests.cs (3)
1589verifyReadOnly(s1.GetEvent("E").RemoveMethod, true, RefKind.RefReadOnly); 1603verifyReadOnly(s2.GetEvent("E").RemoveMethod, true, RefKind.RefReadOnly); 2603Assert.True(peModule.Module.HasIsReadOnlyAttribute(((PEMethodSymbol)testStruct.GetEvent("E").RemoveMethod).Handle));
CodeGen\CodeGenTupleTest.cs (5)
13276Assert.True(m10I1E1.RemoveMethod.IsExplicitInterfaceImplementation); 13277Assert.Equal("void I1.E1.remove", m10I1E1.RemoveMethod.ExplicitInterfaceImplementations.Single().ToTestDisplayString()); 16062Assert.True(m1E1Remove.Equals(m1E1.RemoveMethod, TypeCompareKind.ConsiderEverything)); 16094Assert.NotSame(m1E2Remove, m1E2.RemoveMethod); 16095Assert.True(m1E2Remove.Equals(m1E2.RemoveMethod, TypeCompareKind.ConsiderEverything));
CodeGen\EventTests.cs (3)
221var removeMethod = @event.RemoveMethod; 721var removeMethod = @event.RemoveMethod; 793var removeMethod = @event.RemoveMethod;
Microsoft.CodeAnalysis.CSharp.Emit3.UnitTests (37)
Attributes\AttributeTests.cs (10)
2636AssertEx.SetEqual(accessorsExpected, GetAttributeNames(event1.RemoveMethod.GetAttributes())); 2646AssertEx.SetEqual(accessorsExpected, GetAttributeNames(event2.RemoveMethod.GetAttributes())); 2655AssertEx.SetEqual(accessorsExpected.Concat(new[] { "CC" }), GetAttributeNames(event3.RemoveMethod.GetAttributes())); 2664AssertEx.SetEqual(accessorsExpected, GetAttributeNames(event4.RemoveMethod.GetAttributes())); 2673AssertNoAttributes(event5.RemoveMethod); 2677AssertNoAttributes(event6.RemoveMethod); 2681AssertNoAttributes(event7.RemoveMethod); 2685AssertNoAttributes(event8.RemoveMethod); 2689AssertNoAttributes(event9.RemoveMethod); 2694AssertNoAttributes(event10.RemoveMethod);
Attributes\AttributeTests_Conditional.cs (1)
181attributesArrayBuilder.Add(eventE.RemoveMethod.GetAttributes());
Attributes\AttributeTests_Synthesized.cs (1)
239Assert.Equal("CompilerGeneratedAttribute", peModule.GetCustomAttributesForToken(((PEMethodSymbol)e.RemoveMethod).Handle).Single().AttributeClass.Name);
OverloadResolutionPriorityTests.cs (1)
1651Assert.Equal(0, indexer!.RemoveMethod!.OverloadResolutionPriority);
PartialEventsAndConstructorsTests.cs (24)
1082validateAccessor(e.RemoveMethod!); 1240validateAccessor(e.RemoveMethod!); 1572Assert.True(ev.PartialImplementationPart!.RemoveMethod!.GetPublicSymbol().IsExtern); 1596Assert.False(ev.RemoveMethod!.GetPublicSymbol().IsExtern); 1703verifyAccessor(e.RemoveMethod!, "remove_E", "remove_E"); 1711verifyAccessor(eImpl.RemoveMethod!, "remove_E", "remove_E"); 1783Assert.False(ev.RemoveMethod!.GetPublicSymbol().IsExtern); 1784Assert.Null(ev.RemoveMethod!.GetDllImportData()); 1785Assert.Equal(MethodImplAttributes.InternalCall, ev.RemoveMethod.ImplementationAttributes); 1786Assert.False(ev.RemoveMethod.ImplementationAttributes.HasFlag(MethodImplAttributes.Synchronized)); 1903Assert.True(e.RemoveMethod!.ImplementationAttributes.HasFlag(MethodImplAttributes.Synchronized)); 1964var removeMethod = e.RemoveMethod!; 3384AssertEx.Equal(["A(4)", "A(14)"], e.RemoveMethod!.GetAttributes().ToStrings()); 3385AssertEx.Equal(["A(24)"], e.RemoveMethod.Parameters.Single().GetAttributes().ToStrings()); 3386AssertEx.Equal(["A(34)"], e.RemoveMethod.GetReturnTypeAttributes().ToStrings()); 3395AssertEx.Equal(["A(4)", "A(14)"], eImpl.RemoveMethod!.GetAttributes().ToStrings()); 3396AssertEx.Equal(["A(24)"], eImpl.RemoveMethod.Parameters.Single().GetAttributes().ToStrings()); 3397AssertEx.Equal(["A(34)"], eImpl.RemoveMethod.GetReturnTypeAttributes().ToStrings()); 3405AssertEx.Equal([.. compiledGeneratedAttr, "A(11)", "A(12)"], f.RemoveMethod!.GetAttributes().ToStrings()); 3406AssertEx.Equal(["A(22)", "A(21)"], f.RemoveMethod.Parameters.Single().GetAttributes().ToStrings()); 3407AssertEx.Equal([], f.RemoveMethod.GetReturnTypeAttributes().ToStrings()); 3416AssertEx.Equal([.. compiledGeneratedAttr, "A(11)", "A(12)"], fImpl.RemoveMethod!.GetAttributes().ToStrings()); 3417AssertEx.Equal(["A(22)", "A(21)"], fImpl.RemoveMethod.Parameters.Single().GetAttributes().ToStrings()); 3418AssertEx.Equal([], fImpl.RemoveMethod.GetReturnTypeAttributes().ToStrings());
Microsoft.CodeAnalysis.CSharp.Semantic.UnitTests (7)
Semantics\InheritanceBindingTests.cs (3)
6651Assert.Equal(classEvent.RemoveMethod, @class.FindImplementationForInterfaceMember(interfaceEvent.RemoveMethod)); 6654Assert.True(classEvent.RemoveMethod.IsMetadataVirtual());
Semantics\InitOnlyMemberTests.cs (1)
2454Assert.False(eventSymbol.RemoveMethod.IsInitOnly);
Semantics\NullableReferenceTypesTests.cs (3)
12348Assert.True(ev.TypeWithAnnotations.Equals(ev.RemoveMethod.Parameters.Last().TypeWithAnnotations, TypeCompareKind.ConsiderEverything)); 12716Assert.True(ev.TypeWithAnnotations.Equals(ev.RemoveMethod.Parameters.Last().TypeWithAnnotations, TypeCompareKind.ConsiderEverything)); 12804Assert.True(ev.TypeWithAnnotations.Equals(ev.RemoveMethod.Parameters.Last().TypeWithAnnotations, TypeCompareKind.ConsiderEverything));
Microsoft.CodeAnalysis.CSharp.Symbol.UnitTests (300)
DocumentationComments\EventDocumentationCommentTests.cs (2)
44Assert.Equal("M:Acme.Widget.remove_E(System.Action)", eventSymbol.RemoveMethod.GetDocumentationCommentId()); 53Assert.Equal("M:Acme.Widget.remove_F(System.Action)", eventSymbol.RemoveMethod.GetDocumentationCommentId());
SymbolDisplay\SymbolDisplayTests.cs (1)
5018eventSymbol.RemoveMethod.ToDisplayParts(format),
Symbols\CovariantReturnTests.cs (2)
334if (eventSymbol.RemoveMethod is MethodSymbol removeMethod && overriddenEvent.RemoveMethod is MethodSymbol overriddenRemoveMethod)
Symbols\CSharpCompilerFeatureRequiredTests.cs (2)
193Assert.False(onEventAdderEvent.RemoveMethod!.HasUnsupportedMetadata); 200Assert.True(onEventRemoverEvent.RemoveMethod!.HasUnsupportedMetadata);
Symbols\DefaultInterfaceImplementationTests.cs (151)
6389var rmvE1 = e1.RemoveMethod; 6481var rmvP1 = e1.RemoveMethod; 6983Assert.Same(e7.RemoveMethod, derived.FindImplementationForInterfaceMember(e7.RemoveMethod)); 6984Assert.Same(e8.RemoveMethod, derived.FindImplementationForInterfaceMember(e8.RemoveMethod)); 7159Assert.Equal("void Test.I1.E7.remove", derived.FindImplementationForInterfaceMember(e7.RemoveMethod).ToTestDisplayString()); 7160Assert.Equal("void Test.I1.E8.remove", derived.FindImplementationForInterfaceMember(e8.RemoveMethod).ToTestDisplayString()); 7266Assert.Equal("void Test.E7.remove", derived.FindImplementationForInterfaceMember(e7.RemoveMethod).ToTestDisplayString()); 7267Assert.Equal("void Test.E8.remove", derived.FindImplementationForInterfaceMember(e8.RemoveMethod).ToTestDisplayString()); 7387Assert.True(e7.RemoveMethod.IsVirtual); 7390Assert.True(e7.RemoveMethod.IsMetadataVirtual()); 7393Assert.False(e7.RemoveMethod.IsAbstract); 7396Assert.Same(e7.RemoveMethod, derived.FindImplementationForInterfaceMember(e7.RemoveMethod)); 7509Assert.Null(test2.FindImplementationForInterfaceMember(e7.RemoveMethod)); 7784Assert.False(e7.RemoveMethod.IsVirtual); 7787Assert.False(e7.RemoveMethod.IsMetadataVirtual()); 7790Assert.False(e7.RemoveMethod.IsAbstract); 7793Assert.True(e7.RemoveMethod.IsStatic); 7796Assert.Null(derived.FindImplementationForInterfaceMember(e7.RemoveMethod)); 26850ValidateP01Accessor(p01.RemoveMethod); 26886var p03set = p03.RemoveMethod; 26928var p05set = p05.RemoveMethod; 26970var p07set = p07.RemoveMethod; 27012var p09set = p09.RemoveMethod; 27066ValidateP11Accessor(p11.RemoveMethod); 27092ValidateP14Accessor(p14.RemoveMethod); 27649ValidateAccessor(p1.RemoveMethod, test1P1.RemoveMethod); 27722ValidateAccessor(p1.RemoveMethod); 27823ValidateAccessor(p1.RemoveMethod); 27991ValidateAccessor1(p1.RemoveMethod); 28018ValidateAccessor2(p2.RemoveMethod); 28045ValidateAccessor3(p3.RemoveMethod); 28152ValidateAccessor(p1.RemoveMethod); 28248ValidateP1Accessor(p1.RemoveMethod); 28275ValidateP2Accessor(p2.RemoveMethod); 28302ValidateP3Accessor(p3.RemoveMethod); 28329ValidateP4Accessor(p4.RemoveMethod); 28444var p1remove = p1.RemoveMethod; 28451Assert.Same(test1P1.RemoveMethod, test1.FindImplementationForInterfaceMember(p1remove)); 28489ValidateMethod(p1.RemoveMethod); 28545Assert.Null(test2.FindImplementationForInterfaceMember(p1.RemoveMethod)); 28687var p1Remove = p1.RemoveMethod; 28692Assert.Same(test1P1.RemoveMethod, test1.FindImplementationForInterfaceMember(p1Remove)); 28695Assert.True(test1P1.RemoveMethod.IsMetadataVirtual()); 29514Assert.Null(test1.FindImplementationForInterfaceMember(p1.RemoveMethod)); 29601ValidateAccessor(p1.RemoveMethod); 29717Validate1(p1.RemoveMethod); 29747Validate2(p2.RemoveMethod); 29777Validate3(p3.RemoveMethod); 30023ValidateAccessor(p2.RemoveMethod, test1P2.RemoveMethod); 30028Assert.Null(p2.RemoveMethod); 30033ValidateAccessor(p2.RemoveMethod, test1P2.RemoveMethod); 30130ValidateP1Accessor(p1.RemoveMethod, test2P1.RemoveMethod); 30160ValidateP2Accessor(p2.RemoveMethod, test2P2.RemoveMethod); 30190ValidateP3Accessor(p3.RemoveMethod); 30219ValidateP4Accessor(p4.RemoveMethod); 30248ValidateP5Accessor(p5.RemoveMethod); 30460ValidateP1Accessor(p1.RemoveMethod, test2P1.RemoveMethod); 30490ValidateP2Accessor(p2.RemoveMethod, test2P2.RemoveMethod); 30520ValidateP3Accessor(p3.RemoveMethod); 30549ValidateP4Accessor(p4.RemoveMethod); 30681ValidateP1Accessor(p1.RemoveMethod, test2P1.RemoveMethod); 30711ValidateP2Accessor(p2.RemoveMethod, test2P2.RemoveMethod); 30741ValidateP3Accessor(p3.RemoveMethod); 30771ValidateP4Accessor(p4.RemoveMethod); 30800ValidateP5Accessor(p5.RemoveMethod); 30881var p1remove = p1.RemoveMethod; 30927ValidateMethod(p1.RemoveMethod); 31242ValidateAccessor(p1.RemoveMethod); 40118ValidateAccessor(expected?.RemoveMethod, interfaceEvent.RemoveMethod); 40137ValidateAccessor(expected?.RemoveMethod, interfaceEvent.RemoveMethod); 40163ValidateAccessor(m1.RemoveMethod, isAbstract); 57519Assert.Same(i1p1.RemoveMethod, i2p1.RemoveMethod.ExplicitInterfaceImplementations.Single()); 57520Assert.Null(i2.FindImplementationForInterfaceMember(i1p1.RemoveMethod)); 57521Assert.Null(test1.FindImplementationForInterfaceMember(i1p1.RemoveMethod)); 57540if (reabstracting.RemoveMethod is object) 57542ValidateReabstraction(reabstracting.RemoveMethod, isStatic); 57697Assert.Null(i2.FindImplementationForInterfaceMember(i1p1.RemoveMethod)); 57698Assert.Same(test12p1.RemoveMethod, test1.FindImplementationForInterfaceMember(i1p1.RemoveMethod)); 57845Assert.Null(i3.FindImplementationForInterfaceMember(i1p1.RemoveMethod)); 57846Assert.Null(test1.FindImplementationForInterfaceMember(i1p1.RemoveMethod)); 58005Assert.Same(i3p1.RemoveMethod, i3.FindImplementationForInterfaceMember(i1p1.RemoveMethod)); 58006Assert.Same(i3p1.RemoveMethod, test1.FindImplementationForInterfaceMember(i1p1.RemoveMethod)); 58152Assert.Null(test1.FindImplementationForInterfaceMember(i1p1.RemoveMethod)); 58307Assert.Null(i4.FindImplementationForInterfaceMember(i1p1.RemoveMethod)); 58308Assert.Null(test1.FindImplementationForInterfaceMember(i1p1.RemoveMethod)); 58437Assert.Same(i4p1.RemoveMethod, i4.FindImplementationForInterfaceMember(i1p1.RemoveMethod)); 58438Assert.Same(i4p1.RemoveMethod, test1.FindImplementationForInterfaceMember(i1p1.RemoveMethod)); 58522if (i1p1.RemoveMethod is object) 58524if (i2p1.RemoveMethod is object) 58526Assert.Same(i1p1.RemoveMethod, i2p1.RemoveMethod.ExplicitInterfaceImplementations.Single()); 58529Assert.Null(i2.FindImplementationForInterfaceMember(i1p1.RemoveMethod)); 58530Assert.Null(test1.FindImplementationForInterfaceMember(i1p1.RemoveMethod)); 58532else if (i2p1.RemoveMethod is object) 58534Assert.Empty(i2p1.RemoveMethod.ExplicitInterfaceImplementations); 58713var c2p1Remove = c2p1.RemoveMethod; 58720Assert.Same(i1p1.RemoveMethod, c2p1Remove.ExplicitInterfaceImplementations.Single()); 58721Assert.Same(c2p1Remove, c2.FindImplementationForInterfaceMember(i1p1.RemoveMethod)); 58725Assert.Null(c2.FindImplementationForInterfaceMember(i1p1.RemoveMethod)); 59283Assert.Same(i1p1.RemoveMethod, i2p1.RemoveMethod.ExplicitInterfaceImplementations.Single()); 59284Assert.Null(i2.FindImplementationForInterfaceMember(i1p1.RemoveMethod)); 59285Assert.Null(test1.FindImplementationForInterfaceMember(i1p1.RemoveMethod)); 59336Assert.Empty(i2p1.RemoveMethod.ExplicitInterfaceImplementations); 62737Assert.Same(i1Normal.RemoveMethod, i1.FindImplementationForInterfaceMember(baseInterfaceNormal.RemoveMethod)); 62740Assert.Same(i1WinRT.RemoveMethod, i1.FindImplementationForInterfaceMember(baseInterfaceWinRT.RemoveMethod)); 62744Assert.Same(i1Normal.RemoveMethod, c1.FindImplementationForInterfaceMember(baseInterfaceNormal.RemoveMethod)); 62747Assert.Same(i1WinRT.RemoveMethod, c1.FindImplementationForInterfaceMember(baseInterfaceWinRT.RemoveMethod)); 62750Assert.Equal("void I1.Interface<System.Int32>.Normal.remove", i1Normal.RemoveMethod.ToTestDisplayString()); 62752Assert.Equal("void I1.Interface<System.Int32>.WinRT.remove", i1WinRT.RemoveMethod.ToTestDisplayString()); 62799Assert.Same(i1WinRT.RemoveMethod, c1.FindImplementationForInterfaceMember(i1WinRT.RemoveMethod)); 62802Assert.Equal("void I1.WinRT.remove", i1WinRT.RemoveMethod.ToTestDisplayString()); 62859Assert.Same(i1WinRT.RemoveMethod, i1.FindImplementationForInterfaceMember(baseInterfaceWinRT.RemoveMethod)); 62863Assert.Same(i1WinRT.RemoveMethod, c1.FindImplementationForInterfaceMember(baseInterfaceWinRT.RemoveMethod)); 62866Assert.Equal("void I1.Interface.WinRT.remove", i1WinRT.RemoveMethod.ToTestDisplayString()); 63169Assert.Same(i2i1E1remove, test2.FindImplementationForInterfaceMember(i1E1.RemoveMethod)); 63180Assert.Same(c1i1E1remove, test1.FindImplementationForInterfaceMember(i1E1.RemoveMethod)); 63191Assert.Same(c1i1E1remove, test4.FindImplementationForInterfaceMember(i1E1.RemoveMethod)); 63202Assert.Same(i2i1E1remove, test3.FindImplementationForInterfaceMember(i1E1.RemoveMethod)); 64104Assert.Same(i2i1E1remove, test2.FindImplementationForInterfaceMember(i1E1.RemoveMethod)); 64115Assert.Same(i2i1E1remove, test3.FindImplementationForInterfaceMember(i1E1.RemoveMethod)); 67527Assert.Empty(m.RemoveMethod.ExplicitInterfaceImplementations); 67599Assert.Same(m2.RemoveMethod, m1.RemoveMethod.ExplicitInterfaceImplementations.Single());
Symbols\Metadata\PE\LoadingEvents.cs (6)
80CheckAccessorShape(instanceEvent.RemoveMethod, instanceEvent); 89CheckAccessorShape(staticEvent.RemoveMethod, staticEvent); 102Assert.Same(@event.RemoveMethod, accessor); 138Assert.NotEqual(mismatchedRemoveEvent.Type, mismatchedRemoveEvent.RemoveMethod.Parameters.Single().Type); 161Assert.Equal(0, noParamRemoveEvent.RemoveMethod.Parameters.Length); 447var removeMethod = @event.RemoveMethod;
Symbols\Source\EventTests.cs (30)
93var removeMethod = @event.RemoveMethod; 131var removeMethod = @event.RemoveMethod; 170var removeMethod = @event.RemoveMethod; 205var removeMethod = @event.RemoveMethod; 329Assert.True(fevent.RemoveMethod.IsImplicitlyDeclared, "FieldLikeEvent RemoveAccessor"); 357Assert.Equal(1, e1.RemoveMethod.ParameterTypesWithAnnotations.Length); 358Assert.Equal("System.Action<dynamic>", e1.RemoveMethod.ParameterTypesWithAnnotations[0].ToTestDisplayString()); 363Assert.Equal(1, e2.RemoveMethod.ParameterTypesWithAnnotations.Length); 364Assert.Equal("System.Action<dynamic>", e2.RemoveMethod.ParameterTypesWithAnnotations[0].ToTestDisplayString()); 1869Assert.NotNull(event1.RemoveMethod); 1870Assert.Equal(Accessibility.Public, event1.RemoveMethod.DeclaredAccessibility); 1874Assert.NotNull(event2.RemoveMethod); 1875Assert.Equal(Accessibility.Public, event2.RemoveMethod.DeclaredAccessibility); 1879Assert.NotNull(event3.RemoveMethod); 1880Assert.Equal(Accessibility.Public, event3.RemoveMethod.DeclaredAccessibility); 2270Assert.Equal(baseEventType, event1.RemoveMethod.ParameterTypesWithAnnotations.Single().Type); 2277Assert.Equal(baseEventType, event2.RemoveMethod.ParameterTypesWithAnnotations.Single().Type); 2343Assert.Equal("myRemove", event1.RemoveMethod.Name); 2348Assert.Equal("myRemove", event2.RemoveMethod.Name); 2389Assert.Equal("remove_E", event1.RemoveMethod.Name); 2394Assert.Equal("remove_E", event2.RemoveMethod.Name); 2862AssertEx.Equal([.. compiledGeneratedAttr, "A(2)"], e.RemoveMethod!.GetAttributes().ToStrings()); 2863AssertEx.Equal(["A(3)"], e.RemoveMethod.Parameters.Single().GetAttributes().ToStrings()); 2864AssertEx.Equal([], e.RemoveMethod.GetReturnTypeAttributes().ToStrings()); 2872AssertEx.Equal([.. compiledGeneratedAttr, "A(2)"], f.RemoveMethod!.GetAttributes().ToStrings()); 2873AssertEx.Equal(["A(3)"], f.RemoveMethod.Parameters.Single().GetAttributes().ToStrings()); 2874AssertEx.Equal([], f.RemoveMethod.GetReturnTypeAttributes().ToStrings()); 2881AssertEx.Equal(["A(31)", "A(32)"], g.RemoveMethod!.GetAttributes().ToStrings()); 2882AssertEx.Equal(["A(33)"], g.RemoveMethod.Parameters.Single().GetAttributes().ToStrings()); 2883AssertEx.Equal(["A(34)"], g.RemoveMethod.GetReturnTypeAttributes().ToStrings());
Symbols\StaticAbstractMembersInInterfacesTests.cs (106)
2748return addAccessor ? e.AddMethod : e.RemoveMethod; 25948Assert.Same(i6m.RemoveMethod, ((EventSymbol)i6.FindImplementationForInterfaceMember(m)).RemoveMethod); 26037Assert.Same(i6m.RemoveMethod, ((EventSymbol)i6.FindImplementationForInterfaceMember(m)).RemoveMethod); 26250var m01Remove = m01.RemoveMethod; 26279var cM01Remove = cM01.RemoveMethod; 26345var m01Remove = m01.RemoveMethod; 26374var cM01Remove = cM01.RemoveMethod; 26457Assert.Same(cM01.RemoveMethod, c3.FindImplementationForInterfaceMember(m01.RemoveMethod)); 26461Assert.Same(m01.RemoveMethod, cM01.RemoveMethod.ExplicitInterfaceImplementations.Single()); 26618Assert.Same(c1M01.RemoveMethod, c1.FindImplementationForInterfaceMember(m01.RemoveMethod)); 26621Assert.Same(m01.RemoveMethod, c1M01.RemoveMethod.ExplicitInterfaceImplementations.Single()); 26626Assert.Same(c1M01.RemoveMethod, c2.FindImplementationForInterfaceMember(m01.RemoveMethod)); 26631Assert.Same(c1M01.RemoveMethod, c3.FindImplementationForInterfaceMember(m01.RemoveMethod)); 26636Assert.Same(c1M01.RemoveMethod, c4.FindImplementationForInterfaceMember(m01.RemoveMethod)); 26643Assert.Same(c2M01.RemoveMethod, c5.FindImplementationForInterfaceMember(m01.RemoveMethod)); 26720Assert.Same(m01.RemoveMethod, c1.FindImplementationForInterfaceMember(m01.RemoveMethod)); 26721Assert.Same(m01.RemoveMethod, i1.FindImplementationForInterfaceMember(m01.RemoveMethod)); 26759Assert.Same(c1m01.RemoveMethod, c1.FindImplementationForInterfaceMember(m01.RemoveMethod)); 26760Assert.Same(m01.RemoveMethod, i1.FindImplementationForInterfaceMember(m01.RemoveMethod)); 26786Assert.Same(c1m01.RemoveMethod, c.FindImplementationForInterfaceMember(m01.RemoveMethod)); 26843Assert.Same(m01.RemoveMethod, c1.FindImplementationForInterfaceMember(m01.RemoveMethod)); 26844Assert.Same(m01.RemoveMethod, i1.FindImplementationForInterfaceMember(m01.RemoveMethod)); 26871Assert.Same(m01.RemoveMethod, c1.FindImplementationForInterfaceMember(m01.RemoveMethod)); 26920var cM01Remove = cM01.RemoveMethod; 26932Assert.Same(cM01Remove, c.FindImplementationForInterfaceMember(m01.RemoveMethod)); 26938Assert.Same(m01.RemoveMethod, cM01Remove.ExplicitInterfaceImplementations.Single()); 26969Assert.Same(c1M01.RemoveMethod, c1.FindImplementationForInterfaceMember(m01.RemoveMethod)); 26972Assert.Same(m01.RemoveMethod, c1M01.RemoveMethod.ExplicitInterfaceImplementations.Single()); 26999Assert.Same(m01.RemoveMethod, c1.FindImplementationForInterfaceMember(m01.RemoveMethod)); 27029Assert.Same(c1M01.RemoveMethod, c1.FindImplementationForInterfaceMember(m01.RemoveMethod)); 27059Assert.Same(c1M01.RemoveMethod, c1.FindImplementationForInterfaceMember(m01.RemoveMethod)); 27061Assert.Same(m01.RemoveMethod, c1M01.RemoveMethod.ExplicitInterfaceImplementations.Single()); 27115Assert.Null(c1.FindImplementationForInterfaceMember(m01.RemoveMethod)); 27116Assert.Null(i1.FindImplementationForInterfaceMember(m01.RemoveMethod)); 27144Assert.Same(c1M01.RemoveMethod, c1.FindImplementationForInterfaceMember(m01.RemoveMethod)); 27147Assert.Same(m01.RemoveMethod, c1M01.RemoveMethod.ExplicitInterfaceImplementations.Single()); 27168var m01Remove = m01.RemoveMethod; 27181var cM01Remove = cM01.RemoveMethod; 27242Assert.Same(c1M01.RemoveMethod, c1.FindImplementationForInterfaceMember(m01.RemoveMethod)); 27245Assert.Same(m01.RemoveMethod, c1M01.RemoveMethod.ExplicitInterfaceImplementations.Single()); 27272Assert.Same(c1M01.RemoveMethod, c1.FindImplementationForInterfaceMember(m01.RemoveMethod)); 27303Assert.Null(c1.FindImplementationForInterfaceMember(m01.RemoveMethod)); 27333Assert.Null(c1.FindImplementationForInterfaceMember(m01.RemoveMethod)); 27420Assert.Same(i2M01.RemoveMethod, c1.FindImplementationForInterfaceMember(m01.RemoveMethod)); 27421Assert.Same(i2M01.RemoveMethod, i2.FindImplementationForInterfaceMember(m01.RemoveMethod)); 27425Assert.Same(m01.RemoveMethod, i2M01.RemoveMethod.ExplicitInterfaceImplementations.Single()); 27465var c2M01Remove = (MethodSymbol)c2.FindImplementationForInterfaceMember(m01.RemoveMethod); 27493Assert.Same(m01.RemoveMethod, c2M01Remove.ExplicitInterfaceImplementations.Single()); 27500var c1M01Remove = c1M01.RemoveMethod; 27547Assert.Same(c2M01.RemoveMethod, c2M01Remove); 27666var c1M01Remove = c1M01.RemoveMethod; 27710c1M01Remove = (MethodSymbol)c1.FindImplementationForInterfaceMember(m01.RemoveMethod); 27713Assert.Same(m01.RemoveMethod, c1M01Remove.ExplicitInterfaceImplementations.Single()); 27729Assert.Same(c1M01Remove, c1.FindImplementationForInterfaceMember(m01.RemoveMethod)); 27736var c2M01Remove = c2M01.RemoveMethod; 27766Assert.Same(m01.RemoveMethod, c2M01Remove.ExplicitInterfaceImplementations.Single()); 27767Assert.Same(c2M01Remove, c2.FindImplementationForInterfaceMember(m01.RemoveMethod)); 27777var c3M02Remove = c3M02.RemoveMethod; 27821c3M02Remove = (MethodSymbol)c3.FindImplementationForInterfaceMember(m02.RemoveMethod); 27824Assert.Same(m02.RemoveMethod, c3M02Remove.ExplicitInterfaceImplementations.Single()); 27840Assert.Same(c3M02Remove, c3.FindImplementationForInterfaceMember(m02.RemoveMethod)); 27847var c4M02Remove = c4M02.RemoveMethod; 27881Assert.Same(m02.RemoveMethod, c4M02Remove.ExplicitInterfaceImplementations.Single()); 27882Assert.Same(c4M02Remove, c4.FindImplementationForInterfaceMember(m02.RemoveMethod)); 28011var c1M01Remove = c1M01.RemoveMethod; 28026var c2M01Remove = c3.FindImplementationForInterfaceMember(m01.RemoveMethod); 28036Assert.Same(c1M01.RemoveMethod, c3.FindImplementationForInterfaceMember(m01.RemoveMethod)); 28045Assert.Same(c2M02.RemoveMethod, c3.FindImplementationForInterfaceMember(m02.RemoveMethod)); 28125var c2M01Remove = c2M01.RemoveMethod; 28159var c3M01Remove = (MethodSymbol)c3.FindImplementationForInterfaceMember(m01.RemoveMethod); 28161Assert.Same(m01.RemoveMethod, c3M01Remove.ExplicitInterfaceImplementations.Single()); 28167Assert.Same(c2M01Remove, c3.FindImplementationForInterfaceMember(m01.RemoveMethod));
Microsoft.CodeAnalysis.CSharp.Test.Utilities (2)
LifetimeAnnotationAttributesVisitor.cs (1)
64Visit(@event.RemoveMethod);
TestAttributesVisitor.cs (1)
64Visit(@event.RemoveMethod);
Microsoft.CodeAnalysis.CSharp.WinRT.UnitTests (4)
Metadata\WinMdEventTests.cs (4)
3507Assert.True(instanceEvent.RemoveMethod.IsStatic); 3512Assert.False(staticEvent.RemoveMethod.IsStatic); 3585var removeMethod = @event.RemoveMethod; 3616var removeMethod = @event.RemoveMethod;