PostSharpAPI ReferencePost­Sharp.​AspectsInstance­Level­AspectCreate­Instance
Open sandboxFocus

InstanceLevelAspect.CreateInstance Method

CreateInstance(AdviceArgs)

Creates a new instance of the aspect based on the current instance, serving as a prototype.

Declaration
[HasInheritedAttribute]
[RequiresDebuggerEnhancement]
[RequiresCreateInstanceAnalysis]
[CreateInstanceOptimization]
public virtual object CreateInstance(AdviceArgs adviceArgs)
Parameters
Type Name Description
AdviceArgs adviceArgs

Aspect arguments.

Returns
Type Description
Object

A new instance of the aspect, typically a clone of the current prototype instance.

Implements
IInstanceScopedAspect.CreateInstance(AdviceArgs)
Remarks

This method is typically implemented by invoking System.Object.MemberwiseClone().