PostSharp 1.0
User Guide
Credits
License
Using the PostSharp Platform
Enabling or Disabling PostSharp
Installing Plug-Ins
Debugging Compile-Time Logic
Getting the Best Performance from PostSharp
Running the PostSharp Command-Line Utility
Customizing the Integration of PostSharp into MSBuild
PostSharp Targets
Recognized Properties
PostSharp Task
Advanced
Projects and Configuration Files
PostSharp Properties
PostSharp Search Path
Using PostSharp Laos
Sample
Aspect Kinds
On Exception Aspect
On Method Boundary Aspect
On Method Invocation Aspect
On Field Access Aspect
Composition Aspect
Implement Method Aspect
Aspect Lifetime
Wildcards & Multicasting
Coping with Multiple Instances on the Same Target
Persisting Custom Attributes Metadata
Compile-Time Validation
Compound Aspects
Extending PostSharp Laos
Using PostSharp Core
Code Object Model
Modules, Assemblies and Domains
Types
Generic Constructions
Method Bodies
Debugging Symbols
Binding PostSharp Modules
Binding With System.Reflection
Platform Invoke
Serialized Values
Utilities & Tricks
How to...
How to: Read an Assembly
How to: Iterate All Instructions
Code Weaver
Platform Infrastructure
Understanding the Build Process
Automatic Detection of Tasks
Custom Assembly Binder
Hosting PostSharp
Developing Your Own Plug-In
Defining the Public Interface
Implementing the Analysis and Transformation Logic
Writing the Plug-In Configuration File
Authoring the Installation Package
Publishing Your Work
Module Reader
Module Writer
Class Reference
PostSharp Namespace
ApplicationInfo Class
ApplicationInfo Methods
GetSettingBoolean Method
SetSetting Method
ApplicationInfo Properties
BaseDirectory Property
LocalMachineRegistryKeyName Property
UserRegistryKeyName Property
Version Property
ApplicationInfo Events
SettingChanged Event
AssertionFailedException Class
AssertionFailedException Constructor
AssertionFailedException Constructor (String)
AssertionFailedException Constructor (SerializationInfo, StreamingContext)
AssertionFailedException Constructor (String, Exception)
BoolWithDefault Enumeration
ExceptionHelper Class
ExceptionHelper Constructor
ExceptionHelper Methods
Assert Method
AssertArgumentNotEmptyOrNull Method
AssertArgumentNotNull Method
AssertArgumentNotNull Method (Object, String)
AssertArgumentNotNull Method ( Void *, String)
AssertValidArgument Method
AssertValidOperation Method
AssumeNotNull Method
CreateArgumentException Method
CreateAssertionFailedException Method
CreateBindingException Method
CreateBindingException Method (String, Object[])
CreateBindingException Method (String, Exception, Object[])
CreateFileNotFoundException Method
CreateInvalidEnumerationValueException Method
CreateInvalidOperationException Method
GetMessage Method
GetMessage Method (String)
GetMessage Method (String, Object[])
ITaggable Interface
ITaggable Methods
GetTag Method
SetTag Method
NullableBool Structure
NullableBool Constructor
NullableBool Fields
False Field
Null Field
True Field
NullableBool Methods
BitwiseAnd Operator
BitwiseOr Operator
Equality Operator
Equals Method
Equals Method (Object)
Equals Method (NullableBool)
False Operator
GetHashCode Method
Implicit Method
Implicit Operator
Inequality Operator
LogicalNot Operator
ToString Method
True Operator
NullableBool Properties
IsNull Property
Post Class
Post Methods
Cast(SourceType, TargetType) Method
GetValue(T) Method
Post Properties
IsTransformed Property
Trace Class
Trace Constructor
Trace Methods
Initialize Method
Write Method
Write Method (String)
Write Method (String, Object)
Write Method (String, Object[])
Write Method (String, Object, Object)
Write Method (String, Object, Object, Object)
WriteLine Method
WriteLine Method (String)
WriteLine Method (String, Object)
WriteLine Method (String, Object[])
WriteLine Method (String, Object, Object)
WriteLine Method (String, Object, Object, Object)
Trace Properties
Enabled Property
IsGloballyEnabled Property
PostSharp.CodeModel Namespace
AssemblyEnvelope Class
AssemblyEnvelope Methods
IObservable(String).AddObserver Method
Dispose Method
IAssembly.GetAssemblyEnvelope Method
IObservable(String).GetObservableProperty Method
GetPublicKey Method
GetPublicKeyToken Method
GetSystemAssembly Method
GetTypeDefinition Method
IObserver(String).OnObservedPropertyChanged Method
IObservable(String).RemoveObserver Method
AssemblyEnvelope Properties
Culture Property
FullName Property
IsMscorlib Property
Location Property
ManifestModule Property
Modules Property
Name Property
AssemblyLoadHelper Class
AssemblyLoadHelper Methods
GetLog Method
LoadAssemblyFromFile Method
LoadAssemblyFromFile Method (String)
LoadAssemblyFromFile Method (String, Evidence)
LoadAssemblyFromName Method
LoadAssemblyFromName Method (String)
LoadAssemblyFromName Method (String, Evidence)
LoadType Method
SplitTypeName Method
AssemblyManifestDeclaration Class
AssemblyManifestDeclaration Constructor
AssemblyManifestDeclaration Methods
GetTokenType Method
SetPublicKey Method
WriteILDefinition Method
AssemblyManifestDeclaration Properties
ExportedTypes Property
Files Property
HashAlgorithm Property
OverwrittenFullName Property
OverwrittenName Property
Parent Property
PermissionSets Property
Resources Property
AssemblyRefAttributes Enumeration
AssemblyRefDeclaration Class
AssemblyRefDeclaration Constructor
AssemblyRefDeclaration Methods
FindType Method
GetAssemblyEnvelope Method
Remove Method
SetPublicKeyToken Method
AssemblyRefDeclaration Properties
Attributes Property
HashValue Property
IsWeaklyReferenced Property
TypeRefs Property
AssemblyResolveEventArgs Class
AssemblyResolveEventArgs Properties
AssemblyLocation Property
AssemblyName Property
BindingException Class
BindingException Constructor
BindingException Constructor (String)
BindingException Constructor (SerializationInfo, StreamingContext)
BindingException Constructor (String, Exception)
BindingOptions Enumeration
CallingConvention Enumeration
CustomAttributeConstructorException Class
CustomAttributeConstructorException Constructor
CustomAttributeConstructorException Constructor (String)
CustomAttributeConstructorException Constructor (SerializationInfo, StreamingContext)
CustomAttributeConstructorException Constructor (String, Exception)
CustomAttributeDeclaration Class
CustomAttributeDeclaration Constructor
CustomAttributeDeclaration Constructor (ICustomAttributeValue)
CustomAttributeDeclaration Constructor (IMethod)
CustomAttributeDeclaration Methods
ConstructRuntimeObject Method
InvalidateSerialization Method
CustomAttributeDeclaration Properties
Constructor Property
ConstructorArguments Property
NamedArguments Property
ICustomAttributeInstance.TargetElement Property
ICustomAttributeInstance.Value Property
DataSectionDeclaration Class
DataSectionDeclaration Constructor
DataSectionDeclaration Methods
IObservable(Int32).AddObserver Method
IObservable(Int32).GetObservableProperty Method
IObservable(Int32).RemoveObserver Method
DataSectionDeclaration Properties
IsManaged Property
Ordinal Property
Value Property
Declaration Class
Declaration Constructor
Declaration Properties
DeclaringAssembly Property
Module Property
DeclarationCache Class
DeclarationCache Fields
DelegateGetTarget Field
FieldInfoGetFieldFromHandle Field
FieldInfoGetFieldFromHandle2 Field
IdentityGenericMap Field
MethodBaseGetMethodFromHandle Field
MethodBaseGetMethodFromHandle2 Field
TaggedObjectSerializationType Field
TypeGetTypeFromHandle Field
TypeSerializationType Field
DeclarationCache Methods
Clear Method
GetGenericParameter Method
GetGenericParameterArray Method
GetIntrinsic Method
GetIntrinsic Method (Type)
GetIntrinsic Method (IntrinsicType)
GetIntrinsicBoxedType Method
GetIntrinsicSerializationType Method
GetItem Method
GetType Method
GetType Method (Type)
GetType Method (Type, BindingOptions)
DeclarationCacheCallback Delegate
Domain Class
Domain Constructor
Domain Methods
FindTypeDefinition Method
GetAssembly Method
IsAssemblyLoaded Method
LoadAssembly Method
LoadAssembly Method (Assembly)
LoadAssembly Method (Assembly, Boolean)
Domain Properties
Assemblies Property
Guid Property
Domain Events
AssemblyResolve Event
Element Class
Element Properties
Domain Property
EventDeclaration Class
EventDeclaration Constructor
EventDeclaration Methods
GetReflectionWrapper Method
GetSystemEvent Method
EventDeclaration Properties
EventType Property
ExceptionHandler Class
ExceptionHandler Properties
CatchType Property
FilterBlock Property
HandlerBlock Property
NextSiblingExceptionHandler Property
Options Property
PreviousSiblingExceptionHandler Property
ExportedTypeDeclaration Class
ExportedTypeDeclaration Constructor
ExportedTypeDeclaration Methods
ExportedTypeDeclaration Properties
DeclaringExportedType Property
Implementation Property
TypeDefId Property
FieldDefDeclaration Class
FieldDefDeclaration Constructor
FieldDefDeclaration Fields
AutoOffset Field
FieldDefDeclaration Methods
IField.GetFieldDefinition Method
GetGenericContext Method
GetSystemField Method
Translate Method
FieldDefDeclaration Properties
DeclaringType Property
IMember.DeclaringType Property
FieldType Property
InitialValue Property
LiteralValue Property
MarshalType Property
Offset Property
Visibility Property
FieldRefDeclaration Class
FieldRefDeclaration Constructor
FieldRefDeclaration Methods
GetFieldDefinition Method
FieldRefDeclaration Properties
GenericContextOptions Enumeration
GenericMap Structure
GenericMap Constructor
GenericMap Constructor (IList(ITypeSignature), IList(ITypeSignature))
GenericMap Constructor (GenericMap, IList(ITypeSignature))
GenericMap Fields
Empty Field
GenericMap Methods
Apply Method
GetGenericMethodParameter Method
GetGenericMethodParameters Method
GetGenericParameter Method (IGenericParameter)
GetGenericParameter Method (GenericParameterKind, Int32)
GetGenericTypeParameter Method
GetGenericTypeParameters Method
GetTypeContext Method
GenericMap Properties
GenericMethodParameterCount Property
GenericTypeParameterCount Property
IsEmpty Property
GenericParameterDeclaration Class
GenericParameterDeclaration Constructor
GenericParameterDeclaration Methods
BelongsToClassification Method
Clone Method
ICloneable.Clone Method
ITypeSignature.ContainsGenericArguments Method
IGeneric.GetGenericContext Method
ITypeSignature.GetNakedType Method
GetReference Method
GetSystemType Method
ITypeSignature.GetTypeDefinition Method
GetValueSize Method
MapGenericArguments Method
IVisitable(ITypeSignature).Visit Method
WriteReflectionTypeName Method
GenericParameterDeclaration Properties
Constraints Property
DeclaringGenericDefinition Property
IGeneric.IsGenericDefinition Property
IGeneric.IsGenericInstance Property
Kind Property
GenericParameterKind Enumeration
IAssembly Interface
IAssembly Methods
IAssemblyName Interface
IAssemblyName Methods
IAssemblyName Properties
ICustomAttributeInstance Interface
ICustomAttributeInstance Properties
TargetElement Property
ICustomAttributeValue Interface
ICustomAttributeValue Properties
IDeclaration Interface
IElement Interface
IElement Properties
IField Interface
IField Methods
IField Properties
IGeneric Interface
IGeneric Methods
IGeneric Properties
IsGenericDefinition Property
IsGenericInstance Property
IGenericDefinition Interface
IGenericDefinition Methods
IGenericDefinition Properties
GenericParameterCount Property
IGenericInstance Interface
IGenericInstance Methods
GetGenericArgument Method
IGenericInstance Properties
GenericArgumentCount Property
IGenericMethodDefinition Interface
IGenericMethodDefinition Methods
FindGenericInstance Method
IGenericMethodDefinition Properties
MethodSpecs Property
IGenericParameter Interface
IGenericParameter Methods
IGenericParameter Properties
ImageAttributes Enumeration
IManifestResourceImplementation Interface
IMember Interface
IMember Properties
IMemberRefResolutionScope Interface
IMemberRefResolutionScope Properties
FieldRefs Property
MethodRefs Property
IMetadataDeclaration Interface
IMetadataDeclaration Methods
IMetadataDeclaration Properties
CustomAttributes Property
MetadataToken Property
IMethod Interface
IMethod Methods
GetMethodDefinition Method
GetSystemMethod Method
WriteReflectionMethodName Method
IMethodSignature Interface
IMethodSignature Methods
GetParameterType Method
ReferencesAnyGenericArgument Method
IMethodSignature Properties
CallingConvention Property
ParameterCount Property
ReturnType Property
IModule Interface
IModule Properties
Assembly Property
IModuleScoped Interface
IModuleScoped Properties
INamedType Interface
INamedType Properties
NestedTypes Property
Instruction Class
Instruction Methods
GetLocalVariableSymbol Method
GetOperand Method
GetParameter Method
GetSwitchOperandTarget Method
GetSwitchTargetsOperand Method
Instruction Properties
BranchTargetOperand Property
ByteOperand Property
ConstrainedType Property
DeclarationOperand Property
DoubleOperand Property
FieldOperand Property
HasSymbolSequencePoint Property
InstructionPrefixes Property
Int16Operand Property
Int32Operand Property
Int64Operand Property
LastSymbolSequencePoint Property
LocalVariableOperand Property
MemberRefOperand Property
MethodBody Property
MethodOperand Property
OpCodeNumber Property
OperandType Property
ParameterOperand Property
SignatureOperand Property
SingleOperand Property
StringOperand Property
SwitchOperandTargetCount Property
SymbolSequencePoint Property
TypeOperand Property
UnalignedPrefix Property
InstructionAction Delegate
InstructionBlock Class
InstructionBlock Methods
AddExceptionHandlerCatch Method
AddExceptionHandlerFault Method
AddExceptionHandlerFilter Method
AddExceptionHandlerFinally Method
AddChildBlock Method
AddInstructionSequence Method
DebugOutput Method
DebugOutput Method (IndentedTextWriter)
DefineLocalVariable Method
Detach Method
FindCommonAncestor Method
FindFirstInstructionSequence Method
GetChildrenEnumerator Method
GetChildrenEnumerator Method (Boolean)
MoveInstructionBlock Method
MoveInstructionSequence Method
Nest Method
SplitBlockAfterSequence Method
InstructionBlock Properties
Comment Property
FirstExceptionHandler Property
FirstChildBlock Property
FirstInstructionSequence Property
HasExceptionHandlers Property
HasChildrenBlocks Property
HasInstructionSequences Property
HasLocalVariableSymbols Property
IsExceptionHandler Property
LastExceptionHandler Property
LastChildBlock Property
LastInstructionSequence Property
LocalVariableSymbolCount Property
NextDeepBlock Property
NextSiblingBlock Property
ParentBlock Property
ParentExceptionHandler Property
PreviousDeepBlock Property
PreviousSiblingBlock Property
Token Property
InstructionPrefixes Enumeration
InstructionReader Class
InstructionReader Methods
CreateBookmark Method
EnterInstructionBlock Method
EnterInstructionSequence Method
GetLocalVariableSymbol Method (Int32)
GetLocalVariableSymbol Method (Int32, Boolean)
GoToBookmark Method
JumpToInstructionBlock Method
LeaveInstructionBlock Method
LeaveInstructionSequence Method
ReadInstruction Method
InstructionReader Properties
CurrentInstruction Property
CurrentInstructionBlock Property
CurrentInstructionSequence Property
IsAtEnfOfSequence Property
InstructionReaderBookmark Class
InstructionSequence Class