Skip to content

Reflection.ThrowIfMethodsNotOverloaded(string, Type, string[]) method

Defined in

Type: Reflection Namespace: ReactiveUI.Reactive Assembly: ReactiveUI.Reactive.dll

Applies to

net10.0, net10.0-maccatalyst26.0, net10.0-desktop1.0, net10.0-browserwasm1.0, net10.0-tvos26.0, net10.0-windows10.0.19041, net10.0-macos26.0, net10.0-ios26.0, net10.0-android36.0, net9.0, net9.0-tvos18.0, net9.0-macos15.0, net9.0-maccatalyst18.0, net9.0-windows10.0.19041, net9.0-ios18.0, net9.0-desktop1.0, net8.0, net8.0-windows10.0.19041, net8.0-ios18.0, net8.0-maccatalyst18.0, net8.0-macos15.0, net8.0-tvos18.0, net8.0-ios17.5, net8.0-maccatalyst17.5, net8.0-macos14.5, netstandard2.1, net481, net462, net471

Overloads

  • 1. public static void ThrowIfMethodsNotOverloaded(string callingTypeName, Type targetType, params string[] methodsToCheck)
  • 2. public static void ThrowIfMethodsNotOverloaded(string callingTypeName, object targetObject, params string[] methodsToCheck)

1. Overload

public static void ThrowIfMethodsNotOverloaded(string callingTypeName, Type targetType, params string[] methodsToCheck)

View source

Summary: Checks to make sure that the specified method names on the target type are overridden.

Parameters

NameTypeDescription
callingTypeNamestringThe name of the calling type.
targetTypeTypeThe type to check. Must preserve public and non-public methods under trimming.
params methodsToCheckstring[]The method names to check.

Remarks

Trimming note: this method inspects declared method names; the targetType parameter is annotated accordingly.

Exceptions

TypeCondition
System.InvalidOperationExceptionA method is not overridden on the target type.

2. Overload

Attributes: [RequiresUnreferencedCode("Inspects declared methods on a runtime type; members may be trimmed.")]

public static void ThrowIfMethodsNotOverloaded(string callingTypeName, object targetObject, params string[] methodsToCheck)

View source

Summary: Checks to make sure that the specified method names on the target object are overridden.

Parameters

NameTypeDescription
callingTypeNamestringThe name of the calling type.
targetObjectobjectThe object to check.
params methodsToCheckstring[]The method names to check.

Remarks

Trimming note: the runtime type is discovered dynamically via GetType, so this method cannot express a complete trimming contract locally.

Exceptions

TypeCondition
System.ArgumentNullExceptionThrown when targetObject is null.
System.InvalidOperationExceptionA method is not overridden on the target object.