PostSharpAPI ReferencePost­Sharp.​Patterns.​ModelDisposable­Attribute
Open sandboxFocus

Class DisposableAttribute

Custom attribute that, when applied to a class, implements the IDisposable in such a way that the Dispose() method executes the Dispose() method for all children objects that also implement the IDisposable interface.

Namespace: PostSharp.Patterns.Model
Assembly: PostSharp.Patterns.Model.dll
Syntax
[IntroduceInterface]
[MulticastAttributeUsage]
[HasConstraint]
[Serializer]
public sealed class DisposableAttribute : AggregatableClientAttribute, ITypeLevelAspect, ITypeLevelAspectBuildSemantics, IAspectBuildSemantics, IValidableAnnotation, ICloneAwareAspect, IInstanceScopedAspect, IAspectProvider, IService, IAdviceProvider, IAspect

Constructors

Name Description
DisposableAttribute() PostSharp.Patterns.Model.DisposableAttribute
DisposableAttribute(PortableFormatterConstructorContext)

Fields

Name Description
BaseDisposeMethod
DisposeMethod

Properties

Name Description
ThrowObjectDisposedException

Determines whether an ObjectDisposedException should be thrown when an attempt is made to access an object that has already been disposed.

Methods

Name Description
Advise(Object)
Dispose()
Dispose(Boolean)
IsEligibleChild(Object, ChildInfo)
OnAdviseChildFailed(Object)
OnMethodEntry(MethodExecutionArgs)