IntroduceDelegate(INamespaceOrNamedType, string, Action<IDelegateBuilder>, OverrideStrategy)
Introduces a new delegate to the target namespace or type.
Declaration
IIntroductionAdviceResult<INamedType> IntroduceDelegate(INamespaceOrNamedType targetNamespaceOrType, string name, Action<IDelegateBuilder> buildDelegate, OverrideStrategy whenExists = OverrideStrategy.Default)Parameters
| Type | Name | Description |
|---|---|---|
| INamespaceOrNamedType | targetNamespaceOrType | The namespace or type into which the delegate must be introduced. |
| string | name | The name of the introduced delegate. |
| Action<IDelegateBuilder> | buildDelegate | A callback that configures the introduced delegate, which means its accessibility, its custom attributes, its type
parameters and its signature. The parameter is required and precedes |
| OverrideStrategy | whenExists | Determines the implementation strategy when a type of the same name is already declared in the target namespace or type. The default strategy is to fail with a compile-time error. |
Returns
| Type | Description |
|---|---|
| IIntroductionAdviceResult<INamedType> | An IIntroductionAdviceResult<T> representing the result of the advice. The Declaration property provides access to the introduced delegate. Unlike the result of introducing a class, this result must not be used to introduce members, because a delegate accepts none. |