PostSharp Documentation

PostSharp Documentation PostSharp Documentation

PostSharp is a tool that allows development teams to achieve more with less code in Microsoft .NET:

  1. Software developers will write clean, stable, efficient, and concise code. Fewer lines of code mean less time and fewer defects.
  2. Software architects will be able to deliver partially or fully executable patterns, not just coding guidelines. After having carefully identified and selected design patterns, architects can code, in C# or Visual Basic, how the pattern should be implemented. Depending on the complexity of the pattern, PostSharp will automatically implement the pattern and/or will automatically validate that its manual implementation respects predefined validity rules.

This topic contains the following sections.

  • About Design Pattern Automation
  • PostSharp components
  • How does PostSharp work?
About Design Pattern Automation

PostSharp can be categorized as a Design Pattern Automation tool.

Design Pattern Automation is the use of tools to optimize productivity of development teams implementing software based on patterns. Software patterns are general reusable solutions to a commonly occurring problem. Software design patterns are patterns in the context of software design.

Typically, the architecture team would identify and select design patterns in an early phase of a project. Architects would then create designs that implement the design patterns. These designs typically include class diagrams, and instructions specifying how developers should implement the design. Design specifications are usually expressed in natural language. Design Pattern Automation refers to the ability to express designs in a formal language and use tools to help implementing the design.

Tools can help developers and architects in implementing designs derived from patterns in two ways:

  • Tools can automatically implement some of the artefacts and behaviors required by the design, which then don't appear in source code. Design Pattern Automation therefore raises the level of abstraction of the source code, and makes the design intent more apparent in source code.
  • Tools can validate hand-written code against design rules, from simple naming conventions to complex rules involving analysis of source code. Without tools, this activity would have only relied on code review.

Design Pattern Automation can extend to patterns that are not strictly considered design patterns:

  • Design Pattern Automation extends to application-specific patterns (also named custom patterns), which are specific to the language, framework, and problem domain of an application. Althought these patterns are not general to the whole software engineering industry, their implementation can also be automatically generated and/or validated.
  • Design Pattern Automation extends to implementation patterns, which are mere repetitions of code. Logging and exception handling belong to that category.
PostSharp components

PostSharp is composed of the following frameworks and libraries:

  • PostSharp Pattern Libraries provide ready-made, commoditized implementations of some of the most common patterns in .NET. For more information, see section Working with Ready-Made Aspects.
  • PostSharp Aspect Framework allows you to automate the implementation of other code patterns and address code repetitions that are specific to your own applications, or simply that are not available off-the-shelf in a pattern library. PostSharp Aspect Framework is built on the principle of Aspect-Oriented Programming (AOP), a well-established programming paradigm, orthogonal to (and non-competing with) object-oriented programming or functional programming, that allows to modularize the implementation of some features that would otherwise cross-cut a large number of classes and methods. PostSharp contains the most advanced AOP framework for Microsoft .NET. For more information, see sections Developing Custom Aspects and Adding Aspects to Code.
  • PostSharp Architecture Framework is a static analysis tool that allows you to automate the validation of design pattern implementations, to enforce design intend, or simply to verify coding guidelines. The framework allows you to create constraint classes that encapsulate the validation logic and that can be applied to code artefacts. The framework provides tools to analyze the relationships between code artefacts and have access to the AST of method bodies. For more information, see section Enforcing Design Rules.
How does PostSharp work?

PostSharp inserts itself in the build process and enhances or validates the output of the C# or VB compiler. Although this might sound magic or dangerous, PostSharp's MSIL technology is stable and mature, and has been used by tens of thousands of projects since 2004. Other .NET products relying on MSIL transformation or analysis include Microsoft Code Contracts, Microsoft Code Analysis, and Microsoft Code Coverage.

Online Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)

Send Feedback on this topic to PostSharp Technologies.


What's New in PostSharp?

What's New in PostSharp? PostSharp Documentation

PostSharp has been around since the early days of .NET 2.0 in 2004. Since the first version, many features have been added to make PostSharp the most popular and by far the most powerful tool for aspect-oriented programming and design pattern automation in .NET.

What's New in PostSharp 3.0?

The focus in PostSharp 3.0 was to deliver more value to customers with less initial learning. Instead of having to learn the product before being able to build aspects, customers can now choose from a set of ready-made implementations of some of the most popular design pattern, and apply them to their application from the Visual Studio code editor, using smart tags and wizards. We also improved support for Windows Phone, Silverlight, Windows Store and Portable Class Library.

Model Pattern Library

The NotifyPropertyChangedAttribute aspect is a ready-made implementation of the NotifyPropertyChanged design pattern. The PostSharp.Patterns.Contracts namespace provides code contracts that can validate, at runtime, the value of a parameter, a property, or a field.

Diagnostics Pattern Library

The LogAttribute and LogExceptionAttribute aspects provide a ready-made and high-performance implementation of a tracing aspect. They are compatible with the most popular logging framework, including log4net, nlog, and Enterprise Library.

Threading Pattern Library

PostSharp Threading Pattern Library invites you to raise the level of abstraction in which multithreading is being addressed. It provides three threading models: actors (Actor), reader-writer synchronized (ReaderWriterSynchronizedAttribute) and thread unsafe (ThreadUnsafeAttribute). Additionally, BackgroundAttribute and DispatchedAttribute allow you to easily dispatch a thread back and forth between a background and the UI thread.

Smart Tags and Wizards in Visual Studio

Smart tags allow for better discoverability of ready-made aspects and pattern implementations. When the aspect requires configuration, a wizard user interface collects the parameters and then generates the proper code.

Better platform support through Portable Class Libraries

Windows Phone, Windows Store and Silverlight are now first-class citizens. All features that are available for the .NET Framework now also work with these platforms. All platforms are supported transparently through the portable class library. To provide this feature, we had to develop the PortableFormatter, a portable serializer similar in function to the BinaryFormatter. All you have to do is to replace [Serializable] with [PSerializable].

Unified deployment through NuGet and Visual Studio Gallery

Installation of PostSharp is now unified and built on top of Visual Studio Gallery and NuGet Package Manager.

Transparency to obfuscators

PostSharp no longer requires specific support from obfuscators, as it no longer uses strings to refer to metadata declarations.

Deprecation of old platforms

Support for Silverlight 3, .NET Compact Framework, and Mono has been deprecated.

What's New In PostSharp 2.1?

The objective of release 2.1 was to fix a number of 'gray points' of the version 2.0, which added friction to the adoption path of PostSharp, or even prevented people from using the product.

Better Build-Time Performance

We traded our old text-based compilation engine to a brand new binary writer.

Support for NuGet and Improved No-Setup Experience

PostSharp 2.1 can be installed directly from Online NuGet. Local installation is no longer a requirement to use the Visual Studio Extension. However, because the setup program creates ngenned images, it still provides the faster experience.

Compatibility with Obfuscators

PostSharp can now be used jointly, and without limitation of features, with some obfuscators. See Obfuscation Tools for details.

Extended Reflection API

The class ReflectionSearch allows you to programmatically navigate the structure of an assembly: find custom attributes of a given type, find children of a given type, find members of a given type, find methods referring a given type or members, or find members accessed from a given method.

Architectural Validation

Architecture Validation allows you annotate your code with constraints, which define the conditions in which your API is allowed to be used. Constraints are verified at build time and their violation generates a build warning and an error. See Enforcing Design Rules for details.

Compatibility with Code Contracts

PostSharp 2.1 can be used jointly with Microsoft Code Contracts. Aspects and contracts can be applied to the same method.

Support for Silverlight 5.0

Silverlight 5.0 is added to the list of supported platforms.

License Server

The license server helps customer manage and deploy license keys. The license server is a simple ASP.NET application that can be deployed easily on any Windows machine. Its use is optional.

What's New In PostSharp 2.0?

PostSharp 1.0 and 1.5 made aspect-oriented programming (AOP) popular in the .NET community. PostSharp 2.0 makes it mainstream by enhancing convenience (Visual Studio Extension), reliability (dependency enforcement), run-time performance (optimizer), and features (composite aspects, property- and event-level aspects).

Visual Studio Extension

As developers start being comfortable with PostSharp and add more and more aspects to their code, two questions become manifest: How can I know to which elements of code my aspect has been applied? How can I know which aspects have been applied to the element of code I am looking at? Answering these two questions is precisely what the PostSharp Extension for Visual Studio 2008 and 2010 has been designed for. It provides two new features to the IDE: an Aspect Browser tool window, and new adornments of enhanced elements of code with clickable tooltip.

Composite Aspects (Advices and Pointcuts)

Part of the success of PostSharp 1.5 was due to its ability to introduce aspects without appealing to barbaric terms such as advices and pointcuts. So why to introduce them now? Because they make it easier to develop complex aspects. Thanks to advices and pointcuts, you can implement complex patterns such as observability awareness (INotifyPropertyChanged) with just a few lines of code. And just with PostSharp 1.5, you can still write your own aspects without knowing about advices and pointcuts.

Adaptive Code Generation

PostSharp 2.0 generates much smarter, faster, and smaller code than before. Let's face it: PostSharp 1.5 was quite dumb. It generated a lot of instructions that your aspects did not even need. PostSharp 2.0 analyzes your aspect to see which features are actually being used at runtime, and generates only instructions that support these features. Result: you could probably not write much faster code by hand.

Interception Aspect for Fields and Properties

PostSharp 2.0 comes with a new kind of aspect that handles fields and properties: LocationInterceptionAspect (in replacement of OnFieldAccessAspect). The aspect is much more usable than its predecessor; for instance, it is possible to call the field or property getter from the setter.

Interception Aspect for Events

The new aspect kind EventInterceptionAspect allows an aspect to intercept all event semantics: add, remove, and fire.

Aspect Dependencies

By enforcing aspect dependency rules, PostSharp ensures that aspects behave in a predictable and robust way, even when multiple aspects are applied to the same element of code. This feature is important for large and complex projects, where aspects may be written by different teams, or provided by numerous third-party vendors who don't know about each other.

Instance-Scoped Aspects

In PostSharp 1.5, all aspects had static scope, i.e. there was a single instance of the aspect for every element of code to which they applied. It is now possible to define aspects that have instance lifetime. For instance, if the aspect is applied to an instance field, a new instance of the aspect will be created for every instance of the type declaring the field. This is named an instance-scoped aspect.

Support for New Platforms

  • Microsoft .NET Framework 4.0
  • Microsoft Silverlight 3.0
  • Microsoft Silverlight 4.0
  • Microsoft Windows Phone 7 (Applications and Games)
  • Microsoft .NET Compact Framework 3.5
  • Novell Mono 2.6

Build Time Improvements

Just starting the CLR and loading system assemblies takes considerable time, too much for an application (such as PostSharp) that is typically started very frequently and whose running time is just a couple of seconds. To cope with this issue, PostSharp now preferably runs as a background application

What's New In PostSharp 1.5?

PostSharp 1.5 was published 3 years after the start of the project, and was the first release to be really production-ready.

Aspect Inheritance

It is now possible to put an aspect on an interface and have it implicitly applied to all classes implementing that interface. The same works with classes, virtual or interface methods, and parameters of virtual or interface methods. Read more...

Reading assemblies without loading them in the CLR

In version 1.0, PostSharp required assemblies to be loaded in the CLR (i.e. in the application domain) to be able to read them. This limitation belongs to the past. When PostSharp processes a Silverlight or a Compact Framework assembly, it is never loaded by the CLR.

Lazy loading of assemblies

When PostSharp has to load a dependency assembly, it now reads only the metadata objects it really needs, resulting in a huge performance improvement and much lower memory consumption.

Build-Time Performance Enhancement

The code has been carefully profiled and optimized for maximal performance.

Support for Novell Mono

PostSharp is now truly cross-platform. Binaries compiled on the Microsoft platform can be executed under Novell Mono. Both Windows and Linux are tested and supported. A NAnt task makes it easier to use PostSharp in these environments.

Support for Silverlight 2.0 and the Compact Framework 2.0

You can add aspects to your projects targeting Silverlight 2.0 or the Compact Framework 2.0.

Pluggable Aspect Serializer & Partial Trust

Previously, all aspects were serializers using the standard .NET binary formatter. It is now possible to choose another serializer or implement your own, and enhance assemblies that be executed with partial trust.

Online Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


Deploying and Configuring PostSharp

Deploying and Configuring PostSharp PostSharp Documentation

PostSharp has been designed for easy deployment in typical development environments. Over the years, source control and build servers have become the norm, so we optimized PostSharp for this deployment scenario. All components required for build are published as NuGet packages. These packages are typically stored in source control, or can be restored from a package repository before build. The user interface published as a Visual Studio extension (vsix package).

In most situations, PostSharp should work just fine without any advanced configuration. This chapter includes a detailed description of all deployment and configuration scenarios

This chapter contains the following sections:

  • Requirements
  • Installing PostSharp
  • Deploying License Keys
  • Configuring PostSharp
  • Using PostSharp on a Build Server
  • Restoring packages at build time
  • Upgrading from PostSharp 2
  • Installing PostSharp Unattended

Online Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


Requirements

Requirements PostSharp Documentation

The following software components need to be installed before PostSharp can be used:

  • Microsoft Visual Studio 2010 or 2012, except Express editions.
  • Windows XP with SP3 or later.
  • NuGet Package Manager 2.2 or later.
Note Note
The latest version of NuGet Package Manager will be installed automatically by PostSharp if NuGet 2.2 is not already installed. This operation requires administrative privileges.
Caution note Caution
NuGet Package Manager is still considered unsuitable for some corporate environments, especially in situations with a large number of Visual Studio solutions. Concerns principally include package versioning management. Please contact our technical support if this is a concern for your team.

Online Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


Installing PostSharp

Installing PostSharp PostSharp Documentation

PostSharp is composed of two components:

  • The Visual Studio Extension is the user interface of PostSharp. It extends the Visual Studio editor and provides a new menu, option pages, and toolbox windows. The Visual Studio Extension must be installed on each developer workstation but is not required on build servers.
  • The NuGet package contains the build-time components, which integrate into MSBuild, and the run-time libraries, which should be deployed with the customer's application. The NuGet package is typically included in the source repository or is restored before build from the package repository.

This topic contains the following sections.

  • Installing PostSharp
  • Adding PostSharp to a project
  • Removing PostSharp from a project
  • Uninstalling PostSharp
  • Updating PostSharp
Installing PostSharp

By installing PostSharp, we mean installing its user interface on a developer's computer. This procedure does not add PostSharp to any project.

To install PostSharp:

  1. Download the file PostSharp-X.X.X.X.vsix from Online http://www.postsharp.net/download.

  2. Open the file PostSharp-X.X.X.X.vsix.

  3. Start Visual Studio.

  4. Complete the configuration wizard. You will be asked to enter a license key or to start the trial period. The wizard may ask the permission to install NuGet Package Manager or to uninstall the user interface of PostSharp 2.1.

Adding PostSharp to a project

To add PostSharp to a project:

  1. Open the Solution Explorer in Visual Studio.

  2. Right-click on the project.

  3. Click on Add PostSharp.

Tip Tip
Remember that adding PostSharp to a project just means adding the PostSharp NuGet package. If you want to add PostSharp to several projects in a solution, it may be easier to use NuGet to manage packages at solution level. You may need to select the Include Prerelease option to install a prerelease version of PostSharp.
Tip Tip
NuGet Package Manager can be configured using a file named nuget.config, which can be checked into source control and can specify, among other settings, the location of the package repository (if it must be shared among several solutions, for instance) or package sources (if packages must be pre-approved). See Online NuGet Configuration File and Online NuGet Configuration Settings for more information.
Removing PostSharp from a project

To remove PostSharp from a project:

  1. Open the Solution Explorer in Visual Studio.

  2. Right-click on the project.

  3. Click on Manage NuGet Packages.

  4. Click on Installed Packages.

  5. Find the PostSharp package and click on Remove.

Uninstalling PostSharp

To uninstall PostSharp from Visual Studio:

  1. Open Visual Studio.

  2. Click on menu Tools, then Extensions and Updates.

  3. Find the PostSharp extension and click on Uninstall.

  4. Restart Visual Studio.

Updating PostSharp

When updating PostSharp, remember that it is composed of two kinds of components: the Visual Studio extension and the NuGet packages. These components can be updated separately. The Visual Studio extension is only loosely coupled to the NuGet packages, so the versions do not need to match.

To update the Visual Studio extension:

  1. Open Visual Studio.

  2. Click on menu Tools, then Extensions and Updates.

  3. Click on menu Updates, then Visual Studio Gallery.

  4. Find the PostSharp extension and click on Update.

  5. Restart Visual Studio.

Caution note Caution
Updating the Visual Studio extension for PostSharp does not update the PostSharp NuGet packages.

To update the NuGet packages:

  1. Open the Solution Explorer in Visual Studio.

  2. Right-click on the solution.

  3. Click on Manage NuGet Packages for Solution.

  4. Click on Updates.

  5. Find the PostSharp package and click on Update.

  6. Select all projects, click OK.

Online Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


Deploying License Keys

Deploying License Keys PostSharp Documentation

This section explains how to install PostSharp license keys.

Whether you are using a free or commercial edition, PostSharp requires you to enter a license key before being able to build a project.

This topic contains the following sections.

  • Registering a license key using the user interface
  • Subscribing to a license server using the licensing wizard
  • Installing the license settings in source control
  • License activation and audit
Registering a license key using the user interface

Registering a license key using the user interface is the prefered procedures for individual developers and small teams.

To register a license key using the user interface:

  1. Open Visual Studio.

  2. Click on menu PostSharp, then Options.

  3. Open the License option page.

  4. Click on the Register a license link.

  5. Click on Register a license.

    License Wizard 1

  6. Paste the license key and click Next .

    License Wizard 2

  7. Read the license agreement and check the option I agree. Click on Next.

    License Wizard 3
    Tip Tip
    If you are registering the license key on a build server, also check the option Register these settings for all accounts on this machine.

  8. Click Next on the notice regarding license metering.

Subscribing to a license server using the licensing wizard

PostSharp Commercial Licenses are floating licenses. The license server is a product that provides license leases to developers and computes how many developers are using the product at any time. If the number of concurrent users exceeds the licensed number, the license administrator will receive an email, and excess users will be allowed during a grace period. At the end of the grace period, only the licensed number of concurrent users will be allowed. The duration of the grace period and the number of excess users depend on the kind of license. By default, it is set to 30% of users and 30 days.

Caution note Caution
Using a license server is substantially more cumbersome than other deployment options, becauses it requires your team to maintain an ASP.NET application running IIS as well as an SQL database. Remember that the use of the license server is purely optional and benevolent. Before deciding to use the license server, you may want to consider other options.

To subscribe to a license server using the licensing wizard:

  1. Ask your administrator to download and install the license server. It consists in a MS SQL database and an ASP.NET application.

  2. Open Visual Studio.

  3. Click on menu PostSharp, then Options.

  4. Open the License option page.

  5. Click on the Register a license link.

  6. Click Subscribe to a license server.

    License Wizard 4

  7. Enter the URL where the license server has been installed. You should be able to access this URL with a browser. Click Next.

    License Wizard 5

  8. Read the license agreement and check the option I agree. Click on Next.

    License Wizard 3
    Tip Tip
    If you are registering the license key on a build server, also check the option Register these settings for all accounts on this machine.
Important note Important
If you have subscribed to a license server, you will need periodic connections to the company network. The licensing client will automatically try to renew a lease when it comes close to expiration and if the license server is available. Lease duration and renewal settings can be configured by the administrator of the license server. A connection to the license server is not necessary while the lease is valid.
Installing the license settings in source control

It is possible to install the license settings (license key or license server URL) in source control, so that these settings are automatically applied during the build.

To install license settings in source control:

  1. Create a file named PostSharp.Custom.targets in the directory that contains the Visual Studio project file (*.csproj or *.vbproj), or in a parent of this directory (up to 8 levels from the project file). Typically, you would create this file in the root directory of the source control project.

  2. Add the following content to the PostSharp.Custom.targets file:

    XML
    View Colorized Copy to Clipboard Print
    <Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
  <PropertyGroup>
    <PostSharpLicense>xxx</PostSharpLicense>
  </PropertyGroup>
</Project>
    <Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
  <PropertyGroup>
    <PostSharpLicense>xxx</PostSharpLicense>
  </PropertyGroup>
</Project>

    In this code, xxx must be replaced by the license key or the URL to the license server.

License activation and audit

Althought most software packages are protected with a license activation mechanism, we judged that the practice is not adequate for software development tools:

  • Source code is sometimes compiled several years after it has been written, and there is no guarantee that the license activation server will still be functional.
  • Development teams want their tools to be included in the source control repository together with source code, and want the license key to be deployed the same way.

Instead of license activation, PostSharp relies on asynchronous, fail-safe license audit. PostSharp audits the use of license keys on each client machine and periodically reports it to our license servers. The mechanism does not require a permanent network connection, and PostSharp will not fail if the license server is not available.

The licensing client will contact our licensing servers in the following cases:

  • When a license is registered on a computer with the user interface.

    Once per week, for every user and every device using PostSharp.

No personally identificable information is transmitted during this process except the license key. In case we suspect a rough violation of the License Agreement, we reserve the right to contact the legitimate owner of this license.

Tip Tip
If license audit is not acceptable in your industry, please contact us with a request to disable license audit. Our sales teams will evaluate your request and answer with a license key containing an audit waiver. Global licenses and site licenses are not subject to license audit by default. The use of the license server does not implicitly disable license audit.

Online Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


Configuring PostSharp

Configuring PostSharp PostSharp Documentation

PostSharp accepts several configuration settings such as the version and processor architecture of the target CLR, the search path of dependencies, and whether some features are enabled. Although the default value of settings are appropriate for most situations, you may have to fine-tune some of them to cope with particular cases.

Most PostSharp configuration settings are materialized as MSBuild properties. Therefore, adjusting PostSharp settings does not differ from modifying the settings of any other build component, such as the compiler.

You can modify PostSharp settings by one of the following ways.

  • Using the PostSharp project property page in Visual Studio
  • Editing the project file with a text editor
  • Configuring several projects at a time using PostSharp.Custom.targets
  • Using a command-line parameter of MSBuild
Using the PostSharp project property page in Visual Studio

Most common properties can be edited directly from Visual Studio using the PostSharp project property page.

The PostSharp property page in Visual Studio
Project Property Page
Editing the project file with a text editor

To set a property that persistently applies to a specific project, but not to the whole solution, the best solution is to define it directly inside the C# or Visual Basic project file (*.csproj or *.vbproj, respectively) using a text editor.

Adding a project-level MSBuild property using Visual Studio

  1. Open the Solution Explorer, right-click on the project name, click on Unload project, then right-click again on the same project and click on Edit.

  2. Insert the following XML fragment just before the <Import /> elements:

    XML
    View Colorized Copy to Clipboard Print
    <PropertyGroup>
    <PropertyName>PropertyValue</PropertyName>
</PropertyGroup>
    <PropertyGroup>
    <PropertyName>PropertyValue</PropertyName>
</PropertyGroup>

    See Configurable MSBuild Properties for the list of MSBuild properties used by PostSharp.

    Note Note
    Since you are defining a standard MSBuild property, you are free to use all MSBuild features. For instance, you can use conditional elements to define properties specific to a given build configuration. See MSBuild configuration for details.

  3. Save the file. If the project was open in Visual Studio, go to the Solution Explorer, right-click on the project name, then click on Reload project.

Configuring several projects at a time using PostSharp.Custom.targets

Instead of editing every project file, you can define shared settings in a file named PostSharp.Custom.targets and store in the same directory as the project file or in any parent directory of the parent file (up to 7 levels from the project directory).

Files PostSharp.Custom.targets are loaded from the root directory to the project directory, so that files that are closer to the project directory are loaded after and override files in parent directories.

Thanks to this mechanism, it is possible to define settings that apply to a large set of projects and control the grain of settings.

Files PostSharp.Custom.targets are normal MSBuild project or targets files; they should have the following content:

A sample PostSharp.Custom.targets file
View Colorized Copy to Clipboard Print
<? xml version="1.0" encoding="utf-8" ?>
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
  <PropertyGroup>
    <PropertyName>PropertyValue</PropertyName>
  </PropertyGroup>
</Project>
<? xml version="1.0" encoding="utf-8" ?>
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
  <PropertyGroup>
    <PropertyName>PropertyValue</PropertyName>
  </PropertyGroup>
</Project>

See Configurable MSBuild Properties for the list of MSBuild properties used by PostSharp.

Note Note
Since you are defining a standard MSBuild property, you are free to use all MSBuild features. For instance, you can use conditional elements to define properties specific to a given build configuration. See MSBuild configuration for details.
Using a command-line parameter of MSBuild

When an MSBuild property does not need to be set permanently, it is convenient to set is from the command prompt by appending the flag /p:PropertyName=PropertyValue to the command line of msbuild.exe, for instance:

View Colorized Copy to Clipboard Print
msbuild.exe /v:detailed /p:PostSharpAttachDebugger=true /p:PostSharpBuild=Diag /p:PostSharpTrace=AspectWeaver
msbuild.exe /v:detailed /p:PostSharpAttachDebugger=true /p:PostSharpBuild=Diag /p:PostSharpTrace=AspectWeaver

Online Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


Configurable MSBuild Properties

Configurable MSBuild Properties PostSharp Documentation

Most configuration settings of PostSharp can be set as MSBuild properties.

Note Note
The integration of PostSharp with MSBuild is implemented in files PostSharp.tasks and PostSharp.targets. These files defined properties and items that are not documented here. They are considered implementation details and can change without warning.

This topic contains the following sections.

  • General Properties
  • Hosting Properties
  • Diagnostic Properties
  • Other Properties
General Properties

The following properties are most commonly overwritten. They can be edited in Visual Studio using the PostSharp project property page.

Property Name | Description
PostSharpSearchPath | A semicolon-separated list of directories added to the PostSharp search path. PostSharp will probe these directories when looking for an assembly or an add-in. Note that several directories are automatically added to the search path: the .NET Framework reference directory, the directories containing the dependencies of your project and the directories added to the reference path of your project (tab Reference Path in the Visual Studio project properties dialog box).
SkipPostSharp | True if PostSharp should not be executed.
PostSharpOptimizationMode | When set to OptimizeForBuildTime, PostSharp will use a faster algorithm to generate the final assembly. The other possible value is OptimizeForSize. The default value of the PostSharpOptimizationMode property is OptimizeForBuildTime by default and OptimizeForSize when the C# or Visual Basic compiler is set to generate optimal code (typically, in release builds).
PostSharpDisabledMessages | Comma-separated list of warnings and messages that should be ignored.
PostSharpEscalatedMessages | Comma-separated list of warnings that should be escalated to errors. Use * to escalate all warnings.
PostSharpLicense | License key or URL of the license server.
PostSharpProperties | Additional properties passed to the PostSharp project, in format Name1=Value1;Name2=Value2. See Configurable PostSharp Properties.
PostSharpConstraintVerificationEnabled | Determines whether verification of architecture constraints is enabled. The default value is True.
Hosting Properties

Because PostSharp not only reads, but also executes the assemblies it transforms, it must run under the proper version and processor architecture of the CLR. Additionally, for each version and processor architecture. The following properties allow to influence the choice of the PostSharp host process.

Property Name | Description
PostSharpTargetFrameworkVersion | Version of the CLR that hosts the PostSharp process. The only valid value is 4.0. By default, the value of this property is chosen according to the target framework version of the project.
PostSharpTargetProcessor | Processor architecture of the PostSharp hosting process. Valid values are x86 and x64. By default, the value of this property is chosen according to the target platform of the project. If the target platform is AnyCPU, the architecture of the current machine will be chosen.

PostSharpHost

Kind of process hosting PostSharp. The following values are supported:

  • PipeServer means that PostSharp will run as a background process invoked synchronously from MSBuild. Using the pipe server results in lower build time, since PostSharp would otherwise have to be started every time a project is built. The pipe server uses native code and the CLR Hosting API to control the way assemblies are loaded in application domains; the assembly loading algorithm is generally more accurate and predictable than with the managed host.
  • Native uses the same native code as the pipe server, but the process runs synchronously and terminates immediately after an assembly has been processed. For this reason, it does not have the same build-time performance as the pipe server, but it has exactly the same assembly loading algorithm and is useful for diagnostics.
  • Managed is a purely managed application. The assembly loading algorithm may be less reliable in some situations because PostSharp has less control over it. However, it is the same algorithm as the one of PostSharp 1.5. The managed host is the only one that runs on Mono.
PostSharpBuild | Build configuration of PostSharp. Valid values are Release, Diag and Debug. Only the Release build is distributed in the normal PostSharp packages.
PostSharpHostConfigurationFile | A semicolon-separated list of configuration files containing assembly binding redirections that should be taken into account by the PostSharp hosting process, such as app.config or web.config.
Diagnostic Properties
Property Name | Description
PostSharpAttachDebugger | If this property is set to True, PostSharp will break before starting execution, allowing you to attach a debugger to the PostSharp process. The default value is False. For details, see Attaching a Debugger at Build Time.
PostSharpTrace | A semicolon-separated list of trace categories to be enabled. The property is effective only when PostSharp runs in diagnostic mode (see property PostSharpBuild here above). Additionally, the MSBuild verbosity should be set to detailed at least. For details, see Attaching a Debugger at Build Time.
PostSharpUpdateCheckDisabled | True if the periodic update check mechanism should be disabled, False otherwise.
PostSharpExpectedMessages | A semicolon-separated list of codes of expected messages. PostSharp will return a failure code if any expected message was not emitted. This property is used in unit tests of aspects, to ensure that the application of an aspect results in the expected error message.
PostSharpIgnoreError | If this property is set to True, the PostSharp30 MSBuild task will succeed even if PostSharp returns an error code, allowing the build process to continue. The project or targets file can check the value of the ExitCode output property of the PostSharp30 to take action.
PostSharpFailOnUnexpectedMessage | This property should be used jointly with PostSharpExpectedMessages. If it set to True, PostSharp will fail if any unexpected message was emitted, even if this message was not an error. This property is used in unit tests of aspects, to ensure that the application of an aspect did not result in other messages than expected.
Other Properties
Property Name | Description
PostSharpProject | Location of the PostSharp project (*.psproj) to be executed by PostSharp, or the string None to specify that PostSharp should not be invoked. If this property is defined, the standard detection mechanism based on references to the PostSharp.dll is disabled.
PostSharpUseHardLink | Use hard links instead of file copies when creating the snapshot for Visual Studio Code Analysis (FxCop). This property is True by default.

Online Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


Configurable PostSharp Properties

Configurable PostSharp Properties PostSharp Documentation

The previous section listed properties that are understood by PostSharp but must be defined as MSBuild properties. Additionally, PostSharp has its own system of properties. A project can pass properties to PostSharp by setting the MSBuild property PostSharpProperties. Some system properties have already assigned a value and must not be overwritten.

How to define PostSharp properties?

Some properties are mapped to MSBuild properties and should be modified as described in Configuring PostSharp.

Other properties can be set in Visual Studio using the PostSharp project property page (text box additional properties). Alternatively, you can define the MSBuild property PostSharpProperties in your project files or PostSharp.Custom.targets. For instance, the following MSBuild project fragment defines the PostSharp property IgnoredAssemblies:

Defining a PostSharp properties in MSBuild
View Colorized Copy to Clipboard Print
<PropertyGroup>
  <PostSharpProperties>
    $(PostSharpProperties);
    IgnoredAssemblies=ObfuscatedThirdPartyLib1,ObfuscatedThirdPartyLib2
  </PostSharpProperties>
</PropertyGroup>
<PropertyGroup>
  <PostSharpProperties>
    $(PostSharpProperties);
    IgnoredAssemblies=ObfuscatedThirdPartyLib1,ObfuscatedThirdPartyLib2
  </PostSharpProperties>
</PropertyGroup>
List of properties

The following table lists the PostSharp properties that may be set from the MSBuild project. The second column specifies the name of the MSBuild property that influences the value of the PostSharp property, if any.

Property Name | MSBuild Property Name | Description
Configuration | Configuration | Build configuration (typically Debug or Release).
Platform | Platform | Target processor architecture (typically AnyCPU, x86 or x64).
MSBuildProjectFullPath | MSBuildProjectFullPath | Full path of the C# or VB project being built.
IgnoredAssemblies |  | Comma-separated list of assembly short names (without extension) that should be ignored by the dependency scanning algorithm. Add an assembly to this list if it is obfuscated, or contains native code, and causes PostSharp to fail.
ReferenceDirectory | MSBuildProjectDirectory | Directory with respect to which relative paths are resolved.
SearchPath | PostSharpSearchPath | Comma-separated list of directories containing reference assemblies and plug-ins.
TargetFrameworkIdentifier | TargetFrameworkIdentifier | Identifier of the target framework of the current project (i.e. the framework on which the application will run). For instance .NETFramework or Silverlight.
TargetFrameworkVersion | TargetFrameworkVersion | Version of the target framework of the current project (i.e. the framework on which the application will run). For instance v4.0.
TargetFrameworkProfile | TargetFrameworkProfile | Profile of the target framework of the current project (i.e. the framework on which the application will run). For instance WindowsPhone.

Other properties are recognized but are of little interest for end-users. For a complete list of properties, see PostSharp.targets.

Accessing properties from source code

You can read the value of any PostSharp property thanks to the following piece of code:

C#
VB
C++
F#
View Colorized Copy to Clipboard Print
string value = PostSharpEnvironment.Current.CurrentProject.EvaluateExpression("{$PropertyName}")
string value = PostSharpEnvironment.Current.CurrentProject.EvaluateExpression("{$PropertyName}")
Using custom properties

          By defining your own PostSharp properties, you can pass information from the build environment to aspects, or to
          any code running in PostSharp. Custom PostSharp properties behave exactly as other PostSharp properties, so they
          can be defined and read using the same procedures.

  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


Using PostSharp on a Build Server

Using PostSharp on a Build Server PostSharp Documentation

PostSharp 3 has been designed for frictionless use on build servers. PostSharp build-time components are deployed as NuGet packages, and are integrated with MSBuild. No component needs to be installed or configured on the build server, and no extra build step is necessary. If you choose not to check in NuGet packages in your source control, read Restoring packages at build time.

Installing a License on the Build Server

The License Agreement specifies that build servers don’t need their own license. PostSharp will not attempt to enforce licensing if it detects that it runs in unattended mode. PostSharp uses several heuristics to detect whether it is running unattended. These heuristics include the use of Environment.UserInteractive, checking Process.SessionId (from Windows Vista, all processes running in session 0 are unattended), or checking the parent process.

If this check does not work for any reason, you may use the license key of any licensed user for the build server. This will not be considered a license infringement. However, it is better to report the issue to our technical support so that we can fix the detection algorithms.

It is recommended to include the license key in the source control. See Deploying License Keys for details.

See Also

Online Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


Restoring packages at build time

Restoring packages at build time PostSharp Documentation

NuGet Restore is a feature of NuGet Package Manager that restores packages from their repository during the build. This allows teams to avoid storing NuGet packages in source repository.

PostSharp is not fully compatible with NuGet Restore. The reason is that PostSharp modifies the project file (csproj or vbproj, typically) to include the file PostSharp.targets. This file is required during the build, otherwise PostSharp is not inserted in the build process, and simply does not work. Because of the design of MSBuild, PostSharp.targets must be present when the build starts, so it cannot be restored from the package repository during the same build. The build that triggers the package restore will fail, and subsequent builds will succeed.

This behavior is acceptable on developer workstations. However, on build servers, you must ensure that the packages are restored before the project is built.

To restore NuGet packages before build:

  • Add a preliminary step before building the Visual Studio solutions or projects. This step should execute the command NuGet.exe install packages.config -OutputDirectory SolutionDirectory\packages for every packages.config file. where SolutionDirectory\packages is the directory where the NuGet packages should be installed.

Tip Tip
You can use PowerShell or MSBuild to execute the nuget install command to all packages.config files in your source repository.

Online Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


Upgrading from PostSharp 2

Upgrading from PostSharp 2 PostSharp Documentation

This section explains how to upgrade from PostSharp 2 to PostSharp 3.

PostSharp 3 can be installed side-by-side with PostSharp 2.0 and PostSharp 2.1 on the same machine.

However, both versions of PostSharp cannot be used together in the same project. Every project can have only references to a single version of PostSharp. This applies both to direct and indirect references. The PostSharp 3 compiler is not backward compatible with PostSharp 2, and PostSharp 3 will refuse to compile projects that have a reference to PostSharp 2. Therefore, you will typically use a single version of PostSharp in every solution.

Tip Tip
Other sections of this chapter, specifically Installing PostSharp, Deploying License Keys and Using PostSharp on a Build Server, are also useful if you need to upgrade from an earlier version of PostSharp.
Side-by-side installation

After you install PostSharp 3, you will still be able to open solutions that use PostSharp 2.

The Visual Studio extension of PostSharp 3 is backward compatible with PostSharp 2. However, both versions of the extension cannot coexist. Therefore, PostSharp 3 will attempt to uninstall the Visual Studio extension of PostSharp 2.

Upgrading solutions
Caution note Caution

Do not upgrade to PostSharp 3 in the following situations:

  • The solution must build on Visual Studio 2008 or on Mono.
  • The application targets .NET Compact Framework or Silverlight 3.
  • The application has dependencies to third-party libraries that have references to earlier versions of PostSharp and have not been ported to PostSharp 3.
  • Some aspects still use the old PostSharp.Laos.dll and have not been ported to the PostSharp 2 API.

You can upgrade projects from PostSharp 2 to PostSharp 3 by adding the PostSharp NuGet package to these projects.

To upgrade a solution from PostSharp 2 to PostSharp 3:

  1. Open the Solution Explorer in Visual Studio.

  2. Right-click on the solution.

  3. Click on Manage NuGet Packages for Solution.

  4. Click on Online.

  5. In the search box, type PostSharp. You may want to select the Select prereleases option (instead of the default Stable Only) to install a pre-release version of PostSharp.

  6. Find the PostSharp package and click on Install.

  7. Select all projects, click OK.

Note Note
This procedure may be cumbersome if you have a large number of solutions. Please contact our technical support if you are in this situation.
Upgrading source code

Althought PostSharp 3 is mostly backward compatible with PostSharp 2 at source-code level, you may need to perform small adjustments to your source code:

  • Every occurrence of the Online _Assembly interface has been replaced by the Online Assembly classes. You may have to change the signatures of some methods derived from AssemblyLevelAspect.
  • Aspects that target Silverlight, Windows Phone or Windows Store must be annotated with the PSerializableAttribute custom attribute.
  • PostSharp Toolkits 2.1 need to be uninstalled using NuGet. Instead, you can install PostSharp Pattern Libraries 3 from NuGet. Namespaces and some type names have been changed.

Online Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


Installing PostSharp Unattended

Installing PostSharp Unattended PostSharp Documentation

PostSharp is composed of a user interface (a Visual Studio extension) and build components (NuGet packages). NuGet packages are usually checked into source control or retrieved from a package repository at build time (see Restoring packages at build time), so its deployment does not require additional automation. The user interface is typically installed by each user. It does not require administrative privileges.

Caution note Caution
The PostSharp user interface requires NuGet Package Manager 2.2, which is not installed by default with Visual Studio. Installing NuGet requires administrative privileges on the local machine.

You can install PostSharp automatically for a large number of users using a script.

To install PostSharp on a machine:

  1. Ensure that NuGet 2.2 is installed. Your script will need to look for a file named NuGet.Core.dll under the following directories. The search should include up to 2 levels of subdirectories.

    • C:\Program Files (x86)\Microsoft Visual Studio 10.0\Common7\IDE\Extensions for Visual Studio 2010.
    • C:\Program Files (x86)\Microsoft Visual Studio 11.0\Common7\IDE\Extensions for Visual Studio 2012.

  2. If NuGet 2.2 is not installed, install it with the command line VsixInstaller.exe /q NuGet.Tools.vsix. This command requires administrative privileges on the local machine. The current version of NuGet.Tools.vsix can be downloaded from Online Visual Studio Gallery. Note that PostSharp is tested with versions that are current at the time of writing. If you need to be able to restore a working development environment several years from now, it is a good idea to archive a version of NuGet that is known to work with your version of PostSharp.

  3. Execute command line VsixInstaller.exe /q PostSharp-VERSION.vsix. The file can be downloaded from Online Visual Studio Gallery. Exit codes other than 0 or 1001 should be considered as errors.

  4. Install the license key or the license server URL in the registry key HKEY_CURRENT_USER\Software\SharpCrafters\PostSharp 3, registry value LicenseKey (type REG_SZ).

This procedure can be automated by the following PowerShell 2.0 script:

Unattended installation script
View Colorized Copy to Clipboard Print
# TODO: Set the right value for the following variables
$postsharpFile = "PostSharp-3.0.14-beta.vsix"   # Replace with the proper version number and add the full path.
$nugetFile = "NuGet.Tools.vsix"                 # Add the full path.
$license = "XXXX-XXXXXXXXXXXXXXXXXXXXXXXXX"     # Replace by your license key or license server URL.

$installNuget = $false

# Check NuGet in Visual Studio 2010.
if ( Test-Path "C:\Program Files (x86)\Microsoft Visual Studio 10.0\Common7\IDE\devenv.exe" )
{

    $vsixInstaller = "C:\Program Files (x86)\Microsoft Visual Studio 10.0\Common7\IDE\VsixInstaller.exe"

    $nugetVs10Path = dir "C:\Program Files (x86)\Microsoft Visual Studio 10.0\Common7\IDE\Extensions" -Include "NuGet.Core.dll" -Recurse | select -First 1

    if ( $nugetVs10Path -eq $null )
    {
        $installNuget = $true
    }
    else
    {
        $nugetVs10Version = [System.Diagnostics.FileVersionInfo]::GetVersionInfo($nugetVs10Path)
        Write-Host "Detected NuGet" $nugetVs10Version.FileVersion "for Visual Studio 2010."
        if ( $nugetVs10Version.FileMajorPart -lt 2 -or $nugetVs10Version.FileMinorPart -lt 1 )
        {
            $installNuget = $true;
        }
    }
}

# Check NuGet in Visual Studio 2012.
if ( Test-Path "C:\Program Files (x86)\Microsoft Visual Studio 11.0\Common7\IDE\devenv.exe" )
{

    $vsixInstaller = "C:\Program Files (x86)\Microsoft Visual Studio 11.0\Common7\IDE\VsixInstaller.exe"
    $nugetVs11Path = dir "C:\Program Files (x86)\Microsoft Visual Studio 11.0\Common7\IDE\Extensions" -Include "NuGet.Core.dll" -Recurse | select -First 1

    if ( $nugetVs11Path -eq $null )
    {
        $installNuget = $true
    }
    else
    {
        $nugetVs11Version = [System.Diagnostics.FileVersionInfo]::GetVersionInfo($nugetVs10Path)
        Write-Host "Detected NuGet"  $nugetVs11Version.FileVersion "for Visual Studio 2012."
        if ( $nugetVs11Version.FileMajorPart -lt 2 -or $nugetVs11Version.FileMinorPart -lt 1 )
        {
            $installNuget = $true;
        }
    }
}

if ( -not ( Test-Path $vsixInstaller) )
{
    Write-Host "Cannot find " $vsixInstaller
    exit
}

# Install NuGet
if ( $installNuget )
{
    Write-Host "Installing NuGet"
    $process = Start-Process -FilePath  $vsixInstaller -ArgumentList @("/q", $nugetFile) -Wait -Verb runas  -PassThru
    if ( $process.ExitCode -ne 0 -and $process.ExitCode -ne 1001)
    {
        Write-Host "Error: VsixInstaller exited with code" $process.ExitCode -ForegroundColor Red
    }
}

# Install PostSharp
Write-Host "Installing PostSharp"
$process = Start-Process -FilePath $vsixInstaller -ArgumentList @("/q", $postsharpFile) -Wait -PassThru
if ( $process.ExitCode -ne 0 -and $process.ExitCode -ne 1001)
{
    Write-Host "Error: VsixInstaller exited with code" $process.ExitCode -ForegroundColor Red
}

# Install the license key
Write-Host "Installing the license key"
$regPath = "HKCU:\Software\SharpCrafters\PostSharp 3"

if ( -not ( Test-Path $regPath ) )
{
    New-Item -Path $regPath | Out-Null
}

Set-ItemProperty -Path $regPath -Name "LicenseKey" -Value $license

Write-Host "Done"
# TODO: Set the right value for the following variables
$postsharpFile = "PostSharp-3.0.14-beta.vsix"   # Replace with the proper version number and add the full path.
$nugetFile = "NuGet.Tools.vsix"                 # Add the full path.
$license = "XXXX-XXXXXXXXXXXXXXXXXXXXXXXXX"     # Replace by your license key or license server URL.

$installNuget = $false

# Check NuGet in Visual Studio 2010.
if ( Test-Path "C:\Program Files (x86)\Microsoft Visual Studio 10.0\Common7\IDE\devenv.exe" )
{

    $vsixInstaller = "C:\Program Files (x86)\Microsoft Visual Studio 10.0\Common7\IDE\VsixInstaller.exe"

    $nugetVs10Path = dir "C:\Program Files (x86)\Microsoft Visual Studio 10.0\Common7\IDE\Extensions" -Include "NuGet.Core.dll" -Recurse | select -First 1

    if ( $nugetVs10Path -eq $null )
    {
        $installNuget = $true
    }
    else
    {
        $nugetVs10Version = [System.Diagnostics.FileVersionInfo]::GetVersionInfo($nugetVs10Path)
        Write-Host "Detected NuGet" $nugetVs10Version.FileVersion "for Visual Studio 2010."
        if ( $nugetVs10Version.FileMajorPart -lt 2 -or $nugetVs10Version.FileMinorPart -lt 1 )
        {
            $installNuget = $true;
        }
    }
}

# Check NuGet in Visual Studio 2012.
if ( Test-Path "C:\Program Files (x86)\Microsoft Visual Studio 11.0\Common7\IDE\devenv.exe" )
{

    $vsixInstaller = "C:\Program Files (x86)\Microsoft Visual Studio 11.0\Common7\IDE\VsixInstaller.exe"
    $nugetVs11Path = dir "C:\Program Files (x86)\Microsoft Visual Studio 11.0\Common7\IDE\Extensions" -Include "NuGet.Core.dll" -Recurse | select -First 1

    if ( $nugetVs11Path -eq $null )
    {
        $installNuget = $true
    }
    else
    {
        $nugetVs11Version = [System.Diagnostics.FileVersionInfo]::GetVersionInfo($nugetVs10Path)
        Write-Host "Detected NuGet"  $nugetVs11Version.FileVersion "for Visual Studio 2012."
        if ( $nugetVs11Version.FileMajorPart -lt 2 -or $nugetVs11Version.FileMinorPart -lt 1 )
        {
            $installNuget = $true;
        }
    }
}

if ( -not ( Test-Path $vsixInstaller) )
{
    Write-Host "Cannot find " $vsixInstaller
    exit
}

# Install NuGet
if ( $installNuget )
{
    Write-Host "Installing NuGet"
    $process = Start-Process -FilePath  $vsixInstaller -ArgumentList @("/q", $nugetFile) -Wait -Verb runas  -PassThru
    if ( $process.ExitCode -ne 0 -and $process.ExitCode -ne 1001)
    {
        Write-Host "Error: VsixInstaller exited with code" $process.ExitCode -ForegroundColor Red
    }
}

# Install PostSharp
Write-Host "Installing PostSharp"
$process = Start-Process -FilePath $vsixInstaller -ArgumentList @("/q", $postsharpFile) -Wait -PassThru
if ( $process.ExitCode -ne 0 -and $process.ExitCode -ne 1001)
{
    Write-Host "Error: VsixInstaller exited with code" $process.ExitCode -ForegroundColor Red
}

# Install the license key
Write-Host "Installing the license key"
$regPath = "HKCU:\Software\SharpCrafters\PostSharp 3"

if ( -not ( Test-Path $regPath ) )
{
    New-Item -Path $regPath | Out-Null
}

Set-ItemProperty -Path $regPath -Name "LicenseKey" -Value $license

Write-Host "Done"

Online Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


Incompatibilities with Other Products

Incompatibilities with Other Products PostSharp Documentation

PostSharp is not compatible with the following products or features:

Product or Feature | Reason | Workaround
ILMerge | Bug in ILMerge | Use another product (such as SmartAssembly).
Edit-and-Continue | Not Supported | Rebuild the project after edits
Silverlight 3 or earlier | No support for PCL | Use PostSharp 2.1 or Silverlight 4
.NET Compact Framework | No support for PCL | Use PostSharp 2.1 or Windows Phone 7
Mono | Not Supported | Compile on Windows using MSBuild
Visual Studio Express | Microsoft's licensing policy | Use Visual Studio Standard Edition or superior
Delayed strong-name signing on cloud build servers | No way to unregister verification of strong names | Use normal (non-delayed) strong-name signing or use build servers where you have administrative access.
See Also

Online Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


Working with Ready-Made Aspects

Working with Ready-Made Aspects PostSharp Documentation

PostSharp Pattern Libraries are sets of ready-made aspects. Some of these aspects, such as logging, are straightforward. Other aspects implement more complex design patterns such as the reader-writer-synchronized threading model.

PostSharp currently includes the following pattern libraries:

Pattern Library | Included aspects and pattern implementations
Diagnostics Pattern Library | Logging
Model Pattern Library | INotifyPropertyChanged, code contracts
Threading Pattern Library | Reader-writer-synchronized threading model, thread-unsafe threading model, actor threading model, thread dispatching.

Online Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


Working with the Diagnostics Pattern Library

Working with the Diagnostics Pattern Library PostSharp Documentation

The Diagnostics Pattern Library enables you to configure where logging should be performed and to keep your log entries in sync as you add, remove and refactor your codebase. Currently, the library provides a single aspect: LogAttribute.

This topic contains the following sections.

  • List of available backends
  • Changing the logging back-end
List of available backends
Name | NuGet Package | Description
Console | Online PostSharp.Patterns.Diagnostics | Logging using Online Console WriteLine(String)
Trace | Online PostSharp.Patterns.Diagnostics | Logging using Online Trace
Log4Net | Online PostSharp.Patterns.Diagnostics.Log4Net |
NLog | Online PostSharp.Patterns.Diagnostics.NLog |
EnterpriseLibrary | Online PostSharp.Patterns.Diagnostics.EnterpriseLibrary |
Changing the logging back-end

To change the logging back-end:

  1. Remove the NuGet package containing the previous back-end implementation, if any.

  2. Add the NuGet package containing the new back-end implementation, if any.

  3. If the new NuGet package contains several implementations, set the LoggingBackend property in the PostSharp project file (MyProject.psproj) to the right value for the chosen logging backend.

See Also

Reference

LogAttribute
LogExceptionAttribute

Online Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


Adding Detailed Tracing to a Code Base

Adding Detailed Tracing to a Code Base PostSharp Documentation

When you're working with your codebase it's common to need to add logging either as a non-functional requirement or simply to assist during the development process. In either situation you will want to include information about the parameters passed to the method when it was called as well as the parameter values once the method call has completed. This can be a tedious and brittle process. As you work and refactor methods the order and types of parameters may change, parameters may be added and some maybe removed. Along with performing these refactorings you have to remember to update the logging messages to keep them in sync. This is something that is easy to forget and once forgotten the output of the logging is much less useful.

PostSharp offers a solution to all of these problems. The logging pattern library allows you to configure where logging should be performed and the pattern library takes over the task of keeping your log entries in sync as you add, remove and refactor your codebase. Let's take a look at how you can add trace logging for the start and completion of method calls.

To add trace logging for the start and completion of method calls:

  1. Let's add logging to our Save method.

    C#
    VB
    C++
    F#
    View Colorized Copy to Clipboard Print
    public void Save(string firstName, string lastName, string streetAddress, string city)
{
    var customerRepository = new CustomerRepository();
    customerRepository.Save(firstName, lastName, streetAddress, city);
}
    public void Save(string firstName, string lastName, string streetAddress, string city)
{
    var customerRepository = new CustomerRepository();
    customerRepository.Save(firstName, lastName, streetAddress, city);
}
  2.
                  Put the caret on the Save method name and expand the Smart Tag. From the list select "Add loggging".

      Detailed Tracing 1
  3.
                  The first option that you need to select is the Logging Level. For this example we will take the default provided: it logs the method enters and exits, and include parameter values.

      Detailed Tracing 2
  4.
                  The next page of the wizard gives you the opportunity to choose the logging backend that you want to use. For this example select "System.Diagnostics.Trace" and click Next.

      Detailed Tracing 3
  5.
                  The summary page gives you the opportunity to review the selections that you have made. If you notice that the configuration is not what you wanted you can click the Previous button and adjust your selections. If the configuration meets your needs click Next.

      Detailed Tracing 4
  6.
                  The progress page shows a progress bar and summary of what actions PostSharp is taking to add the selected logging configuration to your codebase. It's at this point that PostSharp and the logging pattern library will be downloaded from Nuget and added as references to your codebase.

      Detailed Tracing 5
  7.
                  Once the download, installation and configuration of PostSharp and the logging pattern library has finished you can close the wizard and look at the changes that were made to your codebase.

      Detailed Tracing 6
  8.
                  You'll notice that the code you added the logging to has changed slightly. PostSharp has added a LogAttribute attribute to the method. Since we chose the default logging profile, there is no argument to the LogAttribute attribute.

    C#
    VB
    C++
    F#
    View Colorized Copy to Clipboard Print
    [Log]
public void Save(string firstName, string lastName, string streetAddress, string city)
{
    var customerRepository = new CustomerRepository();
    customerRepository.Save(firstName, lastName, streetAddress, city);
}
    [Log]
public void Save(string firstName, string lastName, string streetAddress, string city)
{
    var customerRepository = new CustomerRepository();
    customerRepository.Save(firstName, lastName, streetAddress, city);
}
      Note  Note

                    This example has added a single attribute to one method. If you plan on adding this logging to many different locations in your codebase you will want to read about using the MulticastAttribute: Adding Aspects to Multiple Declarations.

  9.
                  If you were to run this method the trace logging that you added would output a log message when entering the method and an entry when leaving the method. Note that the parameter values are automatically included in the log message.

      Detailed Tracing 7

          Now that you have logging added to the Save method you are able to change the method's name as well as add and remove parameters with the confidence that your log entries will be kept in sync with each of those changes. In combination with attribute multicasting (the article Adding Aspects to Multiple Declarations, adding logging to your codebase and maintaining it becomes a very easy task.

See Also
Reference
LogAttribute
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


Tracing Parameter Values Upon Exception

Tracing Parameter Values Upon Exception PostSharp Documentation

When you're working with your codebase it's common to need to add logging of exceptions either as a non-functional requirement or simply to assist during the development process. In either situation you will want to include information about the parameters that were passed to the method where the exception is being caught and logged. This can be a tedious and brittle process. As you work and refactor methods the order and types of parameters may change, parameters may be added and some maybe removed. Along with performing these refactorings you have to remember to update the exception logging messages to keep them in sync. This is something that is easy to forget and once forgotten the output of the logging is much less useful.

PostSharp offers a solution to all of these problems. The logging pattern library allows you to configure where logging should be performed and the pattern library takes over the task of keeping your log entries in sync as you add, remove and refactor your codebase. Let's take a look at how you can add trace logging of exceptions that includes the parameter values that were passed to the method that is being logged.

To add trace logging of exceptions that includes the parameter values:

  1. Let's add logging to our DoStuff method.

    C#
    VB
    C++
    F#
    View Colorized Copy to Clipboard Print
    public void DoStuff(int i, int x)
{
    Console.WriteLine(i/x);
}
    public void DoStuff(int i, int x)
{
    Console.WriteLine(i/x);
}
  2.
                  Put the caret on the DoStuff method name and expand the Smart Tag. From the list select "Add loggging".

      Trace Parameters 1
  3.
                  The first option that you need to select is the Logging Profiles. Here we want to choose the "Exceptions" profile and accept its default values. Click Next.

      Trace Parameters 9
  4.
                  The next page of the wizard gives you the opportunity to choose the logging backend that you want to use. For this example select "System.Diagnostics.Trace" and click Next.

      Trace Parameters 3
  5.
                  The summary page gives you the opporunity to review the selections that you have made. If you notice that the configuration is not what you wanted you can click the Previous button and adjust your selections. If the configuration meets your needs click Next.

      Trace Parameters 4
  6.
                  The progress page shows a progress bar and summary of what actions PostSharp is taking to add the selected logging configuration to your codebase. It's at this point that PostSharp and the logging pattern library will be downloaded from Nuget and added as references to your codebase.

      Trace Parameters 5
  7.
                  Once the download, installation and configuration of PostSharp and the logging pattern library has finished you can close the wizard and look at the changes that were made to your codebase.

      Trace Parameters 6
  8.
                  You'll notice that the code you added the logging to has changed slightly. PostSharp has added a LogAttribute attribute to the method and configured it based on the selections you made in the wizard. For this example you can see that the OnExceptionLevel was set to Error. This accounts for logging when the method fails. Both OnSuccessLevel and OnEntryLevel were set to None as they don't play any part in logging during failures.

    C#
    VB
    C++
    F#
    View Colorized Copy to Clipboard Print
    [Log(OnExceptionLevel = LogLevel.Error, OnSuccessLevel = LogLevel.None, OnEntryLevel = LogLevel.None)]
public void DoStuff(int i, int x)
{
    Console.WriteLine(i/x);
}
    [Log(OnExceptionLevel = LogLevel.Error, OnSuccessLevel = LogLevel.None, OnEntryLevel = LogLevel.None)]
public void DoStuff(int i, int x)
{
    Console.WriteLine(i/x);
}
      Note  Note

                    This example has added a single attribute to one method. If you plan on adding this logging to many different locations in your codebase you will want to read about using attribute multicasting. See Adding Aspects Declaratively Using Attributes.

  9.
                  If you were to run this method from a console application and pass in a value of zero for the second parameter it would generate a DivideByZeroException. The trace logging that you added would output a log message plus the exception's stack trace to the console. Note that the parameter values are automatically included in the log message.

      Trace Parameters 7
  10.
                  For those of you interested in what is happening behind the scenes we can decompile the method and observe what PostSharp has done to our codebase. You'll notice two significant things when you look at the decompiled code. First, PostSharp added in a try...catch block that wraps the entirety of the original methods contents. The second thing you'll notice is that the catch block logs the exception and re-throws it. This ensures that your code execution paths will remain unchanged after you've added the logging.

      Trace Parameters 8

          Now that you have logging added to the DoStuff method you are able to change the method's name as well as add and remove parameters with the confidence that your log entries will be kept in sync with each of those changes. In combination with the attribute multicasting (See the section Adding Aspects Declaratively Using Attributes), adding logging to your codebase and maintaining it becomes a very easy task.

See Also
Reference
LogAttribute
OnExceptionLevel
OnSuccessLevel
OnEntryLevel
Error
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


Working with the Threading Pattern Library

Working with the Threading Pattern Library PostSharp Documentation

The Threading Pattern Library helps building multithreaded applications with fewer lines of code and fewer defects. The library implements locking models (thread unsafe, reader-writer synchronized, actor), thread synchronization aspects (to background thread, to UI thread), and a deadlock detection facility.

It provides the following features:

  • Threading Models. A threading model is a design pattern that gives guarantees that your code executes safely on a multithreaded computer. Three models are implemented: Thread Exclusive (thread unsafe), Reader-Writer Synchronized, and Actor. See Working with Threading Models for details.
  • Thread Dispatching. Custom attributes DispatchedAttribute and BackgroundAttribute cause the execution of a method to be dispatched to the UI thread or to a background thread, respectively. For details, read Dispatching a Method to the UI Thread and Dispatching a Method to Background.
  • Deadlock Detection. Detects deadlocks at runtime and throws an exception instead of allowing your application to freeze. For details, see DeadlockDetectionPolicy.

Online Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


Working with Threading Models

Working with Threading Models PostSharp Documentation

A threading model is a design pattern that gives guarantees that your code executes safely on a multithreaded computer. Threading models both define coding rules (for instance: all fields must be private) and add new behaviors to existing code (for instance: acquiring a lock before method execution). Coding rules are typically enforced at build time or at run time; violations result in build-time errors or run-time exceptions. Threading models may also require the use of custom attributes in source code, for instance to indicate that a method requires read access to the object.

Tip Tip
We recommend to assign a threading model to every class whose instances can be shared between different threads.

Threading models raise the level of abstraction at which multithreading is addressed. Compared to working directly with locks and other low-level threading primitives, using threading models has the following benefits:

  • Threading models are named solutions to a recurring problem. Threading models are specific types of design patterns, and have the same benefits. When team members discuss the multithreaded behavior of a class, they just need to know which threading model this class uses. They don't need to know the very details of its implementation. Since the human short-term memory seems to be limited to 5-9 elements, it is important to think in terms of larger conceptual blocks whenever we can.
  • Much of the code required to implement the threading model can be automatically generated, which decreases the number of lines of code, and therefore the number of defects. It also reduces development and maintenance costs.
  • Your source code can be automatically verified against the selected threading model, both at build time and at run time. This makes the discovery of defect much more deterministic. Without verifications, threading defects usually show up randomly and provoke data structure corruption instead of immediate exceptions. Run-time verification would be too labour-intensive to implement without compiler support, so would be most likely ommitted.

PostSharp Threading Library provides an implementation for the following threading models:

Threading Model | Aspect Type | Description
Thread Unsafe | ThreadUnsafeAttribute | These objects may never be accessed concurrently by several threads. For details, see Ensuring Thread-Unsafe Objects are Not Shared.
Reader-Writer Synchronized | ReaderWriterSynchronizedAttribute | These objects that can be accessed concurrently by several threads. Every object is synchronized by a lock (a single lock can be shared by several objects). Public methods of this object must specify which kind of access they require (read or write, typically). Readers can run concurrently, but writers are exclusive. For details, see Using the Reader/Writer Synchronized Object Model.
Actor | Actor | These objects communicate with their clients using an asynchronous communication pattern. All accesses to the object are queued and then processed in a single thread. However, queuing is transparent to clients, which just call standard void or async methods. For details, see Using the Actor Threading Model.
Optional section title

Add one or more sections with content

Online Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


Ensuring Thread-Unsafe Objects are Not Shared

Ensuring Thread-Unsafe Objects are Not Shared PostSharp Documentation

When you are dealing with multi-threaded code you will run into situations where some objects are not safe for concurrent use by several threads. Although these objects should theoretically not be accessed concurrently, it is very hard to proof that it never happens. And when it does happen, thread-unsafe data structures get corrupted, and symptoms may appear much later. These issues are typically very difficult to debug. So instead of relying on hope, it would be nice if the object threw an exception whenever it is accessed simultaneously by several threads. This is why we have the thread-unsafe threading model.

This topic contains the following sections.

  • Marking an object as thread-unsafe
  • Waiving verification
  • Resolving build-time errors
  • Adding verification to private and protected methods
Marking an object as thread-unsafe

To mark an object as thread-unsafe:

  1. When you don't want multiple threads to access a single instance of a given class you will want to configure InstanceLevelAspect thread safety. To do this, select "Apply threading model" from the smart tag on the class.

    Concurrent Access Instance 1

  2. There are three different threading options provided by PostSharp. To restrict concurrent access you will choose the "Apply thread-unsafe threading model" option.

    Concurrent Access Instance 2

  3. At this point you are prompted to select the threading model policy that is needed by the target class. For this example you have determined that you do not want to have multiple threads concurrently accessing the same class instance. This is the "Instance" policy.

    Concurrent Access Instance 3

  4. You will be prompted with a summary of the changes that will be made based on the configuration you selected in the wizard.

    Concurrent Access Instance 4

  5. PostSharp will download the Threading Pattern Library and add it to your project if that hasn't been done yet.

    Concurrent Access Instance 5

  6. Once the process has completed successfully you'll be presented with the final page of the wizard.

    Concurrent Access Instance 6

  7. You'll notice that only one change was made to your codebase. The [ThreadUnsafeAttribute] attribute was added to the class you were targeting.

    C#
    VB
    C++
    F#
    View Colorized Copy to Clipboard Print
    [ThreadUnsafe]
public class MyDictionary
{
    Dictionary<string,string> dictionary = new Dictionary<string,string>();

    public void Add(string key, string value)
    {
        this.dictionary.Add(key, value);
    }
}
    [ThreadUnsafe]
public class MyDictionary
{
    Dictionary<string,string> dictionary = new Dictionary<string,string>();

    public void Add(string key, string value)
    {
        this.dictionary.Add(key, value);
    }
}

          Now when your application executes no two threads will be able to access a single instance of the MyDictionary class at the same time. If two threads attempt to do this, the second thread will receive a ConcurrentAccessException. Without the exception, there would be a slight chance that internal Dictionary would become corrupted, because this data structure is not thread safe.

Waiving verification

          There may be situations where you don't need to verify thread safety on a specific method. PostSharp offers you the opportunity to waive verfication on specific methods by adding the [ExplicitlySynchronizedAttribute] attribute.

C#
VB
C++
F#
View Colorized Copy to Clipboard Print
[ExplicitlySynchronized]
public void Add(string key, string value)
{
    lock ( this.dictionary )
    {
        this.dictionary.Add(key, value);
    }
}
[ExplicitlySynchronized]
public void Add(string key, string value)
{
    lock ( this.dictionary )
    {
        this.dictionary.Add(key, value);
    }
}

          The compiler won't generate code for methods annotated with [ExplicitlySynchronizedAttribute].

Resolving build-time errors

          The thread-unsafe threading model puts a number of constraints on source code. These constraints allow PostSharp to generate high-performance runtime validation by adding verification code to public and internal methods only. These constraints are the following:

  1.
              All fields must be private or protected.

  2.
              Unless the threading policy is static:

    1.
                  Static method cannot access fields.

    2.
                  Static method cannot invoke private methods.

          If your code does not respect these rules, you will see compiler errors. We recommend you first try to solve these errors by restructuring your code. If this is not possible, you can apply the [ExplicitlySynchronizedAttribute] attribute on methods or fields.

          With [ExplicitlySynchronizedAttribute], the compiler won't generate errors when it detects code that it cannot guarantee to be correct. In other words, this attribute means that you, the developer, take responsibility from the compiler.

Adding verification to private and protected methods

          By default, [ThreadUnsafeAttribute] only adds verification to public and internal methods. This is enough if your code respects the rule set by the thread-unsafe threading model. However, if you work around some rules using [ExplicitlySynchronizedAttribute], you may need to add verification to private and protected methods. This can be done by adding the [VerifyCallingThreadAttribute] attribute to methods that need to be verified.

See Also
Reference
InstanceLevelAspect
ThreadUnsafeAttribute
ExplicitlySynchronizedAttribute
VerifyCallingThreadAttribute
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


Using the Reader/Writer Synchronized Object Model

Using the Reader/Writer Synchronized Object Model PostSharp Documentation

When a class instance is concurrently used by multiple threads, accesses must be synchronized to prevent data races, which typically result in data inconsistencies and corruption of data structures.

Consider the following example of an Order class which stores an amount and a discount:

C#
VB
C++
F#
View Colorized Copy to Clipboard Print
class Order
{
    public void Set(int amount, int discount)
    {
        if (amount < discount)
            throw new InvalidOperationException();

        this.Amount = amount;
        this.Discount = discount;
    }

    int Amount { get; private set; }
    int Discount { get; private set; }

    public int AmountAfterDiscount
    {
        get { return this.Amount - this.Discount; }
    }
}
class Order
{
    public void Set(int amount, int discount)
    {
        if (amount < discount)
            throw new InvalidOperationException();

        this.Amount = amount;
        this.Discount = discount;
    }

    int Amount { get; private set; }
    int Discount { get; private set; }

    public int AmountAfterDiscount
    {
        get { return this.Amount - this.Discount; }
    }
}

        In this example, the Set method writes to the Amount and Discount members, while the AmountAfterDiscount property reads these members. In a single-threaded program, the AmountAfterDiscount property is guaranteed to be positive or zero. However, in a multi-threaded program, the AmountAfterDiscount property could be evaluated in the middle of the Set operation, and return an inconsistent result.

This topic contains the following sections.
  • Problems of the lock keyword
  • Reader-writer locks
  • Making a class reader-writer synchronized
  • Enabling and Disabling ReaderLock/WriterLock checks
  • Raising synchronous events
  • Synchronizing access to multiple instances
  • Executing long-running write methods
Problems of the lock keyword

          The easiest way to synchronize accesses to a class in C# is to use the lock keyword. However, this practice cannot be generalized for two reasons:

  •
            The use of exclusive locks often results in high contention and therefore low performance because many threads queue to access the same resource;

  •
             Applications relying on exclusive locks are prone to deadlocks because of cyclic waiting dependencies.

Reader-writer locks

          Reader-writer locks take advantage of the fact that most applications involve much fewer reads than writes, and that concurrent reads are always safe. Reader-writer locks ensure that no other thread is accessing the object when it is being written. Reader-writer locks are normally implemented by the .NET classes   Online ReaderWriterLock or   Online ReaderWriterLockSlim. The following example shows how   Online ReaderWriterLockSlim would be used to control reads and writes in the Order class:

C#
VB
C++
F#
View Colorized Copy to Clipboard Print
class Order
{
    private ReaderWriterLockSlim cacheLock = new ReaderWriterLockSlim();

    public void Set(decimal amount, decimal discount)
    {

        if (amount < discount)
        {
            throw new InvalidOperationException();
        }

        cacheLock.EnterWriteLock();
        this.Amount = amount;
        this.Discount = discount;
        cacheLock.ExitWriteLock();
    }

    public decimal Amount { get; private set; }
    public decimal Discount { get; private set; }

    public decimal AmountAfterDiscount
    {
        get
        {
            cacheLock.EnterReadLock();
            decimal result = this.Amount - this.Discount;
            cacheLock.ExitReadLock();
            return result;
        }
    }
}
class Order
{
    private ReaderWriterLockSlim cacheLock = new ReaderWriterLockSlim();

    public void Set(decimal amount, decimal discount)
    {

        if (amount < discount)
        {
            throw new InvalidOperationException();
        }

        cacheLock.EnterWriteLock();
        this.Amount = amount;
        this.Discount = discount;
        cacheLock.ExitWriteLock();
    }

    public decimal Amount { get; private set; }
    public decimal Discount { get; private set; }

    public decimal AmountAfterDiscount
    {
        get
        {
            cacheLock.EnterReadLock();
            decimal result = this.Amount - this.Discount;
            cacheLock.ExitReadLock();
            return result;
        }
    }
}

          However, working directly with the   Online ReaderWriterLock and   Online ReaderWriterLockSlim classes has disadvantages:

  •
              It is cumbersome because a lot of code is required.

  •
              It is unreliable because it is too easy to forget to acquire the right type of lock, and these errors are not detectable by the compiler or by unit tests.

          So, not only the direct use of locks results in more lines of code, but it won’t reliably prevent non-deterministic data structure corruptions.

Making a class reader-writer synchronized

          PostSharp Threading Pattern Library has been designed to eliminate non-deterministic data corruptions while reducing the size of thread synchronization code to the absolute minimum (but not less).

          The ReaderWriterSynchronizedAttribute aspect implements the threading model (or threading pattern) based on the reader-writer lock, with the following principles:

  •
              At any time, the object can be open for reading or closed for reading.

  •
              Methods define their required access level using [ReaderLockAttribute] and [WriterLockAttribute] custom attributes (other access levels exist for advanced scenarios)

  •
              An error will be emitted at build-time or runtime, but deterministically, whenever an object field is being accessed by a method that does not have the required access level on the object.

          There are two ways to add the reader-writer-synchronized pattern to your class:

  1.
              using the user interface

  2.
              manually

To apply ReaderWriterSynchronizedAttribute using the user interface:
  1.
                  Hover the mouse over the class name. This displays the smart tag dropdown.

  2.
                  Click the smart tag dropdown and click "Apply threading model":

      Reader Writer 1
  3.
                  Select "Apply reader-writer-synchronized threading model" and click Next:

      Reader Writer 2
  4.
                  Click Next on the summary screen and the click on Finished to complete the process. The ReaderWriterSynchronizedAttribute attribute is now applied to the class.

  5.
                  Once ReaderWriterSynchronizedAttribute is applied to the class, each method or property which accesses member data must then be marked as a reader or a writer. Position the caret on the name of the method or on the get or set keyword and choose "Acquire reader lock" or "Acquire writer lock" from the smart tag dropdown.

To apply ReaderWriterSynchronizedAttribute to a class manually:
  1.
                  Add NuGet Package PostSharp.Patterns.Threading

  2.
                  Add “using PostSharp.Patterns.Threading”.

  3.
                  Add the custom attribute [ReaderWriterSynchronizedAttribute] to the class.

  4.
                  Add the custom attribute [ReaderLockAttribute] or [WriterLockAttribute] to the class.

          The following code shows the Order class , synchronized with the reader-writer threading pattern:

C#
VB
C++
F#
View Colorized Copy to Clipboard Print
[ReaderWriterSynchronized]
class Order
{
    [WriterLock]
    public void Set(decimal amount, decimal discount)
    {
        if (amount < discount)
            throw new InvalidOperationException();

        this.Amount = amount;
        this.Discount = discount;
    }

    decimal Amount { get; private set; }
    decimal Discount { get; private set; }

    public decimal AmountAfterDiscount
    {
            [ReaderLock] get { return this.Amount - this.Discount; }
    }
}
[ReaderWriterSynchronized]
class Order
{
    [WriterLock]
    public void Set(decimal amount, decimal discount)
    {
        if (amount < discount)
            throw new InvalidOperationException();

        this.Amount = amount;
        this.Discount = discount;
    }

    decimal Amount { get; private set; }
    decimal Discount { get; private set; }

    public decimal AmountAfterDiscount
    {
            [ReaderLock] get { return this.Amount - this.Discount; }
    }
}
ReaderLockAttribute places a lock on the instance whenever the property or method is invoked. While this lock is held, other threads can also invoke a property or method of that instance which reads, but calls to properties or methods marked with WriterLockAttribute will be blocked until all reads are complete.

          Likewise, invoking properties or methods marked with WriterLockAttribute will lock the instance causing reads to block until the write has completed and the write lock has been released.

          Since ReaderWriterSynchronizedAttribute requires that all properties and methods which access member data be marked with ReaderLockAttribute or WriterLockAttribute, ReaderWriterSynchronizedAttribute throws an exception when an accessor does not have one of these attributes. This ensures that unsynchronized reads and writes are caught the instant they occur.

  Note  Note

            Property getters or methods that read a single field are intrinsically thread-safe and don’t need to be marked with a [ReaderLockAttribute] custom attribute.

Enabling and Disabling ReaderLock/WriterLock checks

          Runtime checks for ReaderLockAttribute and WriterLockAttribute attributes can be expensive and therefore it’s recommended that these checks be disabled in the final release build. To accommodate this, the ReaderWriterSynchronizedAttribute attribute contains a member called RuntimeVerificationEnabled which is set in the constructor to turn verifications on or off. Setting this flag is best accomplished by defining a pair of constant bool’s in a separate class which are set to true/false based on the build.

          This is demonstrated in the following example where a class called ConditionalConstants defines a variable called IsDebug and sets it to true or false based on the type of build. The constant is then assigned to RuntimeVerificationEnabled in ReaderWriterSynchronizedAttribute’s constructor:

C#
VB
C++
F#
View Colorized Copy to Clipboard Print
static class ConditionalConstants
{
#if DEBUG
    public static const bool IsDebug = true;
#else
    public static const bool IsDebug = false;
#endif
}

[ReaderWriterSynchronized(RuntimeVerificationEnabled=ConditionalConstants.IsDebug)]
class Order
{
    // Details skipped for brevity.
}
static class ConditionalConstants
{
#if DEBUG
    public static const bool IsDebug = true;
#else
    public static const bool IsDebug = false;
#endif
}

[ReaderWriterSynchronized(RuntimeVerificationEnabled=ConditionalConstants.IsDebug)]
class Order
{
    // Details skipped for brevity.
}
Raising synchronous events

          In some situations, a method with write access needs to allow other threads to read the object before another write is performed on the object. The implementation of [I:System.Collections.Specialized.INotifyCollectionChanged] gives a typical example of this situation. The CollectionChanged event defined by this interface is typically raised from a write method but is consumed from the user interface thread. The object cannot have changed between the moment the event is raised and it is processed by the UI thread, because the event arguments contain data that relates to the current state of the object. Using only WriterLockAttribute and ReaderLockAttribute would either result in deadlocks or in inconsistencies, respectively.

          The solution to this problem is to use the ObserverLockAttribute custom attribute, which allows read access from other threads but prevents any other thread from acquiring a writer lock.

          In the following example, OrderCollection is a collection of Order objects. In this example, the Add() and Remove() methods are marked with the WriterLockAttribute attributes. Listeners can be notified about these changes by subscribing to the CollectionChanged event which is exposed through the implementation of [I:System.Collections.Specialized.INotifyCollectionChanged]

          Since listeners can be on other threads (e.g. a UI thread), this event is invoked by the Add() and Remove() methods via a method called OnCollectionChanged() which has been marked with the ObserverLockAttribute attribute. This lock ensures that the listener (which may be in another thread space) can read the current state of the collection without the collection being modified by another invocation of the Add() or Remove() operations from another thread.

C#
VB
C++
F#
View Colorized Copy to Clipboard Print
[ReaderWriterSynchronized]
class OrderCollection : ICollection, INotifyCollectionChanged
{
    ArrayList list = new ArrayList();

    // Details skipped.

    [ReaderLock]
    public int Count
    {
        get
        {
            return list.Count;
        }
    }

    [WriterLock]
    public void Add(Order o)
    {
        list.Add(o);
        NotifyCollectionChangedEventArgs changedArgs = new NotifyCollectionChangedEventArgs(NotifyCollectionChangedAction.Add, o);
        OnCollectionChanged(changedArgs);
    }

    [WriterLock]
    public void Remove(int index)
    {
        NotifyCollectionChangedEventArgs changedArgs = new NotifyCollectionChangedEventArgs(NotifyCollectionChangedAction.Remove, list[index]);
        list.RemoveAt(index);
        OnCollectionChanged(changedArgs);
    }

    [ObserverLock]
    private void OnCollectionChanged(NotifyCollectionChangedEventArgs changedArgs)
    {
        CollectionChanged(this, changedArgs);
    }

    [ReaderLock]
    public Order Get(int index)
    {
        return (Order)list[index];
    }

    public event NotifyCollectionChangedEventHandler CollectionChanged;
}
[ReaderWriterSynchronized]
class OrderCollection : ICollection, INotifyCollectionChanged
{
    ArrayList list = new ArrayList();

    // Details skipped.

    [ReaderLock]
    public int Count
    {
        get
        {
            return list.Count;
        }
    }

    [WriterLock]
    public void Add(Order o)
    {
        list.Add(o);
        NotifyCollectionChangedEventArgs changedArgs = new NotifyCollectionChangedEventArgs(NotifyCollectionChangedAction.Add, o);
        OnCollectionChanged(changedArgs);
    }

    [WriterLock]
    public void Remove(int index)
    {
        NotifyCollectionChangedEventArgs changedArgs = new NotifyCollectionChangedEventArgs(NotifyCollectionChangedAction.Remove, list[index]);
        list.RemoveAt(index);
        OnCollectionChanged(changedArgs);
    }

    [ObserverLock]
    private void OnCollectionChanged(NotifyCollectionChangedEventArgs changedArgs)
    {
        CollectionChanged(this, changedArgs);
    }

    [ReaderLock]
    public Order Get(int index)
    {
        return (Order)list[index];
    }

    public event NotifyCollectionChangedEventHandler CollectionChanged;
}
Synchronizing access to multiple instances

        The previous example showed how synchronization can be handled for a single class instance. In cases where synchronization is required for multiple instances (e.g. when an object is part of a collection), the class requiring synchronization must also implement PostSharp’s IReaderWriterSynchronized interface. IReaderWriterSynchronized returns an instance of PortableReaderWriterLock which is used to manage access to resources.

          To demonstrate this, we’ll begin by adding a collection of Line classes to the Order class, each of which contains an amount which makes up the order. Since access to instances of the Line class are to be synchronized, the Line class will be marked with ReaderWriterSynchronizedAttribute and will also implement IReaderWriterSynchronized. We’ve also added a collection of Line objects and an AddLine() method to the containing Order class which adds new Line objects to this collection. This method is marked with the WriterLockAttribute attribute since it creates, and adds a Line object to the collection.

C#
VB
C++
F#
View Colorized Copy to Clipboard Print
[ReaderWriterSynchronized]
class Order
{
    // Other details skipped for brevity.

    //collection of objects to syncronize
    List<Line> lines = new List<Line>();

    [WriterLock]
    public Order AddLine(decimal amount)
    {
        Line line = new Line(this, amount);
        this.lines.Add(line);
        this.Amount += amount;
        return line;
    }

    [ReaderLock]
    public Line GetLine(int index)
    {
        return lines[index];
    }

    public decimal Amount { [ReaderLock] get; private set; }

    [ReaderWriterSynchronized]
    public class Line : IReaderWriterSynchronized
    {
        decimal amount;
        Order   parent;
        internal Line(Order parent, decimal amount)
        {
            this.Lock =PostSharp.Post.Cast<Order,IReaderWriterSynchronized>(parent).Lock;
            this.amount = amount;
            this.parent = parent;
        }

        public decimal Amount
        {
            [ReaderLock]
            get { return this.amount; }

            [WriterLock]
            set
            {
                decimal difference = value - this.amount;
                this.amount += value;
                this.parent.Amount += value;
            }
        }

        public PortableReaderWriterLock Lock
        {
            get; private set;
        }
    }
}
[ReaderWriterSynchronized]
class Order
{
    // Other details skipped for brevity.

    //collection of objects to syncronize
    List<Line> lines = new List<Line>();

    [WriterLock]
    public Order AddLine(decimal amount)
    {
        Line line = new Line(this, amount);
        this.lines.Add(line);
        this.Amount += amount;
        return line;
    }

    [ReaderLock]
    public Line GetLine(int index)
    {
        return lines[index];
    }

    public decimal Amount { [ReaderLock] get; private set; }

    [ReaderWriterSynchronized]
    public class Line : IReaderWriterSynchronized
    {
        decimal amount;
        Order   parent;
        internal Line(Order parent, decimal amount)
        {
            this.Lock =PostSharp.Post.Cast<Order,IReaderWriterSynchronized>(parent).Lock;
            this.amount = amount;
            this.parent = parent;
        }

        public decimal Amount
        {
            [ReaderLock]
            get { return this.amount; }

            [WriterLock]
            set
            {
                decimal difference = value - this.amount;
                this.amount += value;
                this.parent.Amount += value;
            }
        }

        public PortableReaderWriterLock Lock
        {
            get; private set;
        }
    }
}
Executing long-running write methods

          Since write methods require exclusive access to the object, they should complete as quickly as possible. However, this is not always possible. Some long-running write methods really do a lot of write operations (or rely on slow external services) which make them inappropriate for the reader-writer-synchronized model. However, many write methods are actually composed of a lot of read operations but just a few write operations at the end. In this case, it is possible to use a combination of the UpgradeableReaderLockAttribute and WriterLockAttribute attributes. The UpgradeableReaderLockAttribute attribute ensures that no other thread than the current one will be able to acquire a writer lock on the object, so it gives the guarantee that the object is not going to be modified during the method’s execution. A method that holds an upgradeable reader lock can then invoke a method with the WriterLockAttribute attributes custom attribute. Note that it is important that the writer methods leave the object in a consistent state before exiting, because other threads will be allowed to read the object.

          The following example builds on that in the section where the Order class contains a collection of Line objects which make up the order. In the example below, a new method called Recalculate() has been added to Order which iterates through each Line in the collection, tallies up the amount from each, and then stores the total in Amount.

          Since the Recalculate method performs a series of reads followed by a write operation (to store the total in Amount), it is marked with the UpgradeableReaderLockAttribute attribute which ensures that all of the orders that it reads remain locked so that it calculates and writes out the correct total. In addition to this, the set accessor of the Order’s Amount property as been marked with WriterLockAttribute:

C#
VB
C++
F#
View Colorized Copy to Clipboard Print
[ReaderWriterSynchronized]class Order
{
    // Other details skipped for brevity.

    public decimal Amount
    {
       [ReaderLock] get;

       [WriterLock]
       private set;
    }

    [UpgradeableReaderLock]
    public void Recalculate()
    {
        decimal total = (decimal)0.0;
        for (int i = 0; i < lines.Count; ++i)
        {
            total += lines[i].Amount;
        }

        this.Amount = total;
    }
}
[ReaderWriterSynchronized]class Order
{
    // Other details skipped for brevity.

    public decimal Amount
    {
       [ReaderLock] get;

       [WriterLock]
       private set;
    }

    [UpgradeableReaderLock]
    public void Recalculate()
    {
        decimal total = (decimal)0.0;
        for (int i = 0; i < lines.Count; ++i)
        {
            total += lines[i].Amount;
        }

        this.Amount = total;
    }
}
See Also
Reference
IReaderWriterSynchronized
PortableReaderWriterLock
ReaderWriterSynchronizedAttribute
WriterLockAttribute
UpgradeableReaderLockAttribute
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


Using the Actor Threading Model

Using the Actor Threading Model PostSharp Documentation

Given the complexity of trying to coordinate accesses to an object from several threads, sometimes it makes more sense to avoid multi threading altogether. The Actor model avoids the need for thread safety on class instances by routing method calls from each instance to a single message queue which is processed, in order, by a single thread.

Since the processing for each instance takes place in a single thread, multi-threading is avoided altogether and the object is guaranteed to be free of data races. Calls are processed asynchronously in the order in which they were added to the message queue. Because all calls to an actor are asynchronous, it is recommended that the async/await feature of C# 5.0 be used.

Additionally to provide a race-free programming model, the Actor pattern has the benefit of transparently distributing the computing load to all available CPUs without additional logic. Note that PostSharp’s implementation does not assign a new thread to each actor instance but uses a thread pool instead, so it is possible to have a very large number of actors with relatively low overhead.

This topic contains the following sections.

  • A single-threaded example
  • Applying the Actor model using the UI
  • Applying the Actor manually
  • Dealing with constraints of the Actor model
A single-threaded example

Consider the following example of a Player class for a simple ping pong like game in which Players draw random numbers. If the random number is within the predefined skill range for a given player then the player signals that it’s the other player’s turn to draw a random number. This logic continues until a player draws a random number that’s above their skill level, in which case the player signals that the other player is the winner. Each player records the number of balls it successfully received.

Here is the single-threaded version of this game:

C#
VB
C++
F#
View Colorized Copy to Clipboard Print
class Player
{
    readonly string name;
    readonly Random random = new Random();
    int totalBallsReceived;
    readonly double skills;

    public Player(string name, double skills )
    {
        this.name = name;
        this.skills = skills;
    }

    public Player Ping(Player peer)
    {
        if (random.NextDouble() <= this.skills)
        {
       this.totalBallsReceived++;
            return peer.Ping(this);
        }
        else
        {
            return peer;
        }
    }
}
 class Player
{
    readonly string name;
    readonly Random random = new Random();
    int totalBallsReceived;
    readonly double skills;

    public Player(string name, double skills )
    {
        this.name = name;
        this.skills = skills;
    }

    public Player Ping(Player peer)
    {
        if (random.NextDouble() <= this.skills)
        {
       this.totalBallsReceived++;
            return peer.Ping(this);
        }
        else
        {
            return peer;
        }
    }
}

          Note that accesses to the “random” and “totalBallsReceived” fields make the Ping method thread-unsafe. If we want an actor to be simultaneously involved in several games, we would need to make the object safe for concurrent accesses using locks. However, working directly with locks results in source code that is larger, less readable, and less reliable.

          A better solution in this situation is to avoid concurrency altogether using the Actor pattern and asynchronous methods.

Applying the Actor model using the UI
To apply the Actor threading model to your class with the UI:
  1.
                  Place the mouse cursor over your class name and select “Apply threading model…” from the dropdown.

  2.
                  Select “Apply actor threading model” and click Next.

  3.
                  Verify the actions on the Summary screen and click Next.

  4.
                  Click Finish after the installation completes:

                  Your class will now derive from Actor and all dependencies will have been added to the project.

Applying the Actor manually
To apply the Actor threading model manually:
  1. Add the PostSharp.Patterns.Threading NuGet package to your project.
  2. Derive your class from PostSharp.Patterns.Threading.Actor.

          In the reworked example below, the Player class has been derived from the Actor class and the Ping method has been changed into an asynchronous method:

C#
VB
C++
F#
View Colorized Copy to Clipboard Print
class Player : Actor
{
    readonly string name;
    readonly Random random = new Random();
    int totalBallsReceived;
    readonly double skills;

    public Player(string name, double skills )
    {
        this.name = name;
        this.skills = skills;
    }

    public async Task<Player> Ping(Player peer)
    {
        if (random.NextDouble() <= this.skills)
        {
       this.totalBallsReceived++;
            return await peer.Ping(this);
        }
        else
        {
            return peer;
        }
    }
}
class Player : Actor
{
    readonly string name;
    readonly Random random = new Random();
    int totalBallsReceived;
    readonly double skills;

    public Player(string name, double skills )
    {
        this.name = name;
        this.skills = skills;
    }

    public async Task<Player> Ping(Player peer)
    {
        if (random.NextDouble() <= this.skills)
        {
       this.totalBallsReceived++;
            return await peer.Ping(this);
        }
        else
        {
            return peer;
        }
    }
}
TODO: show of the code is used.

          Behind the scenes, each invocation of Ping() is added to the message queue by the Actor class, which then processes each call sequentially in the order it was added to the queue. This gives us the guarantee that an instance of the Player class is never being accessed concurrently by two threads, and eliminates the need to make the class thread-safe.

        Dealing with constraints of the Actor model

          Per definition of the Actor model, all methods are executed asynchronously. Methods that have no return value (void methods) can be executed asynchronously without syntactic changes.  However, methods that do have a return value need to be made asynchronous using the async keyword.

          In some situations, the application of the async keyword and the corresponding dispatching of the method may be unnecessary. For instance, a method that returns immutable information is always thread-safe and does not need to be dispatched.

          Using the Player class example from above, we may want to add a ToString() method which returns the name of the player. In this situation we don’t really need this method to be dispatched since it’s guaranteed that concurrency is guaranteed to will never be an issue.

To avoid dispatching this method, apply the ExplicitlySynchronizedAttribute attribute:
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
class Player : Actor
{
    readonly string name;
    .
    .
    .

    [ExplicitlySynchronized]
    public string ToString()
    {
        return this.name;
    }
}
 class Player : Actor
{
    readonly string name;
    .
    .
    .

    [ExplicitlySynchronized]
    public string ToString()
    {
        return this.name;
    }
}

          Applying this attribute explicitly tells PostSharp that we take responsibility for the synchronization of this method.

  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


Dispatching a Method to the UI Thread

Dispatching a Method to the UI Thread PostSharp Documentation

When you are building rich client user interfaces you have to be vigilant not to lock up the user interface while performing intensive background tasks.

This topic contains the following sections.

  • Using BackgroundWorker
  • Adding background processing
  • Adding UI thread processing
Using BackgroundWorker

One of the techniques available is to make use of the built in .NET Online BackgroundWorker object. This allows you to remove background processing from the UI thread. As you can see in the example below there are a lot of pieces that you need to make this work.

C#
VB
C++
F#
View Colorized Copy to Clipboard Print
public partial class CustomerEdit : Form
{
    private readonly BackgroundWorker _backgroundWorker;

    public CustomerEdit()
    {
        InitializeComponent();
        _backgroundWorker = new BackgroundWorker();
        _backgroundWorker.DoWork += DoSave;
        _backgroundWorker.RunWorkerCompleted += SaveCompleted;
    }

    private void SaveCompleted(object sender, RunWorkerCompletedEventArgs e)
    {
        lblStatus.Text = "Finished Saving";
    }

    private void btnSave_Click(object sender, EventArgs e)
    {
        _backgroundWorker.RunWorkerAsync();
    }

    private void DoSave(object sender, DoWorkEventArgs doWorkEventArgs)
    {
        var customerRepository = new CustomerRepository();
        customerRepository.Save(BuildCustomerFromScreen());
    }

    private Customer BuildCustomerFromScreen()
    {
        return new Customer();
    }
}
public partial class CustomerEdit : Form
{
    private readonly BackgroundWorker _backgroundWorker;

    public CustomerEdit()
    {
        InitializeComponent();
        _backgroundWorker = new BackgroundWorker();
        _backgroundWorker.DoWork += DoSave;
        _backgroundWorker.RunWorkerCompleted += SaveCompleted;
    }

    private void SaveCompleted(object sender, RunWorkerCompletedEventArgs e)
    {
        lblStatus.Text = "Finished Saving";
    }

    private void btnSave_Click(object sender, EventArgs e)
    {
        _backgroundWorker.RunWorkerAsync();
    }

    private void DoSave(object sender, DoWorkEventArgs doWorkEventArgs)
    {
        var customerRepository = new CustomerRepository();
        customerRepository.Save(BuildCustomerFromScreen());
    }

    private Customer BuildCustomerFromScreen()
    {
        return new Customer();
    }
}

          To properly manage and interact with a   Online BackgroundWorker process you need to hook the DoWork and RunWorkerCompleted events. You need to couple the code that should be run to the DoWorker event handler. The code to update the UI needs to be coupled to the RunWorkerCompleted event handler and, finally, you need to execute the   Online BackgroundWorker object's RunWorkerAsync method to kick off the whole process.

          As you can see, there are a lot of moving pieces in a very simple   Online BackgroundWorker example. Here's how PostSharp simplifies this common coding scenario.

Adding background processing
To add background processing:
  1.
                  The first thing you need to understand is that you can write your code as if you had no thoughts of having any background processing occuring.

    C#
    VB
    C++
    F#
    View Colorized Copy to Clipboard Print
    public partial class CustomerEdit : Form
{
    public CustomerEdit()
    {
        InitializeComponent();
    }

    private void SaveCompleted()
    {
        lblStatus.Text = "Finished Saving";
    }

    private void btnSave_Click(object sender, EventArgs e)
    {
        DoSave();
        SaveCompleted();
    }

    private void DoSave()
    {
        var customerRepository = new CustomerRepository();
        customerRepository.Save(BuildCustomerFromScreen());
    }

    private Customer BuildCustomerFromScreen()
    {
        return new Customer();
    }
}
     public partial class CustomerEdit : Form
{
    public CustomerEdit()
    {
        InitializeComponent();
    }

    private void SaveCompleted()
    {
        lblStatus.Text = "Finished Saving";
    }

    private void btnSave_Click(object sender, EventArgs e)
    {
        DoSave();
        SaveCompleted();
    }

    private void DoSave()
    {
        var customerRepository = new CustomerRepository();
        customerRepository.Save(BuildCustomerFromScreen());
    }

    private Customer BuildCustomerFromScreen()
    {
        return new Customer();
    }
}
  2.
                  Once you have written your code you will need to determine which piece of it should run in the background and in the UI threads. In this example the btnSave_Click method should execute in the background and the SaveCompleted method should execute in the UI thread.
                  First, you should add the background processing to the btnSave_Click method.

      Ui Add Background Processing
  3.
                  You will be prompted with a wizard to complete the process. Accept the first page.

      Ui Add Background Processing Page 1
  4.
                  If you have not yet added background processing to your project, PostSharp will download the Threading Pattern Library and add it for you.

      Ui Add Background Processing Page 2
  5.
                  Click Finish to complete the process.

      Ui Add Background Processing Page 3
  6.
                  When you look at your code you will see that only one thing has changed. The method you designated to run in the background is now decorated with the [  Online BackgroundWorker] attribute.

    C#
    VB
    C++
    F#
    View Colorized Copy to Clipboard Print
    [BackgroundMethod]
private void btnSave_Click(object sender, EventArgs e)
{
    DoSave();
    SaveCompleted();
}
    [BackgroundMethod]
private void btnSave_Click(object sender, EventArgs e)
{
    DoSave();
    SaveCompleted();
}
Adding UI thread processing

          Once you've added background processing to the button click, you will need a way to have the SaveCompleted method run on the UI thread. If you don't do this you will get an InvalidOperationException because setting the lblStatus.Text property is a cross threading operation.

  Ui Threading Error

          Here's how you can fix this:

  1.
                  Your code has encapsulated the UI thread interaction in the SaveCompleted method. Open the smart tag on that method and choose to "execute the method in the object thread". This tells PostSharp to configure this method to execute in the thread that the class containing the method is executing in.

      Ui Object Thread Add
  2.
                  After selecting the smart tag option you will be returned to your code and you'll notice that the only change was the addition of the [DispatchedMethod] attribute to the SaveCompleted method.

    C#
    VB
    C++
    F#
    View Colorized Copy to Clipboard Print
    [DispatchedMethod]
private void SaveCompleted()
{
    lblStatus.Text = "Finished Saving";
}
    [DispatchedMethod]
private void SaveCompleted()
{
    lblStatus.Text = "Finished Saving";
}

          Now if you run your code you will no longer receive the InvalidOperationException and instead will see the label on the UI update. All of the Save functionality will occur in a separate thread which prevents the user interface from locking up while that is happening.

See Also
Reference
  Online BackgroundWorker
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


Dispatching a Method to Background

Dispatching a Method to Background PostSharp Documentation

Long running processes will block the further execution of code while the system waits for them to complete. When you are building applications it's common to push long running processes to the background so that other processes can continue without waiting. Two common ways of doing this are with asyncronous processing and the Online BackgroundWorker. Both require a lot of boiler plate code to push execution to another thread.

PostSharp provides you with the ability to push execution of a method to a background thread without having to worry about all of the boiler plate code.

To add [BackgroundMethod] attribute:

  1. Find the method that you want to push to the background for execution.

    C#
    VB
    C++
    F#
    View Colorized Copy to Clipboard Print
    public class CustomerRepository
{
    public void DoStuff()
    {
        Console.WriteLine("Things are getting done");
    }
}
    public class CustomerRepository
{
    public void DoStuff()
    {
        Console.WriteLine("Things are getting done");
    }
}
  2.
                  Select "Execute method in the background" from the Smart Tag available under the method name.

  3.
                  A summary of the changes that will be made is presented to you.

  4.
                  At this time, and if it is necessary, PostSharp will download the Threading Pattern Library and add it to your project.

  5.
                  Once the process has completed successfully you'll be presented with the final page of the wizard.

  6.
                  You'll notice that only one change was made to your codebase. The [BackgroundMethod] attribute was added to the class you were targeting. Now when this method executes in your application it will occur in another thread and will allow for the calling code to continue executing.

    C#
    VB
    C++
    F#
    View Colorized Copy to Clipboard Print
    public class CustomerRepository
{
    [BackgroundMethod]
    public void DoStuff()
    {
        Console.WriteLine("Things are getting done");
    }
}
    public class CustomerRepository
{
    [BackgroundMethod]
    public void DoStuff()
    {
        Console.WriteLine("Things are getting done");
    }
}

          Those simple steps are all that is required for you to declare that a method should be executed in a background thread.

See Also
Reference
  Online BackgroundWorker
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


Detecting Deadlocks at Runtime

Detecting Deadlocks at Runtime PostSharp Documentation

The Threading Pattern Library contains a deadlock detection aspect. Instead of letting your application freeze because of a deadlock, it will throw an exception with detailed information about which threads and which objects are involved in the deadlock. This makes it possible to diagnose deadlock that happens in production, which is otherwise usually very difficult.

To enable the deadlock detection algorithm, you need to add the DeadlockDetectionPolicy custom attribute to each assembly of the solution.

See DeadlockDetectionPolicy for details.

Online Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


Working with the Model Pattern Library

Working with the Model Pattern Library PostSharp Documentation

The Model Pattern Library provides the following features:

  • INotifyPropertyChanged. The NotifyPropertyChangedAttribute aspect implements the Online INotifyPropertyChanged interface and automatically raises the Online PropertyChanged event for the relevant properties whenever an object is changed. For details, see Automatically implementing INotifyPropertyChanged.
  • Code Contracts. The namespace PostSharp.Patterns.Contracts contains custom attributes such as RequiredAttribute, which can be applied to fields, properties or parameters, and validates their value at runtime. See Validating Parameters, Fields and Properties for details.
See Also

Reference

NotifyPropertyChangedAttribute
PostSharp.Patterns.Contracts

Online Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


Automatically implementing INotifyPropertyChanged

Automatically implementing INotifyPropertyChanged PostSharp Documentation

Binding objects to the UI is a large and tedious task. You must implement Online INotifyPropertyChanged on every property that needs to be bound. You need to ensure that the underlying property setter correctly raises events so that the View knows that changes have occurred. The larger your codebase, the more work there is. You can partially elminate all of this repetitive code by pushing some of the functionality to a base class that each Model class inherits from. It still doesn't eliminate all of the repetition though.

PostSharp can completely eliminate all of that repetition for you. All you have to do is make use of the Model Pattern Library's NotifyPropertyChangedAttribute aspect.

To add INotifyPropertyChanged aspect:

  1. Let's add NotifyPropertyChangedAttribute to the CustomerForEditing class:

    C#
    VB
    C++
    F#
    View Colorized Copy to Clipboard Print
    public class CustomerForEditing
{
    public string FirstName { get; set; }
    public string LastName { get; set; }
    public string FullName
    {
        get { return string.Format("{0} {1}", this.FirstName, this.LastName);}
    }
    public string Phone { get; set; }
    public string Mobile { get; set; }
    public string Email { get; set; }
}
    public class CustomerForEditing
{
    public string FirstName { get; set; }
    public string LastName { get; set; }
    public string FullName
    {
        get { return string.Format("{0} {1}", this.FirstName, this.LastName);}
    }
    public string Phone { get; set; }
    public string Mobile { get; set; }
    public string Email { get; set; }
}
  2.
                  Put the caret on the class name and expand the Smart Tag. From the list select "Implement INotifyPropertyChanged".

      INotify Property Changed 1
  3.
                  If you haven't previously added the Model Pattern Library to the current project, PostSharp will inform you that it will be doing this as well as adding an attribute to the target class.

      INotify Property Changed 2
  4.
                  PostSharp will download the Model Pattern Library and add the attribute.

      INotify Property Changed 3
  5.
                  Once the download, installation and configuration of the Model Pattern Library and the addition of the attribute has finished you can close the wizard and look at the changes that were made to your codebase.

      INotify Property Changed 4
  6.
                  You'll notice that the code you added NotifyPropertyChangedAttribute to has only been slightly modified. PostSharp has added a NotifyPropertyChangedAttribute attribute to the class. This class level attribute will add the implementation of NotifyPropertyChangedAttribute to the class as well as the plumbing code in each property that makes it work.

    C#
    VB
    C++
    F#
    View Colorized Copy to Clipboard Print
    [NotifyPropertyChanged]
public class CustomerForEditing
{
    public string FirstName { get; set; }
    public string LastName { get; set; }
    public string FullName
    {
        get { return string.Format("{0} {1}", this.FirstName, this.LastName); }
    }
    public string Phone { get; set; }
    public string Mobile { get; set; }
    public string Email { get; set; }
}
    [NotifyPropertyChanged]
public class CustomerForEditing
{
    public string FirstName { get; set; }
    public string LastName { get; set; }
    public string FullName
    {
        get { return string.Format("{0} {1}", this.FirstName, this.LastName); }
    }
    public string Phone { get; set; }
    public string Mobile { get; set; }
    public string Email { get; set; }
}
      Note  Note

                    This example has added NotifyPropertyChangedAttribute to one class. If you need to implement NotifyPropertyChangedAttribute to many different classes in your codebase you will want to read about using aspect multicasting. See the section Adding Aspects to Multiple Declarations.

          By using the Model Pattern Library to add NotifyPropertyChangedAttribute to your Model classes you are able to eliminate all of the repetitive boilerplate coding tasks and code from the codebase.

See Also
Reference
  Online INotifyPropertyChanged
NotifyPropertyChangedAttribute
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


Customizing the NotifyPropertyChanged Aspect

Customizing the NotifyPropertyChanged Aspect PostSharp Documentation

Postsharp includes a number of attributes for customizing the Model Pattern’s behaviour and for handling special dependencies.

This topic contains the following sections.

  • Ignoring Changes to Properties
  • Handling Virtual Calls, References, and Delegates in a Get Accessor
  • Handling Local Variables
  • Handling Dependencies on Pure Methods
Ignoring Changes to Properties

Use the IgnoreAutoChangeNotificationAttribute class attribute to prevent an OnPropertyChanged event from being invoked when setting a property. For example, the CustomerModel class contains a Country property amongst others:

C#
VB
C++
F#
View Colorized Copy to Clipboard Print
[NotifyPropertyChanged]
public class CustomerModel
{
    public string FirstName { get; set; }
    public string LastName { get; set; }

    public string Phone { get; set; }
    public string Mobile { get; set; }
    public string Email { get; set; }
    public string Country { get; set;}
}
[NotifyPropertyChanged]
public class CustomerModel
{
    public string FirstName { get; set; }
    public string LastName { get; set; }

    public string Phone { get; set; }
    public string Mobile { get; set; }
    public string Email { get; set; }
    public string Country { get; set;}
}
To prevent a property notification from being invoked when the Country’s value is set, simply place the IgnoreAutoChangeNotificationAttribute attribute above the property:
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
[NotifyPropertyChanged]
public class CustomerModel
{
    public string FirstName { get; set; }
    public string LastName { get; set; }
    public string Phone { get; set; }
    public string Mobile { get; set; }
    public string Email { get; set; }

    [IgnoreAutoChangeNotification]
    public string Country { get; set;}
}
[NotifyPropertyChanged]
public class CustomerModel
{
    public string FirstName { get; set; }
    public string LastName { get; set; }
    public string Phone { get; set; }
    public string Mobile { get; set; }
    public string Email { get; set; }

    [IgnoreAutoChangeNotification]
    public string Country { get; set;}
}
Handling Virtual Calls, References, and Delegates in a Get Accessor

              If a get accessor calls a virtual method from its class or a delegate, or references a property of another object (without using canonical form this.field.Property), PostSharp will generate an error because it cannot resolve such a dependency at build time. To suppress this error, you can add the [SafeForDependencyAnalysisAttribute] custom attribute to the property accessor (or in any method used by the property accessor). This custom attribute instructs PostSharp that the property accessor is “safe” – in other words, it contains only dependencies in the canonical form this.field.Property.

              For example, say CustomerModel contains a virtual method called ValidateCountry() which is used by the get accessor of its Country property:

C#
VB
C++
F#
View Colorized Copy to Clipboard Print
[NotifyPropertyChanged]
public class CustomerModel
{
  // Details skipped.

protected virtual bool ValidateCountry(string s)
{
  if (s!=null)
    return true;
  else
    return false;
}

  public string Country
  {
    get
    {
      if(this.ValidateCountry(value))
        return value;
      else
       return null;
    }
    set;
  }
}
[NotifyPropertyChanged]
public class CustomerModel
{
  // Details skipped.

protected virtual bool ValidateCountry(string s)
{
  if (s!=null)
    return true;
  else
    return false;
}

  public string Country
  {
    get
    {
      if(this.ValidateCountry(value))
        return value;
      else
       return null;
    }
    set;
  }
}

              In this situation the property relies on a virtual method which PostSharp cannot resolve at build time, so the SafeForDependencyAnalysisAttribute attribute can be placed on the Country property suppress this error:

C#
VB
C++
F#
View Colorized Copy to Clipboard Print
[NotifyPropertyChanged]
public class CustomerModel
{
   // Details skipped.

  public virtual bool Test(string s)
  {
    if (s!=null)
      return true;
    else
      return false;
  }

  [SafeForDependencyAnalysisAttribute]
  public string Country
  {
    get
    {
      if(this.test(value) == true)
        return value;
      else
       return null;
    }
    set;
  }
}
[NotifyPropertyChanged]
public class CustomerModel
{
   // Details skipped.

  public virtual bool Test(string s)
  {
    if (s!=null)
      return true;
    else
      return false;
  }

  [SafeForDependencyAnalysisAttribute]
  public string Country
  {
    get
    {
      if(this.test(value) == true)
        return value;
      else
       return null;
    }
    set;
  }
}
  Note  Note

                By using SafeForDependencyAnalysisAttribute, you are taking the responsibility that your code only has dependencies that are given either in the canonical form of this.field.Property either explicitly using the On  construct (see the next section). If you are using this custom attribute but have non-canonical dependencies, some property changes may not be detected in which case no notification will be generated.

Handling Local Variables

            Properties may depend on a property of another object, and sometimes this object must be stored in a local variable.  PostSharp is not able to analyze chains of dependencies in properties that are dependent on a property of a local variable.

            For example, consider the following version of CustomerModel which contains properties for primary and secondary contact phone numbers, each of which is of type Contact, as well a string property called ValidPhoneNumber which attempts to return a non-null phone number:

C#
VB
C++
F#
View Colorized Copy to Clipboard Print
public class Contact
{
  public string Phone {get; set;}
}

[NotifyPropertyChanged]
public class CustomerModel
{
  public Contact PrimaryContact{get; set;}
  public Contact SecondaryContact{get; set;}

  public string ValidPhoneNumber
  {
    Contact contact = null;
    if(PrimaryContact != null)
      contact = PrimaryContact;
    else
      contact = SecondaryContact;

    if(contact != null)
      return contact.Phone;
    else
      return null;
  }
}
public class Contact
{
  public string Phone {get; set;}
}

[NotifyPropertyChanged]
public class CustomerModel
{
  public Contact PrimaryContact{get; set;}
  public Contact SecondaryContact{get; set;}

  public string ValidPhoneNumber
  {
    Contact contact = null;
    if(PrimaryContact != null)
      contact = PrimaryContact;
    else
      contact = SecondaryContact;

    if(contact != null)
      return contact.Phone;
    else
      return null;
  }
}

            In this situation the local variable contact cannot be analyzed, so the dependency must be explicitly specified using the Depends On  method:

C#
VB
C++
F#
View Colorized Copy to Clipboard Print
[NotifyPropertyChanged]
public class CustomerModel
{
  public Contact PrimaryContact{get; set;}
  public Contact SecondaryContact{get; set;}

  [SafeForDependencyAnalysis]
  public string ValidPhoneNumber
  {
    Depends.On(this.PrimaryContact.Phone, this.SecondaryContact.Phone);
    Contact contact = null;
    if(PrimaryContact != null)
      contact = PrimaryContact;
    else
      contact = SecondaryContact;

    if(contact != null)
      return contact.Phone;
    else
      return null;
  }
}
[NotifyPropertyChanged]
public class CustomerModel
{
  public Contact PrimaryContact{get; set;}
  public Contact SecondaryContact{get; set;}

  [SafeForDependencyAnalysis]
  public string ValidPhoneNumber
  {
    Depends.On(this.PrimaryContact.Phone, this.SecondaryContact.Phone);
    Contact contact = null;
    if(PrimaryContact != null)
      contact = PrimaryContact;
    else
      contact = SecondaryContact;

    if(contact != null)
      return contact.Phone;
    else
      return null;
  }
}
  Note  Note

              The SafeForDependencyAnalysisAttribute attribute is still required in order to suppress the error about the dependency on a local variable.

Handling Dependencies on Pure Methods

          Often times an object will depend on a method which is solely dependant on its input parameters to produce an output (e.g. a static method). Consider the following variation to CustomerModel where the ValidPhoneNumber property logic has been moved into a static method called GetValidPhoneNumber() which exists in a separate helper class called ContactHelper:

C#
VB
C++
F#
View Colorized Copy to Clipboard Print
public class ContactHelper
{
  [Pure]
  public static string GetValidPhoneNumber(string firstPhoneNumber, string secondPhoneNumber)
  {
    if(firstPhoneNumber != null)
      return firstPhoneNumber;
    else if (secondPhoneNumber != null)
      return secondPhoneNumber;
    else
      return null;
  }
}

[NotifyPropertyChanged]
public class CustomerModel
{
  public Contact PrimaryContact{get; set;}
  public Contact SecondaryContact{get; set;}

  public string ValidPhoneNumber
  {
    get {
      return ContactHelper.GetValidPhoneNumber(this.PrimaryContact.Phone, this.SecondaryContact.Phone);
    }
  }
}
public class ContactHelper
{
  [Pure]
  public static string GetValidPhoneNumber(string firstPhoneNumber, string secondPhoneNumber)
  {
    if(firstPhoneNumber != null)
      return firstPhoneNumber;
    else if (secondPhoneNumber != null)
      return secondPhoneNumber;
    else
      return null;
  }
}

[NotifyPropertyChanged]
public class CustomerModel
{
  public Contact PrimaryContact{get; set;}
  public Contact SecondaryContact{get; set;}

  public string ValidPhoneNumber
  {
    get {
      return ContactHelper.GetValidPhoneNumber(this.PrimaryContact.Phone, this.SecondaryContact.Phone);
    }
  }
}

          Since GetValidPhoneNumber() is a standalone method of another class, it is not analyzed. Therefore the PureAttribute attribute needs to be applied to this method to acknowledge this dependency.

See Also
Reference
PureAttribute
IgnoreAutoChangeNotificationAttribute
SafeForDependencyAnalysisAttribute
Depends On
Depends
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


Working with Properties that Depend on Other Objects

Working with Properties that Depend on Other Objects PostSharp Documentation

It’s very common for the properties of one class to be dependent on the properties of another class. For example, a view-model layer will often contain a reference to a model object, and public properties which are in turn forwarded to the underlying properties of this referenced object. In this scenario the view-model component’s properties have a dependency on the referenced model’s properties. Subsequently the referenced model may also have properties which depend on the properties of other objects.

PostSharp’s Model Pattern Library easily handles transitive dependencies. Simply add the NotifyPropertyChangedAttribute class attribute to each class in the dependency chain. This will ensure that property change notifications are propagated up and down the dependency chain. The Model Pattern Library takes care of the rest and will even handle circular dependencies.

In the following set of steps, the CustomerModel class is used as a dependency of a CustomerViewModel class containing FirstName and LastName properties both of which directly map to properties of the CustomerModel class, and a public read only property called FullName, which is calculated based on the value of the underlying customer’s FirstName and LastName properties.

  1. Add the CustomerModel class to your project ensuring that the NotifyPropertyChangedAttribute attribute is included:

    C#
    VB
    C++
    F#
    View Colorized Copy to Clipboard Print
    [NotifyPropertyChanged]
public class CustomerModel
{
    public string FirstName { get; set; }
    public string LastName { get; set; }
    public string Phone { get; set; }
    public string Mobile { get; set; }
    public string Email { get; set; }
}
    [NotifyPropertyChanged]
public class CustomerModel
{
    public string FirstName { get; set; }
    public string LastName { get; set; }
    public string Phone { get; set; }
    public string Mobile { get; set; }
    public string Email { get; set; }
}
  2.
                  Setup a view-model class which contains a reference to a CustomerModel object, add properties to get/set the name related fields. References to properties of the CustomersForEditing object should be in the form of this.field.Property (or this.Property.Property), otherwise PostSharp won’t be able to discover the dependencies from your source code.

    C#
    VB
    C++
    F#
    View Colorized Copy to Clipboard Print
    class CustomerViewModel
{
    Customer model;

    public CustomerViewModel(Customer m)
    {
        this.model = m;
    }

    public string FirstName { get { return this.model.FirstName; } set { this.model.FirstName = value;}}

    public string LastName { get { return this.model.LastName; } set { this.model.LastName = value; }}

}
    class CustomerViewModel
{
    Customer model;

    public CustomerViewModel(Customer m)
    {
        this.model = m;
    }

    public string FirstName { get { return this.model.FirstName; } set { this.model.FirstName = value;}}

    public string LastName { get { return this.model.LastName; } set { this.model.LastName = value; }}

}
  3.
                  Add the FullName property and use the same rule as described in the previous step to reference dependent properties:

    C#
    VB
    C++
    F#
    View Colorized Copy to Clipboard Print
    class CustomerViewModel
{
    Customer model;

    public CustomerViewModel(Customer m)
    {
        this.model = m;
    }
    public string FirstName { get { return this.model.FirstName; } set { this.model.FirstName = value;}}
    public string LastName { get { return this.model.LastName; } set { this.model.LastName = value; }}

    public string FullName { get {
      return string.Format("{0} {1}", this.model.FirstName, this.model.LastName);
    } }

 }
    class CustomerViewModel
{
    Customer model;

    public CustomerViewModel(Customer m)
    {
        this.model = m;
    }
    public string FirstName { get { return this.model.FirstName; } set { this.model.FirstName = value;}}
    public string LastName { get { return this.model.LastName; } set { this.model.LastName = value; }}

    public string FullName { get {
      return string.Format("{0} {1}", this.model.FirstName, this.model.LastName);
    } }

 }
  4.
                  Add the NotifyPropertyChangedAttribute attribute to the class:

    C#
    VB
    C++
    F#
    View Colorized Copy to Clipboard Print
    [NotifyPropertyChanged]
class CustomerViewModel
{
    Customer model;

    public CustomerViewModel(Customer m)
    {
        this.model = m;
    }

    public string FirstName { get { return this.model.FirstName; } set { this.model.FirstName = value;}}
    public string LastName { get { return this.model.LastName; } set { this.model.LastName = value; }}

    public string FullName { get {
      return string.Format("{0} {1}", this.model.FirstName, this.model.LastName);
    } }

}
    [NotifyPropertyChanged]
class CustomerViewModel
{
    Customer model;

    public CustomerViewModel(Customer m)
    {
        this.model = m;
    }

    public string FirstName { get { return this.model.FirstName; } set { this.model.FirstName = value;}}
    public string LastName { get { return this.model.LastName; } set { this.model.LastName = value; }}

    public string FullName { get {
      return string.Format("{0} {1}", this.model.FirstName, this.model.LastName);
    } }

}

          You now have a view-model class which can be used to bridge a view (e.g. an application’s user interface) with the underlying data, and calls to get/set will be propagated across the chain of dependencies.

  Note  Note

            Read the article Customizing the NotifyPropertyChanged Aspect to learn about referencing properties without using the this.field.Property form.

See Also
Reference
NotifyPropertyChangedAttribute
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


Validating Parameters, Fields and Properties

Validating Parameters, Fields and Properties PostSharp Documentation

This topic contains the following sections.

  • Contracts
  • Custom Contracts
  • Contract Inheritance
  • See Also
Contracts

Throwing exceptions upon detecting a bad or unexpected value is good programming practice. However, writing the same checks over and over in different areas of the code base is tedious, error prone, and difficult to maintain.

Consider the following method which checks if a valid string has been passed in:

C#
VB
C++
F#
View Colorized Copy to Clipboard Print
public class CustomerModel
{
public void SetFullName(string firstName, string lastName)
{
    if(firstName == null)
      throw NullReferenceException();

    if(lastName == null)
      throw NullReferenceException();

    FullName = firstName + lastName;
}
}
public class CustomerModel
{
public void SetFullName(string firstName, string lastName)
{
    if(firstName == null)
      throw NullReferenceException();

    if(lastName == null)
      throw NullReferenceException();

    FullName = firstName + lastName;
}
}

          In this example, checks have been added to ensure that both parameters contain a valid string. A better solution is to place the logic which performs this check into its own reusable class, especially such boilerplate logic is involved, and then reuse/invoke this class whenever the check needs to be performed.

          PostSharp’s Contract attributes do just that by moving such checks out of code and into parameter attributes. For example, PostSharp’s RequiredAttribute contract could be used to simplify the example as follows:

C#
VB
C++
F#
View Colorized Copy to Clipboard Print
public class CustomerModel
{
    public void SetFullName([Required] string firstName, [Required] string lastName)
    {
        this.FullName = firstName + lastName;
    }
}
public class CustomerModel
{
    public void SetFullName([Required] string firstName, [Required] string lastName)
    {
        this.FullName = firstName + lastName;
    }
}

          In this example the RequiredAttribute attribute performs the check for null, thus eliminating the need to write the boiler plate code for the check inline with other code.

              A contract can also be used in a property as shown in the following example:

C#
VB
C++
F#
View Colorized Copy to Clipboard Print
public class CustomerModel
 {
    [Required]
    public FirstName
    {
        get;
        set;
    }
}
public class CustomerModel
 {
    [Required]
    public FirstName
    {
        get;
        set;
    }
}

              Using a contract in a property ensures that the value being passed into set is validated before the logic (if any) for set is executed.

              Similarly, a contract can be used directly on a field which will validate the value being assigned to the field:

C#
VB
C++
F#
View Colorized Copy to Clipboard Print
public class CustomerModel
{
    [Required]
    private string mFirstName = “Not filled in yet”;

    public void SetFirstName(string firstName)
    {
        mFirstName = firstName;
    }
}
public class CustomerModel
{
    [Required]
    private string mFirstName = “Not filled in yet”;

    public void SetFirstName(string firstName)
    {
        mFirstName = firstName;
    }
}

              In this example, firstName will be validated by the Required contract before being assigned to mFirstName. Placing a contract on a field provides the added benefit of validating the field regardless of where it’s set from.

              Note that PostSharp also includes a number of built-in contracts which range from checks for null values to testing for valid phone numbers. You can also develop your own contracts with custom logic for your own types as described below.

          There are two ways to add contracts:

  •
              from the UI

  •
              manually

This section contains the following subsections.
  • Adding Contracts from the UI
  • Adding Contracts Manually
Adding Contracts from the UI

              PostSharp’s Visual Studio integration provides a smart tag popup which can be used to select and apply a contract to a parameter, field, or property.

To add contract using the UI:
  1.
                      Click on the parameter, field, or property for which the contract is to be applied. While hovering the mouse over this item, a smart tag dropdown will appear:

  2.
                      Click on the smart tag dropdown to reveal the contracts available:

  3.
                      Select a contract from the list or select Add another aspect to display the aspect selection dialog:

  4.
                      Select a contract and click Next.

  5.
                      Confirm the addition of the contract and click Next:

  6.
                      Click Finish when the dialog indicates that the operation completed:

The aspect has now been added in code:
Adding Contracts Manually
To add contract manually:
  1.
                      Add the assembly: PostSharp.Patterns.Model to your project.

  2.
                      Add the namespace: PostSharp.Patterns.Contracts.

  3.
                      Add the attribute before the parameter name for example:

    C#
    VB
    C++
    F#
    View Colorized Copy to Clipboard Print
    public void SetFullName([Required] string firstName, [Required] string lastName)
    public void SetFullName([Required] string firstName, [Required] string lastName)
Custom Contracts

          Given the benefits that contracts provide over manually checking values and throwing exceptions in code, you will likely want to implement your own contracts to perform your own custom checks and handle your own custom types.

          The following steps show how to implement a contract which throws an exception if a numeric parameter is zero:

To implement a contract throwing an exception if a numeric parameter is zero:
  1.
                  Use the following namespaces: PostSharp.Aspects and PostSharp.Reflection.

  2.
                  Derive a class from LocationContractAttribute and set the ErrorMessage property:

    C#
    VB
    C++
    F#
    View Colorized Copy to Clipboard Print
    public class NonZeroAttribute : LocationContractAttribute
{
    public NonZeroAttribute()
      : base()
    {
        ErrorMessage = "The {2} must have a non-zero value";
    }
}
    public class NonZeroAttribute : LocationContractAttribute
{
    public NonZeroAttribute()
      : base()
    {
        ErrorMessage = "The {2} must have a non-zero value";
    }
}
      Note  Note

                    The ErrorMessage property can be set to a formatting string that contains placeholders. See the documentation for the ErrorMessage property for more information.

  3.
                  Implement the ILocationValidationAspect interface in the new contract class which exposes the ValidateValue(T, String, LocationKind) method. Note that this interface must be implemented for each type that is to be handled by the contract. In this example, the contract will handle both int and uint, so the interface is implemented for both integer types. If additional integer types were to be handled by this class (e.g. long), then additional implementations of ILocationValidationAspect would have to be added:

    C#
    VB
    C++
    F#
    View Colorized Copy to Clipboard Print
    public class NonZeroAttribute : LocationContractAttribute, ILocationValidationAspect<int>, ILocationValidationAspect<uint>
{
    public NonZeroAttribute()
      : base()
    {
        ErrorMessage = "Expected some type";
    }

    public Exception ValidateValue(int value, string name, LocationKind locationKind)
    {
       if (value == 0)
         return this.CreateArgumentOutOfRangeException(value, name, locationKind);
      else
         return null;
    }

    public Exception ValidateValue(uint value, string name, LocationKind locationKind)
    {
        if (value == 0)
          return this.CreateArgumentOutOfRangeException(value, name, locationKind);
        else
          return null;
    }
};
    public class NonZeroAttribute : LocationContractAttribute, ILocationValidationAspect<int>, ILocationValidationAspect<uint>
{
    public NonZeroAttribute()
      : base()
    {
        ErrorMessage = "Expected some type";
    }

    public Exception ValidateValue(int value, string name, LocationKind locationKind)
    {
       if (value == 0)
         return this.CreateArgumentOutOfRangeException(value, name, locationKind);
      else
         return null;
    }

    public Exception ValidateValue(uint value, string name, LocationKind locationKind)
    {
        if (value == 0)
          return this.CreateArgumentOutOfRangeException(value, name, locationKind);
        else
          return null;
    }
};
    ValidateValue(T, String, LocationKind) takes in the value to test, the name of the parameter, property or field, and the usage (i.e. whether it’s a parameter, property, or field). The method must return an exception if a check fails, or null or if no exception is to be raised.

          With the contract now created it can be used. For example, the following methods which calculate the modulus between two numbers, can use the contract defined above to ensure that neither of their input parameters are zero:

C#
VB
C++
F#
View Colorized Copy to Clipboard Print
bool Mod([NonZero] int number, [NonZero] int dividend)
{
  return ((number % dividend) == 0);
}

bool Mod([NonZero] uint number, [NonZero] uint dividend)
{
  return ((number % dividend) == 0);
}
bool Mod([NonZero] int number, [NonZero] int dividend)
{
  return ((number % dividend) == 0);
}

bool Mod([NonZero] uint number, [NonZero] uint dividend)
{
  return ((number % dividend) == 0);
}
Contract Inheritance

          PostSharp ensures that any contracts which have been applied to an abstract, virtual, or interface method are inherited along with that method in derived classes, all without the need to re-specify the contract in the derived methods. This is shown in the following example:

C#
VB
C++
F#
View Colorized Copy to Clipboard Print
public interface ICustomerModel
{
  void SetFullName([Required] string firstName, [Required] string lastName);
}

public class CustomerModel : ICustomerModel
{
  public void SetFullName(string firstName, string lastName)
  {
     this.FullName = firstName + “ “ + lastName;
  }

}
public interface ICustomerModel
{
  void SetFullName([Required] string firstName, [Required] string lastName);
}

public class CustomerModel : ICustomerModel
{
  public void SetFullName(string firstName, string lastName)
  {
     this.FullName = firstName + “ “ + lastName;
  }

}

          Here ICustomerModel.SetFullName method specifies that the firstName and lastName parameters are required using the RequiredAttribute attribute. Since the CustomerModel.SetFullName method implements this method, these attributes will also be applied to its parameters.

  Note  Note

            If the derived class exists in a separate assembly, that assembly must be processed by PostSharp and must reference PostSharp and PostSharp Model pattern assembly.

See Also
Reference
RequiredAttribute
PostSharp.Patterns.Model
PostSharp.Patterns.Contracts
PostSharp.Aspects
PostSharp.Reflection
LocationContractAttribute
ErrorMessage
ILocationValidationAspect
ValidateValue(T, String, LocationKind)
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


Adding Aspects to Code

Adding Aspects to Code PostSharp Documentation

An aspect has no effect until it is applied to some element of code. PostSharp provides multiple ways to add aspects to your code.

Applying Aspects to Multiple Elements of Code Declaratively

In many situations, you want to apply the same aspect to many elements of code. For instance, you may need to add tracing or performance monitoring to all public methods of a namespace. Since there may be hundreds of affected methods, you don't want to add a custom attribute to all of them.

Thanks to an extension of semantics of custom attributes named multicast custom attribute (MulticastAttribute), it is easy to apply an aspect to multiple elements of code using a single line of code.

For details, see Adding Aspects Declaratively Using Attributes and Understanding Aspect Inheritance.

Applying Aspects to Multiple Elements of Code Imperatively

If declarative features of MulticastAttribute are not sufficient for your case, you can select elements of code imperatively. For instance, you can develop complex filters based on Online System.Reflection or read information from an XML file.

There are two ways you can implement imperative selection aspect targets:

Filtering Out Using CompileTimeValidate

To filter out elements of codes that have been selected by MulticastAttribute, you can implement the method CompileTimeValidate(Object) of your aspect and silently return false if the candidate target is not appropriate. .

For instance, the following aspect will apply only on security-critical methods.

Filtering out aspect targets using CompileTimeValidate
View Colorized Copy to Clipboard Print
using System;
using System.Reflection;
using PostSharp.Aspects;

namespace Samples2
{
    [Serializable]
    public sealed class TraceSecurityCriticalAttribute : OnMethodBoundaryAspect
    {
        // Select only security-critical methods.
        public override bool CompileTimeValidate(MethodBase method)
        {
            return method.IsSecurityCritical;
        }

        public override void OnEntry(MethodExecutionArgs args)
        {
            Console.WriteLine("On Entry");
        }
    }
}
using System;
using System.Reflection;
using PostSharp.Aspects;

namespace Samples2
{
    [Serializable]
    public sealed class TraceSecurityCriticalAttribute : OnMethodBoundaryAspect
    {
        // Select only security-critical methods.
        public override bool CompileTimeValidate(MethodBase method)
        {
            return method.IsSecurityCritical;
        }

        public override void OnEntry(MethodExecutionArgs args)
        {
            Console.WriteLine("On Entry");
        }
    }
}

See Validating Aspect Usage for details.

Adding Aspect Instances Using IAspectProvider

If you have to implement more complex rules to select the target of aspects, you can create another aspect that will do nothing else than adding aspect instances to your code. This aspect must implement the interface IAspectProvider and will typically derive from AssemblyLevelAspect or TypeLevelAspect.

Tip Tip
Use ReflectionSearch to perform complex queries over System.Reflection.

Online Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


Adding Aspects Declaratively Using Attributes

Adding Aspects Declaratively Using Attributes PostSharp Documentation

In .NET, you normally need to write one line of code for any application of a target attribute. If a custom attribute applies to all types of a namespace, you have to manually add the custom attribute to every single type.

By contrast, multicast custom attributes allow you to apply a custom attribute on multiple declarations from a single line of code by using wildcard or regular expressions, or by filtering on some attributes. It makes it easy to apply an aspect to, say, all public static methods of a namespace, with a single line of code.

Multicast attributes can be inherited: you can put it on an interface and ask it to apply to all classes implementing this interface. Attribute inheritance also works for classes, virtual or interface methods, and parameters of virtual or interface methods.

Custom attributes supporting multicasting needs to be derived from MulticastAttribute. All PostSharp aspects and constraints are derived from this class.

Note Note
Multicasting of custom attribute is a feature of PostSharp. If you do not transform your assembly using PostSharp, multicast attributes will behave as plain old custom attributes.
Note Note
This documentation often refers to this as aspect multicasting and inheritance. This is not totally accurate. Although this feature has been developed to support aspects, you can use it for your own custom attributes, even if they are not aspects. To use multicasting and inheritance for custom attributes that are not aspects, simply derive the attribute class from MulticastAttribute instead of Online Attribute.

Attribute multicasting supports the following scenarios:

  • Adding Aspects to a Single Declaration
  • Adding Aspects to Multiple Declarations
  • Adding Aspects to Derived Classes and Methods
  • Overriding and Removing Aspect Instances
  • Reflecting Aspect Instances at Runtime

For a conceptual overview of this feature, see:.

  • Understanding Attribute Multicasting
  • Understanding Aspect Inheritance
See Also

Reference

MulticastAttribute
MulticastAttributeUsageAttribute
IAspectProvider

Online Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


Adding Aspects to a Single Declaration Using Attributes

Adding Aspects to a Single Declaration Using Attributes PostSharp Documentation

Aspects in PostSharp are plain custom attributes. You can apply them to any element of code as usually.

In the following example, the Trace aspect is applied to two methods.

C#
VB
C++
F#
View Colorized Copy to Clipboard Print
public class CustomerService
 {
     [Trace]
     public Custom GetCustomer( int customerId )
     {
         // Details skipped.
     }

     [Trace]
     public void MergeCustomers( Customer customer1, Customer customer2 );
     {
         // Details skipped.
     }
 }
public class CustomerService
 {
     [Trace]
     public Custom GetCustomer( int customerId )
     {
         // Details skipped.
     }

     [Trace]
     public void MergeCustomers( Customer customer1, Customer customer2 );
     {
         // Details skipped.
     }
 }
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


Adding Aspects to Multiple Declarations Using Attributes

Adding Aspects to Multiple Declarations Using Attributes PostSharp Documentation

Once have written an aspect we have to apply it to the application code so that it will be used. There are a number of ways to do this so let's take a look at one of them: custom attribute multicasting. Other ways include XML Multicasting (see the section Adding Aspects Using XML) and dynamic aspect providers (see more in the section Adding Aspects Programmatically using IAspectProvider).

This topic contains the following sections.

  • Applying to all members of a class
  • Applying an aspect to all types in a namespace
  • Excluding an aspect from some members
  • Filtering by class visibility
  • Filtering by method modifiers
  • Programmatic filtering
Applying to all members of a class

When we are trying to apply a method level aspect we can place an attribute to each of the methods.

C#
VB
C++
F#
View Colorized Copy to Clipboard Print
[OurLoggingAspect]
public class CustomerServices
[OurLoggingAspect]
public class CustomerServices

          As our codebase grows this approach becomes tedious. We need to remember to add the attribute to all of the methods on the class. If you have hundreds of classes, you may have thousands of methods you need to manually add the aspect attribute to. It's an unsustainable proposition. Thankfully, there is a way to make this easier. Instead of applying your aspect on each method you can add that attribute to the class and PostSharp will ensure that the aspect is applied to all of the methods on that class.

Applying an aspect to all types in a namespace

          Even though we don't have to apply an aspect to all methods in all classes in our application, adding the aspect attribute to every class could still be an overwhelming task. If we want to apply our aspect in a broad stroke we can make use of PostSharp's MulticastAttribute.

          The MulticastAttribute is a special attribute that will apply other attributes throughout your codebase. Here's how we would use it.

  1.
                  Open the AssemblyInfo.cs, or create a new file GlobalAspects.cs if you prefer to keep things separate (the name of this file does not matter).

  2.
                  Add an [assembly:] attribute that references the aspect you want applied.

  3.
                  Add the AttributeTargetTypes property to the aspects's constructor and define the namespace that you would like the aspect applied to.

    C#
    VB
    C++
    F#
    View Colorized Copy to Clipboard Print
    [assembly: OurLoggingAspect(AttributeTargetTypes="OurCompany.OurApplication.Controllers.*")]
    [assembly: OurLoggingAspect(AttributeTargetTypes="OurCompany.OurApplication.Controllers.*")]

          This one line of code is the equivalent of adding the aspect attribute to every class in the desired namespace.

  Note  Note

            When setting the AttributeTargetTypes you can use wildcards to indicate that all sub-namespaces should have the aspect applied to them. It is also possible to indicate the targets of the aspect using regex. Add "regex:" as a prefix to the pattern you wish to use for matching.

Excluding an aspect from some members

          Multicasting an attribute can apply the aspect with a very broad brush. It is possible to use AttributeExclude to restrict where the aspect is attached.

C#
VB
C++
F#
View Colorized Copy to Clipboard Print
[assembly: OurLoggingAspect(AttributeTargetTypes="OurCompany.OurApplication.Controllers.*", AttributePriority = 1)]
[assembly: OurLoggingAsepct(AttributeTargetMembers="Dispose", AttributeExclude = true, AttributePriority = 2)]
[assembly: OurLoggingAspect(AttributeTargetTypes="OurCompany.OurApplication.Controllers.*", AttributePriority = 1)]
[assembly: OurLoggingAsepct(AttributeTargetMembers="Dispose", AttributeExclude = true, AttributePriority = 2)]

          In the example above, the first multicast line indicates that the OurLoggingAspect should be attached to all methods in the Controllers namespace. The second multicast line indicates that the OurLoggingAspect should not be applied to any method named Dispose.

  Note  Note

            Notice the AttributePriority property that is set in both of the multicast lines. Since there is no guarantee that the compiler will apply the attributes in the order you have specified in the code, it is necessary to declare an order to ensure processing is completed as desired.

            In this case, the OurLoggingAspect will be applied to all methods in the Controllers namespace first. After that is completed, the second multicast of OurLoggingAspect is performed which then excludes the aspect from methods named Dispose.

          See Overriding and Removing Aspect Instances for more details about exclusing and overriding aspects.

Filtering by class visibility

          Now that you've been able to apply our aspect to all classes in a namespace and its sub-namespaces, you may be faced with the need to restrict that broad stroke. For example, you may want to apply your aspect only to classes defined as being public.

  1.
                  Add the AttributeTargetTypeAttributes property to the MulticastAttribute's constructor.

  2.
                  Set the AttributeTargetTypeAttributes value to Public.

    C#
    VB
    C++
    F#
    View Colorized Copy to Clipboard Print
    [assembly: OurLoggingAspect(AttributeTargetTypes="OurCompany.OurApplication.Controllers.*",
                            AttributeTargetTypeAttributes = MulticastAttributes.Public)]
    [assembly: OurLoggingAspect(AttributeTargetTypes="OurCompany.OurApplication.Controllers.*",
                            AttributeTargetTypeAttributes = MulticastAttributes.Public)]

          By combining AttributeTargetTypeAttributes values you are able to create many combinations that are appropriate for your needs.

  Note  Note

            When specifying attributes of target members or types, do not forget to provide all categories of flags, not only the category on which you want to put a restriction.

Filtering by method modifiers

          Filtering at a class level may not be granular enough for your needs. Aspects can be attached at the method level and you will want to control filtering on these aspects as well. Let's look at an example of how to apply aspects only to methods marked as virtual.

  1.
                  Add the AttributeTargetTypeAttributes property to the MulticastAttribute's constructor.

  2.
                  Set the AttributeTargetTypeAttributes value to VirtualVirtual.

    C#
    VB
    C++
    F#
    View Colorized Copy to Clipboard Print
    [assembly: OurLoggingAspect(AttributeTargetTypes="OurCompany.OurApplication.Controllers.*", AttributeTargetMemberAttributes = MulticastAttributes.Virtual)]
    [assembly: OurLoggingAspect(AttributeTargetTypes="OurCompany.OurApplication.Controllers.*", AttributeTargetMemberAttributes = MulticastAttributes.Virtual)]

          Using this technique you can apply a method level aspect, or stop it from being applied, based on the existence or non-existence of things like the static, abstract, and virtual keywords.

Programmatic filtering

          There are situations where you will want to filter in a way that isn't based on class or method declarations. You may want to apply an aspect only if a class inherits from a specific class or implements a certain interface. There needs to be a way for you to accomplish this.

          The easiest way is to override the CompileTimeValidate(Object) method of your aspect class, where you can perform your custom filtering. This is the opt-out approach. Have the CompileTimeValidate(Object) method return false without emitting any error, and the candidate target will be ignored. See the section [usage-validation] for details.

          The second approach is opt-in. See the section Adding Aspects Programmatically using IAspectProvider for details.

See Also
Reference
MulticastAttribute
AttributeTargetTypes
AttributeExclude
AttributePriority
AttributeTargetTypeAttributes
CompileTimeValidate(Object)
PersistMetaData
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


Adding Aspects to Derived Classes and Methods Using Attributes

Adding Aspects to Derived Classes and Methods Using Attributes PostSharp Documentation

By default, aspects apply to the class or class member which your attribute has been applied to. However, PostSharp provides the ability to specify aspect inheritance which can allow your attributes to be inherited in derived classes. This feature, named aspect inheritance can be specified on types, methods, and parameters, but not on properties or events.

Note Note
PostSharp Professional or higher edition is required for aspect inheritance.

This topic contains the following sections.

  • Applying aspects to derived types
  • Setting inheritance on a per-usage basis
  • Applying aspects to overridden methods
  • Applying aspects to new methods of derived types
Applying aspects to derived types

One way to implement aspect inheritance is to add a MulticastAttributeUsageAttribute custom attribute to your aspect class. Aspects that apply to types are typically derived from TypeLevelAspect or InstanceLevelAspect.

The benefit of this approach is that the aspect will be automatically applied to all derived classes, eliminating the need to manually setup attributes in the derived classes. Moreover, this logic lives in one place.

The following steps describe how to enable aspect inheritance on existing aspect, derived from TypeLevelAspect, which applies a Online DataContractAttribute attribute to the base and all derived classes, and a Online DataMemberAttribute attribute to all properties of the base class and those of derived classes:

How to enable aspect inheritance on existing aspect:

  1. Create a TypeLevelAspect which implements IAspectProvider. In this example we start with the AutoDataContractAttribute class which was introduced in the section Example: Automatically Adding DataContract and DataMember Attributes

  2. Decorate AutoDataContractAttribute with the MulticastAttribute, and set the Inheritance to Strict. Note that MulticastInheritance.Strict and MulticastInheritance.Multicast have the same effect when applied to type-level aspects.

    C#
    VB
    C++
    F#
    View Colorized Copy to Clipboard Print
    [MulticastAttributeUsage(Inheritance = MulticastInheritance.Strict)]
[Serializable]
public sealed class AutoDataContractAttribute : TypeLevelAspect, IAspectProvider
{
   // Details skipped.
}
    [MulticastAttributeUsage(Inheritance = MulticastInheritance.Strict)]
[Serializable]
public sealed class AutoDataContractAttribute : TypeLevelAspect, IAspectProvider
{
   // Details skipped.
}
  3.
                  Decorate your base class with AutoDataContractAttribute. The following snippet shows a base customer class and a derived customer class:

    C#
    VB
    C++
    F#
    View Colorized Copy to Clipboard Print
    [AutoDataContractAttribute]
class Document
{
    public string Title { get; set; }
    public string Author { get; set; }
    public DateTime PublishedOn { get; set; }

}

class MultiPageArticle : Document
{
    public List<ArticlePage> Pages { get; set; }
}
    [AutoDataContractAttribute]
class Document
{
    public string Title { get; set; }
    public string Author { get; set; }
    public DateTime PublishedOn { get; set; }

}

class MultiPageArticle : Document
{
    public List<ArticlePage> Pages { get; set; }
}

          When the attribute is applied to the base class, the   Online DataContractAttribute and   Online DataMemberAttribute attributes will be applied at compile time to both classes. If other derived classes were added, then these would be decorated automatically as well.

Setting inheritance on a per-usage basis

          Specifying targets and attribute inheritance can also be done on a per-usage basis rather that hardcoding it into the custom attribute. In the following snippet, we’ve removed the MulticastAttributeUsageAttribute attribute from AutoDataContractAttribute:

C#
VB
C++
F#
View Colorized Copy to Clipboard Print
[

          // MulticastAttributeUsage(Inheritance = MulticastInheritance.Strict)]
          [Serializable]
          public sealed class AutoDataContractAttribute : TypeLevelAspect, IAspectProvider
          {
              // Details skipped.
          }
[

          // MulticastAttributeUsage(Inheritance = MulticastInheritance.Strict)]
          [Serializable]
          public sealed class AutoDataContractAttribute : TypeLevelAspect, IAspectProvider
          {
              // Details skipped.
          }

          Now the inheritance mode can be specified directly on the AutoDataContractAttribute instance by setting the AttributeInheritance property as shown here:

C#
VB
C++
F#
View Colorized Copy to Clipboard Print
[TraceMethodAttribute(AttributeInheritance = MulticastInheritance.Strict)]
class Document
{
    // Details skipped.
}
[TraceMethodAttribute(AttributeInheritance = MulticastInheritance.Strict)]
class Document
{
    // Details skipped.
}
Applying aspects to overridden methods

          The following example shows a custom attribute which when applied to a class, writes a message to the console window whenever a method enters and exits:

C#
VB
C++
F#
View Colorized Copy to Clipboard Print
[Serializable]
public sealed class TraceMethodAttribute : OnMethodBoundaryAspect
{
    public override void OnEntry(MethodExecutionArgs args)
    {
        Console.WriteLine(string.Format("Entering {0}.{1}.", args.Method.DeclaringType.Name, args.Method.Name));
    }

    public override void OnExit(MethodExecutionArgs args)
    {
        Console.WriteLine(string.Format("Leaving {0}.{1}.", args.Method.DeclaringType.Name, args.Method.Name));
    }
}
[Serializable]
public sealed class TraceMethodAttribute : OnMethodBoundaryAspect
{
    public override void OnEntry(MethodExecutionArgs args)
    {
        Console.WriteLine(string.Format("Entering {0}.{1}.", args.Method.DeclaringType.Name, args.Method.Name));
    }

    public override void OnExit(MethodExecutionArgs args)
    {
        Console.WriteLine(string.Format("Leaving {0}.{1}.", args.Method.DeclaringType.Name, args.Method.Name));
    }
}

          Specifying inheritance is simply a matter of adding the MulticastAttributeUsageAttribute attribute and specifying the inheritance type, or to set the AttributeInheritance property on the custom attribute usage.

          In the snippet below, we have added the TraceMethod aspect to a virtual method and used the AttributeInheritance property to require the aspect to be automatically applied to all overriding methods:

C#
VB
C++
F#
View Colorized Copy to Clipboard Print
class Document
{
    // Details skipped.

       // This method will be traced.
    [TraceMethodAttribute(AttributeInheritance = MulticastInheritance.Strict)]
    public virtual void RenderHtml(StringBuilder html)
    {
         html.AppendLine( this.Title );
       html.AppendLine( this.Author );
    }
}

class MultiPageArticle: Document
{

  // This method will be traced.
    public override void RenderHtml(StringBuilder html)
    {
      base.RenderHtml(html);
      foreach ( ArticlePage page in this.Pages )
      {
        page.RenderHtml( html );
      }
    }

  // This method will NOT be traced.
       public void RenderHtmlPage(StringBuilder html, int pageIndex )
       {
          html.AppendFormat ( “{0}, page {1}”, this.Title, pageIndex+1 );
          html.AppendLine();
          html.AppendLine( this.Author );

       }

   }
class Document
{
    // Details skipped.

       // This method will be traced.
    [TraceMethodAttribute(AttributeInheritance = MulticastInheritance.Strict)]
    public virtual void RenderHtml(StringBuilder html)
    {
         html.AppendLine( this.Title );
       html.AppendLine( this.Author );
    }
}

class MultiPageArticle: Document
{

  // This method will be traced.
    public override void RenderHtml(StringBuilder html)
    {
      base.RenderHtml(html);
      foreach ( ArticlePage page in this.Pages )
      {
        page.RenderHtml( html );
      }
    }

  // This method will NOT be traced.
       public void RenderHtmlPage(StringBuilder html, int pageIndex )
       {
          html.AppendFormat ( “{0}, page {1}”, this.Title, pageIndex+1 );
          html.AppendLine();
          html.AppendLine( this.Author );

       }

   }

          In this example, TraceMethodAttribute will output entry and exit messages for Document.RenderHtml method and MultiPageArcticle.RenderHtml method as shown here:

View Colorized Copy to Clipboard Print
Entering MultiPageArcticle.RenderHtml
Entering Document.RenderHtml
Leaving Document.RenderHtml
Leaving MultiPageArcticle.RenderHtml
Entering MultiPageArcticle.RenderHtml
Entering Document.RenderHtml
Leaving Document.RenderHtml
Leaving MultiPageArcticle.RenderHtml
  Note  Note

            Aspect inheritance works with virtual, abstract and interface methods and their parameters.

          We would get the similar result by adding the TraceMethod attribute to the Document class. Indeed, by virtue of attribute multicasting (see section Adding Aspects to Multiple Declarations for more details), adding a method-level attribute to a class implicitly adds it to all method of this class.

C#
VB
C++
F#
View Colorized Copy to Clipboard Print
[TraceMethodAttribute(AttributeInheritance = MulticastInheritance.Strict)]
class Document
 {
     // All property getters and setters will be traced.
     public string Title { get; set; }
     public string Author { get; set; }
     public DateTime PublishedOn { get; set; }

        // This method will be traced.
     public virtual void RenderHtml(StringBuilder html)
     {
          html.AppendLine( this.Title );
        html.AppendLine( this.Author );
     }
 }

 class MultiPageArticle: Document
 {
    // Property getters and setters will NOT be traced.
    public List<ArticlePage> Pages { get; set; }

   // This method will be traced.
     public override void RenderHtml(StringBuilder html)
     {
       base.RenderHtml(html);
       foreach ( ArticlePage page in this.Pages )
       {
         page.RenderHtml( html );
       }
     }

   // This method will NOT be traced.
        public void RenderHtmlPage(StringBuilder html, int pageIndex )
        {
           html.AppendFormat ( “{0}, page {1}”, this.Title, pageIndex+1 );
           html.AppendLine();
           html.AppendLine( this.Author );

        }

    }
[TraceMethodAttribute(AttributeInheritance = MulticastInheritance.Strict)]
class Document
 {
     // All property getters and setters will be traced.
     public string Title { get; set; }
     public string Author { get; set; }
     public DateTime PublishedOn { get; set; }

        // This method will be traced.
     public virtual void RenderHtml(StringBuilder html)
     {
          html.AppendLine( this.Title );
        html.AppendLine( this.Author );
     }
 }

 class MultiPageArticle: Document
 {
    // Property getters and setters will NOT be traced.
    public List<ArticlePage> Pages { get; set; }

   // This method will be traced.
     public override void RenderHtml(StringBuilder html)
     {
       base.RenderHtml(html);
       foreach ( ArticlePage page in this.Pages )
       {
         page.RenderHtml( html );
       }
     }

   // This method will NOT be traced.
        public void RenderHtmlPage(StringBuilder html, int pageIndex )
        {
           html.AppendFormat ( “{0}, page {1}”, this.Title, pageIndex+1 );
           html.AppendLine();
           html.AppendLine( this.Author );

        }

    }

          However, by adding the TraceMethod aspect to all methods of the Document type, we added it to property getters and setters, influencing the output:

C#
VB
C++
F#
View Colorized Copy to Clipboard Print
Entering MultiPageArcticle.RenderHtml
Entering Document.RenderHtml
Entering Document.get_Title
Leaving Document.get_Title
Entering Document.get_Author
Leaving Document.get_Author
Leaving Document.RenderHtml
Leaving MultiPageArcticle.RenderHtml
Entering MultiPageArcticle.RenderHtml
Entering Document.RenderHtml
Entering Document.get_Title
Leaving Document.get_Title
Entering Document.get_Author
Leaving Document.get_Author
Leaving Document.RenderHtml
Leaving MultiPageArcticle.RenderHtml

        Applying aspects to new methods of derived types

        In the previous section the TraceMethod attribute used Strict inheritance which means that if the base class is decorated with the attribute, it will only be applied to methods which are declared in the base class and overridden in the derived class.

          By changing the inheritance mode to Multicast, we specify that the aspect should be also be applied to new methods of the derived class, i.e. not only methods that are overridden from the base class.

          In the following snippet we’ve changed inheritance from Strict to Multicast:

C#
VB
C++
F#
View Colorized Copy to Clipboard Print
[TraceMethodAttribute(AttributeInheritance = MulticastInheritance.Multicast)]
class Document
 {
     // All property getters and setters will be traced.
     public string Title { get; set; }
     public string Author { get; set; }
     public DateTime PublishedOn { get; set; }

        // This method will be traced.
     public virtual void RenderHtml(StringBuilder html)
     {
          html.AppendLine( this.Title );
      html.AppendLine( this.Author );
     }
 }

 class MultiPageArticle: Document
 {
    // Property getters and setters will ALSO be traced.
    public List<ArticlePage> Pages { get; set; }

   // This method will be traced.
     public override void RenderHtml(StringBuilder html)
     {
       base.RenderHtml(html);
       foreach ( ArticlePage page in this.Pages )
       {
         page.RenderHtml( html );
       }
     }

   // This method will ALSO be traced.
        public void RenderHtmlPage(StringBuilder html, int pageIndex )
        {
           html.AppendFormat ( “{0}, page {1}”, this.Title, pageIndex+1 );
           html.AppendLine();
           html.AppendLine( this.Author );

        }

    }
[TraceMethodAttribute(AttributeInheritance = MulticastInheritance.Multicast)]
class Document
 {
     // All property getters and setters will be traced.
     public string Title { get; set; }
     public string Author { get; set; }
     public DateTime PublishedOn { get; set; }

        // This method will be traced.
     public virtual void RenderHtml(StringBuilder html)
     {
          html.AppendLine( this.Title );
      html.AppendLine( this.Author );
     }
 }

 class MultiPageArticle: Document
 {
    // Property getters and setters will ALSO be traced.
    public List<ArticlePage> Pages { get; set; }

   // This method will be traced.
     public override void RenderHtml(StringBuilder html)
     {
       base.RenderHtml(html);
       foreach ( ArticlePage page in this.Pages )
       {
         page.RenderHtml( html );
       }
     }

   // This method will ALSO be traced.
        public void RenderHtmlPage(StringBuilder html, int pageIndex )
        {
           html.AppendFormat ( “{0}, page {1}”, this.Title, pageIndex+1 );
           html.AppendLine();
           html.AppendLine( this.Author );

        }

    }

          With Strict inheritance in use, TraceMethodAttribute applied to Document was not applied to the RenderHtmlPage method and the Pages property. In other words, as the name suggests, Strict inheritance is strictly applying the attribute on base members and any derived members which are inherited. However, with Multicast inheritance, the aspect is also applied to the RenderHtmlPage method and the Pages property.

Strict inheritance evaluates multicasting and then inheritance, but Multicast inheritance evaluates inheritance and then multicasting.

See Also
Reference
MulticastAttributeUsageAttribute
TypeLevelAspect
InstanceLevelAspect
  Online DataContractAttribute
  Online DataMemberAttribute
IAspectProvider
MulticastAttribute
Inheritance
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


Overriding and Removing Aspect Instances

Overriding and Removing Aspect Instances PostSharp Documentation

Having multiple instances of the same aspect on the same element of code is sometimes a desired behavior. With multicasting custom attributes (MulticastAttribute), it is easy to end up with that situation. Indeed, many multicasting paths can lead to the same target.

However, most of the time, a different behavior is preferred. We could define a method-level aspect on the type (this aspect would apply to all methods) and override (or even exclude) the aspect on a specific method.

The multicasting engine has both the ability to apply multiple aspect instances on the same target, and the ability to replace or remove custom attributes.

Understanding the Multicasting Algorithm

Before going ahead, it is important to understand the multicasting algorithm. The algorithm relies on a notion of order of processing of aspect instances.

Important note Important
This section covers how PostSharp handles multiple instances of the same aspect type for the sole purpose of computing how aspect instances should be overridden or removed. See Coping with Several Aspects on the Same Target to understand how to cope with multiple instances of different aspects.

The following rules apply:

  1. Aspect instances defined on a container (for instance a type) have always precedence over instances defined on an item of that container (for instance a method). Elements of code are processed in the following order: assembly, module, type, field, property, event, method, parameter.
  2. When multiple aspect instances are defined on the same level, they are sorted by increasing of value of the AttributePriority.

The algorithm builds a list of aspect instances applied (directly and indirectly) on an element of code, sorts these instances, and processes overrides or removals as described below.

Applying Multiple Instances of the Same Aspect

The property MulticastAttributeUsageAttribute AllowMultiple determines whether multiple instances of the same aspect are allowed on an element of code. By default, this property is set to true for all aspects.

In the following example, the methods in type MyClass are enhanced by one, two and three instances of the Trace aspect (see code comments).

C#
VB
C++
F#
View Colorized Copy to Clipboard Print
using System;
using System.Diagnostics;
using PostSharp.Aspects;
using PostSharp.Extensibility;
using Samples3;

[assembly: Trace(AttributeTargetTypes = "Samples3.My*", Category = "A")]
[assembly: Trace(AttributeTargetTypes = "Samples3.My*",
    AttributeTargetMemberAttributes = MulticastAttributes.Public, Category = "B")]

namespace Samples3
{
    [Serializable]
    public sealed class TraceAttribute : OnMethodBoundaryAspect
    {
        public string Category { get; set; }

        public override void OnEntry(MethodExecutionArgs args)
        {
            Trace.WriteLine("Entering " +
                            args.Method.DeclaringType.FullName + "." + args.Method.Name, this.Category);
        }
    }

    public class MyClass
    {
        // This method will have 1 Trace aspect with Category set to A.
        private void Method1()
        {
        }

        // This method will have 2 Trace aspects with Category set to A, B
        public void Method2()
        {
        }

        // This method will have 3 Trace aspects with Category set to A, B, C.
        [Trace(Category = "C")]
        public void Method3()
        {
        }
    }
}
using System;
using System.Diagnostics;
using PostSharp.Aspects;
using PostSharp.Extensibility;
using Samples3;

[assembly: Trace(AttributeTargetTypes = "Samples3.My*", Category = "A")]
[assembly: Trace(AttributeTargetTypes = "Samples3.My*",
    AttributeTargetMemberAttributes = MulticastAttributes.Public, Category = "B")]

namespace Samples3
{
    [Serializable]
    public sealed class TraceAttribute : OnMethodBoundaryAspect
    {
        public string Category { get; set; }

        public override void OnEntry(MethodExecutionArgs args)
        {
            Trace.WriteLine("Entering " +
                            args.Method.DeclaringType.FullName + "." + args.Method.Name, this.Category);
        }
    }

    public class MyClass
    {
        // This method will have 1 Trace aspect with Category set to A.
        private void Method1()
        {
        }

        // This method will have 2 Trace aspects with Category set to A, B
        public void Method2()
        {
        }

        // This method will have 3 Trace aspects with Category set to A, B, C.
        [Trace(Category = "C")]
        public void Method3()
        {
        }
    }
}
Overriding an Aspect Instance Manually

          You can require an aspect instance to override any previous one by setting the aspect property
          AttributeReplace.
          This is equivalent to a deletion followed by an insertion (see below).

          In the following examples, the first two methods of type MyClass are enhanced by aspects applied on assembly level,
          but these aspects are replaced by a different one on Method3.

C#
VB
C++
F#
View Colorized Copy to Clipboard Print
using System;
using System.Diagnostics;
using PostSharp.Aspects;
using PostSharp.Extensibility;
using Samples5;

[assembly: Trace(AttributeTargetTypes = "Samples5.My*", Category = "A")]
[assembly: Trace(AttributeTargetTypes = "Samples5.My*",
    AttributeTargetMemberAttributes = MulticastAttributes.Public, Category = "B")]

namespace Samples5
{
    [Serializable]
    public sealed class TraceAttribute : OnMethodBoundaryAspect
    {
        public string Category { get; set; }

        public override void OnEntry(MethodExecutionArgs args)
        {
            Trace.WriteLine("Entering " +
                            args.Method.DeclaringType.FullName + "." + args.Method.Name, this.Category);
        }
    }

    public class MyClass
    {
        // This method will have 1 Trace aspect with Category set to A.
        private void Method1()
        {
        }

        // This method will have 2 Trace aspect with Category set to A, B.
        public void Method2()
        {
        }

        // This method will have 1 Trace aspects with Category set to C.
        [Trace(Category = "C", AttributeReplace = true)]
        public void Method3()
        {
        }
    }
}
using System;
using System.Diagnostics;
using PostSharp.Aspects;
using PostSharp.Extensibility;
using Samples5;

[assembly: Trace(AttributeTargetTypes = "Samples5.My*", Category = "A")]
[assembly: Trace(AttributeTargetTypes = "Samples5.My*",
    AttributeTargetMemberAttributes = MulticastAttributes.Public, Category = "B")]

namespace Samples5
{
    [Serializable]
    public sealed class TraceAttribute : OnMethodBoundaryAspect
    {
        public string Category { get; set; }

        public override void OnEntry(MethodExecutionArgs args)
        {
            Trace.WriteLine("Entering " +
                            args.Method.DeclaringType.FullName + "." + args.Method.Name, this.Category);
        }
    }

    public class MyClass
    {
        // This method will have 1 Trace aspect with Category set to A.
        private void Method1()
        {
        }

        // This method will have 2 Trace aspect with Category set to A, B.
        public void Method2()
        {
        }

        // This method will have 1 Trace aspects with Category set to C.
        [Trace(Category = "C", AttributeReplace = true)]
        public void Method3()
        {
        }
    }
}
Overriding an Aspect Instance Automatically

          To cause a new aspect instance to automatically override any previous one, the aspect developer must disallow multiple instances by annotating
          the aspect class with the custom attribute
          MulticastAttributeUsageAttribute and setting the property
          AllowMultiple to false.

          In the following example, the methods in type MyClass are enhanced by a single Trace
          aspect:

C#
VB
C++
F#
View Colorized Copy to Clipboard Print
using System;
using System.Diagnostics;
using PostSharp.Aspects;
using PostSharp.Extensibility;
using Samples4;

[assembly: Trace(AttributeTargetTypes = "Samples4.My*", AttributePriority = 1, Category = "A")]
[assembly: Trace(AttributeTargetTypes = "Samples4.My*",
    AttributeTargetMemberAttributes = MulticastAttributes.Public, AttributePriority = 2, Category = "B")]

namespace Samples4
{
    [MulticastAttributeUsage(MulticastTargets.Method, AllowMultiple = false)]
    [Serializable]
    public sealed class TraceAttribute : OnMethodBoundaryAspect
    {
        public string Category { get; set; }

        public override void OnEntry(MethodExecutionArgs args)
        {
            Trace.WriteLine("Entering " +
                            args.Method.DeclaringType.FullName + "." + args.Method.Name, this.Category);
        }
    }

    public class MyClass
    {
        // This method will have 1 Trace aspect with Category set to A.
        private void Method1()
        {
        }

        // This method will have 1 Trace aspects with Category set to B.
        public void Method2()
        {
        }

        // This method will have 1 Trace aspects with Category set to C.
        [Trace(Category = "C")]
        public void Method3()
        {
        }
    }
}
using System;
using System.Diagnostics;
using PostSharp.Aspects;
using PostSharp.Extensibility;
using Samples4;

[assembly: Trace(AttributeTargetTypes = "Samples4.My*", AttributePriority = 1, Category = "A")]
[assembly: Trace(AttributeTargetTypes = "Samples4.My*",
    AttributeTargetMemberAttributes = MulticastAttributes.Public, AttributePriority = 2, Category = "B")]

namespace Samples4
{
    [MulticastAttributeUsage(MulticastTargets.Method, AllowMultiple = false)]
    [Serializable]
    public sealed class TraceAttribute : OnMethodBoundaryAspect
    {
        public string Category { get; set; }

        public override void OnEntry(MethodExecutionArgs args)
        {
            Trace.WriteLine("Entering " +
                            args.Method.DeclaringType.FullName + "." + args.Method.Name, this.Category);
        }
    }

    public class MyClass
    {
        // This method will have 1 Trace aspect with Category set to A.
        private void Method1()
        {
        }

        // This method will have 1 Trace aspects with Category set to B.
        public void Method2()
        {
        }

        // This method will have 1 Trace aspects with Category set to C.
        [Trace(Category = "C")]
        public void Method3()
        {
        }
    }
}
Deleting an Aspect Instance

          The MulticastAttribute AttributeExclude property
          removes any previous instance of the same aspect on a target.

          This is useful, for instance, when you need to exclude a target from the matching set of a wildcard expression. For instance:

C#
VB
C++
F#
View Colorized Copy to Clipboard Print
[assembly: Configurable( AttributeTypes = "BusinessLayer.*" )]

          namespace BusinessLayer
          {
            [Configurable( AttributeExclude = true )]
            public static class Helpers
            {

            }
          }
[assembly: Configurable( AttributeTypes = "BusinessLayer.*" )]

          namespace BusinessLayer
          {
            [Configurable( AttributeExclude = true )]
            public static class Helpers
            {

            }
          }
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


Reflecting Aspect Instances at Runtime

Reflecting Aspect Instances at Runtime PostSharp Documentation

Attribute multicasting has been primarily designed as a mechanism to add aspects to a program. Most of the time, the custom attribute representing an aspect can be removed after the aspect has been applied.

By default, if you add an aspect to a program and look at the resulting program using a disassembler or Online System.Reflection, you will not find these corresponding custom attributes.

If you need your aspect (or any other multicast attribute) to be reflected by Online System.Reflection or any other tool, you have to set the MulticastAttributeUsageAttribute PersistMetaData property to true.

For instance:

Multicast attribute visible from System.Reflection
View Colorized Copy to Clipboard Print
[MulticastAttributeUsage( MulticastTargets.Class, PersistMetaData = true )]
        public class TagAttribute : MulticastAttribute
        {
          public string Tag;
        }
[MulticastAttributeUsage( MulticastTargets.Class, PersistMetaData = true )]
        public class TagAttribute : MulticastAttribute
        {
          public string Tag;
        }
Note Note
Multicasting of attributes is not limited only to PostSharp aspects. You can multicast any custom attribute in your codebase in the same way as shown here. If a custom attribute is multicast with the PersistMetaData property set to true, when relfected on the compiled code will look as if you had manually added the custom attribute in all of the locations.

Online Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


Understanding Attribute Multicasting

Understanding Attribute Multicasting PostSharp Documentation

This topic contains the following sections.

  • Overview of the Multicasting Algorithm
  • Filtering Target Elements of Code
  • Filtering Properties
  • Overriding Filtering Attributes
Overview of the Multicasting Algorithm

Every multicast attribute class must be assigned a set of legitimate targets using the MulticastAttributeUsageAttribute custom attribute, which is the equivalent and complement of Online AttributeUsageAttribute for multicast attributes. Multicast attributes can be applied to types, methods, fields, properties, events, or/or parameters. For instance, a caching aspect targets methods. A field validation aspect targets fields.

When a field-level multicast attribute is applied to a type, the attribute is implicitly applied to all fields of that type. When it is applied on an assembly, it is implicitly applied to all fields of that assembly.

The general rule is: when a multicast attribute is applied on a container, it is implicitly (and recursively) applied to all elements of that container.

The next table illustrates how this rule translates for different kinds of targets.

Directly applied to | Implicitly applied to
Assembly or Module | Types, methods, fields, properties, parameters, and events contained in this assembly or module.
Type | Methods, fields, properties, parameters, and events contained in this type.
Property or Event | Accessors of this property or event.
Method | This method and the parameters of this method.
Field | This field.
Parameter | This parameter.
Filtering Target Elements of Code

Note that the default behavior is maximalist: we apply the attribute to all contained elements. However, PostSharp provides a way to restrict the set of elements to which the attribute is multicast: filtering.

Both the attribute developer and the user of the aspect can specify filters.

Developer-Specified Filtering

Just like normal custom attributes should be decorated with the [AttributeUsage] custom attribute, multicast custom attributes must be decorated by the [MulticastAttributeUsage] attribute (see MulticastAttributeUsageAttribute). It specifies which are the valid targets of the multicast attributes.

For instance, the following piece of code specifies that the attribute GuiThreadAttribute can be applied on instance methods. Aspect users experience a build-time error when trying to use this aspect on a constructor or static method.

Restricting an aspect to be applied on instance methods
View Colorized Copy to Clipboard Print
[MulticastAttributeUsage(MulticastTargets.Method, TargetMemberAttributes = MulticastAttributes.Instance)]
[AttributeUsage(AttributeTargets.Assembly|AttributeTargets.Class|AttributeTargets.Method, AllowMultiple = true)]
[Serializable]
public class GuiThreadAttribute : MethodInterceptionAspect
{
// Details skipped.
}
[MulticastAttributeUsage(MulticastTargets.Method, TargetMemberAttributes = MulticastAttributes.Instance)]
[AttributeUsage(AttributeTargets.Assembly|AttributeTargets.Class|AttributeTargets.Method, AllowMultiple = true)]
[Serializable]
public class GuiThreadAttribute : MethodInterceptionAspect
{
// Details skipped.
}

Note the presence of the Online AttributeUsageAttribute attribute in the sample above. It tells the C# or Visual Basic compiler that the attribute can be directly applied to assemblies, classes, constructors, or methods. But this aspect will never be eventually applied to an assembly or a class. Indeed, the MulticastAttributeUsageAttribute attribute specifies that the sole valid targets are methods. Furthermore, the TargetMemberAttributes property establishes a filter that includes only instance methods.

Therefore, if the aspect is applied on a type containing an abstract method, the aspect will not be multicast to this method, neither to its constructors.

Tip Tip
Additionally to multicast filtering, consider using programmatic validation of aspect usage. Any custom attribute can implement IValidableAnnotation to implement build-time validation of targets. Aspects that derive from Aspect already implement these interfaces: your aspect can override the method CompileTimeValidate(Object).
Tip Tip
As an aspect developer, you should enforce as many restrictions as necessary to ensure that your aspect is only used in the way you intended, and raise errors in other cases. Using an aspect in an unexpected way may result in runtime errors that are difficult to debug.

User-Specified Filtering

The attribute user can specify multicasting filters using specific properties of the MulticastAttribute class. To make it clear that these properties only impact the multicasting process, they have the prefix Attribute.

As an aspect user, it is important to understand that you can only apply aspects to elements of codes that have been allowed by the developer of the aspect.

For instance, the following element of code adds a tracing aspect to all public methods of a namespace:

Applying an aspect to several types methods in a single line of code
View Colorized Copy to Clipboard Print
[assembly: Trace( AttributeTargetTypes="AdventureWorks.BusinessLayer.*", AttributeTargetMemberAttributes = MulticastAttributes.Public )]
[assembly: Trace( AttributeTargetTypes="AdventureWorks.BusinessLayer.*", AttributeTargetMemberAttributes = MulticastAttributes.Public )]
Filtering Properties

The following table lists the filters available to users and developers of aspects:

MulticastAttribute Property | MulticastAttributeUsageAttribute Property | Description
AttributeTargetElements | ValidOn | Restricts the kinds of targets (assemblies, classes, value types, delegates, interfaces, properties, events, properties, methods, constructors, parameters) to which the attribute can be indirectly applied.
AttributeTargetAssemblies |  | Wildcard expression or regular expression specifying to which assemblies the attribute is multicast.
 | AllowExternalAssemblies | Determines whether the aspect can be applied to elements defined in a different assembly than the current one.
AttributeTargetTypes |  | Wildcard expression or regular expression filtering by name the type to which the attribute is applied, or the declaring type of the member to which the attribute is applied.
AttributeTargetTypeAttributes | TargetTypeAttributes | Restricts the visibility of the type to which the aspect is applied, or of the type declaring the member to which the aspect is applied.
AttributeTargetMembers |  | Wildcard expression or regular expression filtering by name the member to which the attribute is applied.
AttributeTargetMemberAttributes | TargetMemberAttributes | Restricts the attributes (visibility, virtuality, abstraction, literality, ...) of the member to which the aspect is applied.
AttributeTargetParameters |  | Wildcard expression or regular expression specifying to which parameter the attribute is multicast.
AttributeTargetParameterAttributes | TargetParameterAttributes | Restricts the attributes (in/out/ref) of the parameter to which the aspect is applied.
AttributeInheritance | Inheritance | Specifies whether the aspect is propagated along the lines of inheritance of the target interface, class, method, or parameter (see Understanding Aspect Inheritance).
Caution note Caution
Whenever possible, do not rely on naming conventions to apply aspects (properties AttributeTargetTypes, AttributeTargetMembers and AttributeTargetParameters). This may work perfectly today, and break tomorrow if someone renames an element of code without being aware of the aspect.
Overriding Filtering Attributes

Suppose we have two classes A and B, B being derived from A. Both A and B can be decorated with MulticastAttributeUsageAttribute. However, since B is derived from A, filters on B cannot be more permissive than filters on A.

In other words, the MulticastAttributeUsageAttribute custom attribute is inherited. It can be overwritten in derived classes, but derived class cannot enlarge the set of possible targets. They can only restrict it.

Similarly (and hopefully predictably), the aspect user is subject to the same rule: she can restrict the set of possible targets supported by the aspect, but cannot enlarge it.

Online Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


Understanding Aspect Inheritance

Understanding Aspect Inheritance PostSharp Documentation

This topic contains the following sections.

  • Lines of Inheritance
  • Strict and Multicast Inheritance
Lines of Inheritance

Aspect inheritance is supported on the following elements.

Aspect Applied On | Aspect Propagated To
Interface | Any class implementing this interface or any other interface deriving this interface.
Class | Any class derived from this class.
Virtual or Abstract Methods | Any method implementing or overriding this method.
Interface Methods | Any method implementing that interface semantic.
Parameter or Return Value of an abstract, virtual or interface method | The corresponding parameter or to the return value of derived methods using the method-level rules described above.
Assembly | All assemblies referencing (directly or not) this assembly.
Note Note
Aspect inheritance is not supported on events and properties, but it is supported on event and property accessors. The reason of this limitation is that there is actually nothing like “event inheritance” or “property inheritance” in MSIL (events and properties have nearly no existence for the CLR: these are pure metadata intended for compilers). Obviously, aspect inheritance is not supported on fields.
Strict and Multicast Inheritance

To understand the difference between strict and multicast inheritance, remember the original role of MulticastAttribute: to propagate custom attributes along the lines of containment. So, if you apply a method-level attribute to a type, the attribute will be propagated to all the methods of this type (some methods can be filtered out using specific properties of MulticastAttribute, or MulticastAttributeUsageAttribute; see Adding Aspects Declaratively Using Attributes for details).

The difference between strict and multicasting inheritance is that, with multicasting inheritance (but not with strict inheritance), even inherited attributes are propagated along the lines of containment.

Consider the following piece of code, where A and B are both method-level aspects.

Comparing strict and multicast aspect inheritance
View Colorized Copy to Clipboard Print
[A(AttributeInheritance = MulticastInheritance.Strict)]
[B(AttributeInheritance = MulticastInheritance.Multicast)]
public class BaseClass
{
  // Aspect A, B.
  public virtual void Method1();
}

public class DerivedClass : BaseClass
{
  // Aspects A, B.
  public override void Method1() {}

  // Aspect B.
  public void Method2();
}
[A(AttributeInheritance = MulticastInheritance.Strict)]
[B(AttributeInheritance = MulticastInheritance.Multicast)]
public class BaseClass
{
  // Aspect A, B.
  public virtual void Method1();
}

public class DerivedClass : BaseClass
{
  // Aspects A, B.
  public override void Method1() {}

  // Aspect B.
  public void Method2();
}

If you just look at BaseClass, there is no difference between strict and multicasting inheritance. However, if you look at DerivedClass, you see the difference: only aspect B is applied to MethodB.

The multicasting mechanism for aspect A is the following:

  1. Propagation along the lines of containment from BaseClass to BaseClass.Method1.
  2. Propagation along the lines of inheritance from BaseClass.Method1 to DerivedClass.Method.

For aspect B, the mechanism is the following:

  1. Propagation along the lines of containment from BaseClass to BaseClass.Method1.
  2. Propagation along the lines of inheritance from BaseClass::Method1 to DerivedClass.Method2.
  3. Propagation along the lines of inheritance from BaseClass to DerivedClass.
  4. Propagation along the lines of containment from DerivedClass to DerivedClass.Method1and DerivedClass.Method2.

In other words, the difference between strict and multicasting inheritance is that multicasting inheritance applies containment propagation rules to inherited aspects; strict inheritance does not.

Avoiding Duplicate Aspects

If you read again the multicasting mechanism for aspect B, you will notice that the aspect B is actually applied twice to DerivedClass.Method1: one instance comes from the inheritance propagation from BaseClass.Method1, the other instance comes from containment propagation from DerivedClass.

To avoid surprises, PostSharp implements a mechanism to avoid duplicate aspect instances. The rule: if many paths lead from the same custom attribute usage to the same target element, only one instance of this custom attribute is applied to the target element.

Caution note Caution
Attention: you can still have many instances of the same custom attribute on the same target element if they have different origins (i.e. they originate from different lines of code, typically). You can enforce uniqueness of custom attribute instances by using AllowMultiple. See the section Overriding and Removing Aspect Instances for details.
See Also

Reference

MulticastAttribute
MulticastAttributeUsageAttribute

Online Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


Adding Aspects Using XML

Adding Aspects Using XML PostSharp Documentation

PostSharp not only allows aspects to be applied in code, but also through XML. This is accomplished by adding them to your project’s .psproj file.

Adding aspects through XML gives the advantage of applying aspects without modifying the source code, which could be an advantage in some legacy projects.

Specifying an attribute in XML

This example is based on the AutoDataContractAttribute explained in the section Example: Automatically Adding DataContract and DataMember Attributes.

C#
VB
C++
F#
View Colorized Copy to Clipboard Print
namespace MyCustomAttributes
{
    // We set up multicast inheritance so  the aspect is automatically added to children types.
    [MulticastAttributeUsage(MulticastTargets.Class, Inheritance = MulticastInheritance.Strict)]
    [Serializable]
    public sealed class AutoDataContractAttribute : TypeLevelAspect, IAspectProvider
    {
        // Details skipped.
    }
}
 namespace MyCustomAttributes
{
    // We set up multicast inheritance so  the aspect is automatically added to children types.
    [MulticastAttributeUsage(MulticastTargets.Class, Inheritance = MulticastInheritance.Strict)]
    [Serializable]
    public sealed class AutoDataContractAttribute : TypeLevelAspect, IAspectProvider
    {
        // Details skipped.
    }
}

          Normally AutoDataContractAttribute would be applied to Customer in code as follows:

C#
VB
C++
F#
View Colorized Copy to Clipboard Print
namespace MyNamespace
{
    [AutoDataContractAttribute]
    class Customer
    {
        public string FirstName {get; set;}
        public string LastName { get; set; }
    }
}
 namespace MyNamespace
{
    [AutoDataContractAttribute]
    class Customer
    {
        public string FirstName {get; set;}
        public string LastName { get; set; }
    }
}

          Using XML instead, we can remove the custom attribute from source code and instead specify a Multicast element in the PostSharp project file, a file that has the same name as your project file (csproj or svproj), but with the .psproj extension:

XML
View Colorized Copy to Clipboard Print
<?xml version="1.0" encoding="utf-8"?>
<Project xmlns="http://schemas.postsharp.org/1.0/configuration">
    <Multicast xmlns:my="clr-namespace:MyCustomAttributes;assembly:MyAssembly">
        <my:AutoDataContractAttribute  AttributeTargetTypes=" MyNamespace.Customer" />
    </Multicast>

</Project>
<?xml version="1.0" encoding="utf-8"?>
<Project xmlns="http://schemas.postsharp.org/1.0/configuration">
    <Multicast xmlns:my="clr-namespace:MyCustomAttributes;assembly:MyAssembly">
        <my:AutoDataContractAttribute  AttributeTargetTypes=" MyNamespace.Customer" />
    </Multicast>

</Project>

          In this snippet, the xmlns:my attribute associates a prefix to an XML namespace, which must be mapped to the .NET namespace and assembly where custom attributes classes are defined:

XML
View Colorized Copy to Clipboard Print
<Multicast xmlns:my="clr-namespace:MyCustomAttributes;assembly:MyAssembly">
<Multicast xmlns:my="clr-namespace:MyCustomAttributes;assembly:MyAssembly">

          The next line then specifies the custom attribute to apply and the target attributes to apply the custom attributes to:

XML
View Colorized Copy to Clipboard Print
<my:AutoDataContractAttribute  AttributeTargetTypes="MyNamespace.Customer" />
<my:AutoDataContractAttribute  AttributeTargetTypes="MyNamespace.Customer" />

          The XML element name must be the name of a class inside the .NET namespace and assembly as defined by the XML namespace. Attributes of this XML element map to public properties or fields of this class.

          Note that any property inherited from MulticastAttribute can be used here in order to apply the aspect to several classes at a time. See the section Adding Aspects to Multiple Declarations for details about these properties.

See Also
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


Adding Aspects Programmatically using IAspectProvider

Adding Aspects Programmatically using IAspectProvider PostSharp Documentation

You may have situations where you are looking to implement an aspect as part of a larger pattern. Perhaps you want to add an aspect, implement an interface and dynamically inject some logic into the target code. In those situations you will want to apply an aspect to the target code and have that aspect then add other aspects to other elements of code.

The theoretical concept can cause some mental gymnastics, so let's take a look at the implementation.

  1. Create an aspect that implements that IAspectProvider interface.

    C#
    VB
    C++
    F#
    View Colorized Copy to Clipboard Print
    public class ProviderAspect : IAspectProvider
{
   public IEnumerable<AspectInstance> ProvideAspects(object targetElement)
   {
       throw new System.NotImplementedException();
   }
}
     public class ProviderAspect : IAspectProvider
{
   public IEnumerable<AspectInstance> ProvideAspects(object targetElement)
   {
       throw new System.NotImplementedException();
   }
}
  2.
                  Cast the target object parameter to the type that will be targeted by this aspect: Assembly, Type, MethodInfo, ConstructorInfo or LocationInfo.

    C#
    VB
    C++
    F#
    View Colorized Copy to Clipboard Print
    public IEnumerable<AspectInstance> ProvideAspects(object targetElement)
{
   Type type = (Type) targetElement;

   throw new NotImplementedException();
}
     public IEnumerable<AspectInstance> ProvideAspects(object targetElement)
{
   Type type = (Type) targetElement;

   throw new NotImplementedException();
}
  3.
                    In the ProvideAspects(Object) method returns an AspectInstance of the aspect type you want, for every target element of code.

    C#
    VB
    C++
    F#
    View Colorized Copy to Clipboard Print
    public IEnumerable<AspectInstance> ProvideAspects(object targetElement)
{
    Type type = (Type)targetElement;

    return type.GetMethods().Select(
       m => return new AspectInstance(targetElement, new LoggingAspect()) );

}
     public IEnumerable<AspectInstance> ProvideAspects(object targetElement)
{
    Type type = (Type)targetElement;

    return type.GetMethods().Select(
       m => return new AspectInstance(targetElement, new LoggingAspect()) );

}

            This aspect will now add aspects dynamically at compile time. Use of the IAspectProvider interface and technique is usually reserved for situations where you are trying to implement a larger design pattern. For example, it would be used when implementing an aspect that created the NotifyPropertyChangedAttribute pattern across a large number of locations in your codebase. It is overkill for many of the situations that you will encounter. Use it only for complicated pattern implementation aspects that you will create.

  Note  Note

              To read more about NotifyPropertyChangedAttribute, see Customizing the NotifyPropertyChanged Aspect.

  Note  Note

          PostSharp does not automatically initialize the aspects provided by IAspectProvider,
          even if the method CompileTimeInitialize is defined. Any initialization, if necessary,
          should be done in the ProvideAspects method or in the constructor of provided aspects.

          However, these aspects are initialized at runtime just like normal aspects using the RunTimeInitialize method.

Creating Graphs of Aspects

          It is common that aspects provided by  IAspectProvider (children aspects) form an object graph. For
          instance, children aspects may contain a reference to the parent aspect.

          An interesting feature of PostSharp is that object graphs instantiated at compile-time are serialized, and can be used at
          run-time. In other words, if you store in a child aspect a reference to another aspect, you will be able to use this reference at runtime.

See Also
Reference
IAspectProvider
NotifyPropertyChangedAttribute
ProvideAspects(Object)
AspectInstance
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


Developing Custom Aspects

Developing Custom Aspects PostSharp Documentation

Online Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


Developing Simple Aspects

Developing Simple Aspects PostSharp Documentation

In PostSharp, developing an aspect is as simple as deriving a primitive aspect class and overriding some special methods named advice. Aspects encapsulate a transformation of an element of code (such as a method or a property), and advices are the methods that are executed at runtime.

For instance, the effect of the aspect OnMethodBoundaryAspect is to wrap the target method into a try/catch/finally construct, and the advices of this aspect are OnEntry(MethodExecutionArgs), OnSuccess(MethodExecutionArgs), OnException(MethodExecutionArgs) and OnExit(MethodExecutionArgs)

By default, advices of primitive aspect types have an empty implementation, so the aspect has no effect until you override at least one advice.

To develop a simple aspect:

  1. Add PostSharp to your project. See Installing PostSharp for details.

  2. Create a new class and make it derive from one of the primitive aspect classes (see below).

  3. Annotate the class with the custom attribute Online SerializableAttribute, or PSerializableAttribute if your project targets anything else than the full .NET Framework. See Understanding Aspect Lifetime and Scope to understand why.

  4. Override one of the aspect advice methods.

Aspect Classes

The following table gives a list of available primitive aspect classes. Every aspect class is described in greater detailed in the class reference documentation.

Aspect Type | Targets | Description
OnMethodBoundaryAspect | Methods | Methods enhanced with an OnMethodBoundaryAspect are wrapped by a try/catch/finally construct. This aspect provides the advices OnEntry(MethodExecutionArgs), OnSuccess(MethodExecutionArgs), OnException(MethodExecutionArgs) and OnExit(MethodExecutionArgs); these advices are invoked directly from the transformed method, the return value, and the exception (if applicable). This aspect is useful to implement tracing or transaction handling, for instance. For details, see Injecting Behaviors Before and After Method Execution.
OnExceptionAspect | Methods | Methods enhanced with an OnExceptionAspect are wrapped by a try/catch construct. This aspect provides the advice OnException(MethodExecutionArgs); this advice is invoked from the catch block. This aspect is useful to implement exception handling policies. Contrarily to OnMethodBoundaryAspect, this aspect lets you define the type of caught exceptions by overriding the method GetExceptionType(MethodBase) For details, see Handling Exceptions.
MethodInterceptionAspect | Methods | When a method is enhanced by a MethodInterceptionAspect, all calls to this method are replaced by calls to OnInvoke(MethodInterceptionArgs), the only advice of this aspect type. This aspect is useful when the execution of target method can be deferred (asynchronous calls), must be dispatched on a different thread. For details, see Intercepting Methods.
LocationInterceptionAspect | Fields, Properties | When a field or a property is enhanced by a LocationInterceptionAspect, all calls to its accessors are replaced by calls to advices OnGetValue(LocationInterceptionArgs) and OnSetValue(LocationInterceptionArgs). Fields are transparently replaced by properties. This aspect is useful to implement functionalities that need to get or set the location value, such as the observability design pattern ( Online INotifyPropertyChanged). For details, see Intercepting Properties and Fields.
EventInterceptionAspect | Events | When an event is enhanced by an EventInterceptionAspect, all calls to its add and remove semantics are replaced by calls to advices OnAddHandler(EventInterceptionArgs) and OnRemoveHandler(EventInterceptionArgs). Additionally, when the event is fired, even of invoking directly the handlers that were added to the event, the advice OnInvokeHandler(EventInterceptionArgs) is called instead. This aspect is useful to add functionalities to events, such as implementing asynchronous events or materialized list of subscribers. For details, see Intercepting Events.
CompositionAspect | Types | This aspect introduces an interface into a type by composition. The interface is introduced statically; the aspect method GetPublicInterfaces(Type) should return the type of introduced interfaces. However, the object implementing the interface is created dynamically at runtime by the implementation of the method CreateImplementationObject(AdviceArgs). For details, see Introducing Interfaces.
CustomAttributeIntroductionAspect | Any | This aspect introduces a custom attribute on any element of code. A custom attribute can be represented as a Online CustomAttributeData or a ObjectConstruction. For details, see Introducing Custom Attributes.
ManagedResourceIntroductionAspect | Assemblies | This aspect introduces a managed resource into the current assembly. For details, see Introducing Managed Resources.
ILocationValidationAspect | Fields, Properties, Parameters | This aspect causes any new value assigned to its target to be validated. If the aspect determines the value is invalid, an exception is thrown. The aspects of the PostSharp.Patterns.Contracts namespace are built on the top of this interface aspect. For details, see Validating Parameters, Fields and Properties.
Tip Tip
The implementation of aspects OnMethodBoundaryAspect and OnExceptionAspect is very efficient; they should be preferred over other aspects whenever it makes sense.
Using Aspect Interfaces

The primitive aspect classes listed above only exist for convenience. In reality, PostSharp only understands interfaces. Every of these aspect classes implements a pair of interfaces. For instance, the class OnMethodBoundaryAspect implements the interfaces IOnMethodBoundaryAspect and IMethodLevelAspectBuildSemantics.

The aspect classes are more convenient because they derive from MulticastAttribute, which extends Online System Attribute with multicasting capability. See Adding Aspects to Multiple Declarations for details.

If you do not need or want the capabilities of MulticastAttribute (for instance because the aspect is not used as a custom attribute, see IAspectProvider), you can implement the aspect interface manually. An aspect class must implement an interface derived from IAspect, and may implement an interface derived from IAspectBuildSemantics. Please refer to the documentation of the aspect class to get information about the corresponding aspect interface.

Additionally to the aspect interface corresponding to an aspect class, you can define the following interfaces on aspect classes:

Aspect Interface | Description
IAspectProvider | This interface defines a single method ProvideAspects(Object), returning a collection of AspectInstance. The method allows an aspect to dynamically provide other aspects to the weaver.
IInstanceScopedAspect | By default, aspects have static scope: there is one instance of the aspect per target class. Implementing the IInstanceScopedAspect makes the aspect instance-scoped: there will be one instance of this aspect per instance of the target class.

Online Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


Injecting Behaviors Before and After Method Execution

Injecting Behaviors Before and After Method Execution PostSharp Documentation

There are two ways to inject behaviors into methods. The first is the method decorator: it allows you to add instructions before and after method execution. The second is method interception: the hook gets invoked instead of the method. Decorators are faster than interceptors, but interceptors are more powerful. The current article covers decorators. For the other aspect, see Intercepting Methods.

You may want to use method decorators to perform logging, monitor performance, initialize database transactions or any one of many other infrastructure related tasks. PostSharp provides you with an easy to use framework for all of these tasks in the form of the OnMethodBoundaryAspect.

Injection points

When you are decorating methods there are different locations that you may wish to inject functionality to. You may want to perform a task prior to the method executing or just before it finishes execution. There are situations where you may want to inject functionality only when the method has successfully executed or when it has thrown an exception. All of these injection points are structured and available to you in the OnMethodBoundaryAspect.

To create a simple aspect that writes some text whenever a method enters, succeeds, or fails:

  1. Create an aspect class and inherit OnMethodBoundaryAspect. Annotate the class with the [ Online SerializableAttribute] custom attribute.

    Note Note
    Use [PSerializableAttribute] instead of [ Online SerializableAttribute] if your project targets Silverlight, Windows Phone, Windows Store, or runs with partial trust.

  2. To add functionality prior to the execution of the target method, override the method and code the functionality you desire.

    C#
    VB
    C++
    F#
    View Colorized Copy to Clipboard Print
    [Serializable]
public class LoggingAspect : OnMethodBoundaryAspect
{
  public override void OnEntry(MethodExecutionArgs args)
  {
     Console.WriteLine("The {0} method has been entered.", args.Method.Name);
  }
}
    [Serializable]
public class LoggingAspect : OnMethodBoundaryAspect
{
  public override void OnEntry(MethodExecutionArgs args)
  {
     Console.WriteLine("The {0} method has been entered.", args.Method.Name);
  }
}
  3.
              Inject functionality immediately after the method executes by overriding the OnExit(MethodExecutionArgs) method.

      Note  Note

                It's important to remember that the OnExit(MethodExecutionArgs) method will execute every time that the target method completes its execution regardless of if the target method completed successfully or threw an exception.

    C#
    VB
    C++
    F#
    View Colorized Copy to Clipboard Print
    public override void OnExit(MethodExecutionArgs args)
{
  Console.WriteLine("The {0} method has exited", args.Method.Name);
}
     public override void OnExit(MethodExecutionArgs args)
{
  Console.WriteLine("The {0} method has exited", args.Method.Name);
}
  4.
              To add functionality that only executes when the target method has completed successfully, you will override the OnSuccess(MethodExecutionArgs) method in your aspect. The OnSuccess(MethodExecutionArgs) method will be executed every time that the target method completes successfully. If the target method throws an exception OnSuccess(MethodExecutionArgs) will not execute.

    C#
    VB
    C++
    F#
    View Colorized Copy to Clipboard Print
    public override void OnSuccess(MethodExecutionArgs args)
{
  Console.WriteLine("The {0} method executed successfully.", args.Method.Name);
}
     public override void OnSuccess(MethodExecutionArgs args)
{
  Console.WriteLine("The {0} method executed successfully.", args.Method.Name);
}
  5.
              The final location that you can intercept requires you to override the OnException(MethodExecutionArgs) method. As the name of the overrode method suggests, this is where you can inject functionality that should execute when the target method throws and exception.

    C#
    VB
    C++
    F#
    View Colorized Copy to Clipboard Print
    public override void OnException(MethodExecutionArgs args)
{
  Console.WriteLine("An exception was thrown in {0}.", args.Method.Name);
}
     public override void OnException(MethodExecutionArgs args)
{
  Console.WriteLine("An exception was thrown in {0}.", args.Method.Name);
}

        The four methods (OnEntry(MethodExecutionArgs), OnExit(MethodExecutionArgs), OnSuccess(MethodExecutionArgs) and OnException(MethodExecutionArgs)) that you overrode are the locations that you are able to intercept method execution. Between these four location you are able to implement many different infrastructure patterns with minimal effort.

Accessing the method

              As illustrated in the examples above, you can access information about the method being intercepted from the property Method, which gives you a reflection object MethodBase. This object gives you access to parameters, return type, declaring type, and other characteristics. In case of generic methods or generic types, Method gives you the proper generic method instance, so you can use this object to get generic parameters.

Accessing parameters

          It's rare that you will intercept method execution and not interact with the parameters that were passed to the target method. For example, when you implement method interception for logging you will probably want to log the parameter values that were passed to the target method.

          Each of the interception locations that were outlined earlier has access to that information. If you look at the OnEntry(MethodExecutionArgs) method in your aspect you will see that it has a MethodExecutionArgs parameter. That parameter is used for OnExit(MethodExecutionArgs), OnSuccess(MethodExecutionArgs) and OnException(MethodExecutionArgs) as well. The collection Arguments gives access to parameter values.

          Let's modify the OnEntry(MethodExecutionArgs) method and include the parameter values in the log message.

To include argument values to the logged text:
  1.
                  Create a foreach loop to gather each of the parameter values in the Arguments property of the args parameter.

  2.
                  In the loop concatenate the parameter values into a string.

  3.
                  Pass that string of argument values to the logging tool.

    C#
    VB
    C++
    F#
    View Colorized Copy to Clipboard Print
    public override void OnEntry(MethodExecutionArgs args)
{
  var argValues = new StringBuilder();
  foreach (var argument in args.Arguments)
  {
            argValues.Append(argument.ToString()).Append(",");
  }

  Console.WriteLine("The {0} method was entered with the parameter values: {1}",
                    args.Method.Name, argValues.ToString());
}
     public override void OnEntry(MethodExecutionArgs args)
{
  var argValues = new StringBuilder();
  foreach (var argument in args.Arguments)
  {
            argValues.Append(argument.ToString()).Append(",");
  }

  Console.WriteLine("The {0} method was entered with the parameter values: {1}",
                    args.Method.Name, argValues.ToString());
}
      Note  Note
    A production implementation of this aspect would need to take reentrance into account. See the article Working with the Diagnostics Pattern Library for a ready-made logging aspect.
It's also possible to modify the parameter values inside your aspect methods. All you need to do is modify the value of the item in the Arguments collection. Remember that all items in the Arguments collection are object types so you will need to be careful with how you change values. If the value you are modifying was originally a string, you will want to ensure it stays a string type. It's especially true that when you change the parameter type in the OnEntry(MethodExecutionArgs) method you may cause the system to be unable to execute the target method due to a parameter type mismatch.
  Note  Note

    The only parameter types that you can modify are those defined as either out or ref. If you need to modify input arguments, you should use Intercepting Methods.

Accessing the target objects

        In combination with the parameters you will probably interact with the target code instance that the aspect is attached to. The Instance property provides you with the instance of the object that the aspect is currently operating against. It is an object type so you will need to cast it to the correct type to be able to interact with it. If you debug your aspect and that aspect doesn't make use of Instance, it will be set to null. It's also set to null if the target code is defined as static.

Accessing the return value

          Like target method parameters you also have access to the return value for those target methods. It's possible to both read the return value as well as modify it. The return value can be found at ReturnValue in all four of the aspect methods covered earlier.
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
public override void OnExit(MethodExecutionArgs args)
{
    args.ReturnValue = false;
}
 public override void OnExit(MethodExecutionArgs args)
{
    args.ReturnValue = false;
}
  Note  Note

            If a target method is defined as void, the ReturnValue property will be set to null. ReturnValue is an object type so you must be careful how you modify the return value with respect to the return value type of the target code.

Changing execution flow
Returning without executing the method

              When your aspect is interacting with the target code, there are situations where you will need to alter the execution flow behavior. For example, you may want to exit the execution of the target code at some point in the OnEntry(MethodExecutionArgs) advice. PostSharp offers this ability through the use of FlowBehavior.

C#
VB
C++
F#
View Colorized Copy to Clipboard Print
public override void OnEntry(MethodExecutionArgs args)
{
    if (args.Arguments.Count > 0 &amp;&amp; args.Arguments[0] == null)
    {
        args.FlowBehavior = FlowBehavior.Return;
    }

  Console.WriteLine("The {0} method was entered with the parameter values: {1}",
                    args.Method.Name, argValues.ToString());
}
 public override void OnEntry(MethodExecutionArgs args)
{
    if (args.Arguments.Count > 0 &amp;&amp; args.Arguments[0] == null)
    {
        args.FlowBehavior = FlowBehavior.Return;
    }

  Console.WriteLine("The {0} method was entered with the parameter values: {1}",
                    args.Method.Name, argValues.ToString());
}

              As you can see, all that is needed to exit the execution of the target code is setting the FlowBehavior property on the MethodExecutionArgs to Return.

  Note  Note

                Using flow control to exit the target code execution will return back to the code that called the target code. As a result, you need to be considerate to the target code's return value. In the example above, the target code will always return null. This may or may not be the behavior that you want. If it isn't, you can set the ReturnValue on the MethodExecutionArgs and that value will be returned from the target code.

              Managing execution flow control when dealing with exceptions there are two primary situations that you need to consider: re-throwing the exception and throwing a new exception.

Rethrowing an existing exception

              To rethrow an existing exception, you will set the FlowBehavior property to RethrowException. Whatever exception that was caught in the OnException(MethodExecutionArgs) advice will be rethrown to the code that is calling the target code.

C#
VB
C++
F#
View Colorized Copy to Clipboard Print
public override void OnException(MethodExecutionArgs args)
{
    if (args.Exception.GetType() == typeof(DivideByZeroException))
    {
        args.FlowBehavior = FlowBehavior.RethrowException;
    }
}
 public override void OnException(MethodExecutionArgs args)
{
    if (args.Exception.GetType() == typeof(DivideByZeroException))
    {
        args.FlowBehavior = FlowBehavior.RethrowException;
    }
}
Throwing a new exception

              To throw a new exception you will have to perform two tasks. First you will need to assign the new exception to the Exception property. This is the exception that will be thrown as part of the flow behavior. After that you will need to set the FlowBehavior property to ThrowException.

C#
VB
C++
F#
View Colorized Copy to Clipboard Print
public override void OnException(MethodExecutionArgs args)
{
    if (args.Exception.GetType() == typeof(IndexOutOfRangeException))
    {
        args.Exception = new CustomArrayIndexException("This was thrown from an aspect",
                                                        args.Exception);
        args.FlowBehavior = FlowBehavior.ThrowException;
    }
}
 public override void OnException(MethodExecutionArgs args)
{
    if (args.Exception.GetType() == typeof(IndexOutOfRangeException))
    {
        args.Exception = new CustomArrayIndexException("This was thrown from an aspect",
                                                        args.Exception);
        args.FlowBehavior = FlowBehavior.ThrowException;
    }
}
  Note  Note

                The remaining FlowBehavior enumeration value is Continue. In OnException(MethodExecutionArgs), this behavior will not rethrow the caught exception. In OnEntry(MethodExecutionArgs), OnSuccess(MethodExecutionArgs) and OnExit(MethodExecutionArgs) the target code execution will continue with no interruption.

  Note  Note

                The default FlowBehavior value for OnEntry(MethodExecutionArgs), OnSuccess(MethodExecutionArgs) and OnExit(MethodExecutionArgs) is Continue. For OnException(MethodExecutionArgs) the default value is RethrowException.

Sharing state between advices
When you are working with multiple advices on a single aspect, you will encounter the need to share state between these advices. For example, if you have created an aspect that times the execution of a method, you will need to track the starting time at OnEntry(MethodExecutionArgs) and share that with OnExit(MethodExecutionArgs) to calculate the duration of the call.
To do this we use the MethodExecutionTag property on the MethodExecutionArgs parameter in each of the advices. Because MethodExecutionTag is an object type, you will need to cast the value stored in it while retrieving it and before using it.
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
[Serializable]
public class ExecutionDurationAspect : OnMethodBoundaryAspect
{
    public override void OnEntry(MethodExecutionArgs args)
    {
        args.MethodExecutionTag = Stopwatch.StartNew();
    }

    public override void OnExit(MethodExecutionArgs args)
    {
        var sw = (Stopwatch)args.MethodExecutionTag;
        sw.Stop();

        System.Diagnostics.Debug.WriteLine("{0} executed in {1} seconds", args.Method.Name,
                                           sw.ElapsedMilliseconds / 1000);
    }
}
[Serializable]
public class ExecutionDurationAspect : OnMethodBoundaryAspect
{
    public override void OnEntry(MethodExecutionArgs args)
    {
        args.MethodExecutionTag = Stopwatch.StartNew();
    }

    public override void OnExit(MethodExecutionArgs args)
    {
        var sw = (Stopwatch)args.MethodExecutionTag;
        sw.Stop();

        System.Diagnostics.Debug.WriteLine("{0} executed in {1} seconds", args.Method.Name,
                                           sw.ElapsedMilliseconds / 1000);
    }
}
  Note  Note
 The value stored in MethodExecutionTag will not be shared between different instances of the aspect. If the aspect is attached to two different pieces of target code, each attachment will have its own unshared MethodExecutionTag for state storage.

See Also
Reference
OnMethodBoundaryAspect
Arguments
MethodExecutionTag
OnMethodBoundaryAspect
  Online SerializableAttribute
PSerializableAttribute
OnExit(MethodExecutionArgs)
OnSuccess(MethodExecutionArgs)
OnException(MethodExecutionArgs)
OnEntry(MethodExecutionArgs)
Method
Arguments
Other Resources
  Online PostSharp Aspect Framework - Product Page
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


Handling Exceptions

Handling Exceptions PostSharp Documentation

Adding exception handlers to code requires the addition of try/catch statements which can quickly pollute code. Exception handling implemented this way is also not reusable, requiring the same logic to be implemented over and over where ever exceptions must be dealt with. Raw exceptions also present cryptic information and can often expose too much information to the user.

PostSharp provides a solution to these problems by allowing custom exception handling logic to be encapsulated into a reusable class, which is then easily applied as an attribute to all methods and properties where exceptions are to be dealt with.

This topic contains the following sections.

  • Intercepting an exception
  • Specifying the type of handled exceptions
  • Ignoring exceptions
  • Replacing exceptions
  • Displaying the method arguments on exception
Intercepting an exception

PostSharp provides the OnExceptionAspect class which is the base class from which exception handlers are to be derived from.

The key element of this class is the OnException(MethodExecutionArgs) method: this is the method where the exception handling logic (i.e. what would normally be in a catch statement) goes. A MethodExecutionArgs parameter is passed into this method by PostSharp; it contains information about the exception.

To create an OnExceptionAspect class:

  1. Derive a class from OnExceptionAspect.

  2. Apply the Online SerializableAttribute to the class.

  3. Override OnException(MethodExecutionArgs) and implement your exception handling logic in this class.

The following snippet shows an example of an exception handler which watches for exceptions of any type, and then writes a message to the console when an exception occurs:

C#
VB
C++
F#
View Colorized Copy to Clipboard Print
[Serializable]
public class PrintExceptionAttribute : OnExceptionAspect
{

    public override void OnException(MethodExecutionArgs args)
    {
        Console.WriteLine(args.Exception.Message);
    }
}
[Serializable]
public class PrintExceptionAttribute : OnExceptionAspect
{

    public override void OnException(MethodExecutionArgs args)
    {
        Console.WriteLine(args.Exception.Message);
    }
}

          Once created, apply the derived class to all methods and/or properties for which the exception handling logic is to be used, as shown in the following example:

C#
VB
C++
F#
View Colorized Copy to Clipboard Print
class Customer
{
    public string FirstName { get; set; }
    public string LastName { get; set; }

    [PrintException]
    public void StoreName(string path)
    {
        File.WriteAllText( path, string.Format( “{0} {1}”, this.FirstName, this.LastName ) );
    }

}
 class Customer
{
    public string FirstName { get; set; }
    public string LastName { get; set; }

    [PrintException]
    public void StoreName(string path)
    {
        File.WriteAllText( path, string.Format( “{0} {1}”, this.FirstName, this.LastName ) );
    }

}

          Here PrintException will output a message when an exception occurs in trying to write text to a file.

          Alternatively the attribute can be applied to the class itself as shown below, in which case the exception handler will handle exceptions for all methods and properties in the class:

C#
VB
C++
F#
View Colorized Copy to Clipboard Print
[PrintExceptionAttribute(typeof(IOException))]
    class Customer
    {
      .
      .
      .
    }
[PrintExceptionAttribute(typeof(IOException))]
    class Customer
    {
      .
      .
      .
    }

          See the section Adding Aspects to Multiple Declarations for details about attribute multicasting.

Specifying the type of handled exceptions

          The GetExceptionType(MethodBase) method can be used to return the type of the exception which is to be handled by this aspect. Otherwise, all exceptions will be caught and handled by this class.

  Note  Note

            The GetExceptionType(MethodBase) method is evaluated at build time.

          In the following snippet, we updated the PrintExceptionAttribute aspect and added the possibility to specify from the custom attribute constructor which type of exception should be traced.

C#
VB
C++
F#
View Colorized Copy to Clipboard Print
[Serializable]
    public class PrintExceptionAttribute : OnExceptionAspect
    {
        Type type;

    public PrintExceptionAttribute() : this(typeof(Exception))
    {
    }

        public PrintExceptionAttribute (Type type)
            : base()
        {
            this.type = type;
        }

        // Method invoked at build time.
        // Should return the type of exceptions to be handled.
        public override Type GetExceptionType(MethodBase method)
        {
            return this.type;
        }

        public override void OnException(MethodExecutionArgs args)
        {
            Console.WriteLine(args.Exception.Message);
        }
    }
[Serializable]
    public class PrintExceptionAttribute : OnExceptionAspect
    {
        Type type;

    public PrintExceptionAttribute() : this(typeof(Exception))
    {
    }

        public PrintExceptionAttribute (Type type)
            : base()
        {
            this.type = type;
        }

        // Method invoked at build time.
        // Should return the type of exceptions to be handled.
        public override Type GetExceptionType(MethodBase method)
        {
            return this.type;
        }

        public override void OnException(MethodExecutionArgs args)
        {
            Console.WriteLine(args.Exception.Message);
        }
    }

          Example:

C#
VB
C++
F#
View Colorized Copy to Clipboard Print
class Customer
{
    public string FirstName { get; set; }
    public string LastName { get; set; }

    [PrintException(typeof(IOException)]
    public void StoreName(string path)
    {
        File.WriteAllText( path, string.Format( “{0} {1}”, this.FirstName, this.LastName ) );
    }

}
 class Customer
{
    public string FirstName { get; set; }
    public string LastName { get; set; }

    [PrintException(typeof(IOException)]
    public void StoreName(string path)
    {
        File.WriteAllText( path, string.Format( “{0} {1}”, this.FirstName, this.LastName ) );
    }

}
  Note  Note

            If the aspect needs to handle several types of exception, the GetExceptionAspect should return a common base type, and the OnException implementation should be modified to dynamically handle different types of exception.

Ignoring exceptions

          The FlowBehavior member of MethodExecutionArgs in the exception handler’s OnException(MethodExecutionArgs) method, can be set to ignore an exception. Note however that ignoring exceptions is generally dangerous and not recommended. In practice, it’s only safe to ignore exceptions in event handlers (e.g. to display a message in a WPF form) and in thread entry points.

          Exceptions can be ignored by setting the FlowBehavior to Return:

C#
VB
C++
F#
View Colorized Copy to Clipboard Print
[Serializable]
public class PrintAndIgnoreExceptionAttribute : OnExceptionAspect
{

    public override void OnException(MethodExecutionArgs args)
    {
        Console.WriteLine(args.Exception.Message);
        args.FlowBehavior = FlowBehavior.Return;
    }
 }
[Serializable]
public class PrintAndIgnoreExceptionAttribute : OnExceptionAspect
{

    public override void OnException(MethodExecutionArgs args)
    {
        Console.WriteLine(args.Exception.Message);
        args.FlowBehavior = FlowBehavior.Return;
    }
 }

          If a method returns a value then the ReturnValue member of args can be set to an object to return. For example, consider the following GetDataLength method in Customer which returns the number of characters read from a file:

C#
VB
C++
F#
View Colorized Copy to Clipboard Print
class Customer
{
    [PrintException(typeof(IOException))]
    public int GetDataLength(string path)
    {
return File.ReadAllText(path).Length;
    }

}
 class Customer
{
    [PrintException(typeof(IOException))]
    public int GetDataLength(string path)
    {
return File.ReadAllText(path).Length;
    }

}

          We can then modify the OnException(MethodExecutionArgs) method of PrintAndIgnoreExceptionAttribute to return an integer with a value of -1:

C#
VB
C++
F#
View Colorized Copy to Clipboard Print
public override void OnException(MethodExecutionArgs args)
{
    Console.WriteLine(args.Exception.Message);
    args.FlowBehavior = FlowBehavior.Return;
    args.ReturnValue = -1;
}
 public override void OnException(MethodExecutionArgs args)
{
    Console.WriteLine(args.Exception.Message);
    args.FlowBehavior = FlowBehavior.Return;
    args.ReturnValue = -1;
}
Replacing exceptions

          Many times an exception must be exposed to the user, either by allowing the original exception to be rethrown, or by throwing a new exception. This can be done by setting FlowBehavior as follows:

  • FlowBehavior.RethrowException: rethrows the original exception after the exception handler exits. This is the default behavior for the OnException(MethodExecutionArgs) advise.

  • FlowBehavior.ThrowException: throws a new exception once the exception handler exits. This is useful when details of the original exception should be hidden from the user or when a more meaningful exception is to be shown instead. When throwing a new exception, a new exception object must be assigned to the Exception member of MethodExecutionArgs. The following snippet shows the creation of a new BusinessExceptionAttribute which throws a BusinessException containing a description of the cause:

    C#
    VB
    C++
    F#
    View Colorized Copy to Clipboard Print
    [Serializable]
public sealed class BusinesssExceptionAttribute : OnExceptionAspect
{
    public override void OnException(MethodExecutionArgs args)
    {
        .
        .
        .
        args.FlowBehavior = FlowBehavior.ThrowException;
        args.Exception = new BusinessException("Bad Arguments", new Exception("One or more arguments were null. Use the id " + guid.ToString() + " for more information"));
   }
}

class BusinessException : Exception
{
       public BusinessException(string message, Exception innerException) : base(message, innerException)
       {
       }
}
    [Serializable]
public sealed class BusinesssExceptionAttribute : OnExceptionAspect
{
    public override void OnException(MethodExecutionArgs args)
    {
        .
        .
        .
        args.FlowBehavior = FlowBehavior.ThrowException;
        args.Exception = new BusinessException("Bad Arguments", new Exception("One or more arguments were null. Use the id " + guid.ToString() + " for more information"));
   }
}

class BusinessException : Exception
{
       public BusinessException(string message, Exception innerException) : base(message, innerException)
       {
       }
}

        Displaying the method arguments on exception

          When an exception is thrown, it can be useful to view and display the parameter values that were passed into the method where the exception occurred. These values can be retrieved by iterating through the Arguments field of OnException(MethodExecutionArgs)’s args parameter. In the following snippet, OnException(MethodExecutionArgs) has been modified to iterate through all exception values, and to concatenate them into a string. If a null value is encountered, then the code embeds the word “null” into the string. This string is then displayed as the message of the NullReferenceException which is rethrown:

C#
VB
C++
F#
View Colorized Copy to Clipboard Print
public override void OnException(MethodExecutionArgs args)
  {
      string parameterValues = "";

      foreach (object arg in args.Arguments)
      {
          if (parameterValues.Length > 0)
          {
              parameterValues += ", ";
          }

          if (arg != null)
          {
              parameterValues += arg.ToString();
          }
          else
          {
              parameterValues += "null";
          }
      }

          Console.WriteLine( “Exception {0} in {1}.{2} invoked with arguments {3}”, args.Exception.GetType().Name, args.Method.DeclaringType.FullName, args.Method.Name, parameterValues );
   }
}
  public override void OnException(MethodExecutionArgs args)
  {
      string parameterValues = "";

      foreach (object arg in args.Arguments)
      {
          if (parameterValues.Length > 0)
          {
              parameterValues += ", ";
          }

          if (arg != null)
          {
              parameterValues += arg.ToString();
          }
          else
          {
              parameterValues += "null";
          }
      }

          Console.WriteLine( “Exception {0} in {1}.{2} invoked with arguments {3}”, args.Exception.GetType().Name, args.Method.DeclaringType.FullName, args.Method.Name, parameterValues );
   }
}
  Note  Note

            The Arguments field of args cannot be directly viewed in the debugger. The Arguments field must be referenced by another object in order to be viewable in the debugger.

See Also
Reference
OnException(MethodExecutionArgs)
MethodExecutionArgs
OnExceptionAspect
  Online SerializableAttribute
GetExceptionType(MethodBase)
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


Intercepting Methods

Intercepting Methods PostSharp Documentation

Required introduction

Optional section title

Add one or more sections with content

Online Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


Intercepting Properties and Fields

Intercepting Properties and Fields PostSharp Documentation

In .NET, both fields and properties are "things" that can be set and get. You can intercept get and set operations using the LocationInterceptionAspect. It makes it possible to develop useful aspects, such as validation, filtering, change tracking, change notification, or property virtualization (where the property is backed by a registry value, for instance).

This topic contains the following sections.

  • Intercepting Get operations
  • Intercepting Set operations
  • Getting and setting the underlying property
  • Intercepting fields
  • Getting the property or property being accessed
Intercepting Get operations

In this example, we will see how to create an aspect that filters the value read from a field or property.

To create an aspect that filters the value read from a field or property

  1. Create an aspect that inherits from LocationInterceptionAspect and add the custom attribute [ Online SerializableAttribute].

    Note Note
    Use [PSerializableAttribute] instead of [ Online SerializableAttribute] if your project targets Silverlight, Windows Phone, Windows Store, or runs with partial trust.

  2. Override the OnGetValue(LocationInterceptionArgs) method.

    C#
    VB
    C++
    F#
    View Colorized Copy to Clipboard Print
    [Serializable]
public class StringCheckerAttribute : LocationInterceptionAspect
{
    public override void OnGetValue(LocationInterceptionArgs args)
    {
        base.OnGetValue(args);
    }

}
    [Serializable]
public class StringCheckerAttribute : LocationInterceptionAspect
{
    public override void OnGetValue(LocationInterceptionArgs args)
    {
        base.OnGetValue(args);
    }

}
  3.
                  Calling base.OnGetValue actually retrieves the value from the underlying field or property, and populates the Value property. Add some code to check if the property currently is set to null If the current value is null, we want to return a predefined value. To do this we can set the Value property. Any time this property is requested, and it is set to null, the value "foo" will be returned.

    C#
    VB
    C++
    F#
    View Colorized Copy to Clipboard Print
    public override void OnGetValue(LocationInterceptionArgs args)
{
    base.OnGetValue(args);

    if (args.Value == null)
    {
        args.Value = "foo";
    }
}
     public override void OnGetValue(LocationInterceptionArgs args)
{
    base.OnGetValue(args);

    if (args.Value == null)
    {
        args.Value = "foo";
    }
}
  4.
                  Now that you have a complete getter interception aspect written you can attach it to the target code. Simply add an attribute to either properties or fields to have the interception attached.

    C#
    VB
    C++
    F#
    View Colorized Copy to Clipboard Print
    public class Customer
{
    [StringChecker]
    private readonly string _address;

    public Customer(string address)
    {
        _address = address;
    }
    [StringChecker]
    public string Name { get; set; }
    public string Address { get { return _address; } }
}
     public class Customer
{
    [StringChecker]
    private readonly string _address;

    public Customer(string address)
    {
        _address = address;
    }
    [StringChecker]
    public string Name { get; set; }
    public string Address { get { return _address; } }
}
      Note  Note

                    Adding aspects to target code one property or field at a time can be a tedious process. There are a number of techniques in the article Adding Aspects to Multiple Declarations that explain how to add aspects en mass.

  5.
                  Now when you create an instance of a customer and immediately try to access the Name and Address values the get request will be intercepted and null values will be returned as "foo".

    C#
    VB
    C++
    F#
    View Colorized Copy to Clipboard Print
    class Program
{
    static void Main(string[] args)
    {
        var customer = new Customer("123 Main Street");
        Console.WriteLine("Address: {0}", customer.Address);
        Console.WriteLine("Name: {0}", customer.Name);
        Console.ReadKey();
    }
}
     class Program
{
    static void Main(string[] args)
    {
        var customer = new Customer("123 Main Street");
        Console.WriteLine("Address: {0}", customer.Address);
        Console.WriteLine("Name: {0}", customer.Name);
        Console.ReadKey();
    }
}
      Intercepting Properties 1

          Property and field interception is a simple and seamless task. Once you have intercepted your target you can act on the target or you can allow the original code to execute.

Intercepting Set operations

          The previous section showed how to intercept a get accessor. Intercepting a set accessor is accomplished in a similar manner by implementing OnSetValue(LocationInterceptionArgs) in the LocationInterceptionAspect.

          The following snippet shows the addition of OnSetValue(LocationInterceptionArgs) to the StringCheckerAttribute example:

C#
VB
C++
F#
View Colorized Copy to Clipboard Print
[Serializable]
public class StringCheckerAttribute : LocationInterceptionAspect
{
public override void OnGetValue(LocationInterceptionArgs args)
{
base.OnGetValue(args);
}

public override void OnSetValue(LocationInterceptionArgs args)
{
base.OnSetValue(args);
}
}
[Serializable]
public class StringCheckerAttribute : LocationInterceptionAspect
{
public override void OnGetValue(LocationInterceptionArgs args)
{
base.OnGetValue(args);
}

public override void OnSetValue(LocationInterceptionArgs args)
{
base.OnSetValue(args);
}
}

          When applied to a property with a set operator, OnSetValue(LocationInterceptionArgs) will intercept the set operation. In the Customer example shown below, OnSetValue(LocationInterceptionArgs) will be called whenever the Name property is set:

C#
VB
C++
F#
View Colorized Copy to Clipboard Print
public class Customer
{
    .
    .
    .
[StringChecker]
public string Name { get; set; }
}
 public class Customer
{
    .
    .
    .
[StringChecker]
public string Name { get; set; }
}

          The SetNewValue(Object) method of LocationInterceptionArgs can be used instead of base.OnSetValue() to pass a different value in for the property. For example, OnSetValue(LocationInterceptionArgs) could be used to check for a null string, and then change the string to a non-null value:

C#
VB
C++
F#
View Colorized Copy to Clipboard Print
[Serializable]
public class StringCheckerAttribute : LocationInterceptionAspect
{
    .
    .
    .
public override void OnSetValue(LocationInterceptionArgs args)
{
if (args.Value == null)
{
args.Value = “Empty String";
}

args.ProceedSetValue();

}
}
[Serializable]
public class StringCheckerAttribute : LocationInterceptionAspect
{
    .
    .
    .
public override void OnSetValue(LocationInterceptionArgs args)
{
if (args.Value == null)
{
args.Value = “Empty String";
}

args.ProceedSetValue();

}
}
Getting and setting the underlying property

          PostSharp provides a mechanism to check a property’s underlying value via LocationInterceptionArgs’s GetCurrentValue  method. This can be useful to check the current property value when a setter is called and then take some appropriate action.

          For example, the following snippet shows a modified OnSetValue(LocationInterceptionArgs) method which gets the current underlying property value and compares the (new) value passed into the setter against the current value. If current and new value don’t match then some message is written:

C#
VB
C++
F#
View Colorized Copy to Clipboard Print
public override void OnSetValue(LocationInterceptionArgs args)
{
  //get the current underlying value
  string existingValue = (string)args.GetCurrentValue();

  if (((existingValue==null) && (args.Value != null)) || (!existingValue.Equals(args.Value)))
  {
    Console.WriteLine(“Value changed.”);
    args.ProceedSetValue();
  }
}
 public override void OnSetValue(LocationInterceptionArgs args)
{
  //get the current underlying value
  string existingValue = (string)args.GetCurrentValue();

  if (((existingValue==null) && (args.Value != null)) || (!existingValue.Equals(args.Value)))
  {
    Console.WriteLine(“Value changed.”);
    args.ProceedSetValue();
  }
}
  Note  Note
GetCurrentValue  will call the underlying property getter without going through OnGetValue(LocationInterceptionArgs). If several aspects are applied to the property (and/or to the property setter), GetCurrentValue  will go through the next aspect in the chain of invocation.

            PostSharp also provides a mechanism to set the underlying property in a getter via the SetNewValue(Object) method of LocationInterceptionArgs. This could be used for example, to ensure that a default value is assigned to the underlying property if there is currently no value. The following snippet shows a modified OnGetValue(LocationInterceptionArgs) method which gets the current underlying value, and sets a default value if the current value is null:

C#
VB
C++
F#
View Colorized Copy to Clipboard Print
public override void OnGetValue(LocationInterceptionArgs args)
{
    object o = args.GetCurrentValue();
    if (o == null)
    {
        args.SetNewValue("value not set");
    }

    base.OnGetValue(args);
}
 public override void OnGetValue(LocationInterceptionArgs args)
{
    object o = args.GetCurrentValue();
    if (o == null)
    {
        args.SetNewValue("value not set");
    }

    base.OnGetValue(args);
}
Intercepting fields

          One benefit to implementing a LocationInterceptionAspect is that it can be applied directly to fields, allowing for reads and writes to those fields to be intercepted, just like with properties.

          Applying a LocationInterceptionAspect implementation to a field is simply a matter of setting it as an attribute on a field, just as it was done with a property:

C#
VB
C++
F#
View Colorized Copy to Clipboard Print
public class Customer
{
    .
    .
    .
[StringChecker]
public string name;
}
 public class Customer
{
    .
    .
    .
[StringChecker]
public string name;
}

          With the attribute applied to the name field, all attempts to get and set that field will be intercepted by StringChecker in its OnGetValue(LocationInterceptionArgs) and OnSetValue(LocationInterceptionArgs) methods.

          Note that when a LocationInterceptionAspect is added to a field, the field is replaced by a property of the same field and visibility. The field itself is renamed and made private.

        Getting the property or property being accessed

          Information about the property or field being intercepted can be obtained through the LocationInterceptionArgs via its Location property. The type of this property, LocationInfo, can represent a FieldInfo, a PropertyInfo, or a ParameterInfo (although LocationInterceptionAspect cannot be added to parameters).

          One use for this is to reflect the property name whenever a property is changed. In the following example, we have an Entity class that implements   Online INotifyPropertyChanged and a public OnPropertyChanged method which allows notifications to be made whenever a property is changed. The Customer class has been modified to derive from Entity.

C#
VB
C++
F#
View Colorized Copy to Clipboard Print
class Entity : INotifyPropertyChanged
{

  public event PropertyChangedEventHandler PropertyChanged;

  public void OnPropertyChanged(string propertyName)
  {
    if (PropertyChanged != null)
     PropertyChanged(this, new PropertyChangedEventArgs(propertyName));
  }
}

 class Customer : Entity
{
  public string Name { get; set; }
}
 class Entity : INotifyPropertyChanged
{

  public event PropertyChangedEventHandler PropertyChanged;

  public void OnPropertyChanged(string propertyName)
  {
    if (PropertyChanged != null)
     PropertyChanged(this, new PropertyChangedEventArgs(propertyName));
  }
}

 class Customer : Entity
{
  public string Name { get; set; }
}

          With the ability to invoke an OnPropertyChanged event, we can create a LocationInterceptionAspect which invokes this event when setting a value and pass in the property name from the underlying PropertyInfo object:

C#
VB
C++
F#
View Colorized Copy to Clipboard Print
[Serializable]
public class NotifyPropertyChangedAttribute : LocationInterceptionAspect
{

public override void OnSetValue(LocationInterceptionArgs args)
{
If ( args.Value != args.GetCurrentValue() )
{
args.Value = args.Value;
args.ProceedSetValue();
((Entity)args.Instance).OnPropertyChanged(args.Location.Name);
}
}
}
[Serializable]
public class NotifyPropertyChangedAttribute : LocationInterceptionAspect
{

public override void OnSetValue(LocationInterceptionArgs args)
{
If ( args.Value != args.GetCurrentValue() )
{
args.Value = args.Value;
args.ProceedSetValue();
((Entity)args.Instance).OnPropertyChanged(args.Location.Name);
}
}
}
  Note  Note

          This example is a simplistic implementation of the NotifyPropertyChangedAttribute aspect. For a production-ready implementation, see the section Automatically implementing INotifyPropertyChanged.

          This aspect can then be applied to the Customer class:
View Colorized Copy to Clipboard Print
[NotifyPropertyChangedAttribute]
class Customer : INotifyPropertyChanged
{
    public string Name { get; set; }
}
[NotifyPropertyChangedAttribute]
class Customer : INotifyPropertyChanged
{
    public string Name { get; set; }
}

          Now when the Name property is changed, NotifyPropertyChangedAttribute will invoke the Entity.OnPropertyChanged method passing in the property name retrieved from its underlying property.

See Also
Reference
LocationInterceptionAspect
OnGetValue(LocationInterceptionArgs)
OnSetValue(LocationInterceptionArgs)
LocationInterceptionArgs
Location
LocationInfo
FieldInfo
PropertyInfo
ParameterInfo
  Online INotifyPropertyChanged
NotifyPropertyChangedAttribute
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


Intercepting Events

Intercepting Events PostSharp Documentation

You interact with events in three primary ways; subscribing, unsubscribing and raising them. Like methods and properties, you may find yourself needing to intercept these three interactions. How do you execute code everytime that an event is subscribed to? Or raised? Or unsubscribed? PostSharp provides you with a simple mechanism to accomplish this easily.

This topic contains the following sections.

  • Intercepting Add and Remove
  • Intercepting Raise
  • Accessing the current context
  • Example: Removing offending event subscribers
Intercepting Add and Remove

Throughout the life of an event it is possible to have many different event handlers subscribe and unsubscribe. You may want to log each of these actions.

  1. Create an aspect that inherits from EventInterceptionAspect. Add the [PSerializableAttribute] custom attribute.

    Note Note
    Use [PSerializableAttribute] instead of [ Online SerializableAttribute] if your project targets Silverlight, Windows Phone, Windows Store, or runs with partial trust.

  2. Override the OnAddHandler(EventInterceptionArgs) method and add your logging code to the method body.

  3. Add the base.OnAddHandler call to the body of the OnAddHandler(EventInterceptionArgs) method. If this is omitted, the original call to add a handler will not be executed. Unless you want to stop the addition of the handler, you will need to add this line of code.

    C#
    VB
    C++
    F#
    View Colorized Copy to Clipboard Print
    public class CustomEventing : EventInterceptionAspect
{
    public override void OnAddHandler(EventInterceptionArgs args)
    {
        base.OnAddHandler(args);
        Console.WriteLine("A handler was added");
    }
}
     public class CustomEventing : EventInterceptionAspect
{
    public override void OnAddHandler(EventInterceptionArgs args)
    {
        base.OnAddHandler(args);
        Console.WriteLine("A handler was added");
    }
}
  4.
                  To log the removal of an event handler, override the OnRemoveHandler(EventInterceptionArgs) method.

  5.
                  Add the logging you require to the method body.

  6.
                  Add the base.OnRemoveHandler call to the body of the OnRemoveHandler(EventInterceptionArgs) method. Like you saw when overriding the OnAddHandler(EventInterceptionArgs) method, if you omit this call, the original call to remove the handler will not occur.

    C#
    VB
    C++
    F#
    View Colorized Copy to Clipboard Print
    public override void OnRemoveHandler(EventInterceptionArgs args)
{
    base.OnRemoveHandler(args);
    Console.WriteLine("A handler was removed");
}
     public override void OnRemoveHandler(EventInterceptionArgs args)
{
    base.OnRemoveHandler(args);
    Console.WriteLine("A handler was removed");
}

          Once you have defined the interception points in the aspect you will need to attach the aspect to the target code. The simplest way to do this is to add the attribute to the event handler definition.

C#
VB
C++
F#
View Colorized Copy to Clipboard Print
public class Example
{
    public EventHandler<EventArgs> SomeEvent;

    public void DoSomething()
    {
        if (SomeEvent != null)
        {
            SomeEvent.Invoke(this, EventArgs.Empty);
        }
    }
}
 public class Example
{
    public EventHandler<EventArgs> SomeEvent;

    public void DoSomething()
    {
        if (SomeEvent != null)
        {
            SomeEvent.Invoke(this, EventArgs.Empty);
        }
    }
}
Intercepting Raise

          When you are intercepting events you will also have situations where you will want to intercept the code execution when the event is raised. Raising an event can occur may places and you will want to centralize this code to save repetition.

  1.
                  Override the OnInvokeHandler(EventInterceptionArgs) method on your aspect class and add the logging you require to the method body.

  2.
                  Add a call to base.OnInvokeHandler to ensure that the original invocation occurs.

    C#
    VB
    C++
    F#
    View Colorized Copy to Clipboard Print
    public override void OnInvokeHandler(EventInterceptionArgs args)
{
    base.OnInvokeHandler(args);
    Console.WriteLine("A handler was invoked");
}
     public override void OnInvokeHandler(EventInterceptionArgs args)
{
    base.OnInvokeHandler(args);
    Console.WriteLine("A handler was invoked");
}

          By adding the attribute to the target code's event handler earlier in this process you have enabled intercepting of each raised event.

Accessing the current context

          At any time, the Handler property is set to the delegate being added, removed, or invoked. You can read and write this property. If you write it, the delegate you assign must be compatible with the type of the event. The Event property gets you the   Online EventInfo of the event being accessed.

          Within OnInvokeHandler(EventInterceptionArgs), the property Arguments gives access to the arguments with which the delegate was invoked.

          These concepts will be illustrated in the following example.

Example: Removing offending event subscribers

          When events are subscribed to, the component that raises the event has no way to ensure that the subscriber will behave properly when that event is raised. It's possible that the subscribing code will throw an exception when the event is raised and when that happens you may want to unsubscribe the handler to ensure that it doesn't continue to throw the exception. The EventInterceptionAspect is powerful and can help you to accomplish this with ease.

  1.
                  Override the OnInvokeHandler(EventInterceptionArgs) method on your aspect.

  2.
                  In the method body add a try...catch block.

  3.
              In the try block add a call to base.OnInvokeHandler and in the catch block add a call to RemoveHandler(Delegate)
    C#
    VB
    C++
    F#
    View Colorized Copy to Clipboard Print
    public class CustomEventing : EventInterceptionAspect
{
    public override void OnInvokeHandler(EventInterceptionArgs args)
    {
        try
        {
            base.OnInvokeHandler(args);
        }
        catch (Exception e)
        {
            Console.WriteLine("Handler '{0}' invoked with arguments {1} failed with exception {2}",
                              args.Handler.Method,
                              string.Join(", ", args.Arguments.Select(
                                                                      a => a == null ? "null" : a.ToString())),
                              e.GetType().Name);

            args.RemoveHandler(args.Handler);
            throw;
        }
    }

}
     public class CustomEventing : EventInterceptionAspect
{
    public override void OnInvokeHandler(EventInterceptionArgs args)
    {
        try
        {
            base.OnInvokeHandler(args);
        }
        catch (Exception e)
        {
            Console.WriteLine("Handler '{0}' invoked with arguments {1} failed with exception {2}",
                              args.Handler.Method,
                              string.Join(", ", args.Arguments.Select(
                                                                      a => a == null ? "null" : a.ToString())),
                              e.GetType().Name);

            args.RemoveHandler(args.Handler);
            throw;
        }
    }

}

          Now any time an exception is thrown when the event is executed, the offending event handler will be unsubscribed from the event.

See Also
Reference
EventInterceptionAspect
Handler
Event
PSerializableAttribute
  Online SerializableAttribute
OnAddHandler(EventInterceptionArgs)
OnAddHandler(EventInterceptionArgs)
OnRemoveHandler(EventInterceptionArgs)
OnInvokeHandler(EventInterceptionArgs)
  Online EventInfo
RemoveHandler(Delegate)
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


Introducing Interfaces

Introducing Interfaces PostSharp Documentation

When you create a CompositionAspect you are able to dynamically add interfaces to the target code at compile time and make use of that interface type at run time.

  1. The first thing that you need to do is create an aspect that inherits from CompositionAspect and implements its members.

    C#
    VB
    C++
    F#
    View Colorized Copy to Clipboard Print
    [Serializable]
public class GeneralCompose : CompositionAspect
{
    public override object CreateImplementationObject(AdviceArgs args)
    {
        throw new System.NotImplementedException();
    }
}
    [Serializable]
public class GeneralCompose : CompositionAspect
{
    public override object CreateImplementationObject(AdviceArgs args)
    {
        throw new System.NotImplementedException();
    }
}
  2.
                Next, you need some way to tell the aspect what interface and concrete type you want to implement on the target code. To do that, create a constructor for your aspect that accepts two parameters; one for the interface type and one for the concrete implementation type. Assign those two constructor parameters to field level variables so we can make use of them in the aspect.

    C#
    VB
    C++
    F#
    View Colorized Copy to Clipboard Print
    [Serializable]
public class GeneralCompose : CompositionAspect
{
    private readonly Type _interfaceType;
    private readonly Type _implementationType;

    public GeneralCompose(Type interfaceType, Type implementationType)
    {
        _interfaceType = interfaceType;
        _implementationType = implementationType;
    }
    [Serializable]
public class GeneralCompose : CompositionAspect
{
    private readonly Type _interfaceType;
    private readonly Type _implementationType;

    public GeneralCompose(Type interfaceType, Type implementationType)
    {
        _interfaceType = interfaceType;
        _implementationType = implementationType;
    }
  3.
                There are two methods that you need to implement to complete this aspect. The first is an override of the GetPublicInterfaces(Type) method. This method has a target type parameter which allows you to filter the application of the interface if you choose to. For this example, simply return an array that contains the interface type that was provided via the aspect's constructor.

    C#
    VB
    C++
    F#
    View Colorized Copy to Clipboard Print
    protected override Type[] GetPublicInterfaces(Type targetType)
{
return new[] { _interfaceType };
}
     protected override Type[] GetPublicInterfaces(Type targetType)
{
return new[] { _interfaceType };
}
      Note  Note

                  The interfaces that are returned from the GetPublicInterfaces(Type) method will be applied to the target code during compilation.

  4.
                The second method that you need to override is CreateImplementationObject(AdviceArgs). For this example you will return an instance of the concrete implementation that was provided in the aspect's constructor. The CreateImplementationObject(AdviceArgs) method doesn't return the type of the concrete implementation. It returns an instance of that type instead. To create the instance use the CreateInstance(Type, ActivatorSecurityToken) method.

    C#
    VB
    C++
    F#
    View Colorized Copy to Clipboard Print
    public override object CreateImplementationObject(AdviceArgs args)
{
return Activator.CreateInstance(_implementationType);
}
     public override object CreateImplementationObject(AdviceArgs args)
{
return Activator.CreateInstance(_implementationType);
}
      Note  Note

                  The CreateImplementationObject(AdviceArgs) method is invoked at the application's runtime.

  5.
                Now that you have created a complete CompositionAspect, it will need to be applied to the target code. Add the aspect to the target code as an attribute. Provide the attribute with the interface and concrete types that you wish to implement.

    C#
    VB
    C++
    F#
    View Colorized Copy to Clipboard Print
    [GeneralCompose(typeof(IList), typeof(ArrayList))]
public class Fruit
{
}
    [GeneralCompose(typeof(IList), typeof(ArrayList))]
public class Fruit
{
}
  6.
                After compiling your application you will find that the target code now implements the assigned interfaces and exposes itself as a new instance of the concrete type you declared. The next question that needs addressing is how you will interact with the target code using that interace type.

                To access the dynamically applied interface you must make use of a special PostSharp feature. The Cast SourceType, TargetType (SourceType) method will allow you to safely cast the target code to the interface type that you dynamically applied. Once that call has been done, you are able to make use of the instace through the interface constructs.

    C#
    VB
    C++
    F#
    View Colorized Copy to Clipboard Print
    [GeneralCompose(typeof(IList), typeof(ArrayList))]
public class Fruit
{
    public Fruit()
    {
        IList list = Post.Cast<Fruit,IList>(this);
        list.Add("apple");
        list.Add("orange");
        list.Add("banana");
    }
}
    [GeneralCompose(typeof(IList), typeof(ArrayList))]
public class Fruit
{
    public Fruit()
    {
        IList list = Post.Cast<Fruit,IList>(this);
        list.Add("apple");
        list.Add("orange");
        list.Add("banana");
    }
}
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


Introducing Custom Attributes

Introducing Custom Attributes PostSharp Documentation

Applying custom attributes to class members in C# is a powerful way to add metadata about those members at compile time.

PostSharp provides the ability to create a custom attribute class which when applied to another class, can iterate through those class members and automatically decorate them with custom attributes. This can be useful for example, to automatically apply custom attributes or groups of custom attributes when new class members are added, without having to remember to do it manually each time.

This topic contains the following sections.

  • Introducing new custom attributes
  • Copying existing custom attributes
Introducing new custom attributes

In the following example, we’ll create an attribute decorator class which applies .NET’s Online DataContractAttribute to a class and Online DataMemberAttribute to members of a class at build time.

  1. Start by creating a class called AutoDataContractAttribute which derives from TypeLevelAspect. TypeLevelAspect transforms the class into an attribute which can be applied to other classes. Also implement IAspectProvider which exposes the ProvideAspects(Object) method for iterating on class members. ProvideAspects(Object) will be called for each member in the target class and will contain the code for applying the attributes:

    C#
    VB
    C++
    F#
    View Colorized Copy to Clipboard Print
    public sealed class AutoDataContractAttribute : TypeLevelAspect, IAspectProvider
{
    public IEnumerable<AspectInstance> ProvideAspects(object targetElement)
    {
}
    public sealed class AutoDataContractAttribute : TypeLevelAspect, IAspectProvider
{
    public IEnumerable<AspectInstance> ProvideAspects(object targetElement)
    {
}
  2.
                  Implement the ProvideAspects(Object) method to cast the targetElement parameter to a Type object. Note that this method will be called at build time. Since ProvideAspects(Object) will be called for the class itself and for each member of the target class, the Type object can be used for inspecting each member and making decisions about when and how to apply custom attributes. In the following snippet, the implementation returns a new AspectInstance for the Type containing a new   Online DataContractAttribute and then iterates through each property of the Type returning a new AspectInstance with the   Online DataMemberAttribute for each. Note that both the   Online DataContractAttribute and   Online DataMemberAttribute are both wrapped in CustomAttributeIntroductionAspect objects:

    C#
    VB
    C++
    F#
    View Colorized Copy to Clipboard Print
    public sealed class AutoDataContractAttribute : TypeLevelAspect, IAspectProvider
{
    // This method is called at build time and should just provide other aspects.
    public IEnumerable<AspectInstance> ProvideAspects(object targetElement)
    {
        Type targetType = (Type) targetElement;

        CustomAttributeIntroductionAspect introduceDataContractAspect =
            new CustomAttributeIntroductionAspect(
                new ObjectConstruction(typeof (DataContractAttribute).GetConstructor(Type.EmptyTypes)));
        CustomAttributeIntroductionAspect introduceDataMemberAspect =
            new CustomAttributeIntroductionAspect(
                new ObjectConstruction(typeof (DataMemberAttribute).GetConstructor(Type.EmptyTypes)));

        // Add the DataContract attribute to the type.
        yield return new AspectInstance(targetType, introduceDataContractAspect);

        // Add a DataMember attribute to every relevant property.
        foreach (PropertyInfo property in
            targetType.GetProperties(BindingFlags.Public | BindingFlags.DeclaredOnly | BindingFlags.Instance))
        {
            if (property.CanWrite)
                yield return new AspectInstance(property, introduceDataMemberAspect);
        }
    }
}
    public sealed class AutoDataContractAttribute : TypeLevelAspect, IAspectProvider
{
    // This method is called at build time and should just provide other aspects.
    public IEnumerable<AspectInstance> ProvideAspects(object targetElement)
    {
        Type targetType = (Type) targetElement;

        CustomAttributeIntroductionAspect introduceDataContractAspect =
            new CustomAttributeIntroductionAspect(
                new ObjectConstruction(typeof (DataContractAttribute).GetConstructor(Type.EmptyTypes)));
        CustomAttributeIntroductionAspect introduceDataMemberAspect =
            new CustomAttributeIntroductionAspect(
                new ObjectConstruction(typeof (DataMemberAttribute).GetConstructor(Type.EmptyTypes)));

        // Add the DataContract attribute to the type.
        yield return new AspectInstance(targetType, introduceDataContractAspect);

        // Add a DataMember attribute to every relevant property.
        foreach (PropertyInfo property in
            targetType.GetProperties(BindingFlags.Public | BindingFlags.DeclaredOnly | BindingFlags.Instance))
        {
            if (property.CanWrite)
                yield return new AspectInstance(property, introduceDataMemberAspect);
        }
    }
}
      Note  Note

                    Since the ProvideAspects(Object) method returns an IEnumerable, the yield keyword should be used to return aspects for PostSharp to apply.

  3.
              Apply the   Online DataContractAttribute class. In the following example we apply it to a Product class where it will decorate Product with   Online DataContractAttribute and each member with   Online DataMemberAttribute:

    C#
    VB
    C++
    F#
    View Colorized Copy to Clipboard Print
    [DataContractAttribute]
public class Product
{
    public int ID { get; set; }

    public string Name { get; set; }

    public int RevisionNumber { get; set; }
}
    [DataContractAttribute]
public class Product
{
    public int ID { get; set; }

    public string Name { get; set; }

    public int RevisionNumber { get; set; }
}

          See  Example: Automatically Adding DataContract and DataMember Attributes to learn how to have the   Online DataContractAttribute automatically applied to derived classes.

Copying existing custom attributes

          Another way to introduce attributes to class members is to copy them from another class. This is useful for example, when distinct classes have members with the same names and are of the same types. In this case, attributes can be defined in one class and then that class can be used to decorate other similar classes with same attributes.

          In the following snippet, Product’s ID and Name properties have both been modified to contain an additional attribute from the DataAnnotations namespace – Editable, Display, and Required respectively. Below Product is another class called ProductViewModel containing the same properties to which we want to copy the attributes to:

C#
VB
C++
F#
View Colorized Copy to Clipboard Print
class Product
{
    [EditableAttribute(false)]
    [Required]
    public int Id { get; set; }

    [Display(Name = "The product's name")]
    [Required]
    public string Name { get; set; }
    public int RevisionNumber { get; set; }
}

class ProductViewModel
{
    public int Id { get; set; }
    public string Name { get; set; }
    public int RevisionNumber { get; set; }
}
class Product
{
    [EditableAttribute(false)]
    [Required]
    public int Id { get; set; }

    [Display(Name = "The product's name")]
    [Required]
    public string Name { get; set; }
    public int RevisionNumber { get; set; }
}

class ProductViewModel
{
    public int Id { get; set; }
    public string Name { get; set; }
    public int RevisionNumber { get; set; }
}

          To copy the attributes from the properties of Product to the corresponding properties of ProductViewModel, create an attribute class which can be applied to ProductViewModel to perform this copy process:

  1.
                  Create a TypeLevelAspect which implements IAspectProvider. In the snippet below our class is called CopyCustomAttributesFrom:

    C#
    VB
    C++
    F#
    View Colorized Copy to Clipboard Print
    class CopyCustomAttributesFrom : TypeLevelAspect, IAspectProvider
{
}
    class CopyCustomAttributesFrom : TypeLevelAspect, IAspectProvider
{
}
  2.
                  Create a constructor to take in the class type from which the property attributes are to be copied from. This class type will be used in the next step to enumerate its properties:

    C#
    VB
    C++
    F#
    View Colorized Copy to Clipboard Print
    class CopyCustomAttributesFrom : TypeLevelAspect, IAspectProvider
{
private Type sourceType;

public CopyCustomAttributesFrom(Type srcType)
{
    sourceType = srcType;
}
    }
    class CopyCustomAttributesFrom : TypeLevelAspect, IAspectProvider
{
private Type sourceType;

public CopyCustomAttributesFrom(Type srcType)
{
    sourceType = srcType;
}
    }
  3.
                  Implement ProvideAspects(Object):

    C#
    VB
    C++
    F#
    View Colorized Copy to Clipboard Print
    class CopyCustomAttributesFrom : TypeLevelAspect, IAspectProvider
{
    // Details skipped.

    public IEnumerable<AspectInstance> ProvideAspects(object targetElement)
    {
        Type targetClassType = (Type)targetElement;

        //loop thru each property in target
        foreach (PropertyInfo targetPropertyInfo in targetClassType.GetProperties())
        {
            PropertyInfo sourcePropertyInfo = sourceType.GetProperty(targetPropertyInfo.Name);

            //loop thru all custom attributes for the source property and copy to the target property
            foreach (CustomAttributeData customAttributeData in sourcePropertyInfo.GetCustomAttributesData())
            {
                //filter out attributes that aren’t DataAnnotations
                if (customAttributeData.AttributeType.Namespace.Equals("System.ComponentModel.DataAnnotations"))
                {
                    CustomAttributeIntroductionAspect customAttributeIntroductionAspect =
                        new CustomAttributeIntroductionAspect(new ObjectConstruction(customAttributeData));

                    yield return new AspectInstance(targetPropertyInfo, customAttributeIntroductionAspect);
                }
            }

        }
    }
}
    class CopyCustomAttributesFrom : TypeLevelAspect, IAspectProvider
{
    // Details skipped.

    public IEnumerable<AspectInstance> ProvideAspects(object targetElement)
    {
        Type targetClassType = (Type)targetElement;

        //loop thru each property in target
        foreach (PropertyInfo targetPropertyInfo in targetClassType.GetProperties())
        {
            PropertyInfo sourcePropertyInfo = sourceType.GetProperty(targetPropertyInfo.Name);

            //loop thru all custom attributes for the source property and copy to the target property
            foreach (CustomAttributeData customAttributeData in sourcePropertyInfo.GetCustomAttributesData())
            {
                //filter out attributes that aren’t DataAnnotations
                if (customAttributeData.AttributeType.Namespace.Equals("System.ComponentModel.DataAnnotations"))
                {
                    CustomAttributeIntroductionAspect customAttributeIntroductionAspect =
                        new CustomAttributeIntroductionAspect(new ObjectConstruction(customAttributeData));

                    yield return new AspectInstance(targetPropertyInfo, customAttributeIntroductionAspect);
                }
            }

        }
    }
}

                  The ProvideAspects(Object) method iterates through each property of the target class and then gets the corresponding property from the source class. It then iterates through all custom attributes defined for the source property, copying each to the corresponding property of the target class. ProvideAspects(Object) also filters out attributes which aren’t from the [System.ComponentModel.DataAnnotations] namespace to demonstrate how you may want to ignore some attributes during the copy process.

  4.
                  Decorate the ProductViewModel class with the CopyCustomAttributesFrom attribute, specifying Product as the source type in the constructor. During compilation, CopyCustomAttributesFrom’s ProvideAspects(Object) method will then perform the copy process from Product to ProductViewModel:

    C#
    VB
    C++
    F#
    View Colorized Copy to Clipboard Print
    [CopyCustomAttributesFrom(typeof(Product))]
class ProductViewModel
{
    // Details skipped.
}
    [CopyCustomAttributesFrom(typeof(Product))]
class ProductViewModel
{
    // Details skipped.
}

          The following screenshot shows the Product and ProductViewModel classes reflected from an assembly. Here we can see that the Editable and Display attributes were copied from Product to ProductViewModel using CopyCustomAttributesAttribute at build time:

  Note  Note

            It is not possible to delete or replace an existing custom attribute.

See Also
Reference
ProvideAspects(Object)
CopyCustomAttributesAttribute
  Online DataContractAttribute
  Online DataMemberAttribute
TypeLevelAspect
IAspectProvider
AspectInstance
CustomAttributeIntroductionAspect
DataAnnotations
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


Introducing Managed Resources

Introducing Managed Resources PostSharp Documentation

Embedding resources in .NET allows for data to be packaged together with your code in an assembly. Resources are normally specified at design time and then embedded by the compiler during build time.

PostSharp’s AssemblyLevelAspect adds additional flexibility by allowing you to programmatically add resources at compile time. In doing so you can add logic and therefore flexibility in determining which resources get embedded and how. For example, you could use this feature to encrypt a resource just before embedding it into your assembly.

Introducing resources

In the following example, we’ll create an assembly decorator which retrieves the current date and time during compilation, and then stores that information in the current assembly as a resource. The example will then show that that information can be retrieved from the assembly at runtime.

  1. Start by creating a class called AddBuildInfoAspect which derives from AssemblyLevelAspect. Also implement IAspectProvider which exposes the ProvideAspects(Object) method. The ProvideAspects(Object) method will be called once by PostSharp, providing access to assembly information and allowing for a resource to be programmatically added to the assembly:

    C#
    VB
    C++
    F#
    View Colorized Copy to Clipboard Print
    public sealed class AddBuildInfoAspect : AssemblyLevelAspect, IAspectProvider
{
    public IEnumerable<AspectInstance> ProvideAspects(object targetElement)
    {
    }
}
     public sealed class AddBuildInfoAspect : AssemblyLevelAspect, IAspectProvider
{
    public IEnumerable<AspectInstance> ProvideAspects(object targetElement)
    {
    }
}
  2.
                  Implement the ProvideAspects(Object) method:

    C#
    VB
    C++
    F#
    View Colorized Copy to Clipboard Print
    public sealed class AddBuildInfoAspect : AssemblyLevelAspect, IAspectProvider
{
    public IEnumerable<AspectInstance> ProvideAspects(object targetElement)
    {
        Assembly assembly = (Assembly)targetElement;

        byte[] userNameData = Encoding.ASCII.GetBytes(
           assembly.FullName + " was compiled by: " + Environment.UserName);
        ManagedResourceIntroductionAspect mria2 = new ManagedResourceIntroductionAspect("BuildUser", userNameData);

        yield return new AspectInstance(assembly, mria2);
    }
}
     public sealed class AddBuildInfoAspect : AssemblyLevelAspect, IAspectProvider
{
    public IEnumerable<AspectInstance> ProvideAspects(object targetElement)
    {
        Assembly assembly = (Assembly)targetElement;

        byte[] userNameData = Encoding.ASCII.GetBytes(
           assembly.FullName + " was compiled by: " + Environment.UserName);
        ManagedResourceIntroductionAspect mria2 = new ManagedResourceIntroductionAspect("BuildUser", userNameData);

        yield return new AspectInstance(assembly, mria2);
    }
}

                  In this example the targetElement object passed in is cast to an Assembly object from which the assembly named is retrieved. The code then gets the current date and time, concatenates it with the assembly name, and then converts this string to a byte array. The byte array is then stored along with a name for the data in PostSharp’s ManagedResourceIntroductionAspect object, and returned via an AspectInstance. PostSharp then embeds the resource into the current assembly.

  3.
                  Open your project’s AssemblyInfo.cs file and add a line to include the AddBuildInfoAspect class:

    C#
    VB
    C++
    F#
    View Colorized Copy to Clipboard Print
    [assembly:AddBuildInfoAspect]
    [assembly:AddBuildInfoAspect]

          With this code in place the assembly will now embed the date and time as a resource into itself during compilation.

          The following code demonstrates how to retrieve the data at runtime:

C#
VB
C++
F#
View Colorized Copy to Clipboard Print
class Program
{
    static void Main(string[] args)
    {
        Assembly a = Assembly.GetExecutingAssembly();
        Stream stream = a.GetManifestResourceStream("BuildUser");

        byte[] bytesRead = new byte[stream.Length];
        stream.Read(bytesRead, 0, (int)stream.Length);
        string value = Encoding.ASCII.GetString(bytesRead);
        Console.WriteLine(value);
    }
}
 class Program
{
    static void Main(string[] args)
    {
        Assembly a = Assembly.GetExecutingAssembly();
        Stream stream = a.GetManifestResourceStream("BuildUser");

        byte[] bytesRead = new byte[stream.Length];
        stream.Read(bytesRead, 0, (int)stream.Length);
        string value = Encoding.ASCII.GetString(bytesRead);
        Console.WriteLine(value);
    }
}

          This will display the following line in the console window:

See Also
Reference
AssemblyLevelAspect
IAspectProvider
ManagedResourceIntroductionAspect
AspectInstance
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


Understanding Aspect Lifetime and Scope

Understanding Aspect Lifetime and Scope PostSharp Documentation

An original feature of PostSharp is that aspects are instantiated at compile time. Most other frameworks instantiate aspects at run time.

Persistence of aspects between compile time and run time is achieved by serializing aspect instances into a binary resource stored in the transformed assembly. Therefore, you should carefully mark all aspect classes with the Online SerializableAttribute custom attribute, and distinguish between serialized fields (typically initialized at compile-time and used at run-time) and non-serialized fields (typically used at run-time only or at compile-time only).

Note Note
If your project targets Silverlight, Windows Phone, or the Compact Framework, aspects are initialized at run-time and all compile-time steps are skipped.

This topic contains the following sections.

  • Scope of Aspects
  • Steps in the Lifetime of an Aspect Instance
  • Examples
Scope of Aspects

PostSharp offers two kinds of aspect scopes: static (per-class) and per-instance.

Statically Scoped Aspects

With statically-scoped aspects, PostSharp creates one aspect instance for each element of code to which the aspect applies. The aspect instance is stored in a static field and is shared among all instances of the target class.

In generic types, the aspect instance has not exactly the same scope as static fields. Consider the following piece of code:

Comparing the scope of an aspect instance with the scope of a static variable
View Colorized Copy to Clipboard Print
public class GenericClass<T>
{
  static T f;

  [Trace]
  public void void SetField(T value) { f = value; }
}

public class Program
{
   public static void Main()
   {
      GenericClass<int>.SetField(1);
      GenericClass<long>.SetField(2);
   }
}
 public class GenericClass<T>
{
  static T f;

  [Trace]
  public void void SetField(T value) { f = value; }
}

public class Program
{
   public static void Main()
   {
      GenericClass<int>.SetField(1);
      GenericClass<long>.SetField(2);
   }
}

In this program, there are two instances of the static field f (one for GenericClass<int>, the second for GenericClass<long>) but only a single instance of the aspect Trace.

Instance-Scoped Aspects

Instance-scoped aspect have the same scope (instance or static) as the element of code to which they are applied. If an instance-scoped aspect is applied to a static member, it will have static scope. However, if it is applied to an instance member or to a class, it will have the same lifetime as the class instance: an aspect instance will be created whenever the class is instantiated, and the aspect instance will be garbage-collectable at the same time as the class instance.

Instance-scoped aspects are implemented according to the prototype pattern: the aspect instance created at compile time serves as a prototype, and is cloned at run-time whenever the target class is instantiated.

Instance-scoped aspects must implement the interface IInstanceScopedAspect. Any aspect may be made instance-scoped. The following code is a typical implementation of the interface IInstanceScopedAspect:

Typical implementation of IInstanceScopedAspect
View Colorized Copy to Clipboard Print
object IInstanceScopedAspect.CreateInstance( AdviceArgs adviceArgs )
{
  return this.MemberwiseClone();
}

object IInstanceScopedAspect.RuntimeInitializeInstance()
{
}
 object IInstanceScopedAspect.CreateInstance( AdviceArgs adviceArgs )
{
  return this.MemberwiseClone();
}

object IInstanceScopedAspect.RuntimeInitializeInstance()
{
}
Steps in the Lifetime of an Aspect Instance

The following table summarizes the different steps of

Phase | Step | Description

Compile-Time

Instantiation

PostSharp creates a new instance of the aspect for every target to which it applies. If the aspect has been applied using a multicast custom attribute (MulticastAttribute), there will be one aspect instance for each matching element of code.

When the aspect is given as a custom attribute or a multicast custom attribute, each custom attribute instance is instantiated using the same mechanism as the Common Language Runtime (CLR) does: PostSharp calls the appropriate constructor and sets the properties and/or fields with the appropriate values. For instance, when you use the construction [Trace(Category="FileManager")], PostSharp calls the default constructor and the Category property setter.

Validation | PostSharp validates the aspect by calling the CompileTimeValidate aspect method. See Validating Aspect Usage for details.
Compile-Time Initialization | PostSharp invokes the CompileTimeInitialize aspect method. This method may, but must not, be overridden by concrete aspect classes in order to perform some expensive computations that do not depend on runtime conditions. The name of the element to which the custom attribute instance is applied is always passed to this method.
Serialization | After the aspect instances have all been created and initialized, PostSharp serializes them into a binary stream. This stream is stored inside the new assembly as a managed resource.

Run-Time

Deserialization

Before the first aspect must be executed, the aspect framework deserializes the binary stream that has been stored in a managed resource during post-compilation.

At this point, there is still one aspect instance per target class.

Per-Class Runtime Initialization | Once all custom attribute instances are deserialized, we call for each of them the RuntimeInitialize method. But this time we pass as an argument the real Online System.Reflection object to which it is applied.

Per-Instance Runtime Initialization

This step applies only to instance-scoped aspects when they have been applied to an instance member.

When a class is instantiated, the aspect framework creates an aspect instance by invoking the method CreateInstance(AdviceArgs) of the prototype aspect instance. After the new aspect instance has been set up, the aspect framework invokes the RuntimeInitializeInstance .

Advice Execution | Finally, advices (methods such as OnEntry(MethodExecutionArgs)) are executed.
Examples

Example: Raising an Event When the Object is Finalized

See Also

Other Resources

[5fafef23-0313-4eb9-9e4f-2ef80c616908]

Online Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


Validating Aspect Usage

Validating Aspect Usage PostSharp Documentation

Some aspects make sense only on a specific subset of targets. For instance, an aspect may require to be applied on non-static methods only. Another aspect may not be compatible with methods that have ref or out parameters. If these constraints are not respected, these aspects will fail at runtime. However, defects detected by the compiler are always cheaper to fix than ones detected later. So, as the developer of an aspect, you should ensure that the build will fail if your aspect is being used on an invalid target.

This topic contains the following sections.

  • Using [MulticastAttributeUsage]
  • Implementing CompileTimeValidate
  • Using Message Sources
  • Validating Attributes That Are Not Aspects
  • Examples
Using [MulticastAttributeUsage]

The first level of protection is to configure multicasting properly with [MulticastAttributeUsageAttribute], as described in the article Adding Aspects Declaratively Using Attributes. However, this approach can only filter based on characteristics that are supported by the multicasting component.

Implementing CompileTimeValidate

The best way to validate aspect usage is to override the CompileTimeValidate(Object) method of your aspect class.

In this example, we will show how an aspect RequirePermissionAttribute can require to be applied only to methods of types that implement the ISecurable interface.

  1. Inherit from one of the pre-built aspects. In this case OnMethodBoundaryAspect.

    C#
    VB
    C++
    F#
    View Colorized Copy to Clipboard Print
    public class RequirePermissionAttribute: OnMethodBoundaryAspect
    public class RequirePermissionAttribute: OnMethodBoundaryAspect
  2.
                  Override the CompileTimeValidate(Object) method.

    C#
    VB
    C++
    F#
    View Colorized Copy to Clipboard Print
    public override bool CompileTimeValidate(MethodBase target)
{
     public override bool CompileTimeValidate(MethodBase target)
{
  3.
                  Perfom a check to see if the target class implements the interface in question.

    C#
    VB
    C++
    F#
    View Colorized Copy to Clipboard Print
    Type targetType = target.DeclaringType;
if (!typeof(ISecurable).IsAssignableFrom(targetType))
{

}
    Type targetType = target.DeclaringType;
if (!typeof(ISecurable).IsAssignableFrom(targetType))
{

}
  4.
                  If the target does not implement the interface you must signal the compilation process that this target should not have the aspect applied to it. There are two ways to do this. The first option is to throw an InvalidAnnotationException.

    C#
    VB
    C++
    F#
    View Colorized Copy to Clipboard Print
    if (!typeof(ISecurable).IsAssignableFrom(targetType))
{
  throw new InvalidAnnotationException("The target type does not implement ISecurable.");
}
    if (!typeof(ISecurable).IsAssignableFrom(targetType))
{
  throw new InvalidAnnotationException("The target type does not implement ISecurable.");
}
  5.
                  The second option is to emit an error message to the compilation process.

    C#
    VB
    C++
    F#
    View Colorized Copy to Clipboard Print
    if (!typeof(ISecurable).IsAssignableFrom(targetType))
{
  Message.Write(SeverityType.Error, "Custom01",
                "The target type does not implement ISecurable.", target);
 return false;
}
     if (!typeof(ISecurable).IsAssignableFrom(targetType))
{
  Message.Write(SeverityType.Error, "Custom01",
                "The target type does not implement ISecurable.", target);
 return false;
}
  Note  Note

            You may have noticed that CompileTimeValidate(Object) returns a boolean value. If you only return false from this method the compilation process will silently ignore it. You must either throw the InvalidAnnotationException or emit an error message to not silently ignore the false return value.

          Making use of the CompileTimeValidate(Object) method is a great way to encode custom rules for applying aspects to target code. While it could be used to duplicate the functionality of the AttributeTargetTypeAttributes or AttributeTargetMemberAttributes, its real power is to go beyond those filtering techniques. By using CompileTimeValidate(Object) you are able to filter aspect application in any manner that you can interogate your codebase using reflection.

Using Message Sources

          If you plan to raise many messages, you may prefer to define your own MessageSource.
          A MessageSource is backed by a managed resource mapping error codes to error messages.

          In order to create your own MessageSource, you should:

  1.
              Create an implementation of the IMessageDispenser.
              Typically, implement the GetMessage  method
              using a large switch statement.
 To each message will correspond a string

  2.
              Create a static instance of the MessageSource
              class for your message source.

    For instance, the following code defines a message source based on a message dispenser:
    C#
    VB
    C++
    F#
    View Colorized Copy to Clipboard Print
    internal class ArchitectureMessageSource : MessageSource
{
    public static readonly ArchitectureMessageSource Instance = new ArchitectureMessageSource();

    private ArchitectureMessageSource() : base( "PostSharp.Architecture", new Dispenser() )
    {
    }

    private class Dispenser : MessageDispenser
    {
        public Dispenser() : base( "CUS" )
        {
        }

        protected override string GetMessage( int number)
        {
            switch ( number )
            {
                case 1:
                    return "Interface {0} cannot be implemented by {1} because of the [InternalImplement] constraint.";

                case 2:
                    return "{0} {1} cannot be referenced from {2} {3} because of the [ComponentInternal] constraint.";

                case 3:
                    return "Cannot use [ComponentInternal] on {0} {1} because the {0} is not internal.";

                case 4:
                    return "Cannot use [Internal] on {0} {1} because the {0} is not public.";

                default:
                    return null;
            }
        }
    }
}
    internal class ArchitectureMessageSource : MessageSource
{
    public static readonly ArchitectureMessageSource Instance = new ArchitectureMessageSource();

    private ArchitectureMessageSource() : base( "PostSharp.Architecture", new Dispenser() )
    {
    }

    private class Dispenser : MessageDispenser
    {
        public Dispenser() : base( "CUS" )
        {
        }

        protected override string GetMessage( int number)
        {
            switch ( number )
            {
                case 1:
                    return "Interface {0} cannot be implemented by {1} because of the [InternalImplement] constraint.";

                case 2:
                    return "{0} {1} cannot be referenced from {2} {3} because of the [ComponentInternal] constraint.";

                case 3:
                    return "Cannot use [ComponentInternal] on {0} {1} because the {0} is not internal.";

                case 4:
                    return "Cannot use [Internal] on {0} {1} because the {0} is not public.";

                default:
                    return null;
            }
        }
    }
}
  3.
              Then you can use a convenient set of methods on your MessageSource object:

    Using a custom message source
    View Colorized Copy to Clipboard Print
    MyMessageSource.Instance.Write( classType, SeverityType.Error, "CUS001", new object[] { interfaceType, classType } );
    MyMessageSource.Instance.Write( classType, SeverityType.Error, "CUS001", new object[] { interfaceType, classType } );
  Note  Note

            You can also emit information and warning messages.

  Tip  Tip

            Use ReflectionSearch to perform complex queries over System.Reflection.

Validating Attributes That Are Not Aspects

          You can validate any attribute derived from   Online Attribute by
          implementing the interface IValidableAnnotation.

Examples
Example: Dispatching a Method Execution to the GUI Thread
See Also
Reference
MethodLevelAspectCompileTimeValidate(MethodBase)
TypeLevelAspectCompileTimeValidate(Type)
FieldLevelAspectCompileTimeValidate(FieldInfo)
LocationLevelAspectCompileTimeValidate(LocationInfo)
EventLevelAspectCompileTimeValidate(EventInfo)
AssemblyLevelAspectCompileTimeValidate(_Assembly)
IValidableAnnotation
MessageSource
Message
MessageWrite
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


Initializing Aspects

Initializing Aspects PostSharp Documentation

As explained in the section Understanding Aspect Lifetime and Scope, a different aspect instance is associated with every element of code it is applied to. Aspect instances are created at compile time, serialized into the assembly as a managed resource, and deserialized at runtime. If the aspect is instance-scoped, instances are duplicated from the prototype and initialized.

Therefore, you can override one of the following three methods to handle aspect initializations:

  1. The method CompileTimeInitialize is invoked at compile time, and should initialize only serializable fields of the aspect, so that the value of these fields will be available at run time. The argument of this method is the Online System.Reflection object representing the element of code to which this aspect instance has been applied. Therefore, this method can already perform expensive computations that depend only on metadata.
  2. The method RuntimeInitialize is invoked at run time. Note that the aspect constructor itself is not invoked at run time. Therefore, overriding RuntimeInitialize is the only way to perform initialization tasks at run time. If the aspect is instance-scoped, this method is executed on the prototype instance.
  3. The methods IInstanceScopedAspect CreateInstance(AdviceArgs) and IInstanceScopedAspect RuntimeInitializeInstance is invoked only for instance-scoped aspects. They initialize the aspect instance itself, as RuntimeInitialize was invoked on the prototype.
Tip Tip
Initializing an aspect at compile time is useful when you need to compute a difficult result that depends only on metadata -- that is, it does not depend on any runtime information. An example is to build the strings that need to be printed by a tracing aspect. It is rather expensive to build strings that contain the full type name, the method name, and eventually placeholders for generic parameters and parameters. However, all required pieces of information are available at compile time. So compile time is the best moment to compute these strings.
See Also

Online Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


Developing Composite Aspects

Developing Composite Aspects PostSharp Documentation

PostSharp offers two approaches to aspect-oriented development. The first, as explained in section Developing Simple Aspects, is very similar to object-oriented programming. It requires the aspect developer to override virtual methods or implement interfaces. This approach is very efficient for simple problems.

One way to grow in complexity with the first approach is to use the interface IAspectProvider (see Adding Aspects Dynamically). However, even this technique has its limitations.

This chapter documents the second approach, closer to the classic paradigm of aspect-oriented programming introduced by AspectJ. This approach allows developers to implement more complex design patterns using aspects. We call aspects developed with this approach composite aspects, because they are freely composed of different elements named advices and pointcuts.

An advice is anything that adds a behaviour or a structural element to an element of code. For instance, introducing a method into a class, intercepting a property setter, or catching exceptions, are advices.

A pointcut is a function returning a set of elements of code to which advices apply. For instance, a function returning the set of properties annotated with the custom attribute DataMember is a pointcut.

Classes supporting advices and pointcuts are available in the namespace PostSharp.Aspects.Advices.

A composite aspect generally generally derives from a class that does not define its own advices: AssemblyLevelAspect, TypeLevelAspect, InstanceLevelAspect, MethodLevelAspect, LocationLevelAspect or EventLevelAspect. As such, these aspects have no functionality. You can add functionalities by adding advices to the aspect.

Advices are covered in the following sections:

Section | Description
Adding Behaviors to Existing Members | Advices with equivalent functionality as OnMethodBoundaryAspect, MethodInterceptionAspect, LocationInterceptionAspect, and EventInterceptionAspect.
[interface-introduction] | Make the aspect introduce an interface into the target class. The interface is implemented by the aspect itself.
Accessing Members of the Target Class | Make the aspect introduce a new method, property or event into the target class. The new member is implemented by the aspect itself. Conversely, the aspect can import a member of the target so that it can invoke it through a delegate.

Online Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


Adding Behaviors to Existing Members

Adding Behaviors to Existing Members PostSharp Documentation

In order to add new behaviours to (i.e. modify) existing members (methods, fields, properties, or events), two questions must be addressed:

  • What transformation should be performed? The answer lays in the advice. This advice is a method of your advice, annotated with a custom attribute determining in which situation the method should be invoked. You can freely choose the name of the method, but its signature must match the one expected by the advice type.
  • Where should it be performed, i.e. on which elements on code? The answer lays in the pointcut, another custom attribute expected on the method providing the transformation.

This topic contains the following sections.

  • How to Add a Behavior to an Existing Member
  • Advice Kinds
  • Pointcuts Kinds
  • Grouping Advices
How to Add a Behavior to an Existing Member

  1. Start with an empty aspect class deriving AssemblyLevelAspect, TypeLevelAspect, InstanceLevelAspect, MethodLevelAspect, LocationLevelAspect or EventLevelAspect. Mark it as serializable.

  2. Choose an advice type in the list below. For instance: OnMethodEntryAdvice.

  3. Create a method. The signature of this method should match exactly the signature matched by this advice type.

  4. Annotate this method with a custom attribute of the advice type you chose. For instance: [OnMethodEntryAdvice].

  5. Choose a pointcut type in the list below. For instance: SelfPointcut. Annotate the advice method with that custom attribute. For instance: [SelfPointcut].

Example

The following code shows a simple tracing aspect implemented with an advice and a pointcut. This aspect is exactly equivalent to a class derived from OnMethodBoundaryAspect where only the method OnEntry(MethodExecutionArgs) has been overwritten. The example is a method-level aspect and SelfPointcut means that the advice applies to the same target as the method itself.

A simple composite aspect using an advice and a pointcut
View Colorized Copy to Clipboard Print
using System;
using PostSharp.Aspects;
using PostSharp.Aspects.Advices;

namespace Samples6
{
    [Serializable]
    public sealed class TraceAttribute : MethodLevelAspect
    {
        [OnMethodEntryAdvice, SelfPointcut]
        public void OnEntry(MethodExecutionArgs args)
        {
            Console.WriteLine("Entering {0}.{1}", args.Method.DeclaringType.Name, args.Method.Name);
        }
    }
}
using System;
using PostSharp.Aspects;
using PostSharp.Aspects.Advices;

namespace Samples6
{
    [Serializable]
    public sealed class TraceAttribute : MethodLevelAspect
    {
        [OnMethodEntryAdvice, SelfPointcut]
        public void OnEntry(MethodExecutionArgs args)
        {
            Console.WriteLine("Entering {0}.{1}", args.Method.DeclaringType.Name, args.Method.Name);
        }
    }
}
Advice Kinds

The following table lists all types of advices that can transform existing members. Note that all these advices are available as a part of a simple aspect (for instance OnMethodEntryAdvice corresponds to OnMethodBoundaryAspect OnEntry(MethodExecutionArgs). For a complete documentation of the advice, see the documentation of the corresponding simple aspect.

Advice Type | Targets | Description
OnMethodEntryAdvice OnMethodSuccessAdvice OnMethodExceptionAdvice OnMethodExitAdvice | Methods | These advices are equivalent to the advices of the aspect OnMethodBoundaryAspect. The target method to be wrapped by a try/catch/finally construct.
OnMethodInvokeAdvice | Methods | This advice is equivalent to the aspect MethodInterceptionAspect. Calls to the target methods are replaced to calls to the advice.
OnLocationGetValueAdvice OnLocationSetValueAdvice | Fields, Properties | These advices are equivalent to the advices of the aspect LocationInterceptionAspect. Fields are changed into properties, and calls to the accessors are replaced to calls to the proper advice.
LocationValidationAdvice | Fields, Properties, Parameters | This advice is equivalent to the ValidateValue(T, String, LocationKind)LocationInterceptionAspect method of the ILocationValidationAspect T aspect interface. It validates values assigned to their targets and throws an exception in case of error.
OnEventAddHandlerAdvice OnEventRemoveHandlerAdvice OnEventInvokeHandlerAdvice | Events | These advices are equivalent to the advices of the aspect EventInterceptionAspect. Calls to add and remove semantics are replaced by calls to advices. When the event is fired, the OnEventInvokeHandler is invoked for each handler, instead of the handler itself.
Pointcuts Kinds

Pointcuts determine where the transformation provided by the advice should be applied.

From a logical point of view, pointcuts are functions that return a set of code elements. A pointcut can only select elements of code that are inside the target of the aspect itself. For instance, if an aspect has been applied to a class A, the pointcut can select the class A itself, members of A, but different classes or members of different classes.

Multicast Pointcut

The pointcut type MulticastPointcut allows to express a pointcut in a purely declarative way, using a single custom attribute. It works in a very similar way as MulticastAttribute (see Adding Aspects Declaratively Using Attributes) the kind of code elements being selected, their name and attributes can be filtered using properties of this custom attribute.

For instance, the following code applies the OnPropertySet advice to all non-abstract properties of the class to which the aspect has been applied.

Advice with a MulticastPointcut
View Colorized Copy to Clipboard Print
 [OnLocationSetValueAdvice,
 MulticastPointcut( Targets = MulticastTargets.Property,
                    Attributes = MulticastAttributes.Instance | MulticastAttributes.NonAbstract)]
public void OnPropertySet( LocationInterceptionArgs args )
{
  // Details skipped.
}
 [OnLocationSetValueAdvice,
 MulticastPointcut( Targets = MulticastTargets.Property,
                    Attributes = MulticastAttributes.Instance | MulticastAttributes.NonAbstract)]
public void OnPropertySet( LocationInterceptionArgs args )
{
  // Details skipped.
}

Method Pointcut

The pointcut type MethodPointcut allows to express a pointcut imperatively, using a C# or Visual Basic method. The argument of the custom attribute should contain the name of the method implementing the pointcut.

The only parameter of this method should be type-compatible with the kind of elements of code to which the aspect applies. The return value of the pointcut method should be a collection (IEnumerable T ) of objects that are type-compatible with the kind of elements of code to which the advice applies.

For instance, the following code applies the OnPropertySet advice to all writable properties that are not annotated with the IgnorePropertyChanged custom attribute.

Advice with a MethodPointcut
View Colorized Copy to Clipboard Print
private IEnumerable<PropertyInfo> SelectProperties( Type type )
{
    const BindingFlags bindingFlags = BindingFlags.Instance |
        BindingFlags.DeclaredOnly | BindingFlags.Public;

    return from property
               in type.GetProperties( bindingFlags )
           where property.CanWrite && !property.IsDefined(typeof(IgnorePropertyChanged))
           select property;
}

[OnLocationSetValueAdvice, MethodPointcut( "SelectProperties" )]
public void OnPropertySet( LocationInterceptionArgs args )
{
    // Details skipped.
}
private IEnumerable<PropertyInfo> SelectProperties( Type type )
{
    const BindingFlags bindingFlags = BindingFlags.Instance |
        BindingFlags.DeclaredOnly | BindingFlags.Public;

    return from property
               in type.GetProperties( bindingFlags )
           where property.CanWrite && !property.IsDefined(typeof(IgnorePropertyChanged))
           select property;
}

[OnLocationSetValueAdvice, MethodPointcut( "SelectProperties" )]
public void OnPropertySet( LocationInterceptionArgs args )
{
    // Details skipped.
}

As you can see in this example, pointcut methods can use the power of LINQ to query Online System.Reflection.

Self Pointcut

The pointcut type SelfPointcut simply selects the target of the aspect.

Grouping Advices

The table of above shows advice types grouped in families. Advices of different type but of the same family can be grouped into a single logical filter, so they are considered as single transformation.

Why Grouping Advices

Consider for instance three advices of the family OnMethodBoundaryAspect: OnMethodEntryAdvice, OnMethodSuccessAdvice and OnMethodExceptionAdvice. The way how they are ordered is important, as it results in different generation of try/catch/finally block.

The following table compares advice ordering strategies. In the left column, advices are executed in the order: OnEntry, OnExit, OnException. In the right column, advices are grouped together.

Code generated by ordered advices
View Colorized Copy to Clipboard Print
void Method()
{
  try
  {
    OnEntry();

    try
    {
      // Original method body.
    }
    finally
    {
      OnExit();
    }
  }
  catch
  {
     OnException();
     throw;
  }
}
 void Method()
{
  try
  {
    OnEntry();

    try
    {
      // Original method body.
    }
    finally
    {
      OnExit();
    }
  }
  catch
  {
     OnException();
     throw;
  }
}
Code generated by grouped advices
View Colorized Copy to Clipboard Print
void Method()
{
  OnEntry();

  try
  {
      // Original method body.
  }
  catch
  {
     OnException();
     throw;
  }
  finally
  {
      OnExit();
  }
}
 void Method()
{
  OnEntry();

  try
  {
      // Original method body.
  }
  catch
  {
     OnException();
     throw;
  }
  finally
  {
      OnExit();
  }
}

The code in the left column may make sense in some situations, but it is not consistent with the code generated by OnMethodBoundaryAspect. Note that the advices may have been ordered differently: the order OnEntry, OnException, OnExit would have generated the same code as in the right column. However, you would have had to use custom attributes to specify order relationships between advices (see Ordering Advices). Grouping advices is a much easier way to ensure consistency.

Additionally, when advices of the OnMethodBoundaryAspect family are grouped together, it will be possible to share information among them using MethodExecutionTag.

The reasons to group advices of the family LocationInterceptionAspect and EventInterceptionAspect are similar: advices grouped together behave consistently as a single filter (see Understanding Interception Aspects).

How to Group Advices

To group several advices into a single filter:

  1. Choose a master advice. The choice of the master advice is arbitrary. All other advices of the group are called slave advices.

  2. Annotate the master advice method with one advice custom attribute (see Available Advices and one pointcut custom attribute (see Available Pointcuts), as usually.

  3. Annotate all slave advices with one advice custom attribute. Set the property Master of the custom attribute to the name of the master advice method.

  4. Do not specify any pointcut on slave advice methods.

The following code shows how two advices of type OnMethodEntryAdvice and OnMethodExitAdvice can be grouped into a single filter:

Grouped advices
View Colorized Copy to Clipboard Print
[OnMethodEntryAdvice, MulticastPointcut]
public void OnEntry(MethodExecutionArgs args)
{
}

[OnMethodExitAdvice(Master="OnEntry")]
public void OnExit(MethodExecutionArgs args)
{
}
[OnMethodEntryAdvice, MulticastPointcut]
public void OnEntry(MethodExecutionArgs args)
{
}

[OnMethodExitAdvice(Master="OnEntry")]
public void OnExit(MethodExecutionArgs args)
{
}
See Also

Reference

PostSharp.Aspects.Advices

Online Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


Introducing Interfaces, Methods, Properties and Events into Existing Classes

Introducing Interfaces, Methods, Properties and Events into Existing Classes PostSharp Documentation

Some design patterns require you to add properties, methods or interfaces to your target code. If many components in your codebase need to represent the same construct, repetitively adding those constructs flies in the face of the DRY (Don't Repeat Yourself) principle. So how can you add code constructs to your target code without it becoming repetitive?

PostSharp offers a number of ways for you to add different code constructs to your codebase in a controlled and consistent manner. Let's take a look at those techniques.

This topic contains the following sections.

  • Introducing interfaces
  • Introducing methods
  • Introducing properties
  • Controlling the visibility of introduced members
  • Overriding members or interfaces
Introducing interfaces

One of the common situations that you will encounter is the need to implement a specific interface on a large number of classes. This may be Online INotifyPropertyChanged, Online IDisposable, IEquatable or some custom interface that you have created. If the implementation of the interface is consistent across all of the targets then there is no reason that we shouldn't centralize its implementation. So how do we go about adding that interface to a class at compile time?

  1. Let's add the IIdentifiable interface to the target code.

    C#
    VB
    C++
    F#
    View Colorized Copy to Clipboard Print
    public interface IIdentifiable
{
    Guid Id { get; }
}
     public interface IIdentifiable
{
    Guid Id { get; }
}
  2.
                  Create an aspect that inherits from InstanceLevelAspect and add the custom attribute [  Online SerializableAttribute].

      Note  Note

                    Use [PSerializableAttribute] instead of [  Online SerializableAttribute] if your project targets Silverlight, Windows Phone, Windows Store, or runs with partial trust.

  3.
                  The key to adding an interface to target code is that you must implement that interface on your aspect. Let's implement the [Microsoft.TeamFoundation.TestManagement.Client.IIdentifiable] interface on our aspect. It's this implementation of the interface that will be added to the target code, so anything that you include in method or property bodies will be added to the target code as you have declared it in the aspect.

    C#
    VB
    C++
    F#
    View Colorized Copy to Clipboard Print
    [Serializable]
public class IdentifiableAspect : InstanceLevelAspect, IIdentifiable
{
    public Guid Id { get; private set; }
}
    [Serializable]
public class IdentifiableAspect : InstanceLevelAspect, IIdentifiable
{
    public Guid Id { get; private set; }
}
  4.
                  Add the IntroduceInterfaceAttribute attribute to the aspect and include the interface type that you want to add to the target code.

    C#
    VB
    C++
    F#
    View Colorized Copy to Clipboard Print
    [IntroduceInterface(typeof(IIdentifiable))]
[Serializable]
public class IdentifiableAspect : InstanceLevelAspect, IIdentifiable
{
    public Guid Id { get; private set; }
}
    [IntroduceInterface(typeof(IIdentifiable))]
[Serializable]
public class IdentifiableAspect : InstanceLevelAspect, IIdentifiable
{
    public Guid Id { get; private set; }
}
  5.
                  Finally you need to declare where this aspect should be applied to the codebase. In this example let's add it, as an attribute, to a class.

    C#
    VB
    C++
    F#
    View Colorized Copy to Clipboard Print
    [IdentifiableAspect]
public class Customer
{
    public string Name { get; set; }
    public string Address { get; set; }
}
    [IdentifiableAspect]
public class Customer
{
    public string Name { get; set; }
    public string Address { get; set; }
}
  6.
              After compilation you can decompile the target code and see that the interface has been added to it.

        As you can see in the decompiled code, interfaces are implemented explicitly on the target code. It is also possible to introduce public members to target code. This is covered below.

  Note  Note

          Interfaces and members introduced by PostSharp are not visible at compile time. To access the dynamically applied interface you must make use of a special PostSharp feature; the Cast SourceType, TargetType (SourceType) pseudo-operator. The Cast SourceType, TargetType (SourceType) method will allow you to safely cast the target code to the interface type that was dynamically applied. Once that call has been done, you are able to make use of the instace through the interface constructs.

          There is no way to access a dynamically-inserted method, property or event, other than through reflection or the dynamic keyword.

  Note  Note

            When you start adding code constucts to your target code, you need to determine how to initialize them correctly. Because these code construct are not available for you to work with at compile time you need to figure out how to deal with them some other way. To see more about initializing code constructs that you introduce via aspects, please see the section Initializing Aspects.

        Introducing methods

          The introduction of methods to your target code is very similar to introducing interfaces. The biggest difference is that you will be introducing code at a much more granular level.

  1.
                Create an aspect that inherits from InstanceLevelAspect and add the custom attribute [  Online SerializableAttribute].

  2.
                Add to the aspect the method you want to introduce to the target code.

    C#
    VB
    C++
    F#
    View Colorized Copy to Clipboard Print
    [Serializable]
public class OurCustomAspect : InstanceLevelAspect
{
    public void TheMethodYouWantToUse(string aValue)
    {
        Console.WriteLine("Inside a method that was introduced {0}", aValue);
    }
}
    [Serializable]
public class OurCustomAspect : InstanceLevelAspect
{
    public void TheMethodYouWantToUse(string aValue)
    {
        Console.WriteLine("Inside a method that was introduced {0}", aValue);
    }
}
      Note  Note

                The method that you declare must be marked as public. If it is not you will see an error at compile time.

  3.
                Decorate the method with the IntroduceMemberAttribute attribute.

    C#
    VB
    C++
    F#
    View Colorized Copy to Clipboard Print
    [IntroduceMember]
public void TheMethodYouWantToUse(string aValue)
{
    Console.WriteLine("Inside a method that was introduced {0}", aValue);
}
    [IntroduceMember]
public void TheMethodYouWantToUse(string aValue)
{
    Console.WriteLine("Inside a method that was introduced {0}", aValue);
}
  4.
                Finally, declare where you want this aspect to be applied in the codebase.

    C#
    VB
    C++
    F#
    View Colorized Copy to Clipboard Print
    [OurCustomAspect]
public class Customer
{
    public string Name { get; set; }
}
    [OurCustomAspect]
public class Customer
{
    public string Name { get; set; }
}
  5.
                After compilation you can decompile the target code and see that the method has been added.

      Introducing Method decompile
Introducing properties

          The introduction of properties is almost exactly the same as the introduction of methods. Like introducing a method you will use the IntroduceMemberAttribute attribute. Let's take a look at the details.

  1.
              Create an aspect that inherits from InstanceLevelAspect and add the custom attribute [  Online SerializableAttribute].

  2.
              Add the property you want to introduce to the aspect.

    C#
    VB
    C++
    F#
    View Colorized Copy to Clipboard Print
    [Serializable]
public class OurCustomAspect : InstanceLevelAspect
{
    public string Name { get; set; }
}
    [Serializable]
public class OurCustomAspect : InstanceLevelAspect
{
    public string Name { get; set; }
}
      Note  Note

              The property that you declare must be marked as public. If it is not you will see a compiler error.

  3.
              Decorate the property with the IntroduceMemberAttribute attribute.

    C#
    VB
    C++
    F#
    View Colorized Copy to Clipboard Print
    [IntroduceMember]
public string Name { get; set; }
    [IntroduceMember]
public string Name { get; set; }
  4.
              Add the aspect attribute to the target code where the aspect should be applied.

    C#
    VB
    C++
    F#
    View Colorized Copy to Clipboard Print
    [OurCustomAspect]
public class Customer
{

}
    [OurCustomAspect]
public class Customer
{

}
  5.
              After you have compiled the codebase you can decompile the target code and see that the property has been added.

      Introducing Property decompile

          As noted for both the introduction of methods and properties, the code being introduced must be declared as public. This is needed to ensure that PostSharp can function. If you look closely at the decompiled targets you will see that the introduced members are actually calling the methods/properties that were declared on the aspect. If the method/property on the aspect is not public, the target code will not be able to call it as it should.

  Note  Note

          It is possible to introduce properties to target code, but it is not possible to introduce fields to your target code. The reason is that all members are introduced by delegation: the actual implementation of the member always resides in the aspect.

Controlling the visibility of introduced members

          You may not want the introduced member to have public visibility once it has been introduced to the target code. PostSharp allows you to control the visibility of the introduced member through the use of the Visibility property on the aspect. To declare that a member should be introduced with private visibility, all you have to do is declare it as such.

C#
VB
C++
F#
View Colorized Copy to Clipboard Print
[IntroduceMember(Visibility = Visibility.Private)]
public string Name { get; set; }
[IntroduceMember(Visibility = Visibility.Private)]
public string Name { get; set; }

          You have the ability to introduce members with a number of different visibilities including public, private, assembly (internal in C#) and others. You also have the ability to mark an introduction so that it will be declared as virtual if you set the IsVirtual property to true.

C#
VB
C++
F#
View Colorized Copy to Clipboard Print
[IntroduceMember(Visibility = Visibility.Private, IsVirtual = true)]
public string Name { get; set; }
[IntroduceMember(Visibility = Visibility.Private, IsVirtual = true)]
public string Name { get; set; }
Overriding members or interfaces

          One thing you need to be aware of is the situation where you are introducing a member that may already exist in the scope of the target code. Perhaps the method you are trying to introduce is available on the target code through inheritance. It's possible that the method is explicity declared on the target code as well. The introduction of a member via an aspect needs to take these situations into account. PostSharp allows you to take these situations into account through the use of the OverrideAction property.

          The OverrideAction property allows you to declare a rule for how the introduction of a member or interface should behave if the member or interface is already implemented on the target code. This property allows you to declare rules such as Fail (any conflict situation will throw a compile time error), Ignore (continue on without trying to introduce the member/interface), OverrideOrFail or OverrideOrIgnore. It's important to understand how you want to apply your introduced members/interfaces in situations where that member/interface may already exist.

C#
VB
C++
F#
View Colorized Copy to Clipboard Print
[IntroduceMember(OverrideAction = MemberOverrideAction.Fail)]
public string Name { get; set; }
[IntroduceMember(OverrideAction = MemberOverrideAction.Fail)]
public string Name { get; set; }
See Also
Reference
CreateImplementationObject(AdviceArgs)
CompositionAspect
Cast SourceType, TargetType (SourceType)
  Online INotifyPropertyChanged
  Online IDisposable
InstanceLevelAspect
PSerializableAttribute
  Online SerializableAttribute
IntroduceInterfaceAttribute
IntroduceMemberAttribute
Visibility
IsVirtual
OverrideAction
Fail
Ignore
OverrideOrFail
OverrideOrIgnore
GetPublicInterfaces(Type)
CreateImplementationObject(AdviceArgs)
CreateInstance(Type, ActivatorSecurityToken)
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


Accessing Members of the Target Class

Accessing Members of the Target Class PostSharp Documentation

PostSharp makes it possible to import a delegate of a target class method, property or event into the aspect class, so that the aspect can invoke this member.

These mechanisms allow developers to encapsulate more design patterns using aspects.

This topic contains the following sections.

  • Importing Members of the Target Class
  • Interactions Between Several Member Introductions and Imports
  • Examples
Importing Members of the Target Class

Importing a member into an aspect allows this aspect to invoke the member. An aspect can import methods, properties, or fields.

To import a member of the target type into the aspect class:

  1. Define a field into the aspect class, of the following type:

    Member Kind | Field Type
    Method | A typed Online Delegate, typically one of the variants of Online Action or Online Func TResult . The delegate signature should exactly match the signature of the imported method.
    Property | Property TValue , where the generic argument is the type of the property.
    Collection Indexer | Property TValue, TIndex , where the first generic argument is the type of the property value and the second is the type of the index parameter. Indexers with more than one parameter are not supported.
    Event | Event TDelegate , where the generic argument is the type of the event delegate (for instance Online EventHandler).

  2. Make this field public. The field cannot be static.

  3. Add the custom attribute ImportMemberAttribute to the field. As the constructor argument, pass the name of the member to be imported.

At runtime, the field is set to a delegate of the imported member. Properties and events are imported as set of delegates (Property TValue Get, Property TValue Set; Event TDelegate Add, Event TDelegate Remove). These delegates can be invoked by the aspect as any delegate.

The property ImportMemberAttribute IsRequired determines what happens if the member could not be found in the target class or in its parent. By default, the field will simply have the null value if it could not be bound to a member. If the property IsRequired is set to true, a compile-time error will be emitted.

Interactions Between Several Member Introductions and Imports

Although member introduction and import may seem simple advices at first sight, things become more complex when the several advices try to introduce or import the same member. PostSharp handles these situations in a robust and predictable way. For this purpose, it is primordial to process classes, aspects and advices in a consistent order.

PostSharp enforces the following order:

  1. Base classes are processed first, derived classes after. Therefore, when a class is being processed, all parent classes have already been fully processed.
  2. Aspects targetting the same class are sorted (see Coping with Several Aspects on the Same Target) and executed.

  3. Advices of the same aspect are sorted and executed in the following order:

    1. Member imports which have the property ImportMemberAttribute Order set to BeforeIntroductions.
    2. Member introductions.
    3. Members imports which have the property ImportMemberAttribute Order set to AfterIntroductions (this is the default value).

Based on this well-defined order, the advices behave as follow:

Advice | Precondition | Behavior
ImportMemberAttribute | No member, or private member defined in a parent class. | Error if ImportMemberAttribute IsRequired is true, ignored otherwise (by default).
Non-virtual member defined. | Member imported.
Virtual member defined. | If ImportMemberAttribute Order is BeforeIntroductions, the overridden member is imported. This similar to calling a method with the base prefix in C#. Otherwise (and by default), the member is dynamically resolved using the virtual table of the target object.
IntroduceMemberAttribute | No member, or private member defined in a parent class. | Member introduced.
Non-virtual member defined in a parent class | Ignored if the property IntroduceMemberAttribute OverrideAction is Ignore or OverrideOrIgnore, otherwise fail (by default).
Virtual member defined in a parent class | Introduce a new override method if the property IntroduceMemberAttribute OverrideAction is OverrideOrFail or OverrideOrIgnore, ignore if the property is Ignore, otherwise fail (by default).

Member defined in the target class (virtual or not)

Fail by default or if the property IntroduceMemberAttribute OverrideAction is Fail.

Otherwise:

  1. Move the previous method body to a new method so that the previous implementation can be imported by advices ImportMemberAttribute with the property Order set to BeforeIntroductions.
  2. Override the method with the imported method.
Examples

Example: Raising an Event When the Object is Finalized

See Also

Reference

IntroduceMemberAttribute
ImportMemberAttribute

Online Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


Adding Aspects Dynamically

Adding Aspects Dynamically PostSharp Documentation

Additionally to providing advices, an aspect can provide other aspects dynamically using IAspectProvider. This allows aspect developers to address situations where it is not possible to add aspects declaratively (using custom attributes) to the source code; aspects can be provided on the basis of a complex analysis of the target assembly using Online System.Reflection, or by reading an XML file, for instance.

For details about IAspectProvider, see Adding Aspects Programmatically using IAspectProvider.

See Also

Reference

IAspectProvider

Online Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


Coping with Several Aspects on the Same Target

Coping with Several Aspects on the Same Target PostSharp Documentation

As the team learns aspect-oriented programming and starts adding more aspect to projects, chances raise that several aspects are added to the same element of code. This could be a major source of troubles if PostSharp did not provide a robust framework to detect and prevent conflicts between aspects:

  • Most aspects need to be ordered. For instance, an authorization aspect must be executed before a caching aspect.
  • Even if some aspects don't care to be ordered, it's good to have them applied in predictable order. Otherwise, some code that works today may be broken tomorrow -- just because aspects were applied in a different order.
  • Some aspects conflict; they cannot be together on the same aspect, or not in a given order. For instance, it does not make sense to persist an object using two different aspects: one would persist to the database, the other to the registry.
  • Some aspects require other aspects to be applied. For instance, an aspect changing the mouse pointer to an hourglass requires the method to execute asynchronously, otherwise the pointer shape will never be updated.

PostSharp addresses these issues by making it possible to add dependencies between aspects. The aspect dependency framework is implemented in the namespace PostSharp.Aspects.Dependencies.

Note Note
The aspect dependency framework is not related to the notion of dependency injection.
Aspect Dependency Custom Attributes

You can express dependencies of an aspect by annotating the aspect class with custom attributes derived from the type AspectDependencyAttribute. Several derived types are available; every type matches other aspects according to different criteria.

Types of Aspect Dependency Custom Attributes
Attribute Type | Description
AspectTypeDependencyAttribute | This custom attribute expresses a dependency with a well-known aspect class.
AspectRoleDependencyAttribute | This custom attribute expresses a dependency with any aspect classes enrolled in a given role. Its dual is ProvideAspectRoleAttribute: this custom attribute enrolls an aspect class into a role. A role is simply a string. Whenever possible, consider using one of the roles defined in the class StandardRoles.
AspectEffectDependencyAttribute | This custom attribute expresses a dependency with any aspect that has a specific effect on the source code or the control flow. Effects are represented as a string, whose valid values are listed in the type ProvideAspectRoleAttribute. Effects are provisioned by the aspect weaver on the basis of a rough analysis of what the aspect may do; aspect developers cannot assign new effects to aspects. However, they can waive effects by using the custom attribute WaiveAspectEffectAttribute. For instance, an aspect developer can specify that a trace attribute has no effect at all; this aspect will commute with any other aspect (see below).

Every of these custom attributes have similar structure and members. The first parameter of their constructor, of type AspectDependencyAction, determines the kind of dependency relationship added between the current aspect and the aspects matched by the custom attribute.

PostSharp supports the following kinds of relationships:

Kinds of Aspect Dependency Relationships
Action | Description
Order | The dependency expresses an order relationship. The second constructor of the custom attribute, of type AspectDependencyPosition (with values Before or After), must be specified. The custom attributes determine the position of the current aspect with respect to matched aspects.
Require | The dependency expresses a requirement. PostSharp will issue a compile-time error if the requirement is not satisfied for any target of the current aspect. The second constructor of the custom attribute, of type AspectDependencyPosition, is optional. If specified, an aspect matching the dependency should be present before or after the current aspect.
Conflict | The dependency expresses a conflict. PostSharp will issue a compile-time error if any aspect matching the dependency rule is present on any target of the current aspect. The second constructor of the custom attribute, of type AspectDependencyPosition, is optional. If specified, an error is issued only if a matching aspect is present before or after the current aspect.
Commute | The dependency specifies that the current aspect is commutable with any matching aspect. When aspects are commutable, PostSharp does not issue any warning if they are not strongly ordered.

Custom attribute types and values of the enumeration AspectDependencyAction are orthogonal; they can be freely combined.

Examples

Using role-based dependencies

The following code shows how three aspects can be ordered without having explicit knowledge of each other. Each aspect provides a different role, and defines dependencies with respect to other roles.

Example: role-based dependencies
View Colorized Copy to Clipboard Print
[ProvideAspectRole( StandardRoles.Threading )]
[AspectRoleDependency(AspectDependencyAction.Order, AspectDependencyPosition.Before, "UI")]
public sealed class AsyncAttribute : MethodInterceptionAspect
{
  // Details skipped
}

[ProvideAspectRole( StandardRoles.ExceptionHandling )]
[AspectRoleDependency( AspectDependencyAction.Order, AspectDependencyPosition.After, StandardRoles.Threading )]
[AspectRoleDependency(AspectDependencyAction.Order, AspectDependencyPosition.After, "UI")]
public sealed class ExceptionDialogAttribute : OnExceptionAspect
{
  // Details skipped
}

[ProvideAspectRole("UI")]
public sealed class StatusTextAttribute : OnMethodBoundaryAspect
{
  // Details skipped
}
[ProvideAspectRole( StandardRoles.Threading )]
[AspectRoleDependency(AspectDependencyAction.Order, AspectDependencyPosition.Before, "UI")]
public sealed class AsyncAttribute : MethodInterceptionAspect
{
  // Details skipped
}

[ProvideAspectRole( StandardRoles.ExceptionHandling )]
[AspectRoleDependency( AspectDependencyAction.Order, AspectDependencyPosition.After, StandardRoles.Threading )]
[AspectRoleDependency(AspectDependencyAction.Order, AspectDependencyPosition.After, "UI")]
public sealed class ExceptionDialogAttribute : OnExceptionAspect
{
  // Details skipped
}

[ProvideAspectRole("UI")]
public sealed class StatusTextAttribute : OnMethodBoundaryAspect
{
  // Details skipped
}

Using effect-based dependencies

The following code shows how to protect an authorization aspect to be executed after an aspect which may change the control flow and skipping the execution of the method, such as a caching aspect. Then, it shows how the aspectAsyncAttribute can opt out from this effect, because the aspect developer knows that does aspect does not skip the execution of the method, but only defers it.

Example: effect-based dependencies
View Colorized Copy to Clipboard Print
[AspectEffectDependency( AspectDependencyAction.Conflict, AspectDependencyPosition.Before,
                         StandardEffects.ChangeControlFlow )]
public sealed class AuthorizationAttribute : OnMethodBoundaryAspect
{
  // Details skipped.
}

 [WaiveAspectEffect(StandardEffects.ChangeControlFlow)]
 public sealed class AsyncAttribute : MethodInterceptionAspect
 {
   // Details skipped
 }
[AspectEffectDependency( AspectDependencyAction.Conflict, AspectDependencyPosition.Before,
                         StandardEffects.ChangeControlFlow )]
public sealed class AuthorizationAttribute : OnMethodBoundaryAspect
{
  // Details skipped.
}

 [WaiveAspectEffect(StandardEffects.ChangeControlFlow)]
 public sealed class AsyncAttribute : MethodInterceptionAspect
 {
   // Details skipped
 }
Deferring Ordering to Aspect Users

By adding dependencies to the aspect class, the aspect developer specifies the order of execution of aspects in a fully static way. The same order is used for every element of code to which aspects apply. While this behavior is most of time desirable, there may be situations where we want to defer ordering to users of our aspects.

Aspect users can influence the order of execution of an aspect by setting the aspect property AspectPriority, typically when using the aspect custom attribute (the same property is available in the configuration object as AspectConfiguration AspectPriority, see Configuring Aspects).

Setting the AspectPriority results to an aspect in adding an ordering dependency between this aspect and all other aspects where the same property has been set. Therefore, aspect priorities complement, and do not replace, other ordering dependencies. The aspect developer may specify vital aspect dependencies (that is, under-specify aspect ordering), and let it to the aspect user to complete the ordering with priorities.

Caution note Caution
Do not confuse the property AspectPriority with AttributePriority. The latter determines in which several custom attributes of the same time are processed by the MulticastAttribute engine. The first determines in which order the aspects are executed at run time.
Adding Dependencies to Third-Party Aspects

If you are using aspects provided by several third-party vendors who don't know about each other, you may need to solve conflicts on your own.

You can do that by adding any custom attribute derived from AspectDependencyAttribute at assembly level, and use the property TargetType to specify to which aspect class the dependency applies.

Here is an example:

Adding dependendencies to a third-party aspect
View Colorized Copy to Clipboard Print
[assembly: AspectTypeDependency( AspectDependencyAction.Order, AspectDependencyPosition.Before,
                                 typeof(Vendor1.TraceAspect), TargetType = typeof(Vendor2.ExceptionHandlingAspect) ]
[assembly: AspectTypeDependency( AspectDependencyAction.Order, AspectDependencyPosition.Before,
                                 typeof(Vendor1.TraceAspect), TargetType = typeof(Vendor2.ExceptionHandlingAspect) ]
See Also

Reference

PostSharp.Aspects.Dependencies

Online Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


Ordering Advices

Ordering Advices PostSharp Documentation

The section Coping with Several Aspects on the Same Target talks in terms of aspect dependencies and aspect ordering. Most of what has been said there is also valid to advices. When we talk of the order of execution of aspects, we actually mean the execution of advices ("aspects" themselves, stricto sensu, are never executed).

Dependencies defined at aspect level implicitly apply to all advices. When developing a composite aspect (see Developing Composite Aspects), it is possible to add dependencies directly to advice methods by annotating them with custom attributes of the namespace PostSharp.Aspects.Dependencies.

Note that all advices provided by an aspect are ordered in a single block. Suppose that a method is the target of advices Aspect1.MethodA, Aspect1.MethodB and Aspect2.MethodC. The next table shows valid and invalid orders:

Valid Orders | Invalid Orders
Aspect1.MethodA, Aspect1.MethodB, Aspect2.MethodC | Aspect1.MethodA, Aspect2.MethodC, Aspect1.MethodB
Aspect1.MethodB, Aspect1.MethodA, Aspect2.MethodC | Aspect1.MethodB, Aspect2.MethodC, Aspect1.MethodA
Aspect2.MethodC, Aspect1.MethodA, Aspect1.MethodB |
Aspect2.MethodC, Aspect1.MethodB, Aspect1.MethodA |
Ordering Advices of the Same Aspect

Advices of the same aspect can be used using any custom attribute derived from AspectDependencyAttribute.

Because advices of the same aspect instance are necessarily ordered in block, it is appropriate to specify dependencies between aspect classes extensively, and specify ordering of advices only in the scope of the current aspect instance. The most appropriate dependency custom attribute for this purpose is AdviceDependencyAttribute, which accepts the name of the advice method as a parameter.

See Also

Reference

AdviceDependencyAttribute

Online Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


Targeting Windows Phone, Windows Store or Silverlight

Targeting Windows Phone, Windows Store or Silverlight PostSharp Documentation

Starting from version 3, PostSharp supports the following platforms without any limitation:

  • Silverlight 4, 5
  • Windows Phone 7, 8
  • Windows Store 8

These platforms are supported through the Portable Class Library (PCL). The PCL version of PostSharp.dll has version numbers ending in 3 (for instance, 3.0.20.3), whereas the .NET versions end in 9 (for instance, 3.0.20.9). NuGet should automatically add the right version of the library to your project.

When using the portable version of PostSharp, you should use the portable serializer instead of the .NET Online BinaryFormatter:

  • Use PSerializableAttribute instead of Online SerializableAttribute.
  • Use PNonSerializedAttribute instead of Online NonSerializedAttribute.

For more information about aspect serialization, see section Understanding Aspect Serialization

Online Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


Understanding Interception Aspects

Understanding Interception Aspects PostSharp Documentation

Aspect types MethodInterceptionAspect, LocationInterceptionAspect and EventInterceptionAspect are all based on the same principle: the aspect is invoked instead of the enhanced semantic. The aspect gets access to the intercepted semantic through methods prefixed by Proceed, or by other methods.

Things become more complex when several interception aspects are applied to the same element of code. Consider a method enhanced by three aspects A, B and C. When aspect A calls the method Proceed , it will actually invoke the method OnInvoke(MethodInterceptionArgs) of aspect B. Similarly, aspect B will invoke aspect C, and aspect C will eventually invoke the original method.

Chains of Invocation

Interception aspects form a chain on invocation where every aspect instance is a node in the chain, and the intercepted member is the last node.

An interception aspect can only invoke the next node in the chain. There is no way an aspect can invoke another node, or can access directly the intercepted member. This design ensures that aspects behave in a robust and consistent way in all situations.

Aspect types LocationInterceptionAspect and EventInterceptionAspect have several semantics (Get and Set for LocationInterceptionAspect; Add, Remove and Invoke for EventInterceptionAspect). All advices of the same aspect instance (one advice per semantic) logically belong to the same node in the chain of invocation. Therefore, when the implementation of the advice LocationInterceptionAspect OnSetValue(LocationInterceptionArgs) invokes the method LocationInterceptionArgs GetCurrentValue , it actually invokes the Get semantic of the next node in the chain. If the aspect had used PropertyInfoGetValue(Object) to get the value (as was usual in PostSharp 1.0), it would have invoked the first node in the chain!

Aspects as Filters: a Disciplined Approach to Aspect-Oriented Programming

In its early days, aspect-oriented programming (AOP) has been perceived as a dangerous technology. Aspects allowed to do anything with a program. Although AOP has been designed to improve the readability and maintainability of source code, it could actually have the opposite effect.

As goes the saying, with a sharp tool, one must pay greater attention.

PostSharp was designed to respect one of the most fundamental principles of software engineering: encapsulation. Encapsulation means the condition of being enclosed, as in a capsule. In object-oriented programming, the primary capsule is the class itself. Outside code communicates with the capsule through well-defined ports: public members. Outside code cannot modify what's inside the capsule. A well-designed capsule should check the validity of messages it receives or it sends - something called precondition and postcondition checking. The second level of encapsulation is the method: even inside a class, code should be designed so that the implementation of a method does not need to care about the implementation of another method.

Of course, it is possible to ignore the rules of encapsulation. But it would most probably result in poorly readable and maintainable code.

PostSharp actually allows you to break the first capsule: you can add advices to private members of a class. But it stops there: you cannot break the capsule of a method. Instead, you can enclose a method into a new capsule analog to a filter: the advice. When a method is enhanced by an advice, outside code seeking access to this method must go through its advice.

When a method is enhanced by several advices, every advice constitutes a filter that encloses not only the method, but all advices with lower priority.

Methods have a single semantic: Invoke. Properties, fields and events have many multiple semantics. These members can be considered as a single capsule, and their semantics as different ports in the capsule.

Note Note
Things can become more complex. Consider a property with a getter and a setter. The property is enhanced by an aspect of type LocationInterceptionAspect. The property setter is enhanced by a MethodInterceptionAspect with lower priority. From a logical point of view, the property is considered as a single capsule with two ports. The capsule is enclosed by two filters, one for each aspect. The aspect LocationInterceptionAspect filters both ports. However, MethodInterceptionAspect only filters the Set port. If the LocationInterceptionAspect invokes the Get semantic, it will be directed to the property getter, because there is no filter between the advice and the semantic. However, when the same aspect invokes the Set semantic, it will be directed to LocationInterceptionAspect as this filters lays in the way.
Note Note
The Invoke semantic of EventInterceptionAspect is executed in invert order. Indeed, the message originates inside the capsule is emitted outside. For all other semantics, the message always comes from outside and is directed to the capsule.
Aspect Bindings

When an advice is invoked, it receives an interface to the next node in the chain of invocation: an aspect binding. Every aspect type has its corresponding binding interface, exposed on a property of the advice argument object.

Aspect Type | Binding Interface | Exposed On
MethodInterceptionAspect | IMethodBinding | MethodInterceptionArgs Binding
LocationInterceptionAspect | ILocationBinding | LocationInterceptionArgs Binding
EventInterceptionAspect | IEventBinding | EventInterceptionArgs Binding

Binding objects are singletons. They are fully thread-safe and reentrant. They can be invoked in any situation. This contrasts with advice arguments, which may be shared among different advices and should not be used once the advice gave over control to the next node in the chain invocation.

Note Note
As objects of type Arguments may be shared among different advices, some of which may modify the arguments, it may be safe to clone the object before the advice gives over control.
Note Note
For run-time performance reasons, PostSharp does not access binding classes through their interface, but directly invokes their implementation. Implementation classes of binding interfaces are considered an implementation detail and should not be referred to from user code.
See Also

Reference

LocationInterceptionAspect
MethodInterceptionAspect
EventInterceptionAspect

Online Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


Understanding Aspect Serialization

Understanding Aspect Serialization PostSharp Documentation

As explained in section Understanding Aspect Lifetime and Scope, aspect are first instantiated at build time by the weaver, are then initialized by the CompileTimeInitialize method, and serialized and stored in the assembly as a managed resource. Aspects are then deserialized at runtime, before being executed.

Because of the aspect life cycle, aspect classes must be made serializable as described in this section.

This topic contains the following sections.

  • Default serialization strategy
  • Aspects without serialization
Default serialization strategy

Typically, aspects can be made serializable by adding a custom attribute to the class, which causes all fields of the class to be serialized. Fields that do not need to be serialized must be annotated with an opt-out custom attribute. PostSharp chooses the serialization strategy according these custom attributes. The serialization strategy is implemented in classes derived from the abstract class AspectSerializer according to the following table.

Target platform | Making the class serializable | Excluding fields | Aspect serializer
.NET Framework with full trust | Online SerializableAttribute | Online NonSerializedAttribute | BinaryAspectSerializer, backed by Online BinaryFormatter
Any platform | PSerializableAttribute | PNonSerializedAttribute | PortableAspectSerializer, backed by PortableFormatter
Aspects without serialization

In some situations, serializing and deserializing the aspect may be a suboptimal solution. In case aspect field values are a pure function of constructor arguments and properties, it may be more efficient to emit code that instantiates these aspects at runtime instead of serializing-deserializing them. This is the case, typically, if the aspect does not implement the CompileTimeInitialize method.

In this situation, it is better to use a different serializer: MsilAspectSerializer.

Note Note
MsilAspectSerializer is actually not a serializer. When you use this implementation instead of a real serializer, the aspect is not serialized, but the weaver generates MSIL instructions to build the aspect instance at runtime, by calling the aspect class constructor and by setting its fields and properties.

You can specify which serializer should be used for a specific aspect class by setting the property AspectConfiguration SerializerType of the configuration of this aspect class or instance.

See section Configuring Aspects for details.

The following code shows how to choose the serializer type for an OnMethodBoundaryAspect:

Choosing the aspect serializer
View Colorized Copy to Clipboard Print
[OnMethodBoundaryAspectConfiguration(SerializerType=typeof(MsilAspectSerializer))]
public sealed MyAspect : OnMethodBoundaryAspect
[OnMethodBoundaryAspectConfiguration(SerializerType=typeof(MsilAspectSerializer))]
public sealed MyAspect : OnMethodBoundaryAspect
See Also

Reference

AspectSerializer
BinaryAspectSerializer
PortableAspectSerializer
MsilAspectSerializer
AspectConfiguration SerializerType

Online Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


Testing and Debugging Aspects

Testing and Debugging Aspects PostSharp Documentation

Aspects should be tested as any piece of code. However, testing techniques for aspects differ from testing techniques for normal class libraries because of a number of reasons:

  • Aspects instantiation is not user-controlled.
  • Aspects partially execute at build time.
  • Aspects can emit build errors. Logic that emits build errors should be tested too.

These characteristics are no obstacle to proper testing of aspects.

This chapter contains the following sections:

  • Writing Simple Tests explains how to test the behavior of an aspect.
  • Testing that an Aspect has been Applied shows how to test that an aspect has been applied to the expected set of code artifacts.
  • Consuming Dependencies from the Aspect describes several ways for aspects to consume dependencies from dependency-injection containers and service locators.
  • Attaching a Debugger at Build Time explains how to debug build-time logic.

Online Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


Writing Simple Tests

Writing Simple Tests PostSharp Documentation

When designing a test strategy for aspects, it is fundamental to understand that aspects cannot be used in isolation. They are always used in the context of the code artefact to which it has been applied. Therefore, when writing an aspect, two kinds of test artifacts must be written:

  • Test target code to which the aspect will be applied.
  • Test invocation code that invokes the target code and verifies that the combination of the aspect and the target code exhibits the intended behavior.
Achieving large test coverage

As with other code, you have to test the aspect with input context that varies enough to produce a large code coverage.

In the case of aspects, the input context is composed of the following items:

  • Arguments of the aspect itself, i.e. constructor arguments and property values. If the aspect behavior depends of aspect arguments, high code coverage of the aspect requires varying aspect arguments.
  • Target code can be considered as conceptually being a part of the input arguments of the aspect. For instance, if an aspect contains logic that depends on the method being static or non-static, you should test the aspect against both static and non-static methods.
  • Arguments of the target code can affect the run-time behavior of the aspect. For instance, a buggy aspects may incorrectly handle null arguments.
Example: testing a caching aspect

The following example demonstrates how to test the caching aspect illustrated in section Caching the Result of a Method. High code coverage is achieved by varying the target code and testing with null and non-null parameters.

C#
VB
C++
F#
View Colorized Copy to Clipboard Print
using System;
using Microsoft.VisualStudio.TestTools.UnitTesting;

namespace Samples
{
    [TestClass]
    public class TestCacheAspect
    {
        private static int invocations;

        // Instance method without parameters

        [TestMethod]
        public void TestInstanceMethodWithoutParameter()
        {
            int call1 = this.InstanceMethodWithoutParameter();
            int call2 = this.InstanceMethodWithoutParameter();

            Assert.AreEqual(call1, call2);
        }

        [Cache]
        private int InstanceMethodWithoutParameter()
        {
            return invocations++;
        }

        // Static method without parameters

        [TestMethod]
        public void TestStaticMethodWithoutParameter()
        {
            int call1 = StaticMethodWithoutParameter();
            int call2 = StaticMethodWithoutParameter();

            Assert.AreEqual(call1, call2);
        }

        [Cache]
        private static int StaticMethodWithoutParameter()
        {
            return invocations++;
        }

        //  Instance method with parameters

        [TestMethod]
        public void TestInstanceMethodWithParameter()
        {
            int call1a = this.InstanceMethodWithParameter("foo");
            int call2a = this.InstanceMethodWithParameter(null);
            int call1b = this.InstanceMethodWithParameter("foo");
            int call2b = this.InstanceMethodWithParameter(null);

            Assert.AreEqual(call1a, call1b);
            Assert.AreEqual(call2a, call2b);
            Assert.AreNotEqual(call1a, call2a);
        }

        [Cache]
        private int InstanceMethodWithParameter(string param)
        {
            return invocations++;
        }
    }
}
using System;
using Microsoft.VisualStudio.TestTools.UnitTesting;

namespace Samples
{
    [TestClass]
    public class TestCacheAspect
    {
        private static int invocations;

        // Instance method without parameters

        [TestMethod]
        public void TestInstanceMethodWithoutParameter()
        {
            int call1 = this.InstanceMethodWithoutParameter();
            int call2 = this.InstanceMethodWithoutParameter();

            Assert.AreEqual(call1, call2);
        }

        [Cache]
        private int InstanceMethodWithoutParameter()
        {
            return invocations++;
        }

        // Static method without parameters

        [TestMethod]
        public void TestStaticMethodWithoutParameter()
        {
            int call1 = StaticMethodWithoutParameter();
            int call2 = StaticMethodWithoutParameter();

            Assert.AreEqual(call1, call2);
        }

        [Cache]
        private static int StaticMethodWithoutParameter()
        {
            return invocations++;
        }

        //  Instance method with parameters

        [TestMethod]
        public void TestInstanceMethodWithParameter()
        {
            int call1a = this.InstanceMethodWithParameter("foo");
            int call2a = this.InstanceMethodWithParameter(null);
            int call1b = this.InstanceMethodWithParameter("foo");
            int call2b = this.InstanceMethodWithParameter(null);

            Assert.AreEqual(call1a, call1b);
            Assert.AreEqual(call2a, call2b);
            Assert.AreNotEqual(call1a, call2a);
        }

        [Cache]
        private int InstanceMethodWithParameter(string param)
        {
            return invocations++;
        }
    }
}
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


Testing that an Aspect has been Applied

Testing that an Aspect has been Applied PostSharp Documentation

In the previous section, we have seen how to test the aspect behavior itself. Now, let's see how we can test that the aspect has been applied to the expected set of targets. This can also be called testing the pointcut.

Why to test that the aspect has been property applied?

You may need to test whether an aspect has been applied to specific targets for one of the following reasons:

  • The aspect is applied using non-trivial regular expressions with MulticastAttribute.
  • The aspect is silently filtered out using CompileTimeValidate .
  • The aspect is applied using an IAspectProvider.
Testing that the aspect behavior is exhibited

The most obvious way to test that the aspect has been applied on to an element of code is to execute that code and ensure that the code actually exhibits the aspect behavior. This approach does not differ from the one described in section Writing Simple Tests.

Testing that the aspect custom attribute is present

You can check that an aspect has been applied to a target by reflecting the custom attributes present on this element of code.

However, custom attributes representing aspects are stripped by default. If you want PostSharp to emit custom attributes, follow instructions of section Reflecting Aspect Instances at Runtime.

Note Note
Aspects added by IAspectProvider are not represented by custom attributes, so their presence cannot be tested by this approach.
Parsing the PostSharp symbol file

PostSharp generates a symbol file named bin\Debug\MyAssembly.psssym, where MyAssembly is the name of the assembly. In theory, you could use this file to determine which elements of code have been modified by aspects in your project.

Caution note Caution
The PostSharp symbol file format is undocumented and unsupported. It means that PostSharp support team cannot answer questions related to this file format.

Online Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


Consuming Dependencies from the Aspect

Consuming Dependencies from the Aspect PostSharp Documentation

Aspects, as other components, may have dependencies to other application services. Aspects may be bound to the abstract interface to this service, and may need to resolve the dependency at runtime.

However, two reasons prevent us from the following approaches that are usual with dependency injection containers:

  • Aspects are instantiated at build time, and dependency-injection containers only exist at run-time.
  • Aspects typically have a static scope. Unless they implement the IInstanceScopedAspect, aspect instances are stored in static fields, even when applied to instance members.

These characteristics are not an obstacle to using service containers, but different patterns must be followed.

This section presents several ways to consume dependencies from an aspect:

  • Using a Global Composition Container
  • Using a Global Service Locator
  • Using Dynamic Dependency Resolution
  • Using Contextual Dependency Resolution
  • Importing Dependencies from the Target Object

Online Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


Using a Global Composition Container

Using a Global Composition Container PostSharp Documentation

Although the aspect cannot be instantiated by the dependency injection container, it is possible to initialize the aspect from an ambient container at runtime. An ambient container is one that is exposed as a static member and that is global to the whole application.

Dependency injection containers typically offer methods to initialize objects that have been instantiated externally. For instance, the Managed Extensibility Framework offers the SatisfyImportsOnce method.

The dependency injection method can be invoked from the RuntimeInitialize method.

Note Note
User code has no control over the time when and the thread on which an aspect is initialized. Therefore, using Online ThreadStaticAttribute to make the container local to the current thread is not a reliable approach.
Important note Important
The service container must be initialized before the execution of any class that is enhanced by the aspect. It means that it is not possible to use the aspect on test classes themselves. To relax this constraint, it is possible to initialize the dependency lazily, when the first advice is hit.
Example: testable logging aspect with a global MEF service container
Logging aspect and production code
View Colorized Copy to Clipboard Print
using System;
using System.ComponentModel.Composition;
using System.ComponentModel.Composition.Hosting;
using System.ComponentModel.Composition.Primitives;
using System.Reflection;
using PostSharp.Aspects;
using PostSharp.Extensibility;

namespace DependencyResolution.GlobalServiceContainer
{
    public interface ILogger
    {
        void Log(string message);
    }

    public static class AspectServiceInjector
    {
        private static CompositionContainer container;

        public static void Initialize(ComposablePartCatalog catalog)
        {
            container = new CompositionContainer(catalog);
        }

        public static void BuildObject(object o)
        {
            if (container == null)
                throw new InvalidOperationException();

            container.SatisfyImportsOnce(o);
        }
    }

    [Serializable]
    public class LogAspect : OnMethodBoundaryAspect
    {
        [Import] private ILogger logger;

        public override void RuntimeInitialize(MethodBase method)
        {
            AspectServiceInjector.BuildObject(this);
        }

        public override void OnEntry(MethodExecutionArgs args)
        {
            logger.Log("OnEntry");
        }
    }

    internal class Program
    {
        private static void Main(string[] args)
        {
            AspectServiceInjector.Initialize(new TypeCatalog(typeof (ConsoleLogger)));

            // The static constructor of LogAspect is called before the static constructor of the type
            // containing target methods. This is why we cannot use the aspect in the Program class.
            Foo.LoggedMethod();
        }
    }

    internal class Foo
    {
        [LogAspect]
        public static void LoggedMethod()
        {
            Console.WriteLine("Hello, world.");
        }
    }

    [Export(typeof (ILogger))]
    internal class ConsoleLogger : ILogger
    {
        public void Log(string message)
        {
            Console.WriteLine(message);
        }
    }
}
using System;
using System.ComponentModel.Composition;
using System.ComponentModel.Composition.Hosting;
using System.ComponentModel.Composition.Primitives;
using System.Reflection;
using PostSharp.Aspects;
using PostSharp.Extensibility;

namespace DependencyResolution.GlobalServiceContainer
{
    public interface ILogger
    {
        void Log(string message);
    }

    public static class AspectServiceInjector
    {
        private static CompositionContainer container;

        public static void Initialize(ComposablePartCatalog catalog)
        {
            container = new CompositionContainer(catalog);
        }

        public static void BuildObject(object o)
        {
            if (container == null)
                throw new InvalidOperationException();

            container.SatisfyImportsOnce(o);
        }
    }

    [Serializable]
    public class LogAspect : OnMethodBoundaryAspect
    {
        [Import] private ILogger logger;

        public override void RuntimeInitialize(MethodBase method)
        {
            AspectServiceInjector.BuildObject(this);
        }

        public override void OnEntry(MethodExecutionArgs args)
        {
            logger.Log("OnEntry");
        }
    }

    internal class Program
    {
        private static void Main(string[] args)
        {
            AspectServiceInjector.Initialize(new TypeCatalog(typeof (ConsoleLogger)));

            // The static constructor of LogAspect is called before the static constructor of the type
            // containing target methods. This is why we cannot use the aspect in the Program class.
            Foo.LoggedMethod();
        }
    }

    internal class Foo
    {
        [LogAspect]
        public static void LoggedMethod()
        {
            Console.WriteLine("Hello, world.");
        }
    }

    [Export(typeof (ILogger))]
    internal class ConsoleLogger : ILogger
    {
        public void Log(string message)
        {
            Console.WriteLine(message);
        }
    }
}
Testing code
View Colorized Copy to Clipboard Print
using System;
using System.ComponentModel.Composition;
using System.ComponentModel.Composition.Hosting;
using System.Text;
using Microsoft.VisualStudio.TestTools.UnitTesting;

namespace DependencyResolution.GlobalServiceContainer.Test
{
    [TestClass]
    public class TestLogAspect
    {
        static TestLogAspect()
        {
            AspectServiceInjector.Initialize(new TypeCatalog(typeof (TestLogger)));
        }

        [TestMethod]
        public void TestMethod()
        {
            TestLogger.Clear();
            new TargetClass().TargetMethod();
            Assert.AreEqual("OnEntry" + Environment.NewLine, TestLogger.GetLog());
        }

        private class TargetClass
        {
            [LogAspect]
            public void TargetMethod()
            {
            }
        }
    }

    [Export(typeof (ILogger))]
    internal class TestLogger : ILogger
    {
        public static readonly StringBuilder stringBuilder = new StringBuilder();

        public void Log(string message)
        {
            stringBuilder.AppendLine(message);
        }

        public static string GetLog()
        {
            return stringBuilder.ToString();
        }

        public static void Clear()
        {
            stringBuilder.Clear();
        }
    }
}
using System;
using System.ComponentModel.Composition;
using System.ComponentModel.Composition.Hosting;
using System.Text;
using Microsoft.VisualStudio.TestTools.UnitTesting;

namespace DependencyResolution.GlobalServiceContainer.Test
{
    [TestClass]
    public class TestLogAspect
    {
        static TestLogAspect()
        {
            AspectServiceInjector.Initialize(new TypeCatalog(typeof (TestLogger)));
        }

        [TestMethod]
        public void TestMethod()
        {
            TestLogger.Clear();
            new TargetClass().TargetMethod();
            Assert.AreEqual("OnEntry" + Environment.NewLine, TestLogger.GetLog());
        }

        private class TargetClass
        {
            [LogAspect]
            public void TargetMethod()
            {
            }
        }
    }

    [Export(typeof (ILogger))]
    internal class TestLogger : ILogger
    {
        public static readonly StringBuilder stringBuilder = new StringBuilder();

        public void Log(string message)
        {
            stringBuilder.AppendLine(message);
        }

        public static string GetLog()
        {
            return stringBuilder.ToString();
        }

        public static void Clear()
        {
            stringBuilder.Clear();
        }
    }
}

Online Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


Using a Global Service Locator

Using a Global Service Locator PostSharp Documentation

If all aspect instances are using the same global dependency injection container, it is likely that dependencies of all instances will resolve to the same service implementation. Therefore, storing dependencies in an instance field may be a waste of memory, especially for aspects that are applied to a very high number of code elements.

Alternatively, dependencies can be stored in static fields and initialized in the aspect static constructor.

Tip Tip
Use the PostSharpEnvironment IsPostSharpRunning property to make sure that this part of the static constructor is executed at runtime only, when PostSharp is not running.

In this case, dependency injection method such as SatisfyImportsOnce cannot be used. Instead, the container must be used as a service locator. For instance, MEF exposes the method ExportProviderGetExport .

Important note Important
The service locator must be initialized before the execution of any class that is enhanced by the aspect. It means that it is not possible to use the aspect on the entry-point class (Program or App, typically). To relax this constraint, it is possible to initialize the dependency on demand, for instance using the Lazy construct.
Example: testable aspect with a global MEF service locator

The following source code demonstrates how to call a global service locator from the aspect static constructor.

Logging aspect and production code
View Colorized Copy to Clipboard Print
using System;
using System.ComponentModel.Composition;
using System.ComponentModel.Composition.Hosting;
using System.ComponentModel.Composition.Primitives;
using PostSharp.Aspects;
using PostSharp.Extensibility;

namespace DependencyResolution.GlobalServiceLocator
{
    public interface ILogger
    {
        void Log(string message);
    }

    public static class AspectServiceLocator
    {
        private static CompositionContainer container;

        public static void Initialize(ComposablePartCatalog catalog)
        {
            container = new CompositionContainer(catalog);
        }

        public static Lazy<T> GetService<T>() where T : class
        {
            return new Lazy<T>(GetServiceImpl<T>);
        }

        private static T GetServiceImpl<T>()
        {
            if (container == null)
                throw new InvalidOperationException();

            return container.GetExport<T>().Value;
        }
    }

    [Serializable]
    public class LogAspect : OnMethodBoundaryAspect
    {
        private static readonly Lazy<ILogger> logger;

        static LogAspect()
        {
            if (!PostSharpEnvironment.IsPostSharpRunning)
            {
                logger = AspectServiceLocator.GetService<ILogger>();
            }
        }

        public override void OnEntry(MethodExecutionArgs args)
        {
            logger.Value.Log("OnEntry");
        }
    }

    internal class Program
    {
        private static void Main(string[] args)
        {
            AspectServiceLocator.Initialize(new TypeCatalog(typeof (ConsoleLogger)));

            LoggedMethod();
        }

        [LogAspect]
        public static void LoggedMethod()
        {
            Console.WriteLine("Hello, world.");
        }
    }

    [Export(typeof (ILogger))]
    internal class ConsoleLogger : ILogger
    {
        public void Log(string message)
        {
            Console.WriteLine(message);
        }
    }
}
using System;
using System.ComponentModel.Composition;
using System.ComponentModel.Composition.Hosting;
using System.ComponentModel.Composition.Primitives;
using PostSharp.Aspects;
using PostSharp.Extensibility;

namespace DependencyResolution.GlobalServiceLocator
{
    public interface ILogger
    {
        void Log(string message);
    }

    public static class AspectServiceLocator
    {
        private static CompositionContainer container;

        public static void Initialize(ComposablePartCatalog catalog)
        {
            container = new CompositionContainer(catalog);
        }

        public static Lazy<T> GetService<T>() where T : class
        {
            return new Lazy<T>(GetServiceImpl<T>);
        }

        private static T GetServiceImpl<T>()
        {
            if (container == null)
                throw new InvalidOperationException();

            return container.GetExport<T>().Value;
        }
    }

    [Serializable]
    public class LogAspect : OnMethodBoundaryAspect
    {
        private static readonly Lazy<ILogger> logger;

        static LogAspect()
        {
            if (!PostSharpEnvironment.IsPostSharpRunning)
            {
                logger = AspectServiceLocator.GetService<ILogger>();
            }
        }

        public override void OnEntry(MethodExecutionArgs args)
        {
            logger.Value.Log("OnEntry");
        }
    }

    internal class Program
    {
        private static void Main(string[] args)
        {
            AspectServiceLocator.Initialize(new TypeCatalog(typeof (ConsoleLogger)));

            LoggedMethod();
        }

        [LogAspect]
        public static void LoggedMethod()
        {
            Console.WriteLine("Hello, world.");
        }
    }

    [Export(typeof (ILogger))]
    internal class ConsoleLogger : ILogger
    {
        public void Log(string message)
        {
            Console.WriteLine(message);
        }
    }
}
Testing code
View Colorized Copy to Clipboard Print
using System;
using System.ComponentModel.Composition;
using System.ComponentModel.Composition.Hosting;
using System.Text;
using Microsoft.VisualStudio.TestTools.UnitTesting;

namespace DependencyResolution.GlobalServiceLocator.Test
{
    [TestClass]
    public class TestLogAspect
    {
        static TestLogAspect()
        {
            AspectServiceLocator.Initialize(new TypeCatalog(typeof (TestLogger)));
        }

        [TestMethod]
        public void TestMethod()
        {
            TestLogger.Clear();
            TargetMethod();
            Assert.AreEqual("OnEntry" + Environment.NewLine, TestLogger.GetLog());
        }

        [LogAspect]
        private void TargetMethod()
        {
        }
    }

    [Export(typeof (ILogger))]
    internal class TestLogger : ILogger
    {
        public static readonly StringBuilder stringBuilder = new StringBuilder();

        public void Log(string message)
        {
            stringBuilder.AppendLine(message);
        }

        public static string GetLog()
        {
            return stringBuilder.ToString();
        }

        public static void Clear()
        {
            stringBuilder.Clear();
        }
    }
}
using System;
using System.ComponentModel.Composition;
using System.ComponentModel.Composition.Hosting;
using System.Text;
using Microsoft.VisualStudio.TestTools.UnitTesting;

namespace DependencyResolution.GlobalServiceLocator.Test
{
    [TestClass]
    public class TestLogAspect
    {
        static TestLogAspect()
        {
            AspectServiceLocator.Initialize(new TypeCatalog(typeof (TestLogger)));
        }

        [TestMethod]
        public void TestMethod()
        {
            TestLogger.Clear();
            TargetMethod();
            Assert.AreEqual("OnEntry" + Environment.NewLine, TestLogger.GetLog());
        }

        [LogAspect]
        private void TargetMethod()
        {
        }
    }

    [Export(typeof (ILogger))]
    internal class TestLogger : ILogger
    {
        public static readonly StringBuilder stringBuilder = new StringBuilder();

        public void Log(string message)
        {
            stringBuilder.AppendLine(message);
        }

        public static string GetLog()
        {
            return stringBuilder.ToString();
        }

        public static void Clear()
        {
            stringBuilder.Clear();
        }
    }
}

Online Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


Using Dynamic Dependency Resolution

Using Dynamic Dependency Resolution PostSharp Documentation

Both previous approaches have a static dependency resolution strategy: it cannot be changed over time. Therefore, these strategies could be unsuitable in cases where several tests need different configurations of the dependency container.

A possible solution is to resolve dependencies dynamically each time they are needed, and not only at aspect initialization. Althought this solution is ideal for the sake of testing, it may be too inefficient for production. Therefore, the solution would still need to provide dependency caching for production mode. Caching would neutralize the dynamic characteristics of dependency resolution.

This solution would be based on the following elements:

  1. The service locator can be initialized in two modes: production (the resolution strategy is immutable) and testing (the resolution strategy can be modified).
  2. The service locator returns a delegate (Func<T>, where T is the dependency type), instead of the dependency itself (T or Lazy<T>).
  3. The aspect calls the service locator during aspect initialization and stores the delegate.
  4. The aspect calls the delegate at runtime.
Example: testable logging aspect with a global MEF service container with dynamic resolution
Logging aspect and production code
View Colorized Copy to Clipboard Print
using System;
using System.ComponentModel.Composition;
using System.ComponentModel.Composition.Hosting;
using System.ComponentModel.Composition.Primitives;
using PostSharp.Aspects;
using PostSharp.Extensibility;

namespace DependencyResolution.Dynamic
{
    public interface ILogger
    {
        void Log(string message);
    }

    public static class AspectServiceLocator
    {
        private static CompositionContainer container;
        private static bool isCacheable;

        public static void Initialize(ComposablePartCatalog catalog, bool isCacheable)
        {
            if (AspectServiceLocator.isCacheable && container != null)
                throw new InvalidOperationException();

            container = new CompositionContainer(catalog);
            AspectServiceLocator.isCacheable = isCacheable;
        }

        public static Func<T> GetService<T>() where T : class
        {
            if (isCacheable)
            {
                return () => new Lazy<T>(GetServiceImpl<T>).Value;
            }
            else
            {
                return GetServiceImpl<T>;
            }
        }

        private static T GetServiceImpl<T>()
        {
            if (container == null)
                throw new InvalidOperationException();

            return container.GetExport<T>().Value;
        }
    }

    [Serializable]
    public class LogAspect : OnMethodBoundaryAspect
    {
        private static readonly Func<ILogger> logger;

        static LogAspect()
        {
            if (!PostSharpEnvironment.IsPostSharpRunning)
            {
                logger = AspectServiceLocator.GetService<ILogger>();
            }
        }

        public override void OnEntry(MethodExecutionArgs args)
        {
            logger().Log("OnEntry");
        }
    }

    internal class Program
    {
        private static void Main(string[] args)
        {
            AspectServiceLocator.Initialize(new TypeCatalog(typeof (ConsoleLogger)), true);

            LoggedMethod();
        }

        [LogAspect]
        public static void LoggedMethod()
        {
            Console.WriteLine("Hello, world.");
        }
    }

    [Export(typeof (ILogger))]
    internal class ConsoleLogger : ILogger
    {
        public void Log(string message)
        {
            Console.WriteLine(message);
        }
    }
}
using System;
using System.ComponentModel.Composition;
using System.ComponentModel.Composition.Hosting;
using System.ComponentModel.Composition.Primitives;
using PostSharp.Aspects;
using PostSharp.Extensibility;

namespace DependencyResolution.Dynamic
{
    public interface ILogger
    {
        void Log(string message);
    }

    public static class AspectServiceLocator
    {
        private static CompositionContainer container;
        private static bool isCacheable;

        public static void Initialize(ComposablePartCatalog catalog, bool isCacheable)
        {
            if (AspectServiceLocator.isCacheable && container != null)
                throw new InvalidOperationException();

            container = new CompositionContainer(catalog);
            AspectServiceLocator.isCacheable = isCacheable;
        }

        public static Func<T> GetService<T>() where T : class
        {
            if (isCacheable)
            {
                return () => new Lazy<T>(GetServiceImpl<T>).Value;
            }
            else
            {
                return GetServiceImpl<T>;
            }
        }

        private static T GetServiceImpl<T>()
        {
            if (container == null)
                throw new InvalidOperationException();

            return container.GetExport<T>().Value;
        }
    }

    [Serializable]
    public class LogAspect : OnMethodBoundaryAspect
    {
        private static readonly Func<ILogger> logger;

        static LogAspect()
        {
            if (!PostSharpEnvironment.IsPostSharpRunning)
            {
                logger = AspectServiceLocator.GetService<ILogger>();
            }
        }

        public override void OnEntry(MethodExecutionArgs args)
        {
            logger().Log("OnEntry");
        }
    }

    internal class Program
    {
        private static void Main(string[] args)
        {
            AspectServiceLocator.Initialize(new TypeCatalog(typeof (ConsoleLogger)), true);

            LoggedMethod();
        }

        [LogAspect]
        public static void LoggedMethod()
        {
            Console.WriteLine("Hello, world.");
        }
    }

    [Export(typeof (ILogger))]
    internal class ConsoleLogger : ILogger
    {
        public void Log(string message)
        {
            Console.WriteLine(message);
        }
    }
}
Testing code
View Colorized Copy to Clipboard Print
using System;
using System.ComponentModel.Composition;
using System.ComponentModel.Composition.Hosting;
using System.Text;
using Microsoft.VisualStudio.TestTools.UnitTesting;

namespace DependencyResolution.Dynamic.Test
{
    [TestClass]
    public class TestLogAspect
    {
        [TestMethod]
        public void TestMethod()
        {
            // The ServiceLocator can be initialized for each test.
            AspectServiceLocator.Initialize(new TypeCatalog(typeof (TestLogger)), false);

            TestLogger.Clear();
            TargetMethod();
            Assert.AreEqual("OnEntry" + Environment.NewLine, TestLogger.GetLog());
        }

        [LogAspect]
        private void TargetMethod()
        {
        }
    }

    [Export(typeof (ILogger))]
    internal class TestLogger : ILogger
    {
        public static readonly StringBuilder stringBuilder = new StringBuilder();

        public void Log(string message)
        {
            stringBuilder.AppendLine(message);
        }

        public static string GetLog()
        {
            return stringBuilder.ToString();
        }

        public static void Clear()
        {
            stringBuilder.Clear();
        }
    }
}
using System;
using System.ComponentModel.Composition;
using System.ComponentModel.Composition.Hosting;
using System.Text;
using Microsoft.VisualStudio.TestTools.UnitTesting;

namespace DependencyResolution.Dynamic.Test
{
    [TestClass]
    public class TestLogAspect
    {
        [TestMethod]
        public void TestMethod()
        {
            // The ServiceLocator can be initialized for each test.
            AspectServiceLocator.Initialize(new TypeCatalog(typeof (TestLogger)), false);

            TestLogger.Clear();
            TargetMethod();
            Assert.AreEqual("OnEntry" + Environment.NewLine, TestLogger.GetLog());
        }

        [LogAspect]
        private void TargetMethod()
        {
        }
    }

    [Export(typeof (ILogger))]
    internal class TestLogger : ILogger
    {
        public static readonly StringBuilder stringBuilder = new StringBuilder();

        public void Log(string message)
        {
            stringBuilder.AppendLine(message);
        }

        public static string GetLog()
        {
            return stringBuilder.ToString();
        }

        public static void Clear()
        {
            stringBuilder.Clear();
        }
    }
}

Online Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


Using Contextual Dependency Resolution

Using Contextual Dependency Resolution PostSharp Documentation

The dependency resolution strategy does not necessarily need to resolve to the same service implementation for all occurrences of the dependency. It is possible to design a strategy that depends on the context. For instance, the service locator could accept the aspect type and the target element of code as parameters. Test code could configure the service locator to resolve dependencies to specific implementations for a given context.

Evaluating context-sensitive rules maybe CPU-intensive, but it needs to be done only during testing. In production mode, dependency resolution can be delegated to a global service catalogue.

Example: testable logging aspect with contextual dependency resolution
Logging aspect and production code
View Colorized Copy to Clipboard Print
using System;
using System.Collections.Generic;
using System.ComponentModel.Composition;
using System.ComponentModel.Composition.Hosting;
using System.ComponentModel.Composition.Primitives;
using System.Reflection;
using PostSharp.Aspects;
using PostSharp.Extensibility;

namespace DependencyResolution.Contextual
{
    public interface ILogger
    {
        void Log(string message);
    }

    public static class AspectServiceLocator
    {
        private static CompositionContainer container;
        private static HashSet<object> rules = new HashSet<object>();

        public static void Initialize(ComposablePartCatalog catalog)
        {
            container = new CompositionContainer(catalog);
        }

        public static Lazy<T> GetService<T>(Type aspectType, MemberInfo targetElement) where T : class
        {
            return new Lazy<T>(() => GetServiceImpl<T>(aspectType, targetElement));
        }

        private static T GetServiceImpl<T>(Type aspectType, MemberInfo targetElement) where T : class
        {
            // The rule implementation is naive but this is for testing purpose only.
            foreach (object rule in rules)
            {
                DependencyRule<T> typedRule = rule as DependencyRule<T>;
                if (typedRule == null) continue;

                T service = typedRule.Rule(aspectType, targetElement);
                if (service != null) return service;
            }

            if (container == null)
                throw new InvalidOperationException();

            // Fallback to the container, which should be the default and production behavior.
            return container.GetExport<T>().Value;
        }

        public static IDisposable AddRule<T>(Func<Type, MemberInfo, T> rule)
        {
            DependencyRule<T> dependencyRule = new DependencyRule<T>(rule);
            rules.Add(dependencyRule);
            return dependencyRule;
        }

        private class DependencyRule<T> : IDisposable
        {
            public DependencyRule(Func<Type, MemberInfo, T> rule)
            {
                this.Rule = rule;
            }

            public Func<Type, MemberInfo, T> Rule { get; private set; }

            public void Dispose()
            {
                rules.Remove(this);
            }
        }
    }

    [Serializable]
    public class LogAspect : OnMethodBoundaryAspect
    {
        private Lazy<ILogger> logger;

        public override void RuntimeInitialize(MethodBase method)
        {
            logger = AspectServiceLocator.GetService<ILogger>(this.GetType(), method);
        }

        public override void OnEntry(MethodExecutionArgs args)
        {
            logger.Value.Log("OnEntry");
        }
    }

    internal class Program
    {
        private static void Main(string[] args)
        {
            AspectServiceLocator.Initialize(new TypeCatalog(typeof (ConsoleLogger)));

            LoggedMethod();
        }

        [LogAspect]
        public static void LoggedMethod()
        {
            Console.WriteLine("Hello, world.");
        }
    }

    [Export(typeof (ILogger))]
    internal class ConsoleLogger : ILogger
    {
        public void Log(string message)
        {
            Console.WriteLine(message);
        }
    }
}
using System;
using System.Collections.Generic;
using System.ComponentModel.Composition;
using System.ComponentModel.Composition.Hosting;
using System.ComponentModel.Composition.Primitives;
using System.Reflection;
using PostSharp.Aspects;
using PostSharp.Extensibility;

namespace DependencyResolution.Contextual
{
    public interface ILogger
    {
        void Log(string message);
    }

    public static class AspectServiceLocator
    {
        private static CompositionContainer container;
        private static HashSet<object> rules = new HashSet<object>();

        public static void Initialize(ComposablePartCatalog catalog)
        {
            container = new CompositionContainer(catalog);
        }

        public static Lazy<T> GetService<T>(Type aspectType, MemberInfo targetElement) where T : class
        {
            return new Lazy<T>(() => GetServiceImpl<T>(aspectType, targetElement));
        }

        private static T GetServiceImpl<T>(Type aspectType, MemberInfo targetElement) where T : class
        {
            // The rule implementation is naive but this is for testing purpose only.
            foreach (object rule in rules)
            {
                DependencyRule<T> typedRule = rule as DependencyRule<T>;
                if (typedRule == null) continue;

                T service = typedRule.Rule(aspectType, targetElement);
                if (service != null) return service;
            }

            if (container == null)
                throw new InvalidOperationException();

            // Fallback to the container, which should be the default and production behavior.
            return container.GetExport<T>().Value;
        }

        public static IDisposable AddRule<T>(Func<Type, MemberInfo, T> rule)
        {
            DependencyRule<T> dependencyRule = new DependencyRule<T>(rule);
            rules.Add(dependencyRule);
            return dependencyRule;
        }

        private class DependencyRule<T> : IDisposable
        {
            public DependencyRule(Func<Type, MemberInfo, T> rule)
            {
                this.Rule = rule;
            }

            public Func<Type, MemberInfo, T> Rule { get; private set; }

            public void Dispose()
            {
                rules.Remove(this);
            }
        }
    }

    [Serializable]
    public class LogAspect : OnMethodBoundaryAspect
    {
        private Lazy<ILogger> logger;

        public override void RuntimeInitialize(MethodBase method)
        {
            logger = AspectServiceLocator.GetService<ILogger>(this.GetType(), method);
        }

        public override void OnEntry(MethodExecutionArgs args)
        {
            logger.Value.Log("OnEntry");
        }
    }

    internal class Program
    {
        private static void Main(string[] args)
        {
            AspectServiceLocator.Initialize(new TypeCatalog(typeof (ConsoleLogger)));

            LoggedMethod();
        }

        [LogAspect]
        public static void LoggedMethod()
        {
            Console.WriteLine("Hello, world.");
        }
    }

    [Export(typeof (ILogger))]
    internal class ConsoleLogger : ILogger
    {
        public void Log(string message)
        {
            Console.WriteLine(message);
        }
    }
}
Testing code
View Colorized Copy to Clipboard Print
using System;
using System.Text;
using Microsoft.VisualStudio.TestTools.UnitTesting;

namespace DependencyResolution.Contextual.Test
{
    [TestClass]
    public class TestLogAspect
    {
        [TestMethod]
        public void TestMethod()
        {
            // The ServiceLocator can be initialized for each test.
            using (
                AspectServiceLocator.AddRule<ILogger>(
                    (type, member) =>
                    type == typeof (LogAspect) && member.Name == "TargetMethod" ? new TestLogger() : null)
                )
            {
                TestLogger.Clear();
                TargetMethod();
                Assert.AreEqual("OnEntry" + Environment.NewLine, TestLogger.GetLog());
            }
        }

        [LogAspect]
        public void TargetMethod()
        {
        }
    }

    internal class TestLogger : ILogger
    {
        public static readonly StringBuilder stringBuilder = new StringBuilder();

        public void Log(string message)
        {
            stringBuilder.AppendLine(message);
        }

        public static string GetLog()
        {
            return stringBuilder.ToString();
        }

        public static void Clear()
        {
            stringBuilder.Clear();
        }
    }
}
using System;
using System.Text;
using Microsoft.VisualStudio.TestTools.UnitTesting;

namespace DependencyResolution.Contextual.Test
{
    [TestClass]
    public class TestLogAspect
    {
        [TestMethod]
        public void TestMethod()
        {
            // The ServiceLocator can be initialized for each test.
            using (
                AspectServiceLocator.AddRule<ILogger>(
                    (type, member) =>
                    type == typeof (LogAspect) && member.Name == "TargetMethod" ? new TestLogger() : null)
                )
            {
                TestLogger.Clear();
                TargetMethod();
                Assert.AreEqual("OnEntry" + Environment.NewLine, TestLogger.GetLog());
            }
        }

        [LogAspect]
        public void TargetMethod()
        {
        }
    }

    internal class TestLogger : ILogger
    {
        public static readonly StringBuilder stringBuilder = new StringBuilder();

        public void Log(string message)
        {
            stringBuilder.AppendLine(message);
        }

        public static string GetLog()
        {
            return stringBuilder.ToString();
        }

        public static void Clear()
        {
            stringBuilder.Clear();
        }
    }
}

Online Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


Importing Dependencies from the Target Object

Importing Dependencies from the Target Object PostSharp Documentation

The principal reason why aspects are believed to be difficult to test is that they are statically scoped by default, i.e. aspect objects are stored in static fields. However, any aspect can be made instance-scoped if it implements the IInstanceScopedAspect interface. See Understanding Aspect Lifetime and Scope for more information about aspect scopes.

Instance-scoped aspects can consume dependencies from the objects to which they are applied. They can also add dependencies to the target objects.

For instance, an aspect can consume a service ILogger using the following procedure:

To consume a service from an instance-scoped aspect:

  1. Add a public property of name Logger and type ILogger to the aspect and add the IntroduceMemberAttribute custom attribute. This will cause the aspect to add a property to the target class. Use the parameter MemberOverrideAction.Ignore to ignore the property if it already exists in the target type of if it has been added by another aspect.

  2. Add two custom attributes Online ImportAttribute and CopyCustomAttributesAttribute to the Logger property. This will cause the aspect to add the [Import] custom attribute to the Logger property added to the target class.

  3. Add a public field of name LoggerProperty and type Property<ILogger> to the aspect class and add the ImportMemberAttribute custom attribute to this field, with "Logger" as parameter. This will allow the aspect to read the Logger property even if it has been defined from outside the aspect.

  4. The aspect can now consume the dependency by calling this.LoggerProperty.Get().

The procedure is illustrated in the next example.

Example: testable logging aspect that consumes the dependency from the target object
Logging aspect and production code
View Colorized Copy to Clipboard Print
using System;
using System.Collections.Generic;
using System.ComponentModel.Composition;
using System.ComponentModel.Composition.Hosting;
using System.ComponentModel.Composition.Primitives;
using System.ComponentModel.Design;
using System.Reflection;
using PostSharp.Aspects;
using PostSharp.Aspects.Advices;
using PostSharp.Extensibility;
using PostSharp.Reflection;

namespace DependencyResolution.InstanceScoped
{
    public interface ILogger
    {
        void Log(string message);
    }

    [Serializable]
    public class LogAspect : OnMethodBoundaryAspect, IInstanceScopedAspect
    {
        [IntroduceMember(Visibility = Visibility.Family, OverrideAction = MemberOverrideAction.Ignore)]
        [CopyCustomAttributes(typeof (ImportAttribute))]
        [Import(typeof(ILogger))]
        public ILogger Logger { get; set; }

        [ImportMember("Logger", IsRequired = true)]
        public Property<ILogger> LoggerProperty;

        public override void OnEntry(MethodExecutionArgs args)
        {
            this.LoggerProperty.Get().Log("OnEntry");
        }

        object IInstanceScopedAspect.CreateInstance(AdviceArgs adviceArgs)
        {
            return this.MemberwiseClone();
        }

        void IInstanceScopedAspect.RuntimeInitializeInstance()
        {
        }
    }

    [Export(typeof (MyServiceImpl))]
    internal class MyServiceImpl
    {
        [LogAspect]
        public void LoggedMethod()
        {
            Console.WriteLine("Hello, world.");
        }
    }

    internal class Program
    {
        private static void Main(string[] args)
        {
            AssemblyCatalog catalog = new AssemblyCatalog(typeof (Program).Assembly);
            CompositionContainer container = new CompositionContainer(catalog);
            MyServiceImpl service = container.GetExport<MyServiceImpl>().Value;
            service.LoggedMethod();
        }
    }

    [Export(typeof (ILogger))]
    internal class ConsoleLogger : ILogger
    {
        public void Log(string message)
        {
            Console.WriteLine(message);
        }
    }
}
using System;
using System.Collections.Generic;
using System.ComponentModel.Composition;
using System.ComponentModel.Composition.Hosting;
using System.ComponentModel.Composition.Primitives;
using System.ComponentModel.Design;
using System.Reflection;
using PostSharp.Aspects;
using PostSharp.Aspects.Advices;
using PostSharp.Extensibility;
using PostSharp.Reflection;

namespace DependencyResolution.InstanceScoped
{
    public interface ILogger
    {
        void Log(string message);
    }

    [Serializable]
    public class LogAspect : OnMethodBoundaryAspect, IInstanceScopedAspect
    {
        [IntroduceMember(Visibility = Visibility.Family, OverrideAction = MemberOverrideAction.Ignore)]
        [CopyCustomAttributes(typeof (ImportAttribute))]
        [Import(typeof(ILogger))]
        public ILogger Logger { get; set; }

        [ImportMember("Logger", IsRequired = true)]
        public Property<ILogger> LoggerProperty;

        public override void OnEntry(MethodExecutionArgs args)
        {
            this.LoggerProperty.Get().Log("OnEntry");
        }

        object IInstanceScopedAspect.CreateInstance(AdviceArgs adviceArgs)
        {
            return this.MemberwiseClone();
        }

        void IInstanceScopedAspect.RuntimeInitializeInstance()
        {
        }
    }

    [Export(typeof (MyServiceImpl))]
    internal class MyServiceImpl
    {
        [LogAspect]
        public void LoggedMethod()
        {
            Console.WriteLine("Hello, world.");
        }
    }

    internal class Program
    {
        private static void Main(string[] args)
        {
            AssemblyCatalog catalog = new AssemblyCatalog(typeof (Program).Assembly);
            CompositionContainer container = new CompositionContainer(catalog);
            MyServiceImpl service = container.GetExport<MyServiceImpl>().Value;
            service.LoggedMethod();
        }
    }

    [Export(typeof (ILogger))]
    internal class ConsoleLogger : ILogger
    {
        public void Log(string message)
        {
            Console.WriteLine(message);
        }
    }
}
Testing code
View Colorized Copy to Clipboard Print
using System;
using System.ComponentModel.Composition;
using System.ComponentModel.Composition.Hosting;
using System.Text;
using Microsoft.VisualStudio.TestTools.UnitTesting;

namespace DependencyResolution.InstanceScoped.Test
{
    [TestClass]
    public class TestLogAspect
    {
        [TestMethod]
        public void TestMethod()
        {
            TypeCatalog catalog = new TypeCatalog(typeof (TestLogger), typeof (TestImpl));
            CompositionContainer container = new CompositionContainer(catalog);
            TestImpl service = container.GetExport<TestImpl>().Value;
            TestLogger.Clear();
            service.TargetMethod();
            Assert.AreEqual("OnEntry" + Environment.NewLine, TestLogger.GetLog());
        }

        [Export(typeof (TestImpl))]
        private class TestImpl
        {
            [LogAspect]
            public void TargetMethod()
            {
            }
        }
    }

    [Export(typeof (ILogger))]
    internal class TestLogger : ILogger
    {
        public static readonly StringBuilder stringBuilder = new StringBuilder();

        public void Log(string message)
        {
            stringBuilder.AppendLine(message);
        }

        public static string GetLog()
        {
            return stringBuilder.ToString();
        }

        public static void Clear()
        {
            stringBuilder.Clear();
        }
    }
}
using System;
using System.ComponentModel.Composition;
using System.ComponentModel.Composition.Hosting;
using System.Text;
using Microsoft.VisualStudio.TestTools.UnitTesting;

namespace DependencyResolution.InstanceScoped.Test
{
    [TestClass]
    public class TestLogAspect
    {
        [TestMethod]
        public void TestMethod()
        {
            TypeCatalog catalog = new TypeCatalog(typeof (TestLogger), typeof (TestImpl));
            CompositionContainer container = new CompositionContainer(catalog);
            TestImpl service = container.GetExport<TestImpl>().Value;
            TestLogger.Clear();
            service.TargetMethod();
            Assert.AreEqual("OnEntry" + Environment.NewLine, TestLogger.GetLog());
        }

        [Export(typeof (TestImpl))]
        private class TestImpl
        {
            [LogAspect]
            public void TargetMethod()
            {
            }
        }
    }

    [Export(typeof (ILogger))]
    internal class TestLogger : ILogger
    {
        public static readonly StringBuilder stringBuilder = new StringBuilder();

        public void Log(string message)
        {
            stringBuilder.AppendLine(message);
        }

        public static string GetLog()
        {
            return stringBuilder.ToString();
        }

        public static void Clear()
        {
            stringBuilder.Clear();
        }
    }
}

Online Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


Testing Build-Time Logic

Testing Build-Time Logic PostSharp Documentation

Testing build-time logic of aspects has specific challenges:

  • Aspects can emit errors and warnings, which cannot be tested using a run-time testing framework. We need a mechanism to test error messages themselves.
  • When a project contains a large number of test cases (which are all compiled at the same time), it is difficult to isolate one specific case when the debugger is attached to the build process (see Attaching a Debugger at Build Time). We need a mechanism to run the build process on a single test case.

Therefore, we built a test framework specifically for the purpose of testing aspects.

This topic contains the following sections.

  • Creating an aspect unit test project
  • Executing a single test
  • Executing all tests from a directory
  • Executing all tests in the project directory
  • Test that messages are emitted
  • Allow unsafe code
  • Creating a reference assembly
Creating an aspect unit test project

To create an aspect unit test project:

  1. Create a console project and add all required references to it.

  2. Add PostSharp to this project

  3. Edit the project file using a text editor. The project file must import PostSharp.BuildTests.targets before Microsoft.CSharp.targets ( Online download). File PostSharp.targets also needs to be included (which is the case if the PostSharp NuGet package is added to the project).

  4. Implement each test case as a standalone file having its own Program class and Main method. To avoid naming conflicts, every file should have a distinct namespace.

A test is considered successful in the following situations:

  • the test compiles using the C# or VB compiler, and
  • the test compiles using PostSharp without any unexpected message (see below), and
  • the output exe is valid according PEVERIFY, and
  • the output exe executes successfully and returns the exit code 0,

This default behavior can be altered by test directives, as described below.

Executing a single test

Execute the following line from the command prompt:

View Colorized Copy to Clipboard Print
msbuild /t:TestOne /p:Source=MyFile.cs
msbuild /t:TestOne /p:Source=MyFile.cs
Executing all tests from a directory

Execute the following line from the command prompt:

View Colorized Copy to Clipboard Print
msbuild /t:Test /p:SourceDir=MyDirectory
msbuild /t:Test /p:SourceDir=MyDirectory
Executing all tests in the project directory

Execute the following line from the command prompt:

View Colorized Copy to Clipboard Print
msbuild /t:Test
msbuild /t:Test
Test that messages are emitted

If the test is expected to emit a message (error, warning, information), insert the text @ExpectedMessage(PS0001) in the test file as a comment line.

If this directive is present, the test will be valid if and only if all expected messages, and no other, have been emitted.

Allow unsafe code

To enable unsafe code and disable verification by PEVERIFY, insert the text @Unsafe in the test file as a comment line.

Creating a reference assembly

In case that a test requires a dependency assembly (typically, for tests that require two assemblies, for instance testing aspect inheritance that cross assembly boundaries), you can create a second file named MyTest.Dependency.cs, if the first file is named MyTest.cs. This will create an assembly MyTest.Dependency.dll, and main test will have a reference to this assembly.

Online Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


Attaching a Debugger at Build Time

Attaching a Debugger at Build Time PostSharp Documentation

It may seem unusual to debug compile-time logic, but like any process, it is perfectly legal and even simple to debug the build process!

Basically, what you will do is to attach a debugger to the PostSharp process. If you use the standard MSBuild targets for PostSharp, define the constant PostSharpAttachDebugger=True.

The trick is easier to explain when you have compile-time logic (your aspect, for instance) and the transformed assembly in different Visual Studio projects.

Suppose you have your aspects logic MyAspects.csproj and unit tests (i.e. the code to be transformed) in MyAspects.Test.csproj. The easiest way to debug MyAspects.csproj is to:

  1. Open MyAspects.csproj and MyAspects.Test.csproj in two different instances of Visual Studio.

  2. Open the Visual Studio Command Prompt and go to the directory containing MyAspects.Test.csproj.

  3. Build MyAspects.csproj using Visual Studio as usually .

  4. From the command prompt, type:

    msbuild MyAspects.Test.csproj /T:Rebuild /P:PostSharpAttachDebugger=True

  5. The build process will hit a break point. When it happens, attach the instance of MyAspects.csproj Visual Studio. Set up break points in your code and continue the program execution.

Online Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


Advanced

Advanced PostSharp Documentation

Online Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


Coping with Custom Object Serializers

Coping with Custom Object Serializers PostSharp Documentation

Some aspects need to be initialized when a new instance of the class to which they are applied is created. For instance, instance-scoped aspect must be cloned from the prototype; members imported into the through ImportMemberAttribute must be bound to aspect fields.

PostSharp enhances every constructor of every enhanced class so that aspects are properly initialized.

However, it is possible to create new instances of classes by bypassing the constructor. This happens, for instance, when classes are deserialized by the Online BinaryFormatter or the Online DataContractSerializer. These formatters use the method FormatterServicesGetUnitializedObject(Type) to create new instances, but this method bypasses all constructors.

PostSharp implements a workaround for the deserializers Online BinaryFormatter and Online DataContractSerializer: it creates or modifies a method annotated by the custom attribute Online OnDeserializingAttribute, so that aspects are initialized properly.

However, if you are using a custom deserializer, or for any reason create instances using the method the method FormatterServicesGetUnitializedObject(Type), you will have to initialize aspects manually.

Initializing Aspects Manually

There are many possible ways to initialize an aspect from user code.

By Defining a Method InitializeAspects

You can define in your classes (typically in one of the root classes of your class hierarchy) a method with the following name and signature:

C#
VB
C++
F#
View Colorized Copy to Clipboard Print
protected virtual void InitializeAspects();
protected virtual void InitializeAspects();

              When PostSharp discovers this method, it will insert its own
              initialization logic at the beginning of the InitializeAspects method. The
              original logic is not deleted. This method can safely have an empty implementation.

              The following constraints apply:

  •
                  The method should be virtual unless the class is sealed.

  •
                  The method should be protected or public, unless the class is internal.

              For instance, the following class would enable aspects (applied on this class or on derived classes) to be initialized after deserialization
              (note that PostSharp automatically generates this code for   Online BinaryFormatter
              and   Online DataContractSerializer; you only need to do it manually for
              a custom serializer).

C#
VB
C++
F#
View Colorized Copy to Clipboard Print
[DataContract]
public abstract class BaseClass
{
  protected virtual void InitializeAspects()
  {
  }

  [OnDeserializing]
  private void OnDeserializingInitializeAspects()
  {
    this.InitializeAspects();
  }
}
[DataContract]
public abstract class BaseClass
{
  protected virtual void InitializeAspects()
  {
  }

  [OnDeserializing]
  private void OnDeserializingInitializeAspects()
  {
    this.InitializeAspects();
  }
}
By Invoking AspectUtilities.InitializeCurrentAspects

              Instead of providing an empty method InitializeAspects, it
              is possible to invoke the method
              AspectUtilities InitializeCurrentAspects .
              A call to this method will be translated into a call to InitializeAspects. It has to be invoked from a non-static method of an
              enhanced class.

              If the class from which InitializeCurrentAspects  is invoked
              has not been enhanced by an aspect requiring initialization, the call to this
              method is simply ignored.

  Note  Note

                Using this approach may be brittle in some situations:
                calls to  InitializeCurrentAspects  will have no effect if
                aspects are applied to derived classes, but not to the calling class. In this
                scenario, it is preferable to define the method InitializeAspects.

  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


Configuring Aspects

Configuring Aspects PostSharp Documentation

Configuration settings of aspects determine how they should be processed by their weaver. Configuration settings are always evaluated at build time. Most aspects have one or many of them. For instance, the aspect type OnExceptionAspect has a configuration setting determining the type of exceptions handled with this aspect.

There are two ways to configure an aspect: declarative and imperative.

Declarative Configuration

You can configure an aspect declaratively by applying the appropriate custom attribute on the aspect class. Aspect configuration attributes are in the namespace PostSharp.Aspects.Configuration. Every aspect type has its corresponding type of configuration attribute. The name of the custom attribute starts with the name of the aspect and has the suffix ConfigurationAttribute. For instance, the configuration attribute of the aspect class OnExceptionAspect is OnExceptionAspectConfigurationAttribute.

Declarative configuration has always precedence over imperative configuration: if some property of the configuration custom attribute is set on the aspect class, or on any parent, the corresponding imperative semantic will not be evaluated.

Once a configuration property has been set in a parent class, it cannot be overwritten in a child class.

Note that these restrictions are enforced at the level of properties. If a property of a configuration custom attribute is not set in a parent class, it can still be overwritten in a child class or by an imperative semantic.

Imperative Configuration

A second way to configure an aspect class is to override its configuration methods or set its configuration property.

Note Note
Imperative configuration is only available when you target the full .NET Framework. It is not available for Silverlight or the Compact Framework.

Benefits of Imperative Configuration

The advantage of imperative configuration is that it can be arbitrarily complex (since the code of the configuration method is executed inside the weaver). Specifically, it allows the configuration to be dependent on how the aspect is actually used, for instance the configuration can depend on the value of a property of the aspect custom attribute.

Implementation Note

Under the hood, aspects implement the method IAspectBuildSemantics GetAspectConfiguration(Object). This method should return a configuration object, derived from the class AspectConfiguration. Every aspect class has its own aspect configuration class. For instance, the configuration attribute of the aspect class OnExceptionAspect is OnExceptionAspectConfiguration. The aspect type OnExceptionAspect implements IAspectBuildSemantics GetAspectConfiguration(Object) by creating an instance of OnExceptionAspectConfiguration, then it invokes the method OnExceptionAspect GetExceptionType(MethodBase) and copies the return value of this method to the property OnExceptionAspectConfiguration ExceptionType. Therefore, there are two ways to configure an aspect: either by overriding configuration methods and setting configuration properties (these methods and properties are provided by the framework for convenience only), or by implementing the method IAspectBuildSemantics GetAspectConfiguration(Object). If your aspect does not derive from the aspect class OnExceptionAspect, but directly implements the aspect interface IOnExceptionAspect, you can use only the later method.

Online Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


Examples

Examples PostSharp Documentation

Online Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


Example: Tracing Method Execution

Example: Tracing Method Execution PostSharp Documentation

This code implements an aspect that writes a trace message before and after the execution of the methods to which the aspect is applied.

Requirements

PostSharp 2.0 Community Edition or higher

Demonstrates

The example demonstrates the use of OnMethodBoundaryAspect, and shows how to use RuntimeInitialize(MethodBase) to improve runtime performance.

Example
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
using System;
using System.Diagnostics;
using System.Reflection;
using PostSharp.Aspects;

namespace Samples
{
    [Serializable]
    public sealed class TraceAttribute : OnMethodBoundaryAspect
    {
        // This field is initialized and serialized at build time, then deserialized at runtime.
        private readonly string category;

        // These fields are initialized at runtime. They do not need to be serialized.
        [NonSerialized] private string enteringMessage;
        [NonSerialized] private string exitingMessage;

        // Default constructor, invoked at build time.
        public TraceAttribute()
        {
        }

        // Constructor specifying the tracing category, invoked at build time.
        public TraceAttribute(string category)
        {
            this.category = category;
        }

        // Invoked only once at runtime from the static constructor of type declaring the target method.
        public override void RuntimeInitialize(MethodBase method)
        {
            string methodName = method.DeclaringType.FullName + method.Name;
            this.enteringMessage = "Entering " + methodName;
            this.exitingMessage = "Exiting " + methodName;
        }

        // Invoked at runtime before that target method is invoked.
        public override void OnEntry(MethodExecutionArgs args)
        {
            Trace.WriteLine(this.enteringMessage, this.category);
        }

        // Invoked at runtime after the target method is invoked (in a finally block).
        public override void OnExit(MethodExecutionArgs args)
        {
            Trace.WriteLine(this.exitingMessage, this.category);
        }
    }
}
using System;
using System.Diagnostics;
using System.Reflection;
using PostSharp.Aspects;

namespace Samples
{
    [Serializable]
    public sealed class TraceAttribute : OnMethodBoundaryAspect
    {
        // This field is initialized and serialized at build time, then deserialized at runtime.
        private readonly string category;

        // These fields are initialized at runtime. They do not need to be serialized.
        [NonSerialized] private string enteringMessage;
        [NonSerialized] private string exitingMessage;

        // Default constructor, invoked at build time.
        public TraceAttribute()
        {
        }

        // Constructor specifying the tracing category, invoked at build time.
        public TraceAttribute(string category)
        {
            this.category = category;
        }

        // Invoked only once at runtime from the static constructor of type declaring the target method.
        public override void RuntimeInitialize(MethodBase method)
        {
            string methodName = method.DeclaringType.FullName + method.Name;
            this.enteringMessage = "Entering " + methodName;
            this.exitingMessage = "Exiting " + methodName;
        }

        // Invoked at runtime before that target method is invoked.
        public override void OnEntry(MethodExecutionArgs args)
        {
            Trace.WriteLine(this.enteringMessage, this.category);
        }

        // Invoked at runtime after the target method is invoked (in a finally block).
        public override void OnExit(MethodExecutionArgs args)
        {
            Trace.WriteLine(this.exitingMessage, this.category);
        }
    }
}
Remarks

        Note that fields enteringMessage and exitingMessage are initialized from method RuntimeInitialize. This method is invoked only once, before
        the aspect instance is used for the first time. It may have been possible to format the trace message from methods OnEntry and OnExit, but doing so
        would hurt performance for two reasons:

  1.
          Getting the reflection object (  Online MethodBase) is rather expensive.

  2.
            Concatenating a string creates a new string instance, which causes an overhead to memory allocation and garbage collection.

        The aspect results in instructions that can be inlined by the JIT/NGen compiler, which makes the aspect almost as fast as hand-written code.

  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


Example: Handling Exceptions

Example: Handling Exceptions PostSharp Documentation

This code is an aspect that handles exceptions by opening a message box. It is useful in WPF applications to handle specific exceptions, for instance of type Online IOException

Requirements

PostSharp 2.0 Community Edition or higher

Demonstrates

This example demonstrates the aspect type OnExceptionAspect.

Example
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
using System;
using System.Reflection;
using System.Windows;
using PostSharp.Aspects;

namespace Samples
{
    [Serializable]
    public sealed class ExceptionDialogAttribute : OnExceptionAspect
    {
        // We don't need this field at runtime, so we don't serialize it.
        [NonSerialized] private readonly Type exceptionType;

        public ExceptionDialogAttribute() : this(null)
        {
        }

        public ExceptionDialogAttribute(Type exceptionType)
        {
            this.exceptionType = exceptionType;

            // Set the default value for the dialog box.
            this.Message = "{0}";
            this.Caption = "Error";
        }

        public string Message { get; set; }
        public string Caption { get; set; }

        // Method invoked at build time. Should return the type of exceptions to be handled.
        public override Type GetExceptionType(MethodBase method)
        {
            return this.exceptionType;
        }

        // Method invoked at run time.
        public override void OnException(MethodExecutionArgs args)
        {
            // Format the exception message.
            string message = string.Format(this.Message, args.Exception.Message);

            // Finds the parent window of the dialog box.
            DependencyObject dependencyObject = args.Instance as DependencyObject;
            Window window = null;
            if (dependencyObject != null)
            {
                window = Window.GetWindow(dependencyObject);
            }

            if (window != null)
            {
                // Display the error dialog with a parent window.
                MessageBox.Show(window, message, this.Caption, MessageBoxButton.OK, MessageBoxImage.Error);
            }
            else
            {
                // Display the error dialog without a parent window.
                MessageBox.Show(message, this.Caption, MessageBoxButton.OK, MessageBoxImage.Error);
            }

            // Do not rethrow the exception.
            args.FlowBehavior = FlowBehavior.Return;
        }
    }
}
using System;
using System.Reflection;
using System.Windows;
using PostSharp.Aspects;

namespace Samples
{
    [Serializable]
    public sealed class ExceptionDialogAttribute : OnExceptionAspect
    {
        // We don't need this field at runtime, so we don't serialize it.
        [NonSerialized] private readonly Type exceptionType;

        public ExceptionDialogAttribute() : this(null)
        {
        }

        public ExceptionDialogAttribute(Type exceptionType)
        {
            this.exceptionType = exceptionType;

            // Set the default value for the dialog box.
            this.Message = "{0}";
            this.Caption = "Error";
        }

        public string Message { get; set; }
        public string Caption { get; set; }

        // Method invoked at build time. Should return the type of exceptions to be handled.
        public override Type GetExceptionType(MethodBase method)
        {
            return this.exceptionType;
        }

        // Method invoked at run time.
        public override void OnException(MethodExecutionArgs args)
        {
            // Format the exception message.
            string message = string.Format(this.Message, args.Exception.Message);

            // Finds the parent window of the dialog box.
            DependencyObject dependencyObject = args.Instance as DependencyObject;
            Window window = null;
            if (dependencyObject != null)
            {
                window = Window.GetWindow(dependencyObject);
            }

            if (window != null)
            {
                // Display the error dialog with a parent window.
                MessageBox.Show(window, message, this.Caption, MessageBoxButton.OK, MessageBoxImage.Error);
            }
            else
            {
                // Display the error dialog without a parent window.
                MessageBox.Show(message, this.Caption, MessageBoxButton.OK, MessageBoxImage.Error);
            }

            // Do not rethrow the exception.
            args.FlowBehavior = FlowBehavior.Return;
        }
    }
}
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


Example: Caching the Result of a Method

Example: Caching the Result of a Method PostSharp Documentation

The following class implements an aspect that caches the return value of methods to which it is applied.

Requirements

PostSharp 2.0 Community Edition or higher

Demonstrates

The example demonstrates the use of OnMethodBoundaryAspect, and shows how to use FlowBehavior to skip the execution of a method when its value is found in cache. The property MethodExecutionTag is used to store the cache key between the OnEntry and OnSuccess advices.

Example
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
using System;
using System.Reflection;
using System.Text;
using System.Web;
using PostSharp.Aspects;

namespace Samples
{
    [Serializable]
    public sealed class CacheAttribute : OnMethodBoundaryAspect
    {
        // This field will be set by CompileTimeInitialize and serialized at build time,
        // then deserialized at runtime.
        private string methodName;

        // Method executed at build time.
        public override void CompileTimeInitialize(MethodBase method, AspectInfo aspectInfo)
        {
            this.methodName = method.DeclaringType.FullName + "." + method.Name;
        }

        private string GetCacheKey(object instance, Arguments arguments)
        {
            // If we have no argument, return just the method name so we don't uselessly allocate memory.
            if (instance == null && arguments.Count == 0)
                return this.methodName;

            // Add all arguments to the cache key. Note that generic arguments are not part of the cache
            // key, so method calls that differ only by generic arguments will have conflicting cache keys.
            StringBuilder stringBuilder = new StringBuilder(this.methodName);
            stringBuilder.Append('(');
            if (instance != null)
            {
                stringBuilder.Append(instance);
                stringBuilder.Append("; ");
            }

            for (int i = 0; i < arguments.Count; i++)
            {
                stringBuilder.Append(arguments.GetArgument(i) ?? "null");
                stringBuilder.Append(", ");
            }

            return stringBuilder.ToString();
        }

        // This method is executed before the execution of target methods of this aspect.
        public override void OnEntry(MethodExecutionArgs args)
        {
            // Compute the cache key.
            string cacheKey = GetCacheKey(args.Instance, args.Arguments);

            // Fetch the value from the cache.
            object value = HttpRuntime.Cache[cacheKey];

            if (value != null)
            {
                // The value was found in cache. Don't execute the method. Return immediately.
                args.ReturnValue = value;
                args.FlowBehavior = FlowBehavior.Return;
            }
            else
            {
                // The value was NOT found in cache. Continue with method execution, but store
                // the cache key so that we don't have to compute it in OnSuccess.
                args.MethodExecutionTag = cacheKey;
            }
        }

        // This method is executed upon successful completion of target methods of this aspect.
        public override void OnSuccess(MethodExecutionArgs args)
        {
            string cacheKey = (string) args.MethodExecutionTag;
            HttpRuntime.Cache[cacheKey] = args.ReturnValue;
        }
    }
}
using System;
using System.Reflection;
using System.Text;
using System.Web;
using PostSharp.Aspects;

namespace Samples
{
    [Serializable]
    public sealed class CacheAttribute : OnMethodBoundaryAspect
    {
        // This field will be set by CompileTimeInitialize and serialized at build time,
        // then deserialized at runtime.
        private string methodName;

        // Method executed at build time.
        public override void CompileTimeInitialize(MethodBase method, AspectInfo aspectInfo)
        {
            this.methodName = method.DeclaringType.FullName + "." + method.Name;
        }

        private string GetCacheKey(object instance, Arguments arguments)
        {
            // If we have no argument, return just the method name so we don't uselessly allocate memory.
            if (instance == null && arguments.Count == 0)
                return this.methodName;

            // Add all arguments to the cache key. Note that generic arguments are not part of the cache
            // key, so method calls that differ only by generic arguments will have conflicting cache keys.
            StringBuilder stringBuilder = new StringBuilder(this.methodName);
            stringBuilder.Append('(');
            if (instance != null)
            {
                stringBuilder.Append(instance);
                stringBuilder.Append("; ");
            }

            for (int i = 0; i < arguments.Count; i++)
            {
                stringBuilder.Append(arguments.GetArgument(i) ?? "null");
                stringBuilder.Append(", ");
            }

            return stringBuilder.ToString();
        }

        // This method is executed before the execution of target methods of this aspect.
        public override void OnEntry(MethodExecutionArgs args)
        {
            // Compute the cache key.
            string cacheKey = GetCacheKey(args.Instance, args.Arguments);

            // Fetch the value from the cache.
            object value = HttpRuntime.Cache[cacheKey];

            if (value != null)
            {
                // The value was found in cache. Don't execute the method. Return immediately.
                args.ReturnValue = value;
                args.FlowBehavior = FlowBehavior.Return;
            }
            else
            {
                // The value was NOT found in cache. Continue with method execution, but store
                // the cache key so that we don't have to compute it in OnSuccess.
                args.MethodExecutionTag = cacheKey;
            }
        }

        // This method is executed upon successful completion of target methods of this aspect.
        public override void OnSuccess(MethodExecutionArgs args)
        {
            string cacheKey = (string) args.MethodExecutionTag;
            HttpRuntime.Cache[cacheKey] = args.ReturnValue;
        }
    }
}
Remarks

          Note that the field methodName is initialized from method
          CompileTimeInitialize(MethodBase, AspectInfo). This method is invoked at build time,
          then the value of the field is serialized into the assembly. Thanks to this mechanism, no reflection is needed at runtime.

See Also
Reference
OnMethodBoundaryAspect
MethodExecutionArgs FlowBehavior
MethodLevelAspect CompileTimeInitialize(MethodBase, AspectInfo)
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


Example: Dispatching a Method Execution to the GUI Thread

Example: Dispatching a Method Execution to the GUI Thread PostSharp Documentation

This code implements an aspect that causes methods to which it is applied to be invoked on the GUI thread. Indeed, properties and methods of WPF objects can be accessed only from the thread from which the object was created. Other threads must use the Dispatcher of this object to dispatch the invocation of the method to the GUI thread. The Asynchronous property of this aspect allows the developer to specify that the method should be invoked asynchronously; in this case, the current thread will not wait until completion of the intercepted method.

Requirements

PostSharp 2.0 Community Edition or higher

Demonstrates

This example demonstrates the use of MethodInterceptionAspect to intercept invocations of method. Additionally, it shows bow to use CompileTimeValidate(MethodBase) to check that the aspect has been applied on a valid method.

Example
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
using System;
using System.Linq;
using System.Reflection;
using System.Windows.Threading;
using PostSharp.Aspects;
using PostSharp.Extensibility;

namespace Samples
{
    [Serializable]
    [MulticastAttributeUsage(MulticastTargets.Method, TargetMemberAttributes = MulticastAttributes.Instance)]
    [AttributeUsage(AttributeTargets.Assembly | AttributeTargets.Class | AttributeTargets.Method, AllowMultiple = true)]
    public class GuiThreadAttribute : MethodInterceptionAspect
    {
        public bool Asynchronous { get; set; }

        // Method invoked at build time. It validates that the aspect has been applied to an acceptable method.
        public override bool CompileTimeValidate(MethodBase method)
        {
            // The method must be in a type derived from DispatcherObject.
            if (!typeof (DispatcherObject).IsAssignableFrom(method.DeclaringType))
            {
                Message.Write(SeverityType.Error, "CUSTOM02",
                              "Cannot apply [GuiThread] to method {0} because it is not a member of a type " +
                              "derived from DispatcherObject.", method);
                return false;
            }

            // If the call is asynchronous, there should not be any return value or ByRef parameter.
            if (this.Asynchronous)
            {
                if (((MethodInfo) method).ReturnType == typeof (void) ||
                    method.GetParameters().Any(parameter => parameter.ParameterType.IsByRef))
                {
                    Message.Write(SeverityType.Error, "CUSTOM02",
                                  "Cannot apply [GuiThread(Asynchronous=true)] to method {0} because it is not a member " +
                                  "of a type derived from DispatcherObject.", method);
                    return false;
                }
            }

            return true;
        }

        // Method invoked at run time _instead_ of the intercepted method.
        public override void OnInvoke(MethodInterceptionArgs args)
        {
            // Get the graphic object.
            DispatcherObject dispatcherObject = (DispatcherObject) args.Instance;

            // Check whether the current thread has access to this object.
            if (dispatcherObject.CheckAccess())
            {
                // We have access. Proceed with invocation.
                args.Proceed();
            }
            else
            {
                // We don't have access. Invoke the method synchronously.
                if (this.Asynchronous)
                {
                    dispatcherObject.Dispatcher.BeginInvoke(DispatcherPriority.Normal, new Action(args.Proceed));
                }
                else
                {
                    dispatcherObject.Dispatcher.Invoke(DispatcherPriority.Normal, new Action(args.Proceed));
                }
            }
        }
    }
}
using System;
using System.Linq;
using System.Reflection;
using System.Windows.Threading;
using PostSharp.Aspects;
using PostSharp.Extensibility;

namespace Samples
{
    [Serializable]
    [MulticastAttributeUsage(MulticastTargets.Method, TargetMemberAttributes = MulticastAttributes.Instance)]
    [AttributeUsage(AttributeTargets.Assembly | AttributeTargets.Class | AttributeTargets.Method, AllowMultiple = true)]
    public class GuiThreadAttribute : MethodInterceptionAspect
    {
        public bool Asynchronous { get; set; }

        // Method invoked at build time. It validates that the aspect has been applied to an acceptable method.
        public override bool CompileTimeValidate(MethodBase method)
        {
            // The method must be in a type derived from DispatcherObject.
            if (!typeof (DispatcherObject).IsAssignableFrom(method.DeclaringType))
            {
                Message.Write(SeverityType.Error, "CUSTOM02",
                              "Cannot apply [GuiThread] to method {0} because it is not a member of a type " +
                              "derived from DispatcherObject.", method);
                return false;
            }

            // If the call is asynchronous, there should not be any return value or ByRef parameter.
            if (this.Asynchronous)
            {
                if (((MethodInfo) method).ReturnType == typeof (void) ||
                    method.GetParameters().Any(parameter => parameter.ParameterType.IsByRef))
                {
                    Message.Write(SeverityType.Error, "CUSTOM02",
                                  "Cannot apply [GuiThread(Asynchronous=true)] to method {0} because it is not a member " +
                                  "of a type derived from DispatcherObject.", method);
                    return false;
                }
            }

            return true;
        }

        // Method invoked at run time _instead_ of the intercepted method.
        public override void OnInvoke(MethodInterceptionArgs args)
        {
            // Get the graphic object.
            DispatcherObject dispatcherObject = (DispatcherObject) args.Instance;

            // Check whether the current thread has access to this object.
            if (dispatcherObject.CheckAccess())
            {
                // We have access. Proceed with invocation.
                args.Proceed();
            }
            else
            {
                // We don't have access. Invoke the method synchronously.
                if (this.Asynchronous)
                {
                    dispatcherObject.Dispatcher.BeginInvoke(DispatcherPriority.Normal, new Action(args.Proceed));
                }
                else
                {
                    dispatcherObject.Dispatcher.Invoke(DispatcherPriority.Normal, new Action(args.Proceed));
                }
            }
        }
    }
}
See Also
Reference
MethodInterceptionAspect
CompileTimeValidate(MethodBase)
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


Example: Backing a Property with a Registry Value

Example: Backing a Property with a Registry Value PostSharp Documentation

This code is an aspect that binds a field or a property with a registry value. The first time the field or property is read, its value is retrieved from registry. Whenever the field or property is written, its value is written to registry.

Requirements

PostSharp 2.0 Community Edition or higher

Demonstrates

This example illustrates the use of the aspect type LocationInterceptionAspect in a situation where the location getter invokes the setter. It shows how the aspect can implement IInstanceScopedAspect to get the same scope (static or instance) than the location to which it is applied; thanks to this, we can use an aspect field (fetchedFromRegistry) to store the information whether the value has already been fetched from registry.

Example
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
using System;
using Microsoft.Win32;
using PostSharp.Aspects;

namespace Samples
{
    public sealed class RegistryValueAttribute : LocationInterceptionAspect, IInstanceScopedAspect
    {
        // True if the the value has already been fetched from registry and stored in the field or property.
        // It is not serialize since we don't need it at build time.
        [NonSerialized] private bool fetchedFromRegistry;

        public RegistryValueAttribute(string keyName, string valueName)
        {
            this.KeyName = keyName;
            this.ValueName = valueName;
        }

        public string KeyName { get; private set; }
        public string ValueName { get; private set; }
        public object DefaultValue { get; set; }

        // Invoked at runtime whenever someone gets the value of the field or property.
        public override void OnGetValue(LocationInterceptionArgs args)
        {
            if (!this.fetchedFromRegistry)
            {
                // We have not fetched the value from registry. Do it now.
                object value = Registry.GetValue(this.KeyName, this.ValueName, this.DefaultValue);

                // Store this value in the target field/property.
                args.SetNewValue(value);

                // Return this value (we don't even need to call the underlying getter).
                args.Value = value;
            }
            else
            {
                // The value is already stored in the field/property, so just call the
                // underlying getter.
                args.ProceedGetValue();
            }
        }

        // Invoked at runtime whenever someone gets the value of the field or property.
        public override void OnSetValue(LocationInterceptionArgs args)
        {
            // Store the new value in registry if it has changed.
            if (Equals(args.Value, args.GetCurrentValue()))
            {
                Registry.SetValue(this.KeyName, this.ValueName, args.Value);
            }

            // Call the underlying setter.
            base.OnSetValue(args);

            // Sets that the underlying field/property already stores the field.
            this.fetchedFromRegistry = true;
        }

        #region Implementation of IInstanceScopedAspect

        object IInstanceScopedAspect.CreateInstance(AdviceArgs adviceArgs)
        {
            return this.MemberwiseClone();
        }

        void IInstanceScopedAspect.RuntimeInitializeInstance()
        {
        }

        #endregion
    }
}
using System;
using Microsoft.Win32;
using PostSharp.Aspects;

namespace Samples
{
    public sealed class RegistryValueAttribute : LocationInterceptionAspect, IInstanceScopedAspect
    {
        // True if the the value has already been fetched from registry and stored in the field or property.
        // It is not serialize since we don't need it at build time.
        [NonSerialized] private bool fetchedFromRegistry;

        public RegistryValueAttribute(string keyName, string valueName)
        {
            this.KeyName = keyName;
            this.ValueName = valueName;
        }

        public string KeyName { get; private set; }
        public string ValueName { get; private set; }
        public object DefaultValue { get; set; }

        // Invoked at runtime whenever someone gets the value of the field or property.
        public override void OnGetValue(LocationInterceptionArgs args)
        {
            if (!this.fetchedFromRegistry)
            {
                // We have not fetched the value from registry. Do it now.
                object value = Registry.GetValue(this.KeyName, this.ValueName, this.DefaultValue);

                // Store this value in the target field/property.
                args.SetNewValue(value);

                // Return this value (we don't even need to call the underlying getter).
                args.Value = value;
            }
            else
            {
                // The value is already stored in the field/property, so just call the
                // underlying getter.
                args.ProceedGetValue();
            }
        }

        // Invoked at runtime whenever someone gets the value of the field or property.
        public override void OnSetValue(LocationInterceptionArgs args)
        {
            // Store the new value in registry if it has changed.
            if (Equals(args.Value, args.GetCurrentValue()))
            {
                Registry.SetValue(this.KeyName, this.ValueName, args.Value);
            }

            // Call the underlying setter.
            base.OnSetValue(args);

            // Sets that the underlying field/property already stores the field.
            this.fetchedFromRegistry = true;
        }

        #region Implementation of IInstanceScopedAspect

        object IInstanceScopedAspect.CreateInstance(AdviceArgs adviceArgs)
        {
            return this.MemberwiseClone();
        }

        void IInstanceScopedAspect.RuntimeInitializeInstance()
        {
        }

        #endregion
    }
}
See Also
Reference
LocationInterceptionAspect
IInstanceScopedAspect
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


Example: Making an Event Asynchronous

Example: Making an Event Asynchronous PostSharp Documentation

This code is an aspect making an event asynchronous. When an event enhanced with this aspect is fired, subscribed handlers are invoked asynchronously. Whenever a subscribed handler fails with an exception, it is removed from the list of subscribers of this event.

Requirements

PostSharp 2.0 Professional Edition or higher

Demonstrates

This example illustrates the use of the aspect type EventInterceptionAspect.

Example
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
using System;
using System.Diagnostics;
using System.Threading.Tasks;
using PostSharp.Aspects;

namespace Samples
{
    [Serializable]
    public sealed class AsyncEventAttribute : EventInterceptionAspect
    {
        public override void OnInvokeHandler(EventInterceptionArgs args)
        {
            // Invoke the event handler asynchronously.
            Task.Factory.StartNew(() => Invoke(args)).Start();
        }

        private static void Invoke(EventInterceptionArgs args)
        {
            try
            {
                // Invoke the event handler.
                args.ProceedInvokeHandler();
            }
            catch (Exception e)
            {
                // Remove the event handler if it failed.
                Trace.TraceError(e.ToString());
                args.ProceedRemoveHandler();
            }
        }
    }
}
using System;
using System.Diagnostics;
using System.Threading.Tasks;
using PostSharp.Aspects;

namespace Samples
{
    [Serializable]
    public sealed class AsyncEventAttribute : EventInterceptionAspect
    {
        public override void OnInvokeHandler(EventInterceptionArgs args)
        {
            // Invoke the event handler asynchronously.
            Task.Factory.StartNew(() => Invoke(args)).Start();
        }

        private static void Invoke(EventInterceptionArgs args)
        {
            try
            {
                // Invoke the event handler.
                args.ProceedInvokeHandler();
            }
            catch (Exception e)
            {
                // Remove the event handler if it failed.
                Trace.TraceError(e.ToString());
                args.ProceedRemoveHandler();
            }
        }
    }
}
See Also
Reference
EventInterceptionAspect
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


Example: Dynamically Introducing an Interface

Example: Dynamically Introducing an Interface PostSharp Documentation

This aspect implement a very general way to compose types using a custom attribute. The custom attribute has two parameters: the type of the interface to be introduced, and the type of the class implementing the interface. This class should have a default constructor.

Requirements

PostSharp 2.0 Community Edition or higher

Demonstrates

This example demonstrates the use of CompositionAspect.

Example
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
using System;
using System.Collections;
using PostSharp;
using PostSharp.Aspects;

namespace Samples
{
    [Serializable]
    public sealed class GeneralComposeAttribute : CompositionAspect
    {
        // We don't need this field at runtime, so we mark it as non-serialized.
        [NonSerialized] private readonly Type interfaceType;

        private readonly Type implementationType;

        public GeneralComposeAttribute(Type interfaceType, Type implementationType)
        {
            this.interfaceType = interfaceType;
            this.implementationType = implementationType;
        }

        // Invoked at build time. We return the interface we want to implement.
        protected override Type[] GetPublicInterfaces(Type targetType)
        {
            return new[] {this.interfaceType};
        }

        // Invoked at run time.
        public override object CreateImplementationObject(AdviceArgs args)
        {
            return Activator.CreateInstance(this.implementationType);
        }
    }

    [GeneralCompose(typeof (IList), typeof (ArrayList))]
    internal class TestCompose
    {
        public TestCompose()
        {
            // Note the use of the Post.Cast method to get the implemented interface.
            IList list = Post.Cast<TestCompose, IList>(this);
            list.Add("apple");
            list.Add("orange");
            list.Add("banana");
        }
    }
}
using System;
using System.Collections;
using PostSharp;
using PostSharp.Aspects;

namespace Samples
{
    [Serializable]
    public sealed class GeneralComposeAttribute : CompositionAspect
    {
        // We don't need this field at runtime, so we mark it as non-serialized.
        [NonSerialized] private readonly Type interfaceType;

        private readonly Type implementationType;

        public GeneralComposeAttribute(Type interfaceType, Type implementationType)
        {
            this.interfaceType = interfaceType;
            this.implementationType = implementationType;
        }

        // Invoked at build time. We return the interface we want to implement.
        protected override Type[] GetPublicInterfaces(Type targetType)
        {
            return new[] {this.interfaceType};
        }

        // Invoked at run time.
        public override object CreateImplementationObject(AdviceArgs args)
        {
            return Activator.CreateInstance(this.implementationType);
        }
    }

    [GeneralCompose(typeof (IList), typeof (ArrayList))]
    internal class TestCompose
    {
        public TestCompose()
        {
            // Note the use of the Post.Cast method to get the implemented interface.
            IList list = Post.Cast<TestCompose, IList>(this);
            list.Add("apple");
            list.Add("orange");
            list.Add("banana");
        }
    }
}
See Also
Reference
CompositionAspect
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


Example: Automatically Adding DataContract and DataMember Attributes

Example: Automatically Adding DataContract and DataMember Attributes PostSharp Documentation

This aspect automatically adds custom attributes DataContract and DataMember to classes so they can be serialized by the WCF formatter. Properties that must not be serialized must be annotated with the custom attribute NotDataMemberAttribute.

Requirements

PostSharp 2.0 Professional Edition or higher

Demonstrates

This example demonstrates how CustomAttributeIntroductionAspect can be used together with IAspectProvider.

Example
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
using System;
using System.Collections.Generic;
using System.Reflection;
using System.Runtime.Serialization;
using PostSharp.Aspects;
using PostSharp.Extensibility;
using PostSharp.Reflection;

namespace Samples
{
    // We set up multicast inheritance so  the aspect is automatically added to children types.
    [MulticastAttributeUsage(MulticastTargets.Class, Inheritance = MulticastInheritance.Strict)]
    [Serializable]
    public sealed class AutoDataContractAttribute : TypeLevelAspect, IAspectProvider
    {
        // This method is called at build time and should just provide other aspects.
        public IEnumerable<AspectInstance> ProvideAspects(object targetElement)
        {
            Type targetType = (Type) targetElement;

            CustomAttributeIntroductionAspect introduceDataContractAspect =
                new CustomAttributeIntroductionAspect(
                    new ObjectConstruction(typeof (DataContractAttribute).GetConstructor(Type.EmptyTypes)));
            CustomAttributeIntroductionAspect introduceDataMemberAspect =
                new CustomAttributeIntroductionAspect(
                    new ObjectConstruction(typeof (DataMemberAttribute).GetConstructor(Type.EmptyTypes)));

            // Add the DataContract attribute to the type.
            yield return new AspectInstance(targetType, introduceDataContractAspect);

            // Add a DataMember attribute to every relevant property.
            foreach (PropertyInfo property in
                targetType.GetProperties(BindingFlags.Public | BindingFlags.DeclaredOnly | BindingFlags.Instance))
            {
                if (property.CanWrite && !property.IsDefined(typeof (NotDataMemberAttribute), false))
                    yield return new AspectInstance(property, introduceDataMemberAspect);
            }
        }
    }

    [AttributeUsage(AttributeTargets.Property)]
    public sealed class NotDataMemberAttribute : Attribute
    {
    }
}
using System;
using System.Collections.Generic;
using System.Reflection;
using System.Runtime.Serialization;
using PostSharp.Aspects;
using PostSharp.Extensibility;
using PostSharp.Reflection;

namespace Samples
{
    // We set up multicast inheritance so  the aspect is automatically added to children types.
    [MulticastAttributeUsage(MulticastTargets.Class, Inheritance = MulticastInheritance.Strict)]
    [Serializable]
    public sealed class AutoDataContractAttribute : TypeLevelAspect, IAspectProvider
    {
        // This method is called at build time and should just provide other aspects.
        public IEnumerable<AspectInstance> ProvideAspects(object targetElement)
        {
            Type targetType = (Type) targetElement;

            CustomAttributeIntroductionAspect introduceDataContractAspect =
                new CustomAttributeIntroductionAspect(
                    new ObjectConstruction(typeof (DataContractAttribute).GetConstructor(Type.EmptyTypes)));
            CustomAttributeIntroductionAspect introduceDataMemberAspect =
                new CustomAttributeIntroductionAspect(
                    new ObjectConstruction(typeof (DataMemberAttribute).GetConstructor(Type.EmptyTypes)));

            // Add the DataContract attribute to the type.
            yield return new AspectInstance(targetType, introduceDataContractAspect);

            // Add a DataMember attribute to every relevant property.
            foreach (PropertyInfo property in
                targetType.GetProperties(BindingFlags.Public | BindingFlags.DeclaredOnly | BindingFlags.Instance))
            {
                if (property.CanWrite && !property.IsDefined(typeof (NotDataMemberAttribute), false))
                    yield return new AspectInstance(property, introduceDataMemberAspect);
            }
        }
    }

    [AttributeUsage(AttributeTargets.Property)]
    public sealed class NotDataMemberAttribute : Attribute
    {
    }
}
See Also
Reference
CustomAttributeIntroductionAspect
IAspectProvider
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


Example: Raising an Event When the Object is Finalized

Example: Raising an Event When the Object is Finalized PostSharp Documentation

This example shows an aspect that raises an event when instances of the target class is finalized (during garbage collection).

Requirements

PostSharp 2.0 Professional Edition or higher

Demonstrates

This example demonstrates how a composite aspect can be used to integrate an aspect with another implementation pattern, here Online IDisposable. It demonstrates that the lifetime of an instance-scoped aspect is bound to the lifetime of its target class.

Example
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
using System;
using PostSharp;
using PostSharp.Aspects;
using PostSharp.Aspects.Advices;
using PostSharp.Reflection;

namespace Samples
{
    // The aspect will introduce and implement this interface.
    public interface IObservableLifetime
    {
        // Event raised when the object is disposed.
        event EventHandler Disposed;

        // Event raised when the object is finialized.
        event EventHandler Finalized;
    }

    // The annotation IntroduceInterface specifies that the aspect introduces this interface.
    [Serializable]
    [IntroduceInterface(typeof (IObservableLifetime), OverrideAction = InterfaceOverrideAction.Fail)]
    public class ObservableLifetimeAttribute : InstanceLevelAspect, IObservableLifetime
    {
        // True if the aspect instance is a 'real' instance, false if it is the prototype instance.
        // We do not want to raise the Finalize event on prototype instances.
        [NonSerialized] private bool notPrototype;

        // True if the aspect has already been invoked.
        [NonSerialized] private bool disposed;

        // Initializes the aspect instance.
        public override void RuntimeInitializeInstance()
        {
            this.notPrototype = true;
        }

        // At runtime, this field is set to a delegate of the method Dispose(bool) before we override it.
        [ImportMember("Dispose", IsRequired = true, Order = ImportMemberOrder.BeforeIntroductions)] public Action<bool>
            BaseDisposeMethod;

        // Overrides the method Dispose(bool) of the target type.
        [IntroduceMember(IsVirtual = true, OverrideAction = MemberOverrideAction.OverrideOrFail,
            Visibility = Visibility.Family)]
        public void Dispose(bool disposing)
        {
            // Ignore subsequent calls of this method.
            if (this.disposed)
                return;

            this.disposed = true;

            // Invoke the Dispose(bool) method of the base type.
            this.BaseDisposeMethod(disposing);

            // Raise the Disposed event.
            if (this.Disposed != null)
                this.Disposed(this.Instance, EventArgs.Empty);

            // Unlist this object from finalization.
            if (disposing)
            {
                GC.SuppressFinalize(this);
            }
        }

        // Introduces the event Disposed in the target type.
        [IntroduceMember(OverrideAction = MemberOverrideAction.Fail)]
        public event EventHandler Disposed;

        // Introduces the event Finalized in the target type.
        [IntroduceMember(OverrideAction = MemberOverrideAction.Fail)]
        public event EventHandler Finalized;

        // Finalizer.
        ~ObservableLifetimeAttribute()
        {
            // Ignore the finalizer if we are a prototype instance.
            if (!this.notPrototype)
                return;

            // Call the Dispose method of the target type.
            this.BaseDisposeMethod(false);

            // Raise the Finalized event.
            if (this.Finalized != null)
            {
                this.Finalized(this.Instance, EventArgs.Empty);
            }
        }
    }

    // A sample object.
    [ObservableLifetime]
    internal class DomainObject : IDisposable
    {
        private readonly string tag;

        public DomainObject(string tag)
        {
            this.tag = tag;
        }

        protected virtual void Dispose(bool disposing)
        {
            Console.WriteLine("Dispose({0})", disposing);
        }

        public void Dispose()
        {
            this.Dispose(true);
        }

        public override string ToString()
        {
            return "{" + tag + "}";
        }
    }

    internal class Program
    {
        private static void Main(string[] args)
        {
            DomainObject f1 = new DomainObject("f1");
            IObservableLifetime fe1 = Post.Cast<DomainObject, IObservableLifetime>(f1);
            fe1.Finalized += OnFinalized;
            f1.Dispose();

            DomainObject f2 = new DomainObject("f2");
            IObservableLifetime fe2 = Post.Cast<DomainObject, IObservableLifetime>(f2);
            fe2.Finalized += OnFinalized;
            f2 = null;
            fe2 = null;
            GC.Collect();
            GC.WaitForPendingFinalizers();
        }

        private static void OnFinalized(object sender, EventArgs e)
        {
            Console.WriteLine("OnFinalized: " + sender);
        }
    }
}
using System;
using PostSharp;
using PostSharp.Aspects;
using PostSharp.Aspects.Advices;
using PostSharp.Reflection;

namespace Samples
{
    // The aspect will introduce and implement this interface.
    public interface IObservableLifetime
    {
        // Event raised when the object is disposed.
        event EventHandler Disposed;

        // Event raised when the object is finialized.
        event EventHandler Finalized;
    }

    // The annotation IntroduceInterface specifies that the aspect introduces this interface.
    [Serializable]
    [IntroduceInterface(typeof (IObservableLifetime), OverrideAction = InterfaceOverrideAction.Fail)]
    public class ObservableLifetimeAttribute : InstanceLevelAspect, IObservableLifetime
    {
        // True if the aspect instance is a 'real' instance, false if it is the prototype instance.
        // We do not want to raise the Finalize event on prototype instances.
        [NonSerialized] private bool notPrototype;

        // True if the aspect has already been invoked.
        [NonSerialized] private bool disposed;

        // Initializes the aspect instance.
        public override void RuntimeInitializeInstance()
        {
            this.notPrototype = true;
        }

        // At runtime, this field is set to a delegate of the method Dispose(bool) before we override it.
        [ImportMember("Dispose", IsRequired = true, Order = ImportMemberOrder.BeforeIntroductions)] public Action<bool>
            BaseDisposeMethod;

        // Overrides the method Dispose(bool) of the target type.
        [IntroduceMember(IsVirtual = true, OverrideAction = MemberOverrideAction.OverrideOrFail,
            Visibility = Visibility.Family)]
        public void Dispose(bool disposing)
        {
            // Ignore subsequent calls of this method.
            if (this.disposed)
                return;

            this.disposed = true;

            // Invoke the Dispose(bool) method of the base type.
            this.BaseDisposeMethod(disposing);

            // Raise the Disposed event.
            if (this.Disposed != null)
                this.Disposed(this.Instance, EventArgs.Empty);

            // Unlist this object from finalization.
            if (disposing)
            {
                GC.SuppressFinalize(this);
            }
        }

        // Introduces the event Disposed in the target type.
        [IntroduceMember(OverrideAction = MemberOverrideAction.Fail)]
        public event EventHandler Disposed;

        // Introduces the event Finalized in the target type.
        [IntroduceMember(OverrideAction = MemberOverrideAction.Fail)]
        public event EventHandler Finalized;

        // Finalizer.
        ~ObservableLifetimeAttribute()
        {
            // Ignore the finalizer if we are a prototype instance.
            if (!this.notPrototype)
                return;

            // Call the Dispose method of the target type.
            this.BaseDisposeMethod(false);

            // Raise the Finalized event.
            if (this.Finalized != null)
            {
                this.Finalized(this.Instance, EventArgs.Empty);
            }
        }
    }

    // A sample object.
    [ObservableLifetime]
    internal class DomainObject : IDisposable
    {
        private readonly string tag;

        public DomainObject(string tag)
        {
            this.tag = tag;
        }

        protected virtual void Dispose(bool disposing)
        {
            Console.WriteLine("Dispose({0})", disposing);
        }

        public void Dispose()
        {
            this.Dispose(true);
        }

        public override string ToString()
        {
            return "{" + tag + "}";
        }
    }

    internal class Program
    {
        private static void Main(string[] args)
        {
            DomainObject f1 = new DomainObject("f1");
            IObservableLifetime fe1 = Post.Cast<DomainObject, IObservableLifetime>(f1);
            fe1.Finalized += OnFinalized;
            f1.Dispose();

            DomainObject f2 = new DomainObject("f2");
            IObservableLifetime fe2 = Post.Cast<DomainObject, IObservableLifetime>(f2);
            fe2.Finalized += OnFinalized;
            f2 = null;
            fe2 = null;
            GC.Collect();
            GC.WaitForPendingFinalizers();
        }

        private static void OnFinalized(object sender, EventArgs e)
        {
            Console.WriteLine("OnFinalized: " + sender);
        }
    }
}

            The output of this program is:

View Colorized Copy to Clipboard Print
Dispose(True)
Dispose(False)
OnFinalized: {f2}
Dispose(True)
Dispose(False)
OnFinalized: {f2}
Remarks
This example is made more complex by the fact that it understands the disposable pattern. The aspect requires the target class to implement the
        disposable pattern properly, i.e. to define the method protected virtual void Dispose(bool). PostSharp will fail if
        the user tries to apply this aspect to a class that implements the pattern incorrectly.

          The aspect overrides the Dispose(bool) method by defining a method of the same name and signature, and annotating
          it with the custom attribute IntroduceMemberAttribute.

          In order to be able to invoke the original implementation of Dispose(bool), the aspect defines the field BaseDisposeMethod,
          whose type Action<bool> is a delegate compatible with the signature of the method Dispose(bool).
          The custom attribute ImportMemberAttribute tells PostSharp
          to bind this field to the Dispose method.

          Because the aspect class derives from InstanceLevelAspect, which implements
          IInstanceScopedAspect,
          aspect instances have the same lifetime as instances of the target class: both instances are garbage collected at the same time.
          Thanks to this, the aspect can reliably raise the Finalized event on the class instance when the aspect instance itself
          is collected.

See Also
Reference
InstanceLevelAspect
ImportMemberAttribute
IntroduceMemberAttribute
IntroduceInterfaceAttribute
Other Resources
[e4599448-160c-4d56-8a75-f255195fcd17]
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


More Examples

More Examples PostSharp Documentation

You can find more examples and tutorials on our Online web site.

Online Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


Enforcing Design Rules

Enforcing Design Rules PostSharp Documentation

Besides aspect-oriented programming, you can use PostSharp to validate your source code against architecture and design rules named constraints. Constraints are piece of codes that validate the code against specific rules at build time.

PostSharp provides ready-made constraints for the following scenarios:

  • Restricting Interface Implementation
  • Controlling Component Visibility Beyond Private and Internal

Additionally, you can develop custom constraints to enforce your own design rules. For details, see Developing Custom Architectural Constraints.

Online Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


Restricting Interface Implementation

Restricting Interface Implementation PostSharp Documentation

Under some circumstances you may want to restrict users of an API to implement an interface. You may want to allow them to consume the interface but not to implement it in their own classes, so that, later, you can add new members to this interface without breaking the user's code. If retaining the interface as a public artefact is required, the programming language does not give you any option to enforce the desired restriction. Enter the InternalImplementAttribute from PostSharp.

This topic contains the following sections.

  • Adding the constraint to the interface
  • Emitting an error instead of a warning
  • Ignoring warnings
Adding the constraint to the interface

To restrict implemention of publically declared interfaces you simply need to add [InternalImplementAttribute] to that interface.

  1. Place the caret over the interface that you want to add the attribute select the "Add architectural constraint..."

    Internal Implement 1

  2. Select "Prevent interface implementation in a different assembly" and select Next.

    Internal Implement 2

  3. Verify that you will be adding the InternalImplementAttribute attribute to the correct piece of code.

    Internal Implement 3

  4. Once the download, installation and configuration of PostSharp has finished you can close the wizard and look at the changes that were made to your codebase.

    Internal Implement 4

  5. You'll notice that the only thing that has changed in the code is the addition of the [InternalImplementAttribute] attribute.

    C#
    VB
    C++
    F#
    View Colorized Copy to Clipboard Print
    [InternalImplement]
public interface ICustomerRepository
{
    IEnumerable<Customer> FetchAll();
}
    [InternalImplement]
public interface ICustomerRepository
{
    IEnumerable<Customer> FetchAll();
}

          Once that is done, implementing the interface that was decorated with the InternalImplementAttribute from another assembly will create a compile time warning.

  Internal Implement Warning
  Note  Note

          To perform this architectural validation the project that is trying to implement the interface will need to be processed by PostSharp.

Emitting an error instead of a warning

          If a warning isn't strong enough for your environment you can change the output to a compile time error by setting the InternalImplementAttribute to have a Severity type of Error.

C#
VB
C++
F#
View Colorized Copy to Clipboard Print
[InternalImplement(Severity = SeverityType.Error)]
public interface ICustomerRepository
{
    IEnumerable<Customer> FetchAll();
}
[InternalImplement(Severity = SeverityType.Error)]
public interface ICustomerRepository
{
    IEnumerable<Customer> FetchAll();
}

          Now any reference to the decorated interface from another assembly will generate an error and fail the compilation of your project.

  Internal Implement Error
Ignoring warnings

          If you are trying to implement a constrained interface in a separate assembly and you want to override the warning being generated there is a solution available for you. The IgnoreWarningAttribute attribute can be applied to stop warnings from being generated.

  Note  Note

            The IgnoreWarningAttribute attribute will only suppress warnings. If you have escalated the warnings to be errors, those errors will still be generated even if the IgnoreWarningAttribute attribute is present.

            To suppress warnings all that you need to do is add the IgnoreWarningAttribute attribute to the offending piece of code. In this example we would supress the warning being generated by adding the attribute to the class that is implementing the constrained interface. Once we have done that, the warning generated for that specific implementation would be suppressed. All other locations that are implementing this interface will continue to generate their warnings.

  Note  Note

            You may wonder where the identifier AR0101 comes from. IgnoreWarningAttribute actually works with any PostSharp warning and not just this one. Any build error, whether from MSBuild, C# or PostSharp, has an identifier. To see error identifiers in Visual Studio, open the View menu and click on the Output item, select "Show output from: Build". You will see warnings including their identifiers.

C#
VB
C++
F#
View Colorized Copy to Clipboard Print
[IgnoreWarning("AR0101")]
public class PreferredCustomerRepository : ICustomerRepository
{
    public IEnumerable<Customer> FetchAll()
    {
        return null;
    }
}
[IgnoreWarning("AR0101")]
public class PreferredCustomerRepository : ICustomerRepository
{
    public IEnumerable<Customer> FetchAll()
    {
        return null;
    }
}
See Also
Reference
InternalImplementAttribute
IgnoreWarningAttribute
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


Controlling Component Visibility Beyond Private and Internal

Controlling Component Visibility Beyond Private and Internal PostSharp Documentation

When you are working on applications it's common to run across situations where you want to restrict access to a component you have written. Usually you control this access using the private and/or internal keywords when defining the component. A class marked as internal can be accessed by any other class in the same assembly, but that may not be the level of restriction needed within the codebase. Access to a private class is restricted to those components that are inside the same class or struct that contains the private class, which prevents any other classes from accessing it. In one situation we are restricting access to the component to only the class or struct that contains it. In the other situation we are allowing access to the component from any other component that is in the same assembly. What if needed something in between?

PostSharp offers the ability to define component access rules that exist between the scope of the internal and private keywords. This gives us the opportunity to restrict access to a component only from other components in the same namespace. We can also restrict access to a select few other components.

As an example let's look at a data access related class. As a precaution against developer's circumventing our data access structure we want to limit access to this repository class.

This topic contains the following sections.

  • Restricting access to specific namespaces
  • Restricting access to specific types
  • Controlling component visibility outside of the containing assembly
  • Emitting errors instead of warnings
  • Ignoring warnings
Restricting access to specific namespaces

Our first step is to limit access to this class only to other classes within the validation namespace.

  1. Put the caret on the internal class that should have restricted access. Select "Add architectural constraint..." from the smart tag options.

    Component Internal 1

  2. Select "Prohibit use outside of given types" from the list of options.

    Component Internal 2

  3. Verify that you will be adding the ComponentInternalAttribute attribute to the correct piece of code.

    Component Internal 3

  4. Once the download, installation and configuration of PostSharp has finished you can close the wizard and look at the changes that were made to your codebase.

    Component Internal 4

  5. You'll notice that the only thing that has changed in the code is the addition of the [ComponentInternalAttribute] attribute.

    C#
    VB
    C++
    F#
    View Colorized Copy to Clipboard Print
    namespace Sharpcrafters.Crm.Console.Repositories
{
    public class InvoiceRepository
    {
            [ComponentInternal]
            internal IEnumerable<Invoice> FetchAllForCustomer(Guid id)
            {
                //dostuff
                return null;
            }
     }
}
     namespace Sharpcrafters.Crm.Console.Repositories
{
    public class InvoiceRepository
    {
            [ComponentInternal]
            internal IEnumerable<Invoice> FetchAllForCustomer(Guid id)
            {
                //dostuff
                return null;
            }
     }
}
  6.
                  The [ComponentInternalAttribute] attribute is templated to accept a string for the namespace that should be able to access this method. There are two options that you could use. The first is to pass the attribute an array of typeof(...) values that represents the types that can access this method. The second option is to pass in an array of strings that contain the namespaces of the code that should be able to access this method.
                  For our example, replace the typeof(TODO) with a string for the validation namespace.

  7.
                  If you try to access this component from a namespace that hasn't been granted access you will see a compile time warning in the Output window.

    C#
    VB
    C++
    F#
    View Colorized Copy to Clipboard Print
    namespace Sharpcrafters.Crm.Console.Services
{
    public class InvoiceServices
    {
          public IEnumerable<InvoiceForList> FetchAllInvoicesForCustomer(Guid id)
          {
              var invoiceRepository = new InvoiceRepository();

              var allInvoices = invoiceRepository.FetchAllForCustomer(id);
              return
                  allInvoices.Where(x => !x.PaidInFull).Select(
                      x => new InvoiceForList
                          {
                              PurchaseDate = x.PurchaseDate,
                              ShipDate = x.ShipDate,
                              TotalAmount = x.Total
                           });
          }
      }
}
     namespace Sharpcrafters.Crm.Console.Services
{
    public class InvoiceServices
    {
          public IEnumerable<InvoiceForList> FetchAllInvoicesForCustomer(Guid id)
          {
              var invoiceRepository = new InvoiceRepository();

              var allInvoices = invoiceRepository.FetchAllForCustomer(id);
              return
                  allInvoices.Where(x => !x.PaidInFull).Select(
                      x => new InvoiceForList
                          {
                              PurchaseDate = x.PurchaseDate,
                              ShipDate = x.ShipDate,
                              TotalAmount = x.Total
                           });
          }
      }
}
      Component Internal Warning
      Note  Note

                    If you are trying to access the component from a namespace that is in a different project you will need PostSharp to process that project for the validation to occur.

Restricting access to specific types

          Under some circumstances namespace level restrictions may not be tight enough for your needs. In that situation you have the ability to apply this constraint at a type level.

  1.
                  To restrict access at a component type level you need to explicitly define which component types will have access. This is done by passing types into the constructor of the ComponentInternalAttribute attribute's constructor. The construct accepts an array of Type which allows you to define many different component types that should be granted access.

    C#
    VB
    C++
    F#
    View Colorized Copy to Clipboard Print
    public class InvoiceRepository
{
    [ComponentInternal(typeof(Sharpcrafters.Crm.Console.Services.InvoiceServices))]
    internal IEnumerable<Invoice> FetchAllForCustomer(Guid id)
    {
        //dostuff
        return null;
    }
}
     public class InvoiceRepository
{
    [ComponentInternal(typeof(Sharpcrafters.Crm.Console.Services.InvoiceServices))]
    internal IEnumerable<Invoice> FetchAllForCustomer(Guid id)
    {
        //dostuff
        return null;
    }
}
  2.
                  Now if you try to access this component from a type that hasn't been granted access you will see a compile time warning in the Output window.

    C#
    VB
    C++
    F#
    View Colorized Copy to Clipboard Print
    public class CustomerServices
{
    public IEnumerable<Customer> FetchAll()
    {
        var invoiceRepository = new InvoiceRepository();
        var allInvoices = invoiceRepository.FetchAllForCustomer(Guid.NewGuid());
    }
}
     public class CustomerServices
{
    public IEnumerable<Customer> FetchAll()
    {
        var invoiceRepository = new InvoiceRepository();
        var allInvoices = invoiceRepository.FetchAllForCustomer(Guid.NewGuid());
    }
}
      Component Internal Warning
Controlling component visibility outside of the containing assembly

          Because of framework limitations or automated testing requirements you sometimes need to declare components as public so that you can perform the desired tasks or testing. For some of those components you probably don't want external applications accessing them. For instance, WPF controls need a default constructor for use in the designer, but sometimes you want another constructor to be used at runtime, so you want to prevent the default constructor to be used from code.

          PostSharp offers you the ability to decorate a publically declared component in such a way that it is not accessible by applications that reference its assembly. All you need to do is apply the InternalAttribute attribute.

  1.
                  Let's mark the Customer class so that it can only be accessed from the assembly it resides in.

    C#
    VB
    C++
    F#
    View Colorized Copy to Clipboard Print
    namespace Sharpcrafters.Crm.Core
{
    public class Customer
    {
        public int Id { get; set; }
        public string Name { get; set; }
    }
}
     namespace Sharpcrafters.Crm.Core
{
    public class Customer
    {
        public int Id { get; set; }
        public string Name { get; set; }
    }
}
  2.
                  Place the caret on the publically declared component that you want to restrict external access to and expand the smart tag. Select "Add architectural constraint".

  3.
                  When prompted to select a constraint, choose to "Prohibit use outside of the project".

  4.
                  The summary page gives you the opportunity to review the selections that you have made. If you notice that the configuration is not what you wanted you can click the Previous button and adjust your selections. If the configuration meets your needs click Next.
                  In this demo you will see that the [InternalAttribute] attribute is being added to the Customer class.

  5.
                  Once the download, installation and configuration of PostSharp has finished you can close the wizard and look at the changes that were made to your codebase.

  6.
                  You'll notice that the only thing that has changed in the code is the addition of the [InternalAttribute] attribute.

    C#
    VB
    C++
    F#
    View Colorized Copy to Clipboard Print
    namespace Sharpcrafters.Crm.Core
{
    [Internal]
    public class Customer
    {
        public int Id { get; set; }
        public string Name { get; set; }
    }
}
     namespace Sharpcrafters.Crm.Core
{
    [Internal]
    public class Customer
    {
        public int Id { get; set; }
        public string Name { get; set; }
    }
}
  7.
                  When you attempt to make use of that public component in a different assembly a compile time warning will appear in the Output window.

    C#
    VB
    C++
    F#
    View Colorized Copy to Clipboard Print
    namespace Sharpcrafters.Crm.Console.Repositories
{
    public class CustomerRepository:ICustomerRepository
    {
        public IEnumerable<Customer> FetchAll()
        {
            return new List<Customer>{new Customer{Id=1,Name="Joe Johnson"}};
        }
    }
}
     namespace Sharpcrafters.Crm.Console.Repositories
{
    public class CustomerRepository:ICustomerRepository
    {
        public IEnumerable<Customer> FetchAll()
        {
            return new List<Customer>{new Customer{Id=1,Name="Joe Johnson"}};
        }
    }
}
      Note  Note

                    The assembly that is attempting to use the public component will need to reference PostSharp for this validation to occur.

Emitting errors instead of warnings

          By default any situation that breaks the access rules defined by the application of the ComponentInternalAttribute or InternalAttribute attribute will generate a compile time warning. It's possible to escalate this warning to the error level.

  1.
                  Changing the output warning to an error requires you to set the Severity level.

    C#
    VB
    C++
    F#
    View Colorized Copy to Clipboard Print
    [ComponentInternal(typeof (InvoiceServices), Severity = SeverityType.Error)]
public IEnumerable<Invoice> FetchAllForCustomer(Guid id)
{
    //dostuff
    return null;
}
    [ComponentInternal(typeof (InvoiceServices), Severity = SeverityType.Error)]
public IEnumerable<Invoice> FetchAllForCustomer(Guid id)
{
    //dostuff
    return null;
}
  2.
                  Now when you try to access the component when access hasn't been granted the Output window will display an error message.

      Component Internal Error
Ignoring warnings

          There may be specific situations where you want to supress the warning message that is being generated at compile time. In those cases you can apply the IgnoreWarningAttribute attribute to the locations where you want to allow access to the component.

  Note  Note

            The IgnoreWarningAttribute attribute will only suppress warnings. If you have escalated the warnings to be errors, those errors will still be generated even if the IgnoreWarningAttribute attribute is present.

          If you wanted to allow access to the constrained component in a specific method you could add the IgnoreWarningAttribute attribute to that method.

C#
VB
C++
F#
View Colorized Copy to Clipboard Print
public class CustomerServices
{
    [IgnoreWarning("AR0102")]
    public IEnumerable<Customer> FetchAll()
    {
        var invoiceRepository = new InvoiceRepository();
        var allInvoices = invoiceRepository.FetchAllForCustomer(Guid.NewGuid());
    }
}
 public class CustomerServices
{
    [IgnoreWarning("AR0102")]
    public IEnumerable<Customer> FetchAll()
    {
        var invoiceRepository = new InvoiceRepository();
        var allInvoices = invoiceRepository.FetchAllForCustomer(Guid.NewGuid());
    }
}
  Note  Note
AR0102 is the identifier of the warning emitted by ComponentInternalAttribute. To ignore warnings emitted by Internal, use the identifier AR0104.

            You may wonder where these identifiers come from. IgnoreWarningAttribute actually works with any PostSharp warning and not just this one. Any build error, whether from MSBuild, C# or PostSharp, has an identifier. To see error identifiers in Visual Studio, open the View menu and click on the Output item, select "Show output from: Build". You will see warnings including their identifiers.

          If you wanted to allow access in an entire class you could add the IgnoreWarningAttribute attribute at the class level. Any access to the constrained component within the class would have its warning suppressed.

C#
VB
C++
F#
View Colorized Copy to Clipboard Print
[IgnoreWarning("AR0102")]
public class CustomerServices
{
    public IEnumerable<Customer> FetchAll()
    {
        var invoiceRepository = new InvoiceRepository();
        var allInvoices = invoiceRepository.FetchAllForCustomer(Guid.NewGuid());
    }
}
[IgnoreWarning("AR0102")]
public class CustomerServices
{
    public IEnumerable<Customer> FetchAll()
    {
        var invoiceRepository = new InvoiceRepository();
        var allInvoices = invoiceRepository.FetchAllForCustomer(Guid.NewGuid());
    }
}
See Also
Reference
IgnoreWarningAttribute
ComponentInternalAttribute
InternalAttribute
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


Developing Custom Architectural Constraints

Developing Custom Architectural Constraints PostSharp Documentation

When you are creating your applications it is common to adopt custom design patterns that must be respected accross all modules. Custom design patterns have the same benefits as standard ones, but they are specific to your application. For instance, the team could decide that every class derived from BusinessRule must have a nested class named Factory, derived from BusinessRulesFactory, with a public default constructor.

Even performing line-by-line code reviews can miss violations of the pattern. Is there a better way to ensure that this doesn't happen? PostSharp offers the ability create custom architectural constraints. The constraints that you write are able to verify anything that you can query using reflection.

There are two kinds of constraints: scalar constraints and referential constraints.

This topic contains the following sections.

  • Creating a scalar constraint
  • Creating a referential constraint
  • Validating the constraint itself
  • Ignoring warnings
Creating a scalar constraint

Scalar constraints typically validate an element of code, while referential constraints validate how an element of code is being used.

Let's start with a scalar constraint and create a constraint that verifies the first condition our BusinessRule design pattern: that any class derived from BusinessRule must have a nested class named Factory. We can model this condition as a scalar constraint that applies to any class derived from BusinessRule. Therefore, we will create a type-level scalar constraint, apply it to the BusinessRule class, and use attribute inheritance to have the constraint automatically applied to all derived classes.

  1. Create a class that inherits from the ScalarConstraint class in PostSharp.

    C#
    VB
    C++
    F#
    View Colorized Copy to Clipboard Print
    using System;
public class BusinessRulePatternValidation : ScalarConstraint
{
}
     using System;
public class BusinessRulePatternValidation : ScalarConstraint
{
}
  2.
                  Designate what code construct type this validation aspect should work for by adding the MulticastAttributeUsageAttribute attribute. In this case we want the validation to occur on types only, and we want to enable inheritance.

    C#
    VB
    C++
    F#
    View Colorized Copy to Clipboard Print
    [MulticastAttributeUsage(MulticastTargets.Class, Inheritance = MulticastInheritance.Strict)]
public class BusinessRulePatternValidation : ScalarConstraint
{
}
    [MulticastAttributeUsage(MulticastTargets.Class, Inheritance = MulticastInheritance.Strict)]
public class BusinessRulePatternValidation : ScalarConstraint
{
}
  3.
                  Override the ValidateCode(Object) method.

    C#
    VB
    C++
    F#
    View Colorized Copy to Clipboard Print
    [MulticastAttributeUsage(MulticastTargets.Class, Inheritance = MulticastInheritance.Strict)]
public class BusinessRulePatternValidation : ScalarConstraint
{
    public override void ValidateCode(object target)
    {
    }
}
    [MulticastAttributeUsage(MulticastTargets.Class, Inheritance = MulticastInheritance.Strict)]
public class BusinessRulePatternValidation : ScalarConstraint
{
    public override void ValidateCode(object target)
    {
    }
}
  4.
                  Create a rule that checks that there's a nested type called Factory. You'll note that the target parameter for the ValidateCode(Object) method is an object type. Depending on which target type you declare in the MulticastAttributeUsageAttribute attribute, the value passed through this parameter will change. For MulticastTargets.Type the type passed is Type. To make use of the target for validation you must cast to that type first.

    C#
    VB
    C++
    F#
    View Colorized Copy to Clipboard Print
    [MulticastAttributeUsage(MulticastTargets.Class, Inheritance = MulticastInheritance.Strict)]
public class BusinessRulePatternValidation : ScalarConstraint
{
    public override void ValidateCode(object target)
    {
        var targetType = (Type) target;

        if ( targetType.GetNestedType("Factory") == null )
        {
           // Error
        }
    }
}
    [MulticastAttributeUsage(MulticastTargets.Class, Inheritance = MulticastInheritance.Strict)]
public class BusinessRulePatternValidation : ScalarConstraint
{
    public override void ValidateCode(object target)
    {
        var targetType = (Type) target;

        if ( targetType.GetNestedType("Factory") == null )
        {
           // Error
        }
    }
}
      Note  Note

                    Valid types for the target parameter of the ValidateCode(Object) method include Assembly, Type, MethodInfo, ConstructorInfo, PropertyInfo, EventInfo, FieldInfo, and ParameterInfo.

  5.
                  Write a warning that the rule being broken to the Output window in Visual Studio.

    C#
    VB
    C++
    F#
    View Colorized Copy to Clipboard Print
    [MulticastAttributeUsage(MulticastTargets.Class, Inheritance = MulticastInheritance.Strict)]
public class BusinessRulePatternValidation : ScalarConstraint
{
    public override void ValidateCode(object target)
    {
        var targetType = (Type)target;

        if (targetType.GetNestedType("Factory") == null)
        {
            Message.Write(
                targetType, SeverityType.Warning,
                "2001",
                "The {0} type does not have a nested type named 'Factory'.",
                targetType.DeclaringType,
                 targetType.Name);
        }
    }
}
    [MulticastAttributeUsage(MulticastTargets.Class, Inheritance = MulticastInheritance.Strict)]
public class BusinessRulePatternValidation : ScalarConstraint
{
    public override void ValidateCode(object target)
    {
        var targetType = (Type)target;

        if (targetType.GetNestedType("Factory") == null)
        {
            Message.Write(
                targetType, SeverityType.Warning,
                "2001",
                "The {0} type does not have a nested type named 'Factory'.",
                targetType.DeclaringType,
                 targetType.Name);
        }
    }
}
  6.
                  Attach the rule to the code that needs to be protected. For this example we want to add this rule to the BusinessRule class.

    C#
    VB
    C++
    F#
    View Colorized Copy to Clipboard Print
    [BusinessRulePatternValidation]
public class BusinessRule
{
    // No Factory class here.
}
    [BusinessRulePatternValidation]
public class BusinessRule
{
    // No Factory class here.
}
      Note  Note

                    This example shows applying the constraint to only one class. If you want to apply a constraint to large portions of your codebase, read the section on Adding Aspects to Multiple Declarations
  7.
                  Now if you compile the project you will see an error in the Output window of Visual Studio when you run a build.

      Custom Arch Constraint warning
  8.
                  In some circumstances you may determine that a warning isn't aggressive enough. We can alter the rule that you have created so that it outputs a compile time error instead. All that you need to do is change the SeverityType in the Message.Write to Error.

    C#
    VB
    C++
    F#
    View Colorized Copy to Clipboard Print
    [MulticastAttributeUsage(MulticastTargets.Class, Inheritance = MulticastInheritance.Strict)]
public class BusinessRulePatternValidation : ScalarConstraint
{
    public override void ValidateCode(object target)
    {
        var targetType = (Type)target;

        if (targetType.GetNestedType("Factory") == null)
        {
            Message.Write(
            targetType, SeverityType.Error,
            "2001",
            "The {0} type does not have a nested type named 'Factory'.",
            targetType.DeclaringType,
            targetType.Name);
        }
    }
}
    [MulticastAttributeUsage(MulticastTargets.Class, Inheritance = MulticastInheritance.Strict)]
public class BusinessRulePatternValidation : ScalarConstraint
{
    public override void ValidateCode(object target)
    {
        var targetType = (Type)target;

        if (targetType.GetNestedType("Factory") == null)
        {
            Message.Write(
            targetType, SeverityType.Error,
            "2001",
            "The {0} type does not have a nested type named 'Factory'.",
            targetType.DeclaringType,
            targetType.Name);
        }
    }
}
      Custom Arch Constraint error

          Using this technique it is possible to create rules or restrictions based on a number of different criteria and implement validation for several design patterns.

          When you are working on projects you need to ensure that they adhere to the ideals and principles that our project teams hold dear. As with any process in software development, manual verification is guaranteed to fail at some point in time. As you do in other areas of the development process, you should look to automate the verification and enforcement of our ideals. The ability to create custom architectural constraints provides both the flexibility and verification that you need to achieve this goal.

Creating a referential constraint

          Now let's create a referential constraint that verifies the second condition our BusinessRule design pattern: that the BusinessRule class can only be used in the Controllers namespace. You can model this condition as a referential constraint and apply the constraint to any class in your codebase. If you apply this constraint to the entirety of your codebase you will ensure that the BusinessRule design pattern is only referenced in the Controllers namespace.

  1.
                  Create a class that inherits from the ReferentialConstraint class in PostSharp.

    C#
    VB
    C++
    F#
    View Colorized Copy to Clipboard Print
    public class BusinessRuleUseValidation : ReferentialConstraint
{
}
     public class BusinessRuleUseValidation : ReferentialConstraint
{
}
  2.
                  Declare that this aspect should work only on types by adding the MulticastAttributeUsageAttribute attribute to the class.

    C#
    VB
    C++
    F#
    View Colorized Copy to Clipboard Print
    [MulticastAttributeUsage(MulticastTargets.Class, Inheritance = MulticastInheritance.Strict)]
public class BusinessRuleUseValidation : ReferentialConstraint
{
}
    [MulticastAttributeUsage(MulticastTargets.Class, Inheritance = MulticastInheritance.Strict)]
public class BusinessRuleUseValidation : ReferentialConstraint
{
}
  3.
                  Override the ValidateCode(Object, Assembly) method.

    C#
    VB
    C++
    F#
    View Colorized Copy to Clipboard Print
    [MulticastAttributeUsage(MulticastTargets.Class, Inheritance = MulticastInheritance.Strict)]
BusinessRuleUseValidation : ReferentialConstraint
{
    public override void ValidateCode(object target, Assembly assembly)
    {
    }
}
    [MulticastAttributeUsage(MulticastTargets.Class, Inheritance = MulticastInheritance.Strict)]
BusinessRuleUseValidation : ReferentialConstraint
{
    public override void ValidateCode(object target, Assembly assembly)
    {
    }
}
  4.
                  Create the rule that checks for the use of the BusinessRule type in the target code.

    C#
    VB
    C++
    F#
    View Colorized Copy to Clipboard Print
    [MulticastAttributeUsage(MulticastTargets.Class, Inheritance = MulticastInheritance.Strict)]
public class BusinessRulePatternValidation : ScalarConstraint
{
    public override void ValidateCode(object target, Assembly assembly)
    {
        var targetType = (Type) target;
        var usages = ReflectionSearch
                .GetMethodsUsingDeclaration(typeof (BusinessRule));

        if (usages !=null)
        {
            // Warning
        }
    }
}
    [MulticastAttributeUsage(MulticastTargets.Class, Inheritance = MulticastInheritance.Strict)]
public class BusinessRulePatternValidation : ScalarConstraint
{
    public override void ValidateCode(object target, Assembly assembly)
    {
        var targetType = (Type) target;
        var usages = ReflectionSearch
                .GetMethodsUsingDeclaration(typeof (BusinessRule));

        if (usages !=null)
        {
            // Warning
        }
    }
}
      Note  Note

                    The rule here makes use of the ReflectionSearch helper class that is provided by the PostSharp framework. This class, along with others, is an extension to the built in reflection functionality of .NET and can be used outside of aspects as well.

  5.
                  Write a warning message to be included in the Output window of Visual Studio.

    C#
    VB
    C++
    F#
    View Colorized Copy to Clipboard Print
    [MulticastAttributeUsage(MulticastTargets.Class, Inheritance = MulticastInheritance.Strict)]
public class BusinessRulePatternValidation : ScalarConstraint
{
    public override void ValidateCode(object target, Assembly assembly)
    {
        var targetType = (Type) target;
        var usages = ReflectionSearch
        .GetMethodsUsingDeclaration(typeof (BusinessRule));

        if (usages !=null)
        {
            Message.Write(
                targetType, SeverityType.Warning,
                "2002",
                "The {0} type contains a reference to 'BusinessRule'" +
                "which should only be referenced from Controllers.",
                targetType.Name);
        }
    }
}
    [MulticastAttributeUsage(MulticastTargets.Class, Inheritance = MulticastInheritance.Strict)]
public class BusinessRulePatternValidation : ScalarConstraint
{
    public override void ValidateCode(object target, Assembly assembly)
    {
        var targetType = (Type) target;
        var usages = ReflectionSearch
        .GetMethodsUsingDeclaration(typeof (BusinessRule));

        if (usages !=null)
        {
            Message.Write(
                targetType, SeverityType.Warning,
                "2002",
                "The {0} type contains a reference to 'BusinessRule'" +
                "which should only be referenced from Controllers.",
                targetType.Name);
        }
    }
}
  6.
                  Attach the referential constraint that you created to any code that needs to be checked. In this example, add an attribute to the AccountRepository class.

    C#
    VB
    C++
    F#
    View Colorized Copy to Clipboard Print
    namespace PostSharp.Architecture.Repositories
{
    [BusinessRuleUseValidation]
    public class AccountRepository
    {
        public void AddAccount(string name)
        {
            var businessRule = new BusinessRule();
            businessRule.DoStuff();
        }
    }
}
     namespace PostSharp.Architecture.Repositories
{
    [BusinessRuleUseValidation]
    public class AccountRepository
    {
        public void AddAccount(string name)
        {
            var businessRule = new BusinessRule();
            businessRule.DoStuff();
        }
    }
}
      Note  Note

                    This example shows applying the constraint to only one class. If you want to apply this constraint to a larger portion of your codebase, read the section on Adding Aspects to Multiple Declarations.

  7.
                  Now when you compile the project you will see a warning in the Output window in Visual Studio.

      Referential Constraint Warning
      Note  Note

                    If using a warning isn't aggressive enough you can change the SeverityType to Error. Now when the rule is broken an error will appear in the Output window of Visual Studio and the build will not be successful.

  Caution note  Caution

            PostSharp constraints operate at the lowest level. For instance, checking relationships of a type with the rest of the code
            does not implicitly check the relationships of the methods of this type. Also, checking relationships of namespaces
            is not possible.

            Custom attribute multicasting can be used to apply a constraint to a large number of types, for instance all types of
            a namespace. But this would result in one constraint instance for every type, method and field on this namespace.
            Altough this has no impact on run time, it could severely affect build time. For this reason, the current version
            of PostSharp Constraints is not suitable to check isolation (layering) of namespaces at large scale.

          Referential constraints provide you with the ability to declare architectural design patterns right in your code. By documenting these patterns right in the codebase you are able to provide easy access for the development team as well as continual verification that your desired design patterns are being adhered to.

Validating the constraint itself

          Now that you have created scalar and referential constraints you can be assured that certain architectural rules are being consistently implemented in your codebase. There is one thing that is missing though.

          With what you have done thus far, it is possible to attach your architectural constraints to any code element in your projects. This may not be appropriate. For example, the scalar constraint that you created to perform the BusinessRulePatternValidation may be a valid constraint only on classes that exist in the Models namespace.

          Let's look at how we can ensure that this constraint is only enforced on classes that exist in the Models namespace.

  1.
                  Open the BusinessRulePatternValidation class that you created earlier.

  2.
                  Override the ValidateConstraint(Object) method.

  3.
                  Write the validation logic to ensure that this constraint is only applied to classes in the Models namespace.

      Note  Note

                    When the ValidateConstraint(Object) method returns true, it tells PostSharp that the constraint should be applied to that target code element. When the ValidateConstraint(Object) method returns false PostSharp will not apply the constraint to the target code element.

                  Now, when the BusinessRulePatternValidation attribute is applied to a class that is not in the Models namespace of your project, there will be no warning or error added to the Visual Studio Output window.

          When the attribute is applied to a class in the Models namespace and that class doesn't pass the constraint's rules you will continue to see the warning or error indicating this architectural failure.

Ignoring warnings

          There will be situations where a constraint is generating a warning that is of no concern. In these exceptional circumstances it is best if you remove the warning from the Visual Studio Output window.

          To ignore these unnecessary warnings, find the target code that is responsible for generating the warning. Add the IgnoreWarningAttribute attribute to the target code entering the MessageId of the warning that you want to suppress.

          The MessageId can be found in your constraint where you issue the Message.Write command. The Reason value performs no function during the suppression of the warning. It exists so that you can provide clear communication as to why the warning is being ignored.

  Note  Note

            The IgnoreWarningAttribute attribute will only suppress the issuance of Message.Write statements that are assigned a SeverityType of Warning. If the SeverityType is set to Error the IgnoreWarningAttribute attribute will have no suppression effect on that statement.

See Also
Reference
MulticastAttributeUsageAttribute
ScalarConstraint
IgnoreWarningAttribute
MessageId
Reason
MulticastAttributeUsageAttribute
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


Working with Errors, Warnings, and Messages

Working with Errors, Warnings, and Messages PostSharp Documentation

As any compiler, PostSharp can emit messages, warnings, and errors, commonly referred to asmessage. Custom code running at build time (typically the implementation of CompileTimeValidate or of a custom constraint) can use PostSharp messaging facility to emit their own messages.

In this section:

  • Ignoring and Escalating Warnings
  • Emitting Errors, Warnings, and Messages.
Tip Tip
PostSharp 2.1 contains an experimental feature that adds file and line information to errors and warnings. The feature requires Visual Studio. In must be enabled manually in the PostSharp tab of Visual Studio options.

Online Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


Ignoring and Escalating Warnings

Ignoring and Escalating Warnings PostSharp Documentation

As with conventional compilers, warnings emitted by PostSharp, as well as those emitted by custom code running at build time in PostSharp, can be ignored (in that case they will not be displayed) or escalated into errors.

Warnings can be ignored either globally, using a project-wide setting, or locally for a given element of code. Warnings can be escalated only globally.

Ignoring or escalating warnings globally

There are several ways to ignore or escalate a warning for a complete project:

  • In Visual Studio, in the PostSharp tab of the project properties dialog. See Configuring PostSharp for details.
  • By defining the PostSharpDisabledMessages or PostSharpEscalatedMessages MSBuild properties. See Configuring PostSharp and Configurable MSBuild Properties for details.
  • By using the DisablePostSharpMessageAttribute or EscalatePostSharpMessageAttribute custom attribute at assembly level. This approach is considered obsolete.
Note Note
The value * can be used to escalate all warnings into errors.
Ignoring warnings locally

Most warnings are related to a specific element of code. To disable a specific warning for a specific element of code, add the IgnoreWarningAttribute custom attribute to that element of code, or to any enclosing element of code (for instance, adding the attribute to a type will make it effective for all members of this type).

To ignore warnings emitted by constraints, it is preferable to use the IgnoreConstraintWarningAttribute custom attribute. Indeed, this attribute is conditional to the compilation symbol POSTSHARP_CONSTRAINTS, so it will be ignored by the compiler unless constraint verification is enabled for the current project and build configuration.

You can create your own custom attribute derived from IgnoreWarningAttribute and make it conditional to a compilation symbol by using the Online ConditionalAttribute custom attribute.

Online Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


Emitting Errors, Warnings, and Messages

Emitting Errors, Warnings, and Messages PostSharp Documentation

Custom code running in PostSharp at build time can use the messaging facility to emit its own messages, warnings, and errors. These messages will appear in the MSBuild output and/or in Visual Studio. User-emitted warnings can be ignored or escalated using the same mechanism as for system messages.

Emitting messages

If you just have a few messages to emit, you may simply use one of the overloads of the Write method of the Message class.

All messages must have a severity SeverityType, a message number (used as a reference when ignoring or escalating messages), and a message text. Additionally, and preferably, messages may have a location (MessageLocation).

Note Note
To benefit from the possibility to ignore messages locally, you should always use provide a relevant location with your messages. Previous API overloads, which did not require a message location, are considered obsolete.
Tip Tip
Do not use string.Format to format your messages. Instead, pass message arguments to the messaging facility, which will format ome argument types, for instance reflection objects, in a more readable way.
Emitting messages using a message source

If you want the text of all messages to be stored in a single location, you have to emit messages through a MessageSource. Typically, you would create a singleton instance of MessageSource for each component, and associate each instance with a message dispenser. A message dispenser is a custom-written class implementing the IMessageDispenser interface. The MessageDispenser provides a convenient abstract implementation.

Note Note
Although it is tempting to use a ResourceManager as the back-end of a message dispenser, comes with a non-neglictible performance penalty because of the cost of instantiating the ResourceManager.

Online Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


Combining with Other Technologies

Combining with Other Technologies PostSharp Documentation

Online Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


Using PostSharp with ASP.NET

Using PostSharp with ASP.NET PostSharp Documentation

There are two ways to develop web applications using Microsoft .NET:

  • ASP.NET Application projects are very similar to other projects; they need to be built before they can be executed. Since they are built using MSBuild, you can use PostSharp as with any other kind of project.
  • ASP.NET Site projects are very specific: there is no project file (a site is actually a directory), and these projects must not be built. Although they don't use MSBuild, you can theoretically still use PostSharp with ASP.NET site projects thanks to the project Online PostSharp4AspNet. As explained on the home page of this project, using PostSharp with ASP.NET Site projects is not recommended and not officially supported.
See Also

Other Resources

Online PostSharp4AspNet

Online Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


Combining PostSharp with ILMerge

Combining PostSharp with ILMerge PostSharp Documentation
Caution note Caution
The current version of ILMerge has bugs that prevent it from being used with assemblies processed by PostSharp.

You can use ILMerge to combine PostSharp.dll, or assemblies processed by PostSharp, into a large assembly. However, all assemblies enhanced by aspects must be made aware of this.

As explained in Understanding Aspect Lifetime and Scope, aspects are serialized at build time and deserialized at run time. Serialization data include the type name of aspects. If aspect classes are moved to a different assembly, the deserializer will complain that the aspect type does not exist any more.

Therefore, you have to make the serializer aware of the new name of assemblies. This can be achieved by tweaking the BinaryAspectSerializationBinder object.

Making the aspect serializer aspect of an assembly name change
View Colorized Copy to Clipboard Print
((BinaryAspectSerializationBinder) BinaryAspectSerializer.Binder).Retarget("OldAssemblyName", "MergedAssemblyName");
((BinaryAspectSerializationBinder) BinaryAspectSerializer.Binder).Retarget("OldAssemblyName", "MergedAssemblyName");

The aspect serializer must be configured before aspects are deserialized, i.e. before the first class affected by an aspect is accessed by the program.

Note Note
You can also provide your own implementation of Online SerializationBinder by setting the property BinaryAspectSerializer Binder.

Online Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


Combining PostSharp with an Obfuscation Tool

Combining PostSharp with an Obfuscation Tool PostSharp Documentation

Starting from version 3, PostSharp generates assemblies that are theoretically compatible with all obfuscators.

Caution note Caution
PostSharp 3 generates constructs that are not emitted by Microsoft compilers (for instance methodof). These unusual constructs may reveal bugs in third-party tools, because they are generally tested against the output of Microsoft compilers.

Online Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


Combining PostSharp with Microsoft Code Analysis (FxCop)

Combining PostSharp with Microsoft Code Analysis (FxCop) PostSharp Documentation

Code Analysis for managed code analyzes managed assemblies and reports information about the assemblies, such as violations of the programming and design rules set forth in the Microsoft .NET Framework Design Guidelines.

The analysis tool represents the checks it performs during an analysis as warning messages. Warning messages identify any relevant programming and design issues and, when it is possible, supply information about how to fix the problem.

Code Analysis in integrated into Visual Studio Premium or Visual Studio Ultimate. The same product is available for free and is known as FxCop; FxCop requires manual integration with your build scripts.

Code Analysis must process assemblies before they have been processed by PostSharp. Indeed, PostSharp may add internal and private members, or generate instructions, that do not comply to Code Analysis rules. However, the warnings you would get from analyzing post-processed assemblies are not likely to be relevant.

PostSharp reconfigures the build process so that Code Analysis is executed on the assemblies as they were before being enhanced by PostSharp. If you are using Code Analysis as an integrated part of Visual, no change of configuration is required.

If you are executing FxCop manually or by using custom MSBuild integration, you should process assemblies from directories obj\CodeAnalysis\Before-PostSharp instead of bin\CodeAnalysis.

Online Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


Class Reference

Class Reference PostSharp Documentation
PostSharp is a design pattern automation tool for Microsoft .NET.
Namespaces
Namespace | Description
PostSharp | The PostSharp namespace is the root namespace of PostSharp.
PostSharp.Aspects | The PostSharp.Aspects namespace provides the primitives of the PostSharp aspect-oriented framework, such as abstract aspect classes, aspect interfaces, and advise argument classes.
PostSharp.Aspects.Advices | The PostSharp.Aspects.Advices provides custom attributes that allow developing composite aspects with advices and pointcuts.
PostSharp.Aspects.Configuration | The PostSharp.Aspects.Configuration namespace contains classes and custom attributes configuring the aspects of the PostSharp.Aspects namespace.
PostSharp.Aspects.Dependencies | The PostSharp.Aspects.Dependencies namespace contains types and custom attributes that allow to define dependencies between aspects and advices, so that the aspect weaver behaves determistically even if the same element of code is the target of several aspects provided by multiple vendors.
PostSharp.Aspects.Serialization | The PostSharp.Aspects.Serialization namespace contains types taking care of the process of serializing aspects at build time and deserializing them at run time.
PostSharp.Collections | The PostSharp.Collections namespace contains collection types used by the PostSharp library.
PostSharp.Constraints | The PostSharp.Contraints namespace allows you to validate your code against predefined or custom design rules.
PostSharp.Extensibility | The PostSharp.Extensibility namespace defines the semantics of the attribute multicasting mechanism and exposes other types that allow user code to interact with the PostSharp,platform.
PostSharp.Patterns.Contracts | The PostSharp.Patterns.Contracts namespace contains ready-made contracts that validate fields, properties and parameters at runtime.
PostSharp.Patterns.Diagnostics | The PostSharp.Patterns.Diagnostics namespace contains a logging aspect.
PostSharp.Patterns.Model | The PostSharp.Patterns.Model namespace contains an implementation of the Observer pattern (INotifyPropertyChanged interface).
PostSharp.Patterns.Threading | The PostSharp.Patterns.Threading namespace contains an implementation of several threading models, and other thread dispatching aspects.
PostSharp.Reflection | The PostSharp.Reflection namespace complements the System.Reflection namespace.
PostSharp.Reflection.Syntax | The PostSharp.Reflection.Syntax namespace contains classes and interfaces that can represent the decompiled abstract syntax tree of method bodies.
PostSharp.Serialization | The PostSharp.Serialization namespace implements a portable serializer.

Online Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


PostSharp Namespace

PostSharp Namespace PostSharp Documentation
The PostSharp namespace is the root namespace of PostSharp.
Classes
 | Class | Description
Public class | IgnoreWarningAttribute | Instructs PostSharp to ignore warnings and information messages. Errors cannot be ignored.
Public class | MessageLocation | Represents the location of a message, which means, for the end-user, a line in a file of source code. From the aspect developer, the location can be known as an object representing an element of code (for instance a Online Type or Online MethodInfo). Such implicit locations are resolved by PostSharp to a file and line number.
Public class | Post | Provides some methods that are transformed during post-compilation.

Online Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


IgnoreWarningAttribute Class

IgnoreWarningAttribute Class PostSharp Documentation
Instructs PostSharp to ignore warnings and information messages. Errors cannot be ignored.
Inheritance Hierarchy
Online System Object
Online System Attribute
PostSharp IgnoreWarningAttribute

Namespace: PostSharp
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
public sealed class IgnoreWarningAttribute : Attribute
public sealed class IgnoreWarningAttribute : Attribute
Remarks
See Also
IgnoreWarningAttribute Members
PostSharp Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


IgnoreWarningAttribute Members

IgnoreWarningAttribute Members PostSharp Documentation

The IgnoreWarningAttribute type exposes the following members.
Constructors
 | Name | Description
Public method | IgnoreWarningAttribute | Creates a new instance of IgnoreWarningAttribute.
Back to Top
Properties
 | Name | Description
Public property | MessageId | Gets the identifier of the ignored warning.
Public property | Reason | Gets or set the reason (a human-readable text) why the warning must be ignored.
Back to Top
See Also
IgnoreWarningAttribute Class
PostSharp Namespace

Online Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


IgnoreWarningAttribute Constructor

IgnoreWarningAttribute Constructor PostSharp Documentation
Creates a new instance of IgnoreWarningAttribute.

Namespace: PostSharp
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
public IgnoreWarningAttribute(
    string messageId
)
public IgnoreWarningAttribute(
    string messageId
)
Parameters
messageId
Type:   Online System String
Identifier of the ignored warning.
See Also
IgnoreWarningAttribute Class
IgnoreWarningAttribute Members
PostSharp Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


IgnoreWarningAttribute Properties

IgnoreWarningAttribute Properties PostSharp Documentation
The IgnoreWarningAttribute type exposes the following members.
Properties
 | Name | Description
Public property | MessageId | Gets the identifier of the ignored warning.
Public property | Reason | Gets or set the reason (a human-readable text) why the warning must be ignored.
Back to Top
See Also
IgnoreWarningAttribute Class
PostSharp Namespace

Online Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


IgnoreWarningAttribute.MessageId Property

IgnoreWarningAttribute MessageId Property PostSharp Documentation
Gets the identifier of the ignored warning.

Namespace: PostSharp
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
public string MessageId { get; private set; }
public string MessageId { get; private set; }
Property Value
Type:   Online String
See Also
IgnoreWarningAttribute Class
IgnoreWarningAttribute Members
PostSharp Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


IgnoreWarningAttribute.Reason Property

IgnoreWarningAttribute Reason Property PostSharp Documentation
Gets or set the reason (a human-readable text) why the warning must be ignored.

Namespace: PostSharp
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
public string Reason { get; set; }
public string Reason { get; set; }
Property Value
Type:   Online String
See Also
IgnoreWarningAttribute Class
IgnoreWarningAttribute Members
PostSharp Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


MessageLocation Class

MessageLocation Class PostSharp Documentation
Represents the location of a message, which means, for the end-user, a line in a file of source code. From the aspect developer, the location can be known as an object representing an element of code (for instance a Online Type or Online MethodInfo). Such implicit locations are resolved by PostSharp to a file and line number.
Inheritance Hierarchy
Online System Object
PostSharp MessageLocation

Namespace: PostSharp
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
[SerializableAttribute]
public class MessageLocation
[SerializableAttribute]
public class MessageLocation
Remarks
For unknown locations, prefer Unknown to null as it makes the code more readable.
\

Elements of code are mapped to locations asynchronously and out-of-process. The File, Line and
            Column may be unavailable by the thread or process emitting the message.
See Also
MessageLocation Members
PostSharp Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


MessageLocation Members

MessageLocation Members PostSharp Documentation

The MessageLocation type exposes the following members.
Methods
Name | Description
Explicit(String) | Builds a MessageLocation explicitely by specifying a filename, when the
Explicit(String, Int32, Int32) | Builds a MessageLocation explicitely by specifying a filename, line, and column.
Of(Object) | Builds a MessageLocation from an object representing an element of code ( Online Type, Online MethodInfo, Online ConstructorInfo, Online FieldInfo, Online Assembly, Online ParameterInfo, Online EventInfo, Online PropertyInfo or, if you are using PostSharp SDK, any Declaration).
Of(Assembly) | Builds a MessageLocation from an Online Assembly.
Of(MemberInfo) | Builds a MessageLocation from a Online MemberInfo ( Online Type, Online MethodInfo, Online ConstructorInfo, Online FieldInfo, Online PropertyInfo, Online EventInfo).
Of(ParameterInfo) | Builds a MessageLocation from a Online ParameterInfo.
Of(LocationInfo) | Builds a MessageLocation from a LocationInfo.
Of(SymbolSequencePoint) | Builds a MessageLocation from a SymbolSequencePoint.
Back to Top
Fields
Name | Description
Unknown | Represents an unknown or undeterminate location of the error message.
Back to Top
Properties
 | Name | Description
Public property | CodeElement | Element of code (reflection object or Declaration) from which the location must be resolved.
Public property | Column | Gets the column in the file that caused the message.
Public property | File | Gets the name of the file that caused the message.
Public property | Line | Gets the line in the file that caused the message.
Back to Top
See Also
MessageLocation Class
PostSharp Namespace

Online Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


MessageLocation Fields

MessageLocation Fields PostSharp Documentation
The MessageLocation type exposes the following members.
Fields
Name | Description
Unknown | Represents an unknown or undeterminate location of the error message.
Back to Top
See Also
MessageLocation Class
PostSharp Namespace

Online Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


MessageLocation.Unknown Field

MessageLocation Unknown Field PostSharp Documentation
Represents an unknown or undeterminate location of the error message.

Namespace: PostSharp
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
public static readonly MessageLocation Unknown
public static readonly MessageLocation Unknown
Field Value
Type: MessageLocation
See Also
MessageLocation Class
MessageLocation Members
PostSharp Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


MessageLocation Methods

MessageLocation Methods PostSharp Documentation
Methods
Name | Description
Explicit(String) | Builds a MessageLocation explicitely by specifying a filename, when the
Explicit(String, Int32, Int32) | Builds a MessageLocation explicitely by specifying a filename, line, and column.
Of(Object) | Builds a MessageLocation from an object representing an element of code ( Online Type, Online MethodInfo, Online ConstructorInfo, Online FieldInfo, Online Assembly, Online ParameterInfo, Online EventInfo, Online PropertyInfo or, if you are using PostSharp SDK, any Declaration).
Of(Assembly) | Builds a MessageLocation from an Online Assembly.
Of(MemberInfo) | Builds a MessageLocation from a Online MemberInfo ( Online Type, Online MethodInfo, Online ConstructorInfo, Online FieldInfo, Online PropertyInfo, Online EventInfo).
Of(ParameterInfo) | Builds a MessageLocation from a Online ParameterInfo.
Of(LocationInfo) | Builds a MessageLocation from a LocationInfo.
Of(SymbolSequencePoint) | Builds a MessageLocation from a SymbolSequencePoint.
Back to Top
See Also
MessageLocation Class
PostSharp Namespace

Online Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


MessageLocation.Explicit Method

MessageLocation Explicit Method PostSharp Documentation
Overload List
Name | Description
Explicit(String) | Builds a MessageLocation explicitely by specifying a filename, when the
Explicit(String, Int32, Int32) | Builds a MessageLocation explicitely by specifying a filename, line, and column.
Back to Top
See Also
MessageLocation Class
MessageLocation Members
PostSharp Namespace

Online Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


MessageLocation.Explicit Method (String)

MessageLocation Explicit Method (String) PostSharp Documentation
Builds a MessageLocation explicitely by specifying a filename, when the

Namespace: PostSharp
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
public static MessageLocation Explicit(
    string file
)
public static MessageLocation Explicit(
    string file
)
Parameters
file
Type:   Online System String
File name.
Return Value
Type: MessageLocation
A MessageLocation.
See Also
MessageLocation Class
MessageLocation Members
Explicit Overload
PostSharp Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


MessageLocation.Explicit Method (String, Int32, Int32)

MessageLocation Explicit Method (String, Int32, Int32) PostSharp Documentation
Builds a MessageLocation explicitely by specifying a filename, line, and column.

Namespace: PostSharp
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
public static MessageLocation Explicit(
    string file,
    int line,
    int column
)
public static MessageLocation Explicit(
    string file,
    int line,
    int column
)
Parameters
file
Type:   Online System String
File name.
line
Type:   Online System Int32
Line number.
column
Type:   Online System Int32
Column number.
Return Value
Type: MessageLocation
A MessageLocation.
See Also
MessageLocation Class
MessageLocation Members
Explicit Overload
PostSharp Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


MessageLocation.Of Method

MessageLocation Of Method PostSharp Documentation
Overload List
Name | Description
Of(Object) | Builds a MessageLocation from an object representing an element of code ( Online Type, Online MethodInfo, Online ConstructorInfo, Online FieldInfo, Online Assembly, Online ParameterInfo, Online EventInfo, Online PropertyInfo or, if you are using PostSharp SDK, any Declaration).
Of(Assembly) | Builds a MessageLocation from an Online Assembly.
Of(MemberInfo) | Builds a MessageLocation from a Online MemberInfo ( Online Type, Online MethodInfo, Online ConstructorInfo, Online FieldInfo, Online PropertyInfo, Online EventInfo).
Of(ParameterInfo) | Builds a MessageLocation from a Online ParameterInfo.
Of(LocationInfo) | Builds a MessageLocation from a LocationInfo.
Of(SymbolSequencePoint) | Builds a MessageLocation from a SymbolSequencePoint.
Back to Top
See Also
MessageLocation Class
MessageLocation Members
PostSharp Namespace

Online Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


MessageLocation.Of Method (Object)

MessageLocation Of Method (Object) PostSharp Documentation
Builds a MessageLocation from an object representing an element of code ( Online Type, Online MethodInfo, Online ConstructorInfo, Online FieldInfo, Online Assembly, Online ParameterInfo, Online EventInfo, Online PropertyInfo or, if you are using PostSharp SDK, any Declaration).

Namespace: PostSharp
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
public static MessageLocation Of(
    Object codeElement
)
public static MessageLocation Of(
    Object codeElement
)
Parameters
codeElement
Type:   Online System Object
an object representing an
            element of code (  Online Type,   Online MethodInfo,   Online ConstructorInfo,
              Online FieldInfo,   Online Assembly,   Online ParameterInfo,   Online EventInfo,
              Online PropertyInfo or, if you are using PostSharp SDK, any Declaration.
Return Value
Type: MessageLocation
A MessageLocation representing codeElement.
Remarks
If codeElement is null or cannot mapped to a location of code,
            this method silently returns Unknown.
See Also
MessageLocation Class
MessageLocation Members
Of Overload
PostSharp Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


MessageLocation.Of Method (Assembly)

MessageLocation Of Method (Assembly) PostSharp Documentation
Builds a MessageLocation from an Online Assembly.

Namespace: PostSharp
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
public static MessageLocation Of(
    Assembly assembly
)
public static MessageLocation Of(
    Assembly assembly
)
Parameters
assembly
Type:   Online System.Reflection Assembly
An   Online Assembly (  Online Assembly or its wrapper).
Return Value
Type: MessageLocation
A MessageLocation.
See Also
MessageLocation Class
MessageLocation Members
Of Overload
PostSharp Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


MessageLocation.Of Method (MemberInfo)

MessageLocation Of Method (MemberInfo) PostSharp Documentation
Builds a MessageLocation from a Online MemberInfo ( Online Type, Online MethodInfo, Online ConstructorInfo, Online FieldInfo, Online PropertyInfo, Online EventInfo).

Namespace: PostSharp
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
public static MessageLocation Of(
    MemberInfo member
)
public static MessageLocation Of(
    MemberInfo member
)
Parameters
member
Type:   Online System.Reflection MemberInfo
An element of code (  Online Type,
              Online MethodInfo,   Online ConstructorInfo,   Online FieldInfo,
              Online PropertyInfo,   Online EventInfo).
Return Value
Type: MessageLocation
A MessageLocation.
See Also
MessageLocation Class
MessageLocation Members
Of Overload
PostSharp Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


MessageLocation.Of Method (ParameterInfo)

MessageLocation Of Method (ParameterInfo) PostSharp Documentation
Builds a MessageLocation from a Online ParameterInfo.

Namespace: PostSharp
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
public static MessageLocation Of(
    ParameterInfo parameter
)
public static MessageLocation Of(
    ParameterInfo parameter
)
Parameters
parameter
Type:   Online System.Reflection ParameterInfo
A   Online ParameterInfo.
Return Value
Type: MessageLocation
A MessageLocation.
See Also
MessageLocation Class
MessageLocation Members
Of Overload
PostSharp Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


MessageLocation.Of Method (LocationInfo)

MessageLocation Of Method (LocationInfo) PostSharp Documentation
Builds a MessageLocation from a LocationInfo.

Namespace: PostSharp
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
public static MessageLocation Of(
    LocationInfo location
)
public static MessageLocation Of(
    LocationInfo location
)
Parameters
location
Type: PostSharp.Reflection LocationInfo
A LocationInfo.
Return Value
Type: MessageLocation
A MessageLocation.
See Also
MessageLocation Class
MessageLocation Members
Of Overload
PostSharp Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


MessageLocation.Of Method (SymbolSequencePoint)

MessageLocation Of Method (SymbolSequencePoint) PostSharp Documentation
Builds a MessageLocation from a SymbolSequencePoint.

Namespace: PostSharp
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
public static MessageLocation Of(
    SymbolSequencePoint symbolSequencePoint
)
public static MessageLocation Of(
    SymbolSequencePoint symbolSequencePoint
)
Parameters
symbolSequencePoint
Type: PostSharp.Reflection SymbolSequencePoint
A SymbolSequencePoint.
Return Value
Type: MessageLocation
A MessageLocation corresponding to symbolSequencePoint.
See Also
MessageLocation Class
MessageLocation Members
Of Overload
PostSharp Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


MessageLocation Properties

MessageLocation Properties PostSharp Documentation
The MessageLocation type exposes the following members.
Properties
 | Name | Description
Public property | CodeElement | Element of code (reflection object or Declaration) from which the location must be resolved.
Public property | Column | Gets the column in the file that caused the message.
Public property | File | Gets the name of the file that caused the message.
Public property | Line | Gets the line in the file that caused the message.
Back to Top
See Also
MessageLocation Class
PostSharp Namespace

Online Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


MessageLocation.CodeElement Property

MessageLocation CodeElement Property PostSharp Documentation
Element of code (reflection object or Declaration) from which the location must be resolved.

Namespace: PostSharp
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
public Object CodeElement { get; }
public Object CodeElement { get; }
Property Value
Type:   Online Object
See Also
MessageLocation Class
MessageLocation Members
PostSharp Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


MessageLocation.Column Property

MessageLocation Column Property PostSharp Documentation
Gets the column in the file that caused the message.
An integer greater or equal to 1, or 0 if the column is unknown or does not apply.

Namespace: PostSharp
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
public int Column { get; private set; }
public int Column { get; private set; }
Property Value
Type:   Online Int32
See Also
MessageLocation Class
MessageLocation Members
PostSharp Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


MessageLocation.File Property

MessageLocation File Property PostSharp Documentation
Gets the name of the file that caused the message.

Namespace: PostSharp
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
public string File { get; private set; }
public string File { get; private set; }
Property Value
Type:   Online String

              A full file name, or null if the file name
              is unknown or not applicable.

See Also
MessageLocation Class
MessageLocation Members
PostSharp Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


MessageLocation.Line Property

MessageLocation Line Property PostSharp Documentation
Gets the line in the file that caused the message.
An integer greater or equal to 1, or 0 if the line is unknown or does not apply.

Namespace: PostSharp
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
public int Line { get; private set; }
public int Line { get; private set; }
Property Value
Type:   Online Int32
See Also
MessageLocation Class
MessageLocation Members
PostSharp Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


Post Class

Post Class PostSharp Documentation
Provides some methods that are transformed during post-compilation.
Inheritance Hierarchy
Online System Object
PostSharp Post

Namespace: PostSharp
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
public static class Post
public static class Post
See Also
Post Members
PostSharp Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


Post Members

Post Members PostSharp Documentation

The Post type exposes the following members.
Methods
Name | Description
Cast SourceType, TargetType | At post-compile time, casts an instance of a type into another. A post-compile time error is reported if the source type cannot be assigned to the target type.
GetValue T | When used to retrieve the value of a field, forces the compiler to retrieve a copy of the field value instead of an address to this field. This allows to call instance methods of value-type fields without loading the field address.
Back to Top
Properties
Name | Description
IsTransformed | Determines whether the calling program has been transformed by PostSharp.
Back to Top
See Also
Post Class
PostSharp Namespace

Online Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


Post Methods

Post Methods PostSharp Documentation
The Post type exposes the following members.
Methods
Name | Description
Cast SourceType, TargetType | At post-compile time, casts an instance of a type into another. A post-compile time error is reported if the source type cannot be assigned to the target type.
GetValue T | When used to retrieve the value of a field, forces the compiler to retrieve a copy of the field value instead of an address to this field. This allows to call instance methods of value-type fields without loading the field address.
Back to Top
See Also
Post Class
PostSharp Namespace

Online Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


Post.Cast(SourceType, TargetType) Method

Post Cast SourceType, TargetType Method PostSharp Documentation
At post-compile time, casts an instance of a type into another. A post-compile time error is reported if the source type cannot be assigned to the target type.

Namespace: PostSharp
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
public static TargetType Cast<SourceType, TargetType>(
    SourceType o
)
where SourceType : class
where TargetType : class
public static TargetType Cast<SourceType, TargetType>(
    SourceType o
)
where SourceType : class
where TargetType : class
Parameters
o
Type: SourceType
Instance to be casted.
Type Parameters
SourceType
Source type.
TargetType
Target type.
Return Value
Type: TargetType
The object o casted as TargetType.
Remarks

              The purpose of this method is to make a source code compilable even when
              an interface will be implemented at post-compile time.
              PostSharp ensures that TargetType is assignable from
              SourceType. If yes, the call to this method is
              simply suppressed. If types are not assignable, a build error is issued.

See Also
Post Class
Post Members
PostSharp Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


Post.GetValue(T) Method

Post GetValue T Method PostSharp Documentation
When used to retrieve the value of a field, forces the compiler to retrieve a copy of the field value instead of an address to this field. This allows to call instance methods of value-type fields without loading the field address.

Namespace: PostSharp
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
public static T GetValue<T>(
    T value
)
where T : struct, new()
public static T GetValue<T>(
    T value
)
where T : struct, new()
Parameters
value
Type: T
Value.
Type Parameters
T
Type of the value to retrieve (this type parameter can generally be omitted).
Return Value
Type: T
value, exactly.
See Also
Post Class
Post Members
PostSharp Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


Post Properties

Post Properties PostSharp Documentation
The Post type exposes the following members.
Properties
Name | Description
IsTransformed | Determines whether the calling program has been transformed by PostSharp.
Back to Top
See Also
Post Class
PostSharp Namespace

Online Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


Post.IsTransformed Property

Post IsTransformed Property PostSharp Documentation
Determines whether the calling program has been transformed by PostSharp.

Namespace: PostSharp
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
public static bool IsTransformed { get; }
public static bool IsTransformed { get; }
Property Value
Type:   Online Boolean
true if the calling program has been transformed by PostSharp, otherwise
              false.

See Also
Post Class
Post Members
PostSharp Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


PostSharp.Aspects Namespace

PostSharp.Aspects Namespace PostSharp Documentation
The PostSharp.Aspects namespace provides the primitives of the PostSharp aspect-oriented framework, such as abstract aspect classes, aspect interfaces, and advise argument classes.
Classes
 | Class | Description
Public class | AdviceArgs | Base class for arguments of all advices.
Public class | Arguments | Encapsulation of method arguments.
Public class | Aspect | Base class for all aspects that are declared using multicast custom attributes (MulticastAttribute).
Public class | AspectInfo | Reserved for future usage.
Public class | AspectInstance | Completely specifies an aspect instance, including its target code element. An AspectInstance contains either the aspect instance itself (Aspect property), either information allowing to construct the aspect (AspectConstruction) and configure the weaver (AspectConfiguration).
Public class | AspectSpecification | Completely specifies an aspect instance (but not its target). An AspectSpecification either the aspect instance itself (Aspect property), either information allowing to construct the aspect (AspectConstruction) and configure the weaver (AspectConfiguration).
Public class | AspectUtilities | Utility methods for PostSharp.Aspects.
Public class | AssemblyLevelAspect | Base class for all aspects applied on assemblies.
Public class | CompositionAspect | Aspect that, when applied on a type, introduces one or many new interfaces into that type.
Public class | CustomAttributeIntroductionAspect | Aspect that, when applied to a target, adds a custom attribute to this target.
Public class | EventInterceptionArgs | Arguments of handlers of aspects of the type EventInterceptionAspect.
Public class | EventInterceptionAspect | Aspect that, when applied on an event, intercepts invocations of its semantics Add (OnAddHandler(EventInterceptionArgs)), Remove (OnRemoveHandler(EventInterceptionArgs)) and Invoke (OnInvokeHandler(EventInterceptionArgs)).
Public class | EventLevelAspect | Base class for all aspects applied on events.
Public class | ExternalAspect | Obsolete. Aspect implemented in a different type (implementing the IExternalAspectImplementation interface), typically contained in an external assembly. Classes derived from ExternalAspect must be annotated by the custom attribute ExternalAspectConfigurationAttribute.
Public class | FieldLevelAspect | Base class for all aspects applied on fields.
Public class | InstanceLevelAspect | Base class for aspects applied on types, but having the same lifetime as instances of the type to which they are applied.
Public class | LocationInterceptionArgs | Arguments of advices of aspect type LocationInterceptionAspect.
Public class | LocationInterceptionAspect | Aspect that, when applied on a location (field or property), intercepts invocations of the Get (OnGetValue(LocationInterceptionArgs)) and Set (OnSetValue(LocationInterceptionArgs)) semantics.
Public class | LocationLevelAspect | Base class for aspects defined in fields, properties, or parameters.
Public class | ManagedResourceIntroductionAspect | Aspect that, when applied to an assembly, adds a custom attribute to this assembly.
Public class | MethodExecutionArgs | Arguments of advices of aspects of type OnMethodBoundaryAspect and OnExceptionAspect
Public class | MethodImplementationAspect | Aspect that, when applied on an abstract or extern method, creates an implementation for this method.
Public class | MethodInterceptionArgs | Arguments of advices of aspect type MethodInterceptionAspect.
Public class | MethodInterceptionAspect | Aspect that, when applied on a method, intercepts invocations of this method.
Public class | MethodLevelAspect | Base class for all aspects applied on methods.
Public class | OnExceptionAspect | Aspect that, when applied to a method, defines an exception handler around the whole method and calls a custom method in this exception handler.
Public class | OnMethodBoundaryAspect | Aspect that, when applied to a method defined in the current assembly, inserts a piece of code before and after the body of these methods.
Public class | TypeIdentity | Wraps a Type or a type name.
Public class | TypeLevelAspect | Base class for all aspects applied on types.
Structures
 | Structure | Description
Public structure | InstanceCredentials | Credentials that give access to 'protected' semantics.
Interfaces
 | Interface | Description
Public interface | IAspect | Base interface for run-time semantics of all aspects.
Public interface | IAspectBuildSemantics | Compile-time semantics of IAspect.
Public interface | IAspectProvider | Interface that, when implemented by an aspect class, allows aspect instances to provide other aspects to the weaver.
Public interface | IAssemblyLevelAspect | Runtime semantics of aspects applied at assembly level.
Public interface | IAssemblyLevelAspectBuildSemantics | Build-time semantics of aspects applied at assembly level.
Public interface | ICloneAwareAspect | Defines the semantics of aspects that require to be notified after a target object is cloned using Online MemberwiseClone .
Public interface | IComposed T | Interface exposing the implementation of another interface introduced by a CompositionAspect.
Public interface | ICompositionAspect | Defines the semantics of an aspect that, when applied on a type, introduce one or many new interfaces into that type, and let these interfaces be implemented by an object created at runtime.
Public interface | ICustomAttributeIntroductionAspect | Semantics of an aspect that, when applied to a target, adds a custom attribute to this target.
Public interface | IEventBinding | Interface through which an event-level aspect or advice can invoke the next node in the chain of invocation.
Public interface | IEventInterceptionAspect | Runtime semantics of an aspect that, when applied on an event, intercepts invocations of its semantics Add (OnAddHandler(EventInterceptionArgs)), Remove (OnRemoveHandler(EventInterceptionArgs)) and Invoke (OnInvokeHandler(EventInterceptionArgs)) semantics.
Public interface | IEventLevelAspect | Runtime semantics of aspects that can be applied on events.
Public interface | IEventLevelAspectBuildSemantics | Build-time semantics of aspects that can be applied on events.
Public interface | IExternalAspect | Obsolete. Allows to turn an arbitrary custom attribute into an aspect, while implementing the aspect in a different class. Classes implementing this interface must be annotated with the ExternalAspectConfigurationAttribute custom attribute.
Public interface | IExternalAspectImplementation | Obsolete. Implementation of an IExternalAspect.
Public interface | IFieldLevelAspect | Run-time semantics of aspects applied to fields.
Public interface | IFieldLevelAspectBuildSemantics | Compile-time semantics of IFieldLevelAspect.
Public interface | IInstanceScopedAspect | Runtime semantics of aspects that have the same lifetime as instance of types to which their are applied (or instance of the declaring type of members to which they are applied).
Public interface | ILocationBinding | Interface through which a field- or property-level aspect or advice can invoke the next node in the chain of invocation.
Public interface | ILocationInterceptionAspect | Runtime semantics of an aspect that, when applied on a location (field or property), intercepts invocations of the Get (OnGetValue(LocationInterceptionArgs)) and Set (OnSetValue(LocationInterceptionArgs)) semantics.
Public interface | ILocationLevelAspect | Runtime semantics of aspects defined on a field, property, or parameter.
Public interface | ILocationLevelAspectBuildSemantics | Compile-time semantics of ILocationLevelAspect.
Public interface | ILocationValidationAspect | Ancestor of ILocationValidationAspect T .
Public interface | ILocationValidationAspect T | Runtime semantics of an aspect that, when applied on a location (field, property, or parameter), validates the value assigned to this location using method ValidateValue(T, String, LocationKind), and throws the exception returned by this method if any.
Public interface | IManagedResourceIntroductionAspect | Semantics of an aspect that, when applied to an assembly, adds a managed resource to this assembly.
Public interface | IMethodBinding | Interface through which a method-level aspect or advice can invoke the next node in the chain of invocation.
Public interface | IMethodInterceptionAspect | Runtime semantics of an aspect that, when applied on a method, intercepts invocations of this method.
Public interface | IMethodLevelAspect | Runtime semantics of aspects applied to methods.
Public interface | IMethodLevelAspectBuildSemantics | Compile-time semantics of IMethodLevelAspect.
Public interface | IOnExceptionAspect | Runtime semantics of an aspect that, when applied on a method, defines an exception handler around the whole method body and let the implementation of this interface handle the exception.
Public interface | IOnMethodBoundaryAspect | Runtime semantics of OnMethodBoundaryAspect.
Public interface | IProtectedInterface T | Gives access to a 'protected' interface, typically introduced by a CompositionAspect or a IntroduceInterfaceAttribute
Public interface | ITypeLevelAspect | Run-time semantics of aspects applied to types.
Public interface | ITypeLevelAspectBuildSemantics | Compile-time semantics of ITypeLevelAspect.
Enumerations
 | Enumeration | Description
Public enumeration | FlowBehavior | Enumerates the possible behaviors of the calling method after the calling method has returned.

Online Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


AdviceArgs Class

AdviceArgs Class PostSharp Documentation
Base class for arguments of all advices.
Inheritance Hierarchy
Online System Object
PostSharp.Aspects AdviceArgs
PostSharp.Aspects EventInterceptionArgs
PostSharp.Aspects LocationInterceptionArgs
PostSharp.Aspects MethodExecutionArgs
PostSharp.Aspects MethodInterceptionArgs

Namespace: PostSharp.Aspects
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
public class AdviceArgs
public class AdviceArgs
See Also
AdviceArgs Members
PostSharp.Aspects Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


AdviceArgs Members

AdviceArgs Members PostSharp Documentation

The AdviceArgs type exposes the following members.
Constructors
 | Name | Description
Public method | AdviceArgs | Initializes a new AdviceArgs.
Back to Top
Properties
 | Name | Description
Public property | Instance | Gets or sets the object instance on which the method is being executed.
Public property | InstanceCredentials | Obsolete.
Back to Top
See Also
AdviceArgs Class
PostSharp.Aspects Namespace

Online Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


AdviceArgs Constructor

AdviceArgs Constructor PostSharp Documentation
Initializes a new AdviceArgs.

Namespace: PostSharp.Aspects
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
public AdviceArgs(
    Object instance
)
public AdviceArgs(
    Object instance
)
Parameters
instance
Type:   Online System Object
The instance related to the advice invocation, or
              null if the advice is associated to a static element of code.
See Also
AdviceArgs Class
AdviceArgs Members
PostSharp.Aspects Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


AdviceArgs Properties

AdviceArgs Properties PostSharp Documentation
The AdviceArgs type exposes the following members.
Properties
 | Name | Description
Public property | Instance | Gets or sets the object instance on which the method is being executed.
Public property | InstanceCredentials | Obsolete.
Back to Top
See Also
AdviceArgs Class
PostSharp.Aspects Namespace

Online Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


AdviceArgs.Instance Property

AdviceArgs Instance Property PostSharp Documentation
Gets or sets the object instance on which the method is being executed.

Namespace: PostSharp.Aspects
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
public Object Instance { get; set; }
public Object Instance { get; set; }
Property Value
Type:   Online Object
Remarks

              This set may be set by user code only when the instance is a value type.
              As usually, user code is responsible for setting an object of the
              right type.

See Also
AdviceArgs Class
AdviceArgs Members
PostSharp.Aspects Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


AdviceArgs.InstanceCredentials Property

AdviceArgs InstanceCredentials Property PostSharp Documentation

[Missing <summary> documentation for "P:PostSharp.Aspects.AdviceArgs.InstanceCredentials"]

Namespace: PostSharp.Aspects
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
[ObsoleteAttribute]
public InstanceCredentials InstanceCredentials { get; set; }
[ObsoleteAttribute]
public InstanceCredentials InstanceCredentials { get; set; }
Property Value
Type: InstanceCredentials
See Also
AdviceArgs Class
AdviceArgs Members
PostSharp.Aspects Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


Arguments Class

Arguments Class PostSharp Documentation
Encapsulation of method arguments.
Inheritance Hierarchy
Online System Object
PostSharp.Aspects Arguments

Namespace: PostSharp.Aspects
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
public class Arguments : IList<Object>,
    ICollection<Object>, IEnumerable<Object>, IEnumerable,
    ICloneable
public class Arguments : IList<Object>,
    ICollection<Object>, IEnumerable<Object>, IEnumerable,
    ICloneable
Remarks
  Note  Note

                As a result of optimizations, an Arguments object may be shared between different
                advices. If an advice implementation needs to access an Arguments object after it has given over
                control, it should take a reference to a clone instead of the initial object itself.

  Note  Note

                Implementations of this type should be considered an implementation detail and should not be accessed
                by user code.

See Also
Arguments Members
PostSharp.Aspects Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


Arguments Members

Arguments Members PostSharp Documentation

The Arguments type exposes the following members.
Methods
 | Name | Description
Public method | Clone | Returns a shallow copy of the current object.
Public method | CopyFrom | Copies all the argument values from the elements of Online Array.
Public method | CopyTo | Copies all arguments values to the specified Online Array starting at the specified destination Online Array index.
Public method | GetArgument | Gets the value of the argument at a given index.
Public method | GetEnumerator | Returns an enumerator that iterates through the collection.
Public method | SetArgument | Sets the value of the argument at a given index.
Public method | ToArray | Converts the current argument list into an Online Array.
Back to Top
Fields
Name | Description
Empty | Empty list of Arguments.
Back to Top
Properties
 | Name | Description
Public property | Count | Gets the number of arguments encapsulated by the current object.
Public property | Item | Gets or sets the value of an argument.
Back to Top
See Also
Arguments Class
PostSharp.Aspects Namespace

Online Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


Arguments Fields

Arguments Fields PostSharp Documentation
The Arguments type exposes the following members.
Fields
Name | Description
Empty | Empty list of Arguments.
Back to Top
See Also
Arguments Class
PostSharp.Aspects Namespace

Online Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


Arguments.Empty Field

Arguments Empty Field PostSharp Documentation
Empty list of Arguments.

Namespace: PostSharp.Aspects
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
public static readonly Arguments Empty
public static readonly Arguments Empty
Field Value
Type: Arguments
See Also
Arguments Class
Arguments Members
PostSharp.Aspects Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


Arguments Methods

Arguments Methods PostSharp Documentation
The Arguments type exposes the following members.
Methods
 | Name | Description
Public method | Clone | Returns a shallow copy of the current object.
Public method | CopyFrom | Copies all the argument values from the elements of Online Array.
Public method | CopyTo | Copies all arguments values to the specified Online Array starting at the specified destination Online Array index.
Public method | GetArgument | Gets the value of the argument at a given index.
Public method | GetEnumerator | Returns an enumerator that iterates through the collection.
Public method | SetArgument | Sets the value of the argument at a given index.
Public method | ToArray | Converts the current argument list into an Online Array.
Back to Top
See Also
Arguments Class
PostSharp.Aspects Namespace

Online Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


Arguments.Clone Method

Arguments Clone Method PostSharp Documentation
Returns a shallow copy of the current object.

Namespace: PostSharp.Aspects
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
public Arguments Clone()
public Arguments Clone()
Return Value
Type: Arguments
A shallow copy of the current object.
See Also
Arguments Class
Arguments Members
PostSharp.Aspects Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


Arguments.CopyFrom Method

Arguments CopyFrom Method PostSharp Documentation
Copies all the argument values from the elements of Online Array.

Namespace: PostSharp.Aspects
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
public virtual void CopyFrom(
    Object[] array,
    int index
)
public virtual void CopyFrom(
    Object[] array,
    int index
)
Parameters
array
Type:    Online System Object
The array that is the source of the argument values copied into the current Arguments.
index
Type:   Online System Int32
An integer that represents the index in array at which copying begins.
Exceptions
Exception | Condition
Online System ArgumentNullException | array is null.
Online System ArgumentOutOfRangeException | index is lower than zero.
See Also
Arguments Class
Arguments Members
PostSharp.Aspects Namespace
Arguments CopyTo( Object , Int32)
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


Arguments.CopyTo Method

Arguments CopyTo Method PostSharp Documentation
Copies all arguments values to the specified Online Array starting at the specified destination Online Array index.

Namespace: PostSharp.Aspects
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
public virtual void CopyTo(
    Object[] array,
    int index
)
public virtual void CopyTo(
    Object[] array,
    int index
)
Parameters
array
Type:    Online System Object
The array that is the destination of argument values copied from the current Arguments.
index
Type:   Online System Int32
An integer that represents the index in array at which copying begins
Implements
  Online ICollection T  CopyTo( T , Int32)
See Also
Arguments Class
Arguments Members
PostSharp.Aspects Namespace
Arguments CopyFrom( Object , Int32)
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


Arguments.GetArgument Method

Arguments GetArgument Method PostSharp Documentation
Gets the value of the argument at a given index.

Namespace: PostSharp.Aspects
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
public virtual Object GetArgument(
    int index
)
public virtual Object GetArgument(
    int index
)
Parameters
index
Type:   Online System Int32
Argument index.
Return Value
Type:   Online Object
The value of the argument at position index.
Exceptions
Exception | Condition
Online System ArgumentOutOfRangeException | index is lower than zero or greater or equal than Count.
See Also
Arguments Class
Arguments Members
PostSharp.Aspects Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


Arguments.GetEnumerator Method

Arguments GetEnumerator Method PostSharp Documentation
Returns an enumerator that iterates through the collection.

Namespace: PostSharp.Aspects
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
public IEnumerator<Object> GetEnumerator()
public IEnumerator<Object> GetEnumerator()
Return Value
Type:   Online IEnumerator    Online Object
A   Online IEnumerator T  that can be used to iterate through the collection.
Implements
  Online IEnumerable T  GetEnumerator
See Also
Arguments Class
Arguments Members
PostSharp.Aspects Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


Arguments.SetArgument Method

Arguments SetArgument Method PostSharp Documentation
Sets the value of the argument at a given index.

Namespace: PostSharp.Aspects
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
public virtual void SetArgument(
    int index,
    Object value
)
public virtual void SetArgument(
    int index,
    Object value
)
Parameters
index
Type:   Online System Int32
Argument index.
value
Type:   Online System Object
New value of the argument at position index.
Exceptions
Exception | Condition
Online System InvalidCastException | value is not assignable to parameter at position index.
Online System ArgumentOutOfRangeException | index is lower than zero or greater or equal than Count.
See Also
Arguments Class
Arguments Members
PostSharp.Aspects Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


Arguments.ToArray Method

Arguments ToArray Method PostSharp Documentation
Converts the current argument list into an Online Array.

Namespace: PostSharp.Aspects
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
public Object[] ToArray()
public Object[] ToArray()
Return Value
Type:    Online Object
An   Online Array whose elements are equal to the values encapsulated by the current Arguments.
See Also
Arguments Class
Arguments Members
PostSharp.Aspects Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


Arguments Properties

Arguments Properties PostSharp Documentation
The Arguments type exposes the following members.
Properties
 | Name | Description
Public property | Count | Gets the number of arguments encapsulated by the current object.
Public property | Item | Gets or sets the value of an argument.
Back to Top
See Also
Arguments Class
PostSharp.Aspects Namespace

Online Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


Arguments.Count Property

Arguments Count Property PostSharp Documentation
Gets the number of arguments encapsulated by the current object.

Namespace: PostSharp.Aspects
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
public int Count { get; }
public int Count { get; }
Property Value
Type:   Online Int32
Implements
  Online ICollection T  Count
See Also
Arguments Class
Arguments Members
PostSharp.Aspects Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


Arguments.Item Property

Arguments Item Property PostSharp Documentation
Gets or sets the value of an argument.

Namespace: PostSharp.Aspects
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
public Object this[
    int index
] { get; set; }
public Object this[
    int index
] { get; set; }
Parameters
index
Type:   Online System Int32
Argument index.
Return Value
Type:   Online Object
The argument value.
Implements
  Online IList T  Item Int32
Exceptions
Exception | Condition
Online System ArgumentOutOfRangeException | index is lower than zero or greater or equal than Count.
See Also
Arguments Class
Arguments Members
PostSharp.Aspects Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


Aspect Class

Aspect Class PostSharp Documentation
Base class for all aspects that are declared using multicast custom attributes (MulticastAttribute).
Inheritance Hierarchy
Online System Object
Online System Attribute
PostSharp.Extensibility MulticastAttribute
PostSharp.Aspects Aspect
PostSharp.Aspects AssemblyLevelAspect
PostSharp.Aspects EventLevelAspect
PostSharp.Aspects ExternalAspect
PostSharp.Aspects FieldLevelAspect
PostSharp.Aspects LocationLevelAspect
PostSharp.Aspects MethodLevelAspect
PostSharp.Aspects TypeLevelAspect
PostSharp.Patterns.Threading ObserverLockAttribute

Namespace: PostSharp.Aspects
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
[SerializableAttribute]
public abstract class Aspect : MulticastAttribute,
    IAspect, IAspectBuildSemantics, IValidableAnnotation
[SerializableAttribute]
public abstract class Aspect : MulticastAttribute,
    IAspect, IAspectBuildSemantics, IValidableAnnotation
Remarks
This class is not specific to any kind of declaration (method, field, type, ...).
             Considering deriving your aspect from TypeLevelAspect, MethodLevelAspect, LocationLevelAspect,
            or EventLevelAspect if it should be applied to a specifc kind of declarations.

  Note  Note

      This class does not provide any advice. You may derive your aspect class from a

        class providing
        predefined advice

      , or build a
      composite aspect
      .

  Note  Note

        All classes implementing
        IAspect
        should typically be marked as serializable
        using the custom attribute
          Online SerializableAttribute
        . Fields that
        are only used at runtime (and unknown at compile-time) should be carefully
        marked with the custom attribute
          Online NonSerializedAttribute
        .
        When PostSharp is used on a platform that does not support aspect serialization
        (such as .NET Compact Framework, Silverlight, or Windows Phone), or when
        another aspect serializer is used, it is not necessary to mark the aspect
        class as serializable.
        For more information, see
        Aspect Serialization
        .

See Also
Aspect Members
PostSharp.Aspects Namespace

      Conceptual Documentation: Aspect Classes

      Conceptual Documentation: Developing Complex Aspects

      Conceptual Documentation: Aspect Serialization

  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


Aspect Members

Aspect Members PostSharp Documentation

The Aspect type exposes the following members.
Constructors
 | Name | Description
Protected method | Aspect | Initializes a new instance of the Aspect class
Back to Top
Methods
 | Name | Description
Public method | CompileTimeValidate | Method invoked at build time to ensure that the aspect has been applied to the right target.
Protected method | CreateAspectConfiguration | Method invoked at build time to create a concrete AspectConfiguration instance specifically for the current Aspect type.
Public method | GetAspectConfiguration | Method invoked at build tome to get the imperative configuration of the current Aspect.
Protected method | SetAspectConfiguration | Method invoked at build time to set up an AspectConfiguration object according to the current Aspect instance and a specified target element of the current aspect.
Back to Top
Properties
 | Name | Description
Public property | AspectPriority | Gets or sets the weaving priority of the aspect.
Public property | AttributeExclude | If true, indicates that this attribute removes all other instances of the same attribute type from the set of elements defined by the current instance. (Inherited from MulticastAttribute.)
Public property | AttributeId | Obsolete. (Inherited from MulticastAttribute.)
Public property | AttributeInheritance | Determines whether this attribute is inherited (Inherited from MulticastAttribute.)
Public property | AttributePriority | Gets or sets the priority of the current attribute in case that multiple instances are defined on the same element (lower values are processed before). (Inherited from MulticastAttribute.)
Public property | AttributeReplace | Determines whether this attribute replaces other attributes found on the target declarations. (Inherited from MulticastAttribute.)
Public property | AttributeTargetAssemblies | Gets or sets the assemblies to which the current attribute apply. (Inherited from MulticastAttribute.)
Public property | AttributeTargetElements | Gets or sets the kind of elements to which this custom attributes applies. (Inherited from MulticastAttribute.)
Public property | AttributeTargetExternalMemberAttributes | Gets or sets the visibilities, scopes, virtualities, and implementation of members to which this attribute applies, when the member is external to the current module. (Inherited from MulticastAttribute.)
Public property | AttributeTargetExternalTypeAttributes | Gets or sets the visibilities of types to which this attribute applies, when this type is external to the current module. (Inherited from MulticastAttribute.)
Public property | AttributeTargetMemberAttributes | Gets or sets the visibilities, scopes, virtualities, and implementation of members to which this attribute applies. (Inherited from MulticastAttribute.)
Public property | AttributeTargetMembers | Gets or sets the expression specifying to which members this instance applies. (Inherited from MulticastAttribute.)
Public property | AttributeTargetParameterAttributes | Gets or sets the passing style (by value, out or ref) of parameters to which this attribute applies. (Inherited from MulticastAttribute.)
Public property | AttributeTargetParameters | Gets or sets the expression specifying to which parameters this instance applies. (Inherited from MulticastAttribute.)
Public property | AttributeTargetTypeAttributes | Gets or sets the visibilities of types to which this attribute applies. (Inherited from MulticastAttribute.)
Public property | AttributeTargetTypes | Gets or sets the expression specifying to which types this instance applies. (Inherited from MulticastAttribute.)
Protected property | SerializerType | Gets or sets the Online Type of the serializer (a type derived from AspectSerializer) used to serialize the aspect instance at build time and deserialize it at runtime.
Back to Top
See Also
Aspect Class
PostSharp.Aspects Namespace

Online Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


Aspect Constructor

Aspect Constructor PostSharp Documentation
Initializes a new instance of the Aspect class

Namespace: PostSharp.Aspects
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
protected Aspect()
protected Aspect()
See Also
Aspect Class
Aspect Members
PostSharp.Aspects Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


Aspect Methods

Aspect Methods PostSharp Documentation
The Aspect type exposes the following members.
Methods
 | Name | Description
Public method | CompileTimeValidate | Method invoked at build time to ensure that the aspect has been applied to the right target.
Protected method | CreateAspectConfiguration | Method invoked at build time to create a concrete AspectConfiguration instance specifically for the current Aspect type.
Public method | GetAspectConfiguration | Method invoked at build tome to get the imperative configuration of the current Aspect.
Protected method | SetAspectConfiguration | Method invoked at build time to set up an AspectConfiguration object according to the current Aspect instance and a specified target element of the current aspect.
Back to Top
See Also
Aspect Class
PostSharp.Aspects Namespace

Online Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


Aspect.CompileTimeValidate Method

Aspect CompileTimeValidate Method PostSharp Documentation
Method invoked at build time to ensure that the aspect has been applied to the right target.

Namespace: PostSharp.Aspects
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
public virtual bool CompileTimeValidate(
    Object target
)
public virtual bool CompileTimeValidate(
    Object target
)
Parameters
target
Type:   Online System Object
Code element (  Online Assembly,   Online Type,
                Online FieldInfo,   Online MethodBase,   Online PropertyInfo,   Online EventInfo,
                Online ParameterInfo, or LocationInfo) to which the aspect has been applied.
Return Value
Type:   Online Boolean
true if the aspect was applied to an acceptable target, otherwise
              false.
Remarks

              The implementation of this method is expected to emit an error message (see
              MessageSource) or an exception in case of error. Returning false without emitting an
              error message or exception causes the aspect to be silently ignored.

See Also
Aspect Class
Aspect Members
PostSharp.Aspects Namespace

      Conceptual Documentation: Validating Aspects

  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


Aspect.CreateAspectConfiguration Method

Aspect CreateAspectConfiguration Method PostSharp Documentation
Method invoked at build time to create a concrete AspectConfiguration instance specifically for the current Aspect type.

Namespace: PostSharp.Aspects
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
protected virtual AspectConfiguration CreateAspectConfiguration()
protected virtual AspectConfiguration CreateAspectConfiguration()
Return Value
Type: AspectConfiguration
A new and empty instance of AspectConfiguration, whose concrete type corresponds to
              the concrete type of the Aspect.
Remarks

              This method should not set up the returned AspectConfiguration. After the current method has
              returned, the SetAspectConfiguration(AspectConfiguration, Object) method will be invoked, and this method is responsible
              for setting up the AspectConfigurationobject.

See Also
Aspect Class
Aspect Members
PostSharp.Aspects Namespace

      Conceptual Documentation: Configuring Aspects

  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


Aspect.GetAspectConfiguration Method

Aspect GetAspectConfiguration Method PostSharp Documentation
Method invoked at build tome to get the imperative configuration of the current Aspect.

Namespace: PostSharp.Aspects
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
public AspectConfiguration GetAspectConfiguration(
    Object targetElement
)
public AspectConfiguration GetAspectConfiguration(
    Object targetElement
)
Parameters
targetElement
Type:   Online System Object
Code element (  Online Assembly,   Online Type,
                Online FieldInfo,   Online MethodBase,   Online PropertyInfo,   Online EventInfo,
                Online ParameterInfo, or LocationInfo) to which the current Aspect
              has been applied.

Return Value
Type: AspectConfiguration
An AspectConfiguration representing the imperative configuration
              of the current Aspect.
Implements
IAspectBuildSemantics GetAspectConfiguration(Object)
Remarks
This method can be customized by overriding CreateAspectConfiguration  and/or
                SetAspectConfiguration(AspectConfiguration, Object)
.

See Also
Aspect Class
Aspect Members
PostSharp.Aspects Namespace

      Conceptual Documentation: Configuring Aspects

  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


Aspect.SetAspectConfiguration Method

Aspect SetAspectConfiguration Method PostSharp Documentation
Method invoked at build time to set up an AspectConfiguration object according to the current Aspect instance and a specified target element of the current aspect.

Namespace: PostSharp.Aspects
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
protected virtual void SetAspectConfiguration(
    AspectConfiguration aspectConfiguration,
    Object targetElement
)
protected virtual void SetAspectConfiguration(
    AspectConfiguration aspectConfiguration,
    Object targetElement
)
Parameters
aspectConfiguration
Type: PostSharp.Aspects.Configuration AspectConfiguration
The AspectConfiguration instance previously returned  by the
              CreateAspectConfiguration  method.
targetElement
Type:   Online System Object
Code element (  Online Assembly,   Online Type,
                Online FieldInfo,   Online MethodBase,   Online PropertyInfo,   Online EventInfo,
                Online ParameterInfo, or LocationInfo) to which the current Aspect
              has been applied.

Remarks
Classes overriding this method must always invoke the base implementation before performing their own
                changes to the
                AspectConfiguration.
See Also
Aspect Class
Aspect Members
PostSharp.Aspects Namespace

      Conceptual Documentation: Configuring Aspects

  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


Aspect Properties

Aspect Properties PostSharp Documentation
The Aspect type exposes the following members.
Properties
 | Name | Description
Public property | AspectPriority | Gets or sets the weaving priority of the aspect.
Public property | AttributeExclude | If true, indicates that this attribute removes all other instances of the same attribute type from the set of elements defined by the current instance. (Inherited from MulticastAttribute.)
Public property | AttributeId | Obsolete. (Inherited from MulticastAttribute.)
Public property | AttributeInheritance | Determines whether this attribute is inherited (Inherited from MulticastAttribute.)
Public property | AttributePriority | Gets or sets the priority of the current attribute in case that multiple instances are defined on the same element (lower values are processed before). (Inherited from MulticastAttribute.)
Public property | AttributeReplace | Determines whether this attribute replaces other attributes found on the target declarations. (Inherited from MulticastAttribute.)
Public property | AttributeTargetAssemblies | Gets or sets the assemblies to which the current attribute apply. (Inherited from MulticastAttribute.)
Public property | AttributeTargetElements | Gets or sets the kind of elements to which this custom attributes applies. (Inherited from MulticastAttribute.)
Public property | AttributeTargetExternalMemberAttributes | Gets or sets the visibilities, scopes, virtualities, and implementation of members to which this attribute applies, when the member is external to the current module. (Inherited from MulticastAttribute.)
Public property | AttributeTargetExternalTypeAttributes | Gets or sets the visibilities of types to which this attribute applies, when this type is external to the current module. (Inherited from MulticastAttribute.)
Public property | AttributeTargetMemberAttributes | Gets or sets the visibilities, scopes, virtualities, and implementation of members to which this attribute applies. (Inherited from MulticastAttribute.)
Public property | AttributeTargetMembers | Gets or sets the expression specifying to which members this instance applies. (Inherited from MulticastAttribute.)
Public property | AttributeTargetParameterAttributes | Gets or sets the passing style (by value, out or ref) of parameters to which this attribute applies. (Inherited from MulticastAttribute.)
Public property | AttributeTargetParameters | Gets or sets the expression specifying to which parameters this instance applies. (Inherited from MulticastAttribute.)
Public property | AttributeTargetTypeAttributes | Gets or sets the visibilities of types to which this attribute applies. (Inherited from MulticastAttribute.)
Public property | AttributeTargetTypes | Gets or sets the expression specifying to which types this instance applies. (Inherited from MulticastAttribute.)
Protected property | SerializerType | Gets or sets the Online Type of the serializer (a type derived from AspectSerializer) used to serialize the aspect instance at build time and deserialize it at runtime.
Back to Top
See Also
Aspect Class
PostSharp.Aspects Namespace

Online Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


Aspect.AspectPriority Property

Aspect AspectPriority Property PostSharp Documentation
Gets or sets the weaving priority of the aspect.

Namespace: PostSharp.Aspects
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
public int AspectPriority { get; set; }
public int AspectPriority { get; set; }
Property Value
Type:   Online Int32
The aspect priority, or null if the aspect priority is
              not specified.
Remarks
Advices with lower priority are executed before in case of
                'entry' semantics (entering or invoking a method, setting a field
                value), but this order is inverted for advices of 'exit' semantics
                (leaving a method, getting a field value).

This property must not be confused with
                AttributePriority, which solely
                influences the multicasting process.
See Also
Aspect Class
Aspect Members
PostSharp.Aspects Namespace

      Conceptual Documentation: Coping with Several Aspects on the Same Target

  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


Aspect.SerializerType Property

Aspect SerializerType Property PostSharp Documentation
Gets or sets the Online Type of the serializer (a type derived from AspectSerializer) used to serialize the aspect instance at build time and deserialize it at runtime.

Namespace: PostSharp.Aspects
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
protected Type SerializerType { get; set; }
protected Type SerializerType { get; set; }
Property Value
Type:   Online Type
See Also
Aspect Class
Aspect Members
PostSharp.Aspects Namespace

      Conceptual Documentation: Aspect Serialization

  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


AspectInfo Class

AspectInfo Class PostSharp Documentation
Reserved for future usage.
Inheritance Hierarchy
Online System Object
PostSharp.Aspects AspectInfo

Namespace: PostSharp.Aspects
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
public sealed class AspectInfo
public sealed class AspectInfo
See Also
AspectInfo Members
PostSharp.Aspects Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


AspectInfo Members

AspectInfo Members PostSharp Documentation

The AspectInfo type exposes the following members.
Constructors
 | Name | Description
Public method | AspectInfo | Initializes a new instance of the AspectInfo class
Back to Top
See Also
AspectInfo Class
PostSharp.Aspects Namespace

Online Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


AspectInfo Constructor

AspectInfo Constructor PostSharp Documentation
Initializes a new instance of the AspectInfo class

Namespace: PostSharp.Aspects
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
public AspectInfo()
public AspectInfo()
See Also
AspectInfo Class
AspectInfo Members
PostSharp.Aspects Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


AspectInstance Class

AspectInstance Class PostSharp Documentation
Completely specifies an aspect instance, including its target code element. An AspectInstance contains either the aspect instance itself (Aspect property), either information allowing to construct the aspect (AspectConstruction) and configure the weaver (AspectConfiguration).
Inheritance Hierarchy
Online System Object
PostSharp.Aspects AspectSpecification
PostSharp.Aspects AspectInstance

Namespace: PostSharp.Aspects
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
public sealed class AspectInstance : AspectSpecification
public sealed class AspectInstance : AspectSpecification
See Also
AspectInstance Members
PostSharp.Aspects Namespace

      Conceptual Documentation: Adding Aspects Dynamically

  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


AspectInstance Members

AspectInstance Members PostSharp Documentation

The AspectInstance type exposes the following members.
Constructors
 | Name | Description
Public method | AspectInstance(Object, IAspect) | Initializes a new AspectInstance from a runtime aspect instance (IAspect).
Public method | AspectInstance(Object, IAspect, AspectConfiguration) | Initializes a new AspectInstance from a runtime aspect instance (IAspect) and its AspectConfiguration.
Public method | AspectInstance(Object, ObjectConstruction, AspectConfiguration) | Initializes a new AspectInstance from
Back to Top
Properties
 | Name | Description
Public property | Aspect | Gets the aspect instance. (Inherited from AspectSpecification.)
Public property | AspectAssemblyQualifiedTypeName | Gets the assembly-qualified type name of the aspect. (Inherited from AspectSpecification.)
Public property | AspectConfiguration | Gets the aspect configuration. (Inherited from AspectSpecification.)
Public property | AspectConstruction | Gets the aspect construction. (Inherited from AspectSpecification.)
Public property | AspectTypeName | Gets the type name of the aspect. (Inherited from AspectSpecification.)
Public property | TargetElement | Gets the code element ( Online Assembly, Online Type, Online FieldInfo, Online MethodBase, Online PropertyInfo, Online EventInfo, Online ParameterInfo, or LocationInfo) to which the current AspectInstance is applied.
Back to Top
See Also
AspectInstance Class
PostSharp.Aspects Namespace

Online Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


AspectInstance Constructor

AspectInstance Constructor PostSharp Documentation
Overload List
 | Name | Description
Public method | AspectInstance(Object, IAspect) | Initializes a new AspectInstance from a runtime aspect instance (IAspect).
Public method | AspectInstance(Object, IAspect, AspectConfiguration) | Initializes a new AspectInstance from a runtime aspect instance (IAspect) and its AspectConfiguration.
Public method | AspectInstance(Object, ObjectConstruction, AspectConfiguration) | Initializes a new AspectInstance from
Back to Top
See Also
AspectInstance Class
AspectInstance Members
PostSharp.Aspects Namespace

Online Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


AspectInstance Constructor (Object, IAspect)

AspectInstance Constructor (Object, IAspect) PostSharp Documentation
Initializes a new AspectInstance from a runtime aspect instance (IAspect).

Namespace: PostSharp.Aspects
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
public AspectInstance(
    Object targetElement,
    IAspect aspect
)
public AspectInstance(
    Object targetElement,
    IAspect aspect
)
Parameters
targetElement
Type:   Online System Object
Code element (  Online Assembly,   Online Type,
                Online FieldInfo,   Online MethodBase,   Online PropertyInfo,   Online EventInfo,
                Online ParameterInfo, or LocationInfo) to which the current AspectInstance
              is applied.
aspect
Type: PostSharp.Aspects IAspect
The aspect runtime instance.
See Also
AspectInstance Class
AspectInstance Members
AspectInstance Overload
PostSharp.Aspects Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


AspectInstance Constructor (Object, IAspect, AspectConfiguration)

AspectInstance Constructor (Object, IAspect, AspectConfiguration) PostSharp Documentation
Initializes a new AspectInstance from a runtime aspect instance (IAspect) and its AspectConfiguration.

Namespace: PostSharp.Aspects
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
public AspectInstance(
    Object targetElement,
    IAspect aspect,
    AspectConfiguration aspectConfiguration
)
public AspectInstance(
    Object targetElement,
    IAspect aspect,
    AspectConfiguration aspectConfiguration
)
Parameters
targetElement
Type:   Online System Object
Code element (  Online Assembly,   Online Type,
                Online FieldInfo,   Online MethodBase,   Online PropertyInfo,   Online EventInfo,
                Online ParameterInfo, or LocationInfo) to which the current AspectInstance
              is applied.
aspect
Type: PostSharp.Aspects IAspect
The aspect runtime instance.
aspectConfiguration
Type: PostSharp.Aspects.Configuration AspectConfiguration
The aspect configuration (the type of this parameter should be equal to the
              type configuration objects expected by the concrete aspect).
See Also
AspectInstance Class
AspectInstance Members
AspectInstance Overload
PostSharp.Aspects Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


AspectInstance Constructor (Object, ObjectConstruction, AspectConfiguration)

AspectInstance Constructor (Object, ObjectConstruction, AspectConfiguration) PostSharp Documentation
Initializes a new AspectInstance from

Namespace: PostSharp.Aspects
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
public AspectInstance(
    Object targetElement,
    ObjectConstruction aspectConstruction,
    AspectConfiguration aspectConfiguration
)
public AspectInstance(
    Object targetElement,
    ObjectConstruction aspectConstruction,
    AspectConfiguration aspectConfiguration
)
Parameters
targetElement
Type:   Online System Object
Code element (  Online Assembly,   Online Type,
                Online FieldInfo,   Online MethodBase,   Online PropertyInfo,   Online EventInfo,
                Online ParameterInfo, or LocationInfo) to which the current AspectInstance
              is applied.
aspectConstruction
Type: PostSharp.Reflection ObjectConstruction
An ObjectConstruction instructing how the aspect instance
              should be constructed.
aspectConfiguration
Type: PostSharp.Aspects.Configuration AspectConfiguration
An optional configuration object whose type corresponds to
              the the aspect type.
See Also
AspectInstance Class
AspectInstance Members
AspectInstance Overload
PostSharp.Aspects Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


AspectInstance Properties

AspectInstance Properties PostSharp Documentation
The AspectInstance type exposes the following members.
Properties
 | Name | Description
Public property | Aspect | Gets the aspect instance. (Inherited from AspectSpecification.)
Public property | AspectAssemblyQualifiedTypeName | Gets the assembly-qualified type name of the aspect. (Inherited from AspectSpecification.)
Public property | AspectConfiguration | Gets the aspect configuration. (Inherited from AspectSpecification.)
Public property | AspectConstruction | Gets the aspect construction. (Inherited from AspectSpecification.)
Public property | AspectTypeName | Gets the type name of the aspect. (Inherited from AspectSpecification.)
Public property | TargetElement | Gets the code element ( Online Assembly, Online Type, Online FieldInfo, Online MethodBase, Online PropertyInfo, Online EventInfo, Online ParameterInfo, or LocationInfo) to which the current AspectInstance is applied.
Back to Top
See Also
AspectInstance Class
PostSharp.Aspects Namespace

Online Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


AspectInstance.TargetElement Property

AspectInstance TargetElement Property PostSharp Documentation
Gets the code element ( Online Assembly, Online Type, Online FieldInfo, Online MethodBase, Online PropertyInfo, Online EventInfo, Online ParameterInfo, or LocationInfo) to which the current AspectInstance is applied.

Namespace: PostSharp.Aspects
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
public Object TargetElement { get; private set; }
public Object TargetElement { get; private set; }
Property Value
Type:   Online Object
See Also
AspectInstance Class
AspectInstance Members
PostSharp.Aspects Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


AspectSpecification Class

AspectSpecification Class PostSharp Documentation
Completely specifies an aspect instance (but not its target). An AspectSpecification either the aspect instance itself (Aspect property), either information allowing to construct the aspect (AspectConstruction) and configure the weaver (AspectConfiguration).
Inheritance Hierarchy
Online System Object
PostSharp.Aspects AspectSpecification
PostSharp.Aspects AspectInstance

Namespace: PostSharp.Aspects
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
public class AspectSpecification
public class AspectSpecification
Remarks

              User code cannot create an instance of the AspectSpecification class. Always create an instance of
              AspectInstance instead.

See Also
AspectSpecification Members
PostSharp.Aspects Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


AspectSpecification Members

AspectSpecification Members PostSharp Documentation

The AspectSpecification type exposes the following members.
Constructors
 | Name | Description
Protected method | AspectSpecification | Initializes a new AspectSpecification when one cannot provide an aspect instance, i.e. from an ObjectConstruction and a AspectConfiguration.
Back to Top
Properties
 | Name | Description
Public property | Aspect | Gets the aspect instance.
Public property | AspectAssemblyQualifiedTypeName | Gets the assembly-qualified type name of the aspect.
Public property | AspectConfiguration | Gets the aspect configuration.
Public property | AspectConstruction | Gets the aspect construction.
Public property | AspectTypeName | Gets the type name of the aspect.
Back to Top
See Also
AspectSpecification Class
PostSharp.Aspects Namespace

Online Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


AspectSpecification Constructor

AspectSpecification Constructor PostSharp Documentation
Initializes a new AspectSpecification when one cannot provide an aspect instance, i.e. from an ObjectConstruction and a AspectConfiguration.

Namespace: PostSharp.Aspects
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
protected AspectSpecification(
    ObjectConstruction aspectConstruction,
    AspectConfiguration aspectConfiguration
)
protected AspectSpecification(
    ObjectConstruction aspectConstruction,
    AspectConfiguration aspectConfiguration
)
Parameters
aspectConstruction
Type: PostSharp.Reflection ObjectConstruction
Aspect construction.
aspectConfiguration
Type: PostSharp.Aspects.Configuration AspectConfiguration
Aspect configuration.
See Also
AspectSpecification Class
AspectSpecification Members
PostSharp.Aspects Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


AspectSpecification Properties

AspectSpecification Properties PostSharp Documentation
The AspectSpecification type exposes the following members.
Properties
 | Name | Description
Public property | Aspect | Gets the aspect instance.
Public property | AspectAssemblyQualifiedTypeName | Gets the assembly-qualified type name of the aspect.
Public property | AspectConfiguration | Gets the aspect configuration.
Public property | AspectConstruction | Gets the aspect construction.
Public property | AspectTypeName | Gets the type name of the aspect.
Back to Top
See Also
AspectSpecification Class
PostSharp.Aspects Namespace

Online Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


AspectSpecification.Aspect Property

AspectSpecification Aspect Property PostSharp Documentation
Gets the aspect instance.

Namespace: PostSharp.Aspects
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
public IAspect Aspect { get; }
public IAspect Aspect { get; }
Property Value
Type: IAspect

              The aspect instance, or null if the AspectConfiguration was provided instead.

See Also
AspectSpecification Class
AspectSpecification Members
PostSharp.Aspects Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


AspectSpecification.AspectAssemblyQualifiedTypeName Property

AspectSpecification AspectAssemblyQualifiedTypeName Property PostSharp Documentation
Gets the assembly-qualified type name of the aspect.

Namespace: PostSharp.Aspects
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
public string AspectAssemblyQualifiedTypeName { get; }
public string AspectAssemblyQualifiedTypeName { get; }
Property Value
Type:   Online String
See Also
AspectSpecification Class
AspectSpecification Members
PostSharp.Aspects Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


AspectSpecification.AspectConfiguration Property

AspectSpecification AspectConfiguration Property PostSharp Documentation
Gets the aspect configuration.

Namespace: PostSharp.Aspects
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
public AspectConfiguration AspectConfiguration { get; }
public AspectConfiguration AspectConfiguration { get; }
Property Value
Type: AspectConfiguration

              The aspect configuration, or null if none was provided.

See Also
AspectSpecification Class
AspectSpecification Members
PostSharp.Aspects Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


AspectSpecification.AspectConstruction Property

AspectSpecification AspectConstruction Property PostSharp Documentation
Gets the aspect construction.

Namespace: PostSharp.Aspects
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
public ObjectConstruction AspectConstruction { get; }
public ObjectConstruction AspectConstruction { get; }
Property Value
Type: ObjectConstruction

              The aspect construction, or null if the aspect instance was provided instead.

See Also
AspectSpecification Class
AspectSpecification Members
PostSharp.Aspects Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


AspectSpecification.AspectTypeName Property

AspectSpecification AspectTypeName Property PostSharp Documentation
Gets the type name of the aspect.

Namespace: PostSharp.Aspects
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
public string AspectTypeName { get; }
public string AspectTypeName { get; }
Property Value
Type:   Online String
See Also
AspectSpecification Class
AspectSpecification Members
PostSharp.Aspects Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


AspectUtilities Class

AspectUtilities Class PostSharp Documentation
Utility methods for PostSharp.Aspects.
Inheritance Hierarchy
Online System Object
PostSharp.Aspects AspectUtilities

Namespace: PostSharp.Aspects
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
public sealed class AspectUtilities
public sealed class AspectUtilities
See Also
AspectUtilities Members
PostSharp.Aspects Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


AspectUtilities Members

AspectUtilities Members PostSharp Documentation

The AspectUtilities type exposes the following members.
Constructors
 | Name | Description
Public method | AspectUtilities | Initializes a new instance of the AspectUtilities class
Back to Top
Methods
Name | Description
GetCurrentInstanceCredentials | Gets the InstanceCredentials of the calling instance. This method must be invoked from an instance method (not a static method) of a type that has been enhanced by an aspect.
InitializeCurrentAspects | Initializes the all the aspects of the calling instance. This method must be invoked from an instance method (not a static method) of a type that has been enhanced by an aspect.
Back to Top
See Also
AspectUtilities Class
PostSharp.Aspects Namespace

Online Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


AspectUtilities Constructor

AspectUtilities Constructor PostSharp Documentation
Initializes a new instance of the AspectUtilities class

Namespace: PostSharp.Aspects
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
public AspectUtilities()
public AspectUtilities()
See Also
AspectUtilities Class
AspectUtilities Members
PostSharp.Aspects Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


AspectUtilities Methods

AspectUtilities Methods PostSharp Documentation
The AspectUtilities type exposes the following members.
Methods
Name | Description
GetCurrentInstanceCredentials | Gets the InstanceCredentials of the calling instance. This method must be invoked from an instance method (not a static method) of a type that has been enhanced by an aspect.
InitializeCurrentAspects | Initializes the all the aspects of the calling instance. This method must be invoked from an instance method (not a static method) of a type that has been enhanced by an aspect.
Back to Top
See Also
AspectUtilities Class
PostSharp.Aspects Namespace

Online Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


AspectUtilities.GetCurrentInstanceCredentials Method

AspectUtilities GetCurrentInstanceCredentials Method PostSharp Documentation
Gets the InstanceCredentials of the calling instance. This method must be invoked from an instance method (not a static method) of a type that has been enhanced by an aspect.

Namespace: PostSharp.Aspects
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
public static InstanceCredentials GetCurrentInstanceCredentials()
public static InstanceCredentials GetCurrentInstanceCredentials()
Return Value
Type: InstanceCredentials
The InstanceCredentials of the calling instance.
Remarks

                Calls to this method are transformed, at build time, to calls to
                this.GetInstanceCredentials, a method that is typically generated by PostSharp.
                This is why the current method has actually no
                implementation.

  Note  Note

                Aspect credentials are considered obsolete and their use should be avoided.

See Also
AspectUtilities Class
AspectUtilities Members
PostSharp.Aspects Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


AspectUtilities.InitializeCurrentAspects Method

AspectUtilities InitializeCurrentAspects Method PostSharp Documentation
Initializes the all the aspects of the calling instance. This method must be invoked from an instance method (not a static method) of a type that has been enhanced by an aspect.

Namespace: PostSharp.Aspects
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
public static void InitializeCurrentAspects()
public static void InitializeCurrentAspects()
Remarks

                Calls to this method are transformed, at build time, to calls to
                this.InitializeAspects, a method that is typically generated by PostSharp.
                This is why the current method has actually no implementation.

                The constructors of enhanced classes always initialize aspects. The only scenario
                where this method needs to be invoked manually is when instances are not built
                using the constructor, but for instance with the method   Online GetUninitializedObject(Type).

See Also
AspectUtilities Class
AspectUtilities Members
PostSharp.Aspects Namespace

      Conceptual Documentation: Coping with Custom Serializers

  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


AssemblyLevelAspect Class

AssemblyLevelAspect Class PostSharp Documentation
Base class for all aspects applied on assemblies.
Inheritance Hierarchy
Online System Object
Online System Attribute
PostSharp.Extensibility MulticastAttribute
PostSharp.Aspects Aspect
PostSharp.Aspects AssemblyLevelAspect
PostSharp.Patterns.Threading DeadlockDetectionPolicy

Namespace: PostSharp.Aspects
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
[SerializableAttribute]
public abstract class AssemblyLevelAspect : Aspect,
    IAssemblyLevelAspect, IAssemblyLevelAspectBuildSemantics, IAspect
[SerializableAttribute]
public abstract class AssemblyLevelAspect : Aspect,
    IAssemblyLevelAspect, IAssemblyLevelAspectBuildSemantics, IAspect
Remarks
  Note  Note

      This class does not provide any advice. You may derive your aspect class from a

        class providing
        predefined advice

      , or build a
      composite aspect
      .

  Note  Note

        All classes implementing
        IAspect
        should typically be marked as serializable
        using the custom attribute
          Online SerializableAttribute
        . Fields that
        are only used at runtime (and unknown at compile-time) should be carefully
        marked with the custom attribute
          Online NonSerializedAttribute
        .
        When PostSharp is used on a platform that does not support aspect serialization
        (such as .NET Compact Framework, Silverlight, or Windows Phone), or when
        another aspect serializer is used, it is not necessary to mark the aspect
        class as serializable.
        For more information, see
        Aspect Serialization
        .

See Also
AssemblyLevelAspect Members
PostSharp.Aspects Namespace
PostSharp.Aspects IAssemblyLevelAspect

      Conceptual Documentation: Aspect Classes

      Conceptual Documentation: Developing Complex Aspects

      Conceptual Documentation: Aspect Serialization

  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


AssemblyLevelAspect Members

AssemblyLevelAspect Members PostSharp Documentation

The AssemblyLevelAspect type exposes the following members.
Constructors
 | Name | Description
Protected method | AssemblyLevelAspect | Initializes a new instance of the AssemblyLevelAspect class
Back to Top
Methods
 | Name | Description
Public method | CompileTimeInitialize | Method invoked at build time to initialize the instance fields of the current aspect. This method is invoked before any other build-time method.
Public method | CompileTimeValidate | Method invoked at build time to ensure that the aspect has been applied to the right target. (Inherited from Aspect.)
Protected method | CreateAspectConfiguration | Method invoked at build time to create a concrete AspectConfiguration instance specifically for the current Aspect type. (Inherited from Aspect.)
Public method | GetAspectConfiguration | Method invoked at build tome to get the imperative configuration of the current Aspect. (Inherited from Aspect.)
Protected method | SetAspectConfiguration | Method invoked at build time to set up an AspectConfiguration object according to the current Aspect instance and a specified target element of the current aspect. (Inherited from Aspect.)
Back to Top
Properties
 | Name | Description
Public property | AspectPriority | Gets or sets the weaving priority of the aspect. (Inherited from Aspect.)
Public property | AttributeExclude | If true, indicates that this attribute removes all other instances of the same attribute type from the set of elements defined by the current instance. (Inherited from MulticastAttribute.)
Public property | AttributeId | Obsolete. (Inherited from MulticastAttribute.)
Public property | AttributeInheritance | Determines whether this attribute is inherited (Inherited from MulticastAttribute.)
Public property | AttributePriority | Gets or sets the priority of the current attribute in case that multiple instances are defined on the same element (lower values are processed before). (Inherited from MulticastAttribute.)
Public property | AttributeReplace | Determines whether this attribute replaces other attributes found on the target declarations. (Inherited from MulticastAttribute.)
Public property | AttributeTargetAssemblies | Gets or sets the assemblies to which the current attribute apply. (Inherited from MulticastAttribute.)
Public property | AttributeTargetElements | Gets or sets the kind of elements to which this custom attributes applies. (Inherited from MulticastAttribute.)
Public property | AttributeTargetExternalMemberAttributes | Gets or sets the visibilities, scopes, virtualities, and implementation of members to which this attribute applies, when the member is external to the current module. (Inherited from MulticastAttribute.)
Public property | AttributeTargetExternalTypeAttributes | Gets or sets the visibilities of types to which this attribute applies, when this type is external to the current module. (Inherited from MulticastAttribute.)
Public property | AttributeTargetMemberAttributes | Gets or sets the visibilities, scopes, virtualities, and implementation of members to which this attribute applies. (Inherited from MulticastAttribute.)
Public property | AttributeTargetMembers | Gets or sets the expression specifying to which members this instance applies. (Inherited from MulticastAttribute.)
Public property | AttributeTargetParameterAttributes | Gets or sets the passing style (by value, out or ref) of parameters to which this attribute applies. (Inherited from MulticastAttribute.)
Public property | AttributeTargetParameters | Gets or sets the expression specifying to which parameters this instance applies. (Inherited from MulticastAttribute.)
Public property | AttributeTargetTypeAttributes | Gets or sets the visibilities of types to which this attribute applies. (Inherited from MulticastAttribute.)
Public property | AttributeTargetTypes | Gets or sets the expression specifying to which types this instance applies. (Inherited from MulticastAttribute.)
Protected property | SerializerType | Gets or sets the Online Type of the serializer (a type derived from AspectSerializer) used to serialize the aspect instance at build time and deserialize it at runtime. (Inherited from Aspect.)
Back to Top
See Also
AssemblyLevelAspect Class
PostSharp.Aspects Namespace

Online Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


AssemblyLevelAspect Constructor

AssemblyLevelAspect Constructor PostSharp Documentation
Initializes a new instance of the AssemblyLevelAspect class

Namespace: PostSharp.Aspects
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
protected AssemblyLevelAspect()
protected AssemblyLevelAspect()
See Also
AssemblyLevelAspect Class
AssemblyLevelAspect Members
PostSharp.Aspects Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


AssemblyLevelAspect Methods

AssemblyLevelAspect Methods PostSharp Documentation
The AssemblyLevelAspect type exposes the following members.
Methods
 | Name | Description
Public method | CompileTimeInitialize | Method invoked at build time to initialize the instance fields of the current aspect. This method is invoked before any other build-time method.
Public method | CompileTimeValidate | Method invoked at build time to ensure that the aspect has been applied to the right target. (Inherited from Aspect.)
Protected method | CreateAspectConfiguration | Method invoked at build time to create a concrete AspectConfiguration instance specifically for the current Aspect type. (Inherited from Aspect.)
Public method | GetAspectConfiguration | Method invoked at build tome to get the imperative configuration of the current Aspect. (Inherited from Aspect.)
Protected method | SetAspectConfiguration | Method invoked at build time to set up an AspectConfiguration object according to the current Aspect instance and a specified target element of the current aspect. (Inherited from Aspect.)
Back to Top
See Also
AssemblyLevelAspect Class
PostSharp.Aspects Namespace

Online Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


AssemblyLevelAspect.CompileTimeInitialize Method

AssemblyLevelAspect CompileTimeInitialize Method PostSharp Documentation
Method invoked at build time to initialize the instance fields of the current aspect. This method is invoked before any other build-time method.

Namespace: PostSharp.Aspects
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
public virtual void CompileTimeInitialize(
    Assembly assembly,
    AspectInfo aspectInfo
)
public virtual void CompileTimeInitialize(
    Assembly assembly,
    AspectInfo aspectInfo
)
Parameters
assembly
Type:   Online System.Reflection Assembly
Assembly to which the current aspect is applied
aspectInfo
Type: PostSharp.Aspects AspectInfo
Reserved for future usage.
Implements
IAssemblyLevelAspectBuildSemantics CompileTimeInitialize(Assembly, AspectInfo)
See Also
AssemblyLevelAspect Class
AssemblyLevelAspect Members
PostSharp.Aspects Namespace

      Conceptual Documentation: Initializing Aspects

  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


AssemblyLevelAspect Properties

AssemblyLevelAspect Properties PostSharp Documentation
The AssemblyLevelAspect type exposes the following members.
Properties
 | Name | Description
Public property | AspectPriority | Gets or sets the weaving priority of the aspect. (Inherited from Aspect.)
Public property | AttributeExclude | If true, indicates that this attribute removes all other instances of the same attribute type from the set of elements defined by the current instance. (Inherited from MulticastAttribute.)
Public property | AttributeId | Obsolete. (Inherited from MulticastAttribute.)
Public property | AttributeInheritance | Determines whether this attribute is inherited (Inherited from MulticastAttribute.)
Public property | AttributePriority | Gets or sets the priority of the current attribute in case that multiple instances are defined on the same element (lower values are processed before). (Inherited from MulticastAttribute.)
Public property | AttributeReplace | Determines whether this attribute replaces other attributes found on the target declarations. (Inherited from MulticastAttribute.)
Public property | AttributeTargetAssemblies | Gets or sets the assemblies to which the current attribute apply. (Inherited from MulticastAttribute.)
Public property | AttributeTargetElements | Gets or sets the kind of elements to which this custom attributes applies. (Inherited from MulticastAttribute.)
Public property | AttributeTargetExternalMemberAttributes | Gets or sets the visibilities, scopes, virtualities, and implementation of members to which this attribute applies, when the member is external to the current module. (Inherited from MulticastAttribute.)
Public property | AttributeTargetExternalTypeAttributes | Gets or sets the visibilities of types to which this attribute applies, when this type is external to the current module. (Inherited from MulticastAttribute.)
Public property | AttributeTargetMemberAttributes | Gets or sets the visibilities, scopes, virtualities, and implementation of members to which this attribute applies. (Inherited from MulticastAttribute.)
Public property | AttributeTargetMembers | Gets or sets the expression specifying to which members this instance applies. (Inherited from MulticastAttribute.)
Public property | AttributeTargetParameterAttributes | Gets or sets the passing style (by value, out or ref) of parameters to which this attribute applies. (Inherited from MulticastAttribute.)
Public property | AttributeTargetParameters | Gets or sets the expression specifying to which parameters this instance applies. (Inherited from MulticastAttribute.)
Public property | AttributeTargetTypeAttributes | Gets or sets the visibilities of types to which this attribute applies. (Inherited from MulticastAttribute.)
Public property | AttributeTargetTypes | Gets or sets the expression specifying to which types this instance applies. (Inherited from MulticastAttribute.)
Protected property | SerializerType | Gets or sets the Online Type of the serializer (a type derived from AspectSerializer) used to serialize the aspect instance at build time and deserialize it at runtime. (Inherited from Aspect.)
Back to Top
See Also
AssemblyLevelAspect Class
PostSharp.Aspects Namespace

Online Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


CompositionAspect Class

CompositionAspect Class PostSharp Documentation
Aspect that, when applied on a type, introduces one or many new interfaces into that type.
Inheritance Hierarchy
Online System Object
Online System Attribute
PostSharp.Extensibility MulticastAttribute
PostSharp.Aspects Aspect
PostSharp.Aspects TypeLevelAspect
PostSharp.Aspects CompositionAspect

Namespace: PostSharp.Aspects
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
[SerializableAttribute]
public abstract class CompositionAspect : TypeLevelAspect,
    ICompositionAspect, ITypeLevelAspect, IAspect
[SerializableAttribute]
public abstract class CompositionAspect : TypeLevelAspect,
    ICompositionAspect, ITypeLevelAspect, IAspect
Remarks
  Note  Note

              Consider using a composite aspect introducing an interface
             instead of using a CompositionAspect.  For details,
            see Introducing Interfaces.

            Methods GetPublicInterfaces(Type) and GetProtectedInterfaces(Type)
            are invoked at build time. At runtime, the method CreateImplementationObject(AdviceArgs)
            should return an object implementing all interfaces.

            Use the Post.Cast SourceType, TargetType (SourceType)
            method to cast the enhanced type to the newly implemented interface. This
            cast is verified during post-compilation.

                Properties OverrideAction and AncestorOverrideAction determine
            what should happen if the target type already implements the interface directly or indirectly.

             By default, the object implementing the interface is stored as a serializable field. If the property
            NonSerializedImplementation is set to true, this field will be marked
            as   Online NonSerializedAttribute.

  Note  Note

        All classes implementing
        IAspect
        should typically be marked as serializable
        using the custom attribute
          Online SerializableAttribute
        . Fields that
        are only used at runtime (and unknown at compile-time) should be carefully
        marked with the custom attribute
          Online NonSerializedAttribute
        .
        When PostSharp is used on a platform that does not support aspect serialization
        (such as .NET Compact Framework, Silverlight, or Windows Phone), or when
        another aspect serializer is used, it is not necessary to mark the aspect
        class as serializable.
        For more information, see
        Aspect Serialization
        .

Examples
Example: Dynamically Introducing an Interface
See Also
CompositionAspect Members
PostSharp.Aspects Namespace

      Conceptual Documentation: Aspect Serialization

PostSharp.Aspects.Advices IntroduceInterfaceAttribute

      Conceptual Documentation: Introducing Interfaces

  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


CompositionAspect Members

CompositionAspect Members PostSharp Documentation

The CompositionAspect type exposes the following members.
Constructors
 | Name | Description
Protected method | CompositionAspect | Initializes a new instance of the CompositionAspect class
Back to Top
Methods
 | Name | Description
Public method | CompileTimeInitialize | Method invoked at build time to initialize the instance fields of the current aspect. This method is invoked before any other build-time method. (Inherited from TypeLevelAspect.)
Public method | CompileTimeValidate | Method invoked at build time to ensure that the aspect has been applied to the right target. (Inherited from Aspect.)
Protected method | CreateAspectConfiguration | Method invoked at build time to create a concrete AspectConfiguration instance specifically for the current Aspect type. (Overrides Aspect CreateAspectConfiguration .)
Public method | CreateImplementationObject | Method invoked at runtime, during the initialization of instances of the target type, to create the composed object.
Public method | GetAspectConfiguration | Method invoked at build tome to get the imperative configuration of the current Aspect. (Inherited from Aspect.)
Protected method | GetProtectedInterfaces | Gets the array of interfaces to be introduced indirectly into the target type of the current aspect. These interfaces will become accessible through the IProtectedInterface T interface.
Protected method | GetPublicInterfaces | Gets the array of interfaces that should be introduced publicly into the target type of the current aspect.
Public method | RuntimeInitialize | Initializes the current aspect. (Inherited from TypeLevelAspect.)
Protected method | SetAspectConfiguration(AspectConfiguration, Object) | Method invoked at build time to set up an AspectConfiguration object according to the current Aspect instance and a specified target element of the current aspect. (Inherited from Aspect.)
Protected method | SetAspectConfiguration(AspectConfiguration, Type) | Method invoked at build time to set up an AspectConfiguration object according to the current Aspect instance and a specified target element of the current aspect. (Overrides TypeLevelAspectSetAspectConfiguration(AspectConfiguration, Type).)
Back to Top
Properties
 | Name | Description
Protected property | AncestorOverrideAction | Specifies the action (Fail or Ignore) to be overtaken when an ancestor of one of the interfaces returned by GetPublicInterfaces(Type) is already implemented by the type to which the current aspect is applied.
Public property | AspectPriority | Gets or sets the weaving priority of the aspect. (Inherited from Aspect.)
Public property | AttributeExclude | If true, indicates that this attribute removes all other instances of the same attribute type from the set of elements defined by the current instance. (Inherited from MulticastAttribute.)
Public property | AttributeId | Obsolete. (Inherited from MulticastAttribute.)
Public property | AttributeInheritance | Determines whether this attribute is inherited (Inherited from MulticastAttribute.)
Public property | AttributePriority | Gets or sets the priority of the current attribute in case that multiple instances are defined on the same element (lower values are processed before). (Inherited from MulticastAttribute.)
Public property | AttributeReplace | Determines whether this attribute replaces other attributes found on the target declarations. (Inherited from MulticastAttribute.)
Public property | AttributeTargetAssemblies | Gets or sets the assemblies to which the current attribute apply. (Inherited from MulticastAttribute.)
Public property | AttributeTargetElements | Gets or sets the kind of elements to which this custom attributes applies. (Inherited from MulticastAttribute.)
Public property | AttributeTargetExternalMemberAttributes | Gets or sets the visibilities, scopes, virtualities, and implementation of members to which this attribute applies, when the member is external to the current module. (Inherited from MulticastAttribute.)
Public property | AttributeTargetExternalTypeAttributes | Gets or sets the visibilities of types to which this attribute applies, when this type is external to the current module. (Inherited from MulticastAttribute.)
Public property | AttributeTargetMemberAttributes | Gets or sets the visibilities, scopes, virtualities, and implementation of members to which this attribute applies. (Inherited from MulticastAttribute.)
Public property | AttributeTargetMembers | Gets or sets the expression specifying to which members this instance applies. (Inherited from MulticastAttribute.)
Public property | AttributeTargetParameterAttributes | Gets or sets the passing style (by value, out or ref) of parameters to which this attribute applies. (Inherited from MulticastAttribute.)
Public property | AttributeTargetParameters | Gets or sets the expression specifying to which parameters this instance applies. (Inherited from MulticastAttribute.)
Public property | AttributeTargetTypeAttributes | Gets or sets the visibilities of types to which this attribute applies. (Inherited from MulticastAttribute.)
Public property | AttributeTargetTypes | Gets or sets the expression specifying to which types this instance applies. (Inherited from MulticastAttribute.)
Protected property | GenerateImplementationAccessor | Determines whether the interface IComposed T should be introduced into the type to which the aspect is applied for each interface returned by the GetPublicInterfaces(Type) method.
Protected property | NonSerializedImplementation | Determines whether the field containing the interface implementation (and storing the object returned by CreateImplementationObject(AdviceArgs)) should be excluded from serialization by Online BinaryFormatter. The same effect is typically obtained by applying the Online NonSerializedAttribute custom attribute to the field.
Protected property | OverrideAction | Specifies the action (Fail or Ignore) to be overtaken when one of the interfaces returned by GetPublicInterfaces(Type) or GetProtectedInterfaces(Type) is already implemented by the type to which the current aspect is applied.
Protected property | SerializerType | Gets or sets the Online Type of the serializer (a type derived from AspectSerializer) used to serialize the aspect instance at build time and deserialize it at runtime. (Inherited from Aspect.)
Back to Top
See Also
CompositionAspect Class
PostSharp.Aspects Namespace

Online Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


CompositionAspect Constructor

CompositionAspect Constructor PostSharp Documentation
Initializes a new instance of the CompositionAspect class

Namespace: PostSharp.Aspects
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
protected CompositionAspect()
protected CompositionAspect()
See Also
CompositionAspect Class
CompositionAspect Members
PostSharp.Aspects Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


CompositionAspect Methods

CompositionAspect Methods PostSharp Documentation
The CompositionAspect type exposes the following members.
Methods
 | Name | Description
Public method | CompileTimeInitialize | Method invoked at build time to initialize the instance fields of the current aspect. This method is invoked before any other build-time method. (Inherited from TypeLevelAspect.)
Public method | CompileTimeValidate | Method invoked at build time to ensure that the aspect has been applied to the right target. (Inherited from Aspect.)
Protected method | CreateAspectConfiguration | Method invoked at build time to create a concrete AspectConfiguration instance specifically for the current Aspect type. (Overrides Aspect CreateAspectConfiguration .)
Public method | CreateImplementationObject | Method invoked at runtime, during the initialization of instances of the target type, to create the composed object.
Public method | GetAspectConfiguration | Method invoked at build tome to get the imperative configuration of the current Aspect. (Inherited from Aspect.)
Protected method | GetProtectedInterfaces | Gets the array of interfaces to be introduced indirectly into the target type of the current aspect. These interfaces will become accessible through the IProtectedInterface T interface.
Protected method | GetPublicInterfaces | Gets the array of interfaces that should be introduced publicly into the target type of the current aspect.
Public method | RuntimeInitialize | Initializes the current aspect. (Inherited from TypeLevelAspect.)
Protected method | SetAspectConfiguration(AspectConfiguration, Object) | Method invoked at build time to set up an AspectConfiguration object according to the current Aspect instance and a specified target element of the current aspect. (Inherited from Aspect.)
Protected method | SetAspectConfiguration(AspectConfiguration, Type) | Method invoked at build time to set up an AspectConfiguration object according to the current Aspect instance and a specified target element of the current aspect. (Overrides TypeLevelAspectSetAspectConfiguration(AspectConfiguration, Type).)
Back to Top
See Also
CompositionAspect Class
PostSharp.Aspects Namespace

Online Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


CompositionAspect.CreateAspectConfiguration Method

CompositionAspect CreateAspectConfiguration Method PostSharp Documentation
Method invoked at build time to create a concrete AspectConfiguration instance specifically for the current Aspect type.

Namespace: PostSharp.Aspects
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
protected override sealed AspectConfiguration CreateAspectConfiguration()
protected override sealed AspectConfiguration CreateAspectConfiguration()
Return Value
Type: AspectConfiguration
A new and empty instance of AspectConfiguration, whose concrete type corresponds to
              the concrete type of the Aspect.
Remarks

              This method should not set up the returned AspectConfiguration. After the current method has
              returned, the SetAspectConfiguration(AspectConfiguration, Object) method will be invoked, and this method is responsible
              for setting up the AspectConfigurationobject.

See Also
CompositionAspect Class
CompositionAspect Members
PostSharp.Aspects Namespace

      Conceptual Documentation: Configuring Aspects

  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


CompositionAspect.CreateImplementationObject Method

CompositionAspect CreateImplementationObject Method PostSharp Documentation
Method invoked at runtime, during the initialization of instances of the target type, to create the composed object.

Namespace: PostSharp.Aspects
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
public abstract Object CreateImplementationObject(
    AdviceArgs args
)
public abstract Object CreateImplementationObject(
    AdviceArgs args
)
Parameters
args
Type: PostSharp.Aspects AdviceArgs
[Missing <param name="args"/> documentation for "M:PostSharp.Aspects.CompositionAspect.CreateImplementationObject(PostSharp.Aspects.AdviceArgs)"]
Return Value
Type:   Online Object
The composed object. This interface should implement the interfaces specified
              by the GetPublicInterfaces(Type) and
              GetProtectedInterfaces(Type) methods.
Implements
ICompositionAspect CreateImplementationObject(AdviceArgs)
Remarks

              This method is invoked during at runtime after the base constructor has executed, and before
              the constructor of the current type is executed.

See Also
CompositionAspect Class
CompositionAspect Members
PostSharp.Aspects Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


CompositionAspect.GetProtectedInterfaces Method

CompositionAspect GetProtectedInterfaces Method PostSharp Documentation
Gets the array of interfaces to be introduced indirectly into the target type of the current aspect. These interfaces will become accessible through the IProtectedInterface T interface.

Namespace: PostSharp.Aspects
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
protected virtual Type[] GetProtectedInterfaces(
    Type targetType
)
protected virtual Type[] GetProtectedInterfaces(
    Type targetType
)
Parameters
targetType
Type:   Online System Type
  Online Type to which the current aspect is applied.
Return Value
Type:    Online Type
The array of interfaces that should be introduced indirectly into   Online Type targetType, or null if no interface should be introduced indirectly.
Remarks
  Note  Note
Protected interfaces are provided for legacy support. It is recommended to use a different
                pattern, such as a composite aspect,

See Also
CompositionAspect Class
CompositionAspect Members
PostSharp.Aspects Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


CompositionAspect.GetPublicInterfaces Method

CompositionAspect GetPublicInterfaces Method PostSharp Documentation
Gets the array of interfaces that should be introduced publicly into the target type of the current aspect.

Namespace: PostSharp.Aspects
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
protected virtual Type[] GetPublicInterfaces(
    Type targetType
)
protected virtual Type[] GetPublicInterfaces(
    Type targetType
)
Parameters
targetType
Type:   Online System Type
  Online Type to which the current aspect is applied.
Return Value
Type:    Online Type
The array of interfaces that should be introduced publicly into   Online Type targetType, or null if no interface should
              be introduced publicly.
See Also
CompositionAspect Class
CompositionAspect Members
PostSharp.Aspects Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


CompositionAspect.SetAspectConfiguration Method

CompositionAspect SetAspectConfiguration Method PostSharp Documentation
Overload List
 | Name | Description
Protected method | SetAspectConfiguration(AspectConfiguration, Object) | Method invoked at build time to set up an AspectConfiguration object according to the current Aspect instance and a specified target element of the current aspect. (Inherited from Aspect.)
Protected method | SetAspectConfiguration(AspectConfiguration, Type) | Method invoked at build time to set up an AspectConfiguration object according to the current Aspect instance and a specified target element of the current aspect. (Overrides TypeLevelAspectSetAspectConfiguration(AspectConfiguration, Type).)
Back to Top
See Also
CompositionAspect Class
CompositionAspect Members
PostSharp.Aspects Namespace

Online Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


CompositionAspect.SetAspectConfiguration Method (AspectConfiguration, Type)

CompositionAspect SetAspectConfiguration Method (AspectConfiguration, Type) PostSharp Documentation
Method invoked at build time to set up an AspectConfiguration object according to the current Aspect instance and a specified target element of the current aspect.

Namespace: PostSharp.Aspects
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
protected override void SetAspectConfiguration(
    AspectConfiguration aspectConfiguration,
    Type targetType
)
protected override void SetAspectConfiguration(
    AspectConfiguration aspectConfiguration,
    Type targetType
)
Parameters
aspectConfiguration
Type: PostSharp.Aspects.Configuration AspectConfiguration
The AspectConfiguration instance previously returned  by the
              CreateAspectConfiguration  method.
targetType
Type:   Online System Type
Type to which the current aspect has been applied.
Remarks
Classes overriding this method must always invoke the base implementation before performing their own
                changes to the
                AspectConfiguration.
See Also
CompositionAspect Class
CompositionAspect Members
SetAspectConfiguration Overload
PostSharp.Aspects Namespace

      Conceptual Documentation: Configuring Aspects

  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


CompositionAspect Properties

CompositionAspect Properties PostSharp Documentation
The CompositionAspect type exposes the following members.
Properties
 | Name | Description
Protected property | AncestorOverrideAction | Specifies the action (Fail or Ignore) to be overtaken when an ancestor of one of the interfaces returned by GetPublicInterfaces(Type) is already implemented by the type to which the current aspect is applied.
Public property | AspectPriority | Gets or sets the weaving priority of the aspect. (Inherited from Aspect.)
Public property | AttributeExclude | If true, indicates that this attribute removes all other instances of the same attribute type from the set of elements defined by the current instance. (Inherited from MulticastAttribute.)
Public property | AttributeId | Obsolete. (Inherited from MulticastAttribute.)
Public property | AttributeInheritance | Determines whether this attribute is inherited (Inherited from MulticastAttribute.)
Public property | AttributePriority | Gets or sets the priority of the current attribute in case that multiple instances are defined on the same element (lower values are processed before). (Inherited from MulticastAttribute.)
Public property | AttributeReplace | Determines whether this attribute replaces other attributes found on the target declarations. (Inherited from MulticastAttribute.)
Public property | AttributeTargetAssemblies | Gets or sets the assemblies to which the current attribute apply. (Inherited from MulticastAttribute.)
Public property | AttributeTargetElements | Gets or sets the kind of elements to which this custom attributes applies. (Inherited from MulticastAttribute.)
Public property | AttributeTargetExternalMemberAttributes | Gets or sets the visibilities, scopes, virtualities, and implementation of members to which this attribute applies, when the member is external to the current module. (Inherited from MulticastAttribute.)
Public property | AttributeTargetExternalTypeAttributes | Gets or sets the visibilities of types to which this attribute applies, when this type is external to the current module. (Inherited from MulticastAttribute.)
Public property | AttributeTargetMemberAttributes | Gets or sets the visibilities, scopes, virtualities, and implementation of members to which this attribute applies. (Inherited from MulticastAttribute.)
Public property | AttributeTargetMembers | Gets or sets the expression specifying to which members this instance applies. (Inherited from MulticastAttribute.)
Public property | AttributeTargetParameterAttributes | Gets or sets the passing style (by value, out or ref) of parameters to which this attribute applies. (Inherited from MulticastAttribute.)
Public property | AttributeTargetParameters | Gets or sets the expression specifying to which parameters this instance applies. (Inherited from MulticastAttribute.)
Public property | AttributeTargetTypeAttributes | Gets or sets the visibilities of types to which this attribute applies. (Inherited from MulticastAttribute.)
Public property | AttributeTargetTypes | Gets or sets the expression specifying to which types this instance applies. (Inherited from MulticastAttribute.)
Protected property | GenerateImplementationAccessor | Determines whether the interface IComposed T should be introduced into the type to which the aspect is applied for each interface returned by the GetPublicInterfaces(Type) method.
Protected property | NonSerializedImplementation | Determines whether the field containing the interface implementation (and storing the object returned by CreateImplementationObject(AdviceArgs)) should be excluded from serialization by Online BinaryFormatter. The same effect is typically obtained by applying the Online NonSerializedAttribute custom attribute to the field.
Protected property | OverrideAction | Specifies the action (Fail or Ignore) to be overtaken when one of the interfaces returned by GetPublicInterfaces(Type) or GetProtectedInterfaces(Type) is already implemented by the type to which the current aspect is applied.
Protected property | SerializerType | Gets or sets the Online Type of the serializer (a type derived from AspectSerializer) used to serialize the aspect instance at build time and deserialize it at runtime. (Inherited from Aspect.)
Back to Top
See Also
CompositionAspect Class
PostSharp.Aspects Namespace

Online Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


CompositionAspect.AncestorOverrideAction Property

CompositionAspect AncestorOverrideAction Property PostSharp Documentation
Specifies the action (Fail or Ignore) to be overtaken when an ancestor of one of the interfaces returned by GetPublicInterfaces(Type) is already implemented by the type to which the current aspect is applied.

Namespace: PostSharp.Aspects
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
protected InterfaceOverrideAction AncestorOverrideAction { get; set; }
protected InterfaceOverrideAction AncestorOverrideAction { get; set; }
Property Value
Type: InterfaceOverrideAction
See Also
CompositionAspect Class
CompositionAspect Members
PostSharp.Aspects Namespace
CompositionAspect OverrideAction
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


CompositionAspect.GenerateImplementationAccessor Property

CompositionAspect GenerateImplementationAccessor Property PostSharp Documentation
Determines whether the interface IComposed T should be introduced into the type to which the aspect is applied for each interface returned by the GetPublicInterfaces(Type) method.

Namespace: PostSharp.Aspects
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
protected bool GenerateImplementationAccessor { get; set; }
protected bool GenerateImplementationAccessor { get; set; }
Property Value
Type:   Online Boolean
See Also
CompositionAspect Class
CompositionAspect Members
PostSharp.Aspects Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


CompositionAspect.NonSerializedImplementation Property

CompositionAspect NonSerializedImplementation Property PostSharp Documentation
Determines whether the field containing the interface implementation (and storing the object returned by CreateImplementationObject(AdviceArgs)) should be excluded from serialization by Online BinaryFormatter. The same effect is typically obtained by applying the Online NonSerializedAttribute custom attribute to the field.

Namespace: PostSharp.Aspects
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
protected bool NonSerializedImplementation { get; set; }
protected bool NonSerializedImplementation { get; set; }
Property Value
Type:   Online Boolean
See Also
CompositionAspect Class
CompositionAspect Members
PostSharp.Aspects Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


CompositionAspect.OverrideAction Property

CompositionAspect OverrideAction Property PostSharp Documentation
Specifies the action (Fail or Ignore) to be overtaken when one of the interfaces returned by GetPublicInterfaces(Type) or GetProtectedInterfaces(Type) is already implemented by the type to which the current aspect is applied.

Namespace: PostSharp.Aspects
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
protected InterfaceOverrideAction OverrideAction { get; set; }
protected InterfaceOverrideAction OverrideAction { get; set; }
Property Value
Type: InterfaceOverrideAction
See Also
CompositionAspect Class
CompositionAspect Members
PostSharp.Aspects Namespace
CompositionAspect AncestorOverrideAction
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


CustomAttributeIntroductionAspect Class

CustomAttributeIntroductionAspect Class PostSharp Documentation
Aspect that, when applied to a target, adds a custom attribute to this target.
Inheritance Hierarchy
Online System Object
PostSharp.Aspects CustomAttributeIntroductionAspect

Namespace: PostSharp.Aspects
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
public sealed class CustomAttributeIntroductionAspect : ICustomAttributeIntroductionAspect,
    IAspect, IAspectBuildSemantics, IValidableAnnotation
public sealed class CustomAttributeIntroductionAspect : ICustomAttributeIntroductionAspect,
    IAspect, IAspectBuildSemantics, IValidableAnnotation
Remarks

                There are two ways to specify a custom attribute: either using an
                ObjectConstruction (to construct a new custom attribute),
                either a   Online CustomAttributeData (to copy a custom attribute reflected
                using one of the overload of the method   Online GetCustomAttributes(Assembly)/

  Note  Note

                This aspect is not a custom attribute. You have to create another aspect
                implementing IAspectProvider and have the method ProvideAspects(Object)
                return instances of this aspect.

Examples
Example: Automatically Adding DataContract and DataMember Attributes
See Also
CustomAttributeIntroductionAspect Members
PostSharp.Aspects Namespace

      Conceptual Documentation: Adding Aspects Dynamically

  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


CustomAttributeIntroductionAspect Members

CustomAttributeIntroductionAspect Members PostSharp Documentation

The CustomAttributeIntroductionAspect type exposes the following members.
Constructors
 | Name | Description
Public method | CustomAttributeIntroductionAspect(CustomAttributeData) | Initializes a new CustomAttributeIntroductionAspect by specifying a Online CustomAttributeData.
Public method | CustomAttributeIntroductionAspect(ObjectConstruction) | Initializes a new CustomAttributeIntroductionAspect by specifying an ObjectConstruction.
Back to Top
Properties
 | Name | Description
Public property | CustomAttribute | Gets the construction of the custom attribute that must be applied to the target of this aspect.
Back to Top
See Also
CustomAttributeIntroductionAspect Class
PostSharp.Aspects Namespace

Online Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


CustomAttributeIntroductionAspect Constructor

CustomAttributeIntroductionAspect Constructor PostSharp Documentation
Overload List
 | Name | Description
Public method | CustomAttributeIntroductionAspect(CustomAttributeData) | Initializes a new CustomAttributeIntroductionAspect by specifying a Online CustomAttributeData.
Public method | CustomAttributeIntroductionAspect(ObjectConstruction) | Initializes a new CustomAttributeIntroductionAspect by specifying an ObjectConstruction.
Back to Top
See Also
CustomAttributeIntroductionAspect Class
CustomAttributeIntroductionAspect Members
PostSharp.Aspects Namespace

Online Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


CustomAttributeIntroductionAspect Constructor (CustomAttributeData)

CustomAttributeIntroductionAspect Constructor (CustomAttributeData) PostSharp Documentation
Initializes a new CustomAttributeIntroductionAspect by specifying a Online CustomAttributeData.

Namespace: PostSharp.Aspects
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
public CustomAttributeIntroductionAspect(
    CustomAttributeData customAttributeData
)
public CustomAttributeIntroductionAspect(
    CustomAttributeData customAttributeData
)
Parameters
customAttributeData
Type:   Online System.Reflection CustomAttributeData
Construction of the custom attribute to be added to the target.
See Also
CustomAttributeIntroductionAspect Class
CustomAttributeIntroductionAspect Members
CustomAttributeIntroductionAspect Overload
PostSharp.Aspects Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


CustomAttributeIntroductionAspect Constructor (ObjectConstruction)

CustomAttributeIntroductionAspect Constructor (ObjectConstruction) PostSharp Documentation
Initializes a new CustomAttributeIntroductionAspect by specifying an ObjectConstruction.

Namespace: PostSharp.Aspects
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
public CustomAttributeIntroductionAspect(
    ObjectConstruction attribute
)
public CustomAttributeIntroductionAspect(
    ObjectConstruction attribute
)
Parameters
attribute
Type: PostSharp.Reflection ObjectConstruction
Construction of the custom attribute to be added to the target.
See Also
CustomAttributeIntroductionAspect Class
CustomAttributeIntroductionAspect Members
CustomAttributeIntroductionAspect Overload
PostSharp.Aspects Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


CustomAttributeIntroductionAspect Properties

CustomAttributeIntroductionAspect Properties PostSharp Documentation
The CustomAttributeIntroductionAspect type exposes the following members.
Properties
 | Name | Description
Public property | CustomAttribute | Gets the construction of the custom attribute that must be applied to the target of this aspect.
Back to Top
See Also
CustomAttributeIntroductionAspect Class
PostSharp.Aspects Namespace

Online Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


CustomAttributeIntroductionAspect.CustomAttribute Property

CustomAttributeIntroductionAspect CustomAttribute Property PostSharp Documentation
Gets the construction of the custom attribute that must be applied to the target of this aspect.

Namespace: PostSharp.Aspects
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
public ObjectConstruction CustomAttribute { get; }
public ObjectConstruction CustomAttribute { get; }
Property Value
Type: ObjectConstruction
See Also
CustomAttributeIntroductionAspect Class
CustomAttributeIntroductionAspect Members
PostSharp.Aspects Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


EventInterceptionArgs Class

EventInterceptionArgs Class PostSharp Documentation
Arguments of handlers of aspects of the type EventInterceptionAspect.
Inheritance Hierarchy
Online System Object
PostSharp.Aspects AdviceArgs
PostSharp.Aspects EventInterceptionArgs

Namespace: PostSharp.Aspects
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
public abstract class EventInterceptionArgs : AdviceArgs
public abstract class EventInterceptionArgs : AdviceArgs
Remarks
  Note  Note

      As a result of weaving optimizations, instances of classes derived from
      AdviceArgs
      may be shared among different aspects. Therefore,
      aspect code should not attempt to access this object once the control has been given over to the next node in the chain of invocation. Consider working
      with
      aspect bindings
      if you need such deferred execution.

See Also
EventInterceptionArgs Members
PostSharp.Aspects Namespace
PostSharp.Aspects EventInterceptionAspect

      Conceptual Documentation: Aspect Bindings

PostSharp.Aspects EventInterceptionAspect
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


EventInterceptionArgs Members

EventInterceptionArgs Members PostSharp Documentation

The EventInterceptionArgs type exposes the following members.
Methods
 | Name | Description
Public method | AddHandler | Adds a handler to the event by invoking the Add semantic of the next node in the chain of invocation.
Public method | InvokeHandler | Invokes a handler by calling the Invoke semantic of the next node in the chain of invocation.
Public method | ProceedAddHandler | Proceeds with adding the Online Delegate to the event to which the current aspect. This method invokes the next handler in chain. It is typically invoked from the implementation of OnAddHandler(EventInterceptionArgs).
Public method | ProceedInvokeHandler | Proceeds with invoking the Online Delegate with the arguments specified in the Arguments property. The delegate may change the Arguments and set the ReturnValue. This method invokes the next handler in chain. It is typically invoked from the implementation of OnInvokeHandler(EventInterceptionArgs).
Public method | ProceedRemoveHandler | Proceeds with removing the Online Delegate from the event to which the current aspect. This method invokes the next handler in chain. It is typically invoked from the implementation of OnRemoveHandler(EventInterceptionArgs).
Public method | RemoveHandler | Removes a handler from the event by invoking the Remove semantic of the next node in the chain of invocation.
Back to Top
Properties
 | Name | Description
Public property | Arguments | Gets the delegate arguments.
Public property | Binding | Gets an interface that allows to invoke the next node in the chain of invocation of the intercepted method.
Public property | Event | Gets the event to which the current aspect has been applied.
Public property | Handler | Gets the delegate being added, removed, or invoked.
Public property | Instance | Gets or sets the object instance on which the method is being executed. (Inherited from AdviceArgs.)
Public property | InstanceCredentials | Obsolete. (Inherited from AdviceArgs.)
Public property | ReturnValue | Gets the return value of the delegate.
Back to Top
See Also
EventInterceptionArgs Class
PostSharp.Aspects Namespace

Online Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


EventInterceptionArgs Methods

EventInterceptionArgs Methods PostSharp Documentation
The EventInterceptionArgs type exposes the following members.
Methods
 | Name | Description
Public method | AddHandler | Adds a handler to the event by invoking the Add semantic of the next node in the chain of invocation.
Public method | InvokeHandler | Invokes a handler by calling the Invoke semantic of the next node in the chain of invocation.
Public method | ProceedAddHandler | Proceeds with adding the Online Delegate to the event to which the current aspect. This method invokes the next handler in chain. It is typically invoked from the implementation of OnAddHandler(EventInterceptionArgs).
Public method | ProceedInvokeHandler | Proceeds with invoking the Online Delegate with the arguments specified in the Arguments property. The delegate may change the Arguments and set the ReturnValue. This method invokes the next handler in chain. It is typically invoked from the implementation of OnInvokeHandler(EventInterceptionArgs).
Public method | ProceedRemoveHandler | Proceeds with removing the Online Delegate from the event to which the current aspect. This method invokes the next handler in chain. It is typically invoked from the implementation of OnRemoveHandler(EventInterceptionArgs).
Public method | RemoveHandler | Removes a handler from the event by invoking the Remove semantic of the next node in the chain of invocation.
Back to Top
See Also
EventInterceptionArgs Class
PostSharp.Aspects Namespace

Online Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


EventInterceptionArgs.AddHandler Method

EventInterceptionArgs AddHandler Method PostSharp Documentation
Adds a handler to the event by invoking the Add semantic of the next node in the chain of invocation.

Namespace: PostSharp.Aspects
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
public abstract void AddHandler(
    Delegate handler
)
public abstract void AddHandler(
    Delegate handler
)
Parameters
handler
Type:   Online System Delegate
The handler to add to the event.
See Also
EventInterceptionArgs Class
EventInterceptionArgs Members
PostSharp.Aspects Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


EventInterceptionArgs.InvokeHandler Method

EventInterceptionArgs InvokeHandler Method PostSharp Documentation
Invokes a handler by calling the Invoke semantic of the next node in the chain of invocation.

Namespace: PostSharp.Aspects
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
public abstract Object InvokeHandler(
    Delegate handler,
    Arguments arguments
)
public abstract Object InvokeHandler(
    Delegate handler,
    Arguments arguments
)
Parameters
handler
Type:   Online System Delegate
Handler to be invoked.
arguments
Type: PostSharp.Aspects Arguments
Arguments passed to the handler.
Return Value
Type:   Online Object
Return value of the handler.
See Also
EventInterceptionArgs Class
EventInterceptionArgs Members
PostSharp.Aspects Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


EventInterceptionArgs.ProceedAddHandler Method

EventInterceptionArgs ProceedAddHandler Method PostSharp Documentation
Proceeds with adding the Online Delegate to the event to which the current aspect. This method invokes the next handler in chain. It is typically invoked from the implementation of OnAddHandler(EventInterceptionArgs).

Namespace: PostSharp.Aspects
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
public abstract void ProceedAddHandler()
public abstract void ProceedAddHandler()
See Also
EventInterceptionArgs Class
EventInterceptionArgs Members
PostSharp.Aspects Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


EventInterceptionArgs.ProceedInvokeHandler Method

EventInterceptionArgs ProceedInvokeHandler Method PostSharp Documentation
Proceeds with invoking the Online Delegate with the arguments specified in the Arguments property. The delegate may change the Arguments and set the ReturnValue. This method invokes the next handler in chain. It is typically invoked from the implementation of OnInvokeHandler(EventInterceptionArgs).

Namespace: PostSharp.Aspects
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
public abstract void ProceedInvokeHandler()
public abstract void ProceedInvokeHandler()
See Also
EventInterceptionArgs Class
EventInterceptionArgs Members
PostSharp.Aspects Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


EventInterceptionArgs.ProceedRemoveHandler Method

EventInterceptionArgs ProceedRemoveHandler Method PostSharp Documentation
Proceeds with removing the Online Delegate from the event to which the current aspect. This method invokes the next handler in chain. It is typically invoked from the implementation of OnRemoveHandler(EventInterceptionArgs).

Namespace: PostSharp.Aspects
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
public abstract void ProceedRemoveHandler()
public abstract void ProceedRemoveHandler()
See Also
EventInterceptionArgs Class
EventInterceptionArgs Members
PostSharp.Aspects Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


EventInterceptionArgs.RemoveHandler Method

EventInterceptionArgs RemoveHandler Method PostSharp Documentation
Removes a handler from the event by invoking the Remove semantic of the next node in the chain of invocation.

Namespace: PostSharp.Aspects
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
public abstract void RemoveHandler(
    Delegate handler
)
public abstract void RemoveHandler(
    Delegate handler
)
Parameters
handler
Type:   Online System Delegate
Handler to be removed.
See Also
EventInterceptionArgs Class
EventInterceptionArgs Members
PostSharp.Aspects Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


EventInterceptionArgs Properties

EventInterceptionArgs Properties PostSharp Documentation
The EventInterceptionArgs type exposes the following members.
Properties
 | Name | Description
Public property | Arguments | Gets the delegate arguments.
Public property | Binding | Gets an interface that allows to invoke the next node in the chain of invocation of the intercepted method.
Public property | Event | Gets the event to which the current aspect has been applied.
Public property | Handler | Gets the delegate being added, removed, or invoked.
Public property | Instance | Gets or sets the object instance on which the method is being executed. (Inherited from AdviceArgs.)
Public property | InstanceCredentials | Obsolete. (Inherited from AdviceArgs.)
Public property | ReturnValue | Gets the return value of the delegate.
Back to Top
See Also
EventInterceptionArgs Class
PostSharp.Aspects Namespace

Online Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


EventInterceptionArgs.Arguments Property

EventInterceptionArgs Arguments Property PostSharp Documentation
Gets the delegate arguments.

Namespace: PostSharp.Aspects
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
public Arguments Arguments { get; private set; }
public Arguments Arguments { get; private set; }
Property Value
Type: Arguments
Remarks
This property is meaningful only during a delegate invocation (not during an addition or removal).
This property is typically accessed by the ProceedInvokeHandler  method. Implementations of
                OnInvokeHandler(EventInterceptionArgs) can also get or change the value of this property.
See Also
EventInterceptionArgs Class
EventInterceptionArgs Members
PostSharp.Aspects Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


EventInterceptionArgs.Binding Property

EventInterceptionArgs Binding Property PostSharp Documentation
Gets an interface that allows to invoke the next node in the chain of invocation of the intercepted method.

Namespace: PostSharp.Aspects
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
public abstract IEventBinding Binding { get; }
public abstract IEventBinding Binding { get; }
Property Value
Type: IEventBinding
Remarks

      Bindings are thread-safe and context-free singleton instances exposing the next node in the chain of invocation.

See Also
EventInterceptionArgs Class
EventInterceptionArgs Members
PostSharp.Aspects Namespace

      Conceptual Documentation: Aspect Bindings

  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


EventInterceptionArgs.Event Property

EventInterceptionArgs Event Property PostSharp Documentation
Gets the event to which the current aspect has been applied.

Namespace: PostSharp.Aspects
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
public EventInfo Event { get; set; }
public EventInfo Event { get; set; }
Property Value
Type:   Online EventInfo
Remarks
  Note  Note

                Using this property causes the aspect weaver to generate code that has non-trivial runtime overhead. Avoid using
                this property whenever possible. One of the possible solution is to use compile-time initialization of
                aspect instances and to make use of reflection only at build time.

See Also
EventInterceptionArgs Class
EventInterceptionArgs Members
PostSharp.Aspects Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


EventInterceptionArgs.Handler Property

EventInterceptionArgs Handler Property PostSharp Documentation
Gets the delegate being added, removed, or invoked.

Namespace: PostSharp.Aspects
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
public Delegate Handler { get; private set; }
public Delegate Handler { get; private set; }
Property Value
Type:   Online Delegate
See Also
EventInterceptionArgs Class
EventInterceptionArgs Members
PostSharp.Aspects Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


EventInterceptionArgs.ReturnValue Property

EventInterceptionArgs ReturnValue Property PostSharp Documentation
Gets the return value of the delegate.

Namespace: PostSharp.Aspects
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
public Object ReturnValue { get; set; }
public Object ReturnValue { get; set; }
Property Value
Type:   Online Object
Remarks
This property is meaningful only during a delegate invocation (not during an addition or removal).
This property is typically set by the ProceedInvokeHandler  method. It is also legal for
                an implementation of OnInvokeHandler(EventInterceptionArgs) to change the value of this property.
See Also
EventInterceptionArgs Class
EventInterceptionArgs Members
PostSharp.Aspects Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


EventInterceptionAspect Class

EventInterceptionAspect Class PostSharp Documentation
Aspect that, when applied on an event, intercepts invocations of its semantics Add (OnAddHandler(EventInterceptionArgs)), Remove (OnRemoveHandler(EventInterceptionArgs)) and Invoke (OnInvokeHandler(EventInterceptionArgs)).
Inheritance Hierarchy
Online System Object
Online System Attribute
PostSharp.Extensibility MulticastAttribute
PostSharp.Aspects Aspect
PostSharp.Aspects EventLevelAspect
PostSharp.Aspects EventInterceptionAspect

Namespace: PostSharp.Aspects
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
[SerializableAttribute]
public abstract class EventInterceptionAspect : EventLevelAspect,
    IEventInterceptionAspect, IEventLevelAspect, IAspect
[SerializableAttribute]
public abstract class EventInterceptionAspect : EventLevelAspect,
    IEventInterceptionAspect, IEventLevelAspect, IAspect
Remarks

            Applying an aspect of type EventInterceptionAspect to an event results in the add and remove
            methods of the event to be replaced by a call to OnAddHandler(EventInterceptionArgs) and OnRemoveHandler(EventInterceptionArgs), respectively.
            The original accessor body is moved into new methods, which the aspect code can call by invoking ProceedAddHandler
            or ProceedRemoveHandler .

            The method OnInvokeHandler(EventInterceptionArgs), if defined, is called instead when the event is raised, once for every handler that has been added
            to the list. When you define OnInvokeHandler(EventInterceptionArgs) method, PostSharp will use a broker object to control access to the event; this broker
            object will be the unique subscriber of the event, and maintains its own list of subscribers.

For details about the implementation of this aspect, see Interception Aspects.
  Note  Note

                    The aspect works only when caller code access the event through its add/remove semantics. It does not work when the caller
                    code bypasses the event semantics and accesses directly its implementation (the underlying field of the event, typically). The C# compiler
                    is known to bypass the semantics when the event is accessed directly from the class declaring it (it accesses directly the private field
                    whenever it can).

  Note  Note

        All classes implementing
        IAspect
        should typically be marked as serializable
        using the custom attribute
          Online SerializableAttribute
        . Fields that
        are only used at runtime (and unknown at compile-time) should be carefully
        marked with the custom attribute
          Online NonSerializedAttribute
        .
        When PostSharp is used on a platform that does not support aspect serialization
        (such as .NET Compact Framework, Silverlight, or Windows Phone), or when
        another aspect serializer is used, it is not necessary to mark the aspect
        class as serializable.
        For more information, see
        Aspect Serialization
        .

  Note  Note

      PostSharp Professional Edition is required for this feature.

Examples
Example: Making an Event Asynchronous
See Also
EventInterceptionAspect Members
PostSharp.Aspects Namespace

      Conceptual Documentation: Aspect Serialization

      Conceptual Documentation: Interception Aspects

  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


EventInterceptionAspect Members

EventInterceptionAspect Members PostSharp Documentation

The EventInterceptionAspect type exposes the following members.
Constructors
 | Name | Description
Protected method | EventInterceptionAspect | Initializes a new instance of the EventInterceptionAspect class
Back to Top
Methods
 | Name | Description
Public method | CompileTimeInitialize | Method invoked at build time to initialize the instance fields of the current aspect. This method is invoked before any other build-time method. (Inherited from EventLevelAspect.)
Public method | CompileTimeValidate | Method invoked at build time to ensure that the aspect has been applied to the right target. (Inherited from Aspect.)
Protected method | CreateAspectConfiguration | Method invoked at build time to create a concrete AspectConfiguration instance specifically for the current Aspect type. (Overrides Aspect CreateAspectConfiguration .)
Public method | GetAspectConfiguration | Method invoked at build tome to get the imperative configuration of the current Aspect. (Inherited from Aspect.)
Public method | OnAddHandler | Method invoked instead of the Add semantic of the event to which the current aspect is applied, i.e. when a new delegate is added to this event.
Public method | OnInvokeHandler | Method invoked when the event to which the current aspect is applied is fired, for each delegate of this event, and instead of invoking this delegate.
Public method | OnRemoveHandler | Method invoked instead of the Remove semantic of the event to which the current aspect is applied, i.e. when a delegate is removed from this event.
Public method | RuntimeInitialize | Initializes the current aspect. (Inherited from EventLevelAspect.)
Protected method | SetAspectConfiguration | Method invoked at build time to set up an AspectConfiguration object according to the current Aspect instance and a specified target element of the current aspect. (Inherited from Aspect.)
Back to Top
Properties
 | Name | Description
Public property | AspectPriority | Gets or sets the weaving priority of the aspect. (Inherited from Aspect.)
Public property | AttributeExclude | If true, indicates that this attribute removes all other instances of the same attribute type from the set of elements defined by the current instance. (Inherited from MulticastAttribute.)
Public property | AttributeId | Obsolete. (Inherited from MulticastAttribute.)
Public property | AttributeInheritance | Determines whether this attribute is inherited (Inherited from MulticastAttribute.)
Public property | AttributePriority | Gets or sets the priority of the current attribute in case that multiple instances are defined on the same element (lower values are processed before). (Inherited from MulticastAttribute.)
Public property | AttributeReplace | Determines whether this attribute replaces other attributes found on the target declarations. (Inherited from MulticastAttribute.)
Public property | AttributeTargetAssemblies | Gets or sets the assemblies to which the current attribute apply. (Inherited from MulticastAttribute.)
Public property | AttributeTargetElements | Gets or sets the kind of elements to which this custom attributes applies. (Inherited from MulticastAttribute.)
Public property | AttributeTargetExternalMemberAttributes | Gets or sets the visibilities, scopes, virtualities, and implementation of members to which this attribute applies, when the member is external to the current module. (Inherited from MulticastAttribute.)
Public property | AttributeTargetExternalTypeAttributes | Gets or sets the visibilities of types to which this attribute applies, when this type is external to the current module. (Inherited from MulticastAttribute.)
Public property | AttributeTargetMemberAttributes | Gets or sets the visibilities, scopes, virtualities, and implementation of members to which this attribute applies. (Inherited from MulticastAttribute.)
Public property | AttributeTargetMembers | Gets or sets the expression specifying to which members this instance applies. (Inherited from MulticastAttribute.)
Public property | AttributeTargetParameterAttributes | Gets or sets the passing style (by value, out or ref) of parameters to which this attribute applies. (Inherited from MulticastAttribute.)
Public property | AttributeTargetParameters | Gets or sets the expression specifying to which parameters this instance applies. (Inherited from MulticastAttribute.)
Public property | AttributeTargetTypeAttributes | Gets or sets the visibilities of types to which this attribute applies. (Inherited from MulticastAttribute.)
Public property | AttributeTargetTypes | Gets or sets the expression specifying to which types this instance applies. (Inherited from MulticastAttribute.)
Protected property | SerializerType | Gets or sets the Online Type of the serializer (a type derived from AspectSerializer) used to serialize the aspect instance at build time and deserialize it at runtime. (Inherited from Aspect.)
Back to Top
See Also
EventInterceptionAspect Class
PostSharp.Aspects Namespace

Online Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


EventInterceptionAspect Constructor

EventInterceptionAspect Constructor PostSharp Documentation
Initializes a new instance of the EventInterceptionAspect class

Namespace: PostSharp.Aspects
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
protected EventInterceptionAspect()
protected EventInterceptionAspect()
See Also
EventInterceptionAspect Class
EventInterceptionAspect Members
PostSharp.Aspects Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


EventInterceptionAspect Methods

EventInterceptionAspect Methods PostSharp Documentation
The EventInterceptionAspect type exposes the following members.
Methods
 | Name | Description
Public method | CompileTimeInitialize | Method invoked at build time to initialize the instance fields of the current aspect. This method is invoked before any other build-time method. (Inherited from EventLevelAspect.)
Public method | CompileTimeValidate | Method invoked at build time to ensure that the aspect has been applied to the right target. (Inherited from Aspect.)
Protected method | CreateAspectConfiguration | Method invoked at build time to create a concrete AspectConfiguration instance specifically for the current Aspect type. (Overrides Aspect CreateAspectConfiguration .)
Public method | GetAspectConfiguration | Method invoked at build tome to get the imperative configuration of the current Aspect. (Inherited from Aspect.)
Public method | OnAddHandler | Method invoked instead of the Add semantic of the event to which the current aspect is applied, i.e. when a new delegate is added to this event.
Public method | OnInvokeHandler | Method invoked when the event to which the current aspect is applied is fired, for each delegate of this event, and instead of invoking this delegate.
Public method | OnRemoveHandler | Method invoked instead of the Remove semantic of the event to which the current aspect is applied, i.e. when a delegate is removed from this event.
Public method | RuntimeInitialize | Initializes the current aspect. (Inherited from EventLevelAspect.)
Protected method | SetAspectConfiguration | Method invoked at build time to set up an AspectConfiguration object according to the current Aspect instance and a specified target element of the current aspect. (Inherited from Aspect.)
Back to Top
See Also
EventInterceptionAspect Class
PostSharp.Aspects Namespace

Online Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


EventInterceptionAspect.CreateAspectConfiguration Method

EventInterceptionAspect CreateAspectConfiguration Method PostSharp Documentation
Method invoked at build time to create a concrete AspectConfiguration instance specifically for the current Aspect type.

Namespace: PostSharp.Aspects
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
protected override AspectConfiguration CreateAspectConfiguration()
protected override AspectConfiguration CreateAspectConfiguration()
Return Value
Type: AspectConfiguration
A new and empty instance of AspectConfiguration, whose concrete type corresponds to
              the concrete type of the Aspect.
Remarks

              This method should not set up the returned AspectConfiguration. After the current method has
              returned, the SetAspectConfiguration(AspectConfiguration, Object) method will be invoked, and this method is responsible
              for setting up the AspectConfigurationobject.

See Also
EventInterceptionAspect Class
EventInterceptionAspect Members
PostSharp.Aspects Namespace

      Conceptual Documentation: Configuring Aspects

  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


EventInterceptionAspect.OnAddHandler Method

EventInterceptionAspect OnAddHandler Method PostSharp Documentation
Method invoked instead of the Add semantic of the event to which the current aspect is applied, i.e. when a new delegate is added to this event.

Namespace: PostSharp.Aspects
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
public virtual void OnAddHandler(
    EventInterceptionArgs args
)
public virtual void OnAddHandler(
    EventInterceptionArgs args
)
Parameters
args
Type: PostSharp.Aspects EventInterceptionArgs
Handler arguments.
Implements
IEventInterceptionAspect OnAddHandler(EventInterceptionArgs)
Remarks
  Note  Note

      Because of the way how the C# compiler implements
      automatic events
      (i.e. events where you
      don't implement the
      Add
      and
      Remove
      semantics manually), the
      Invoke Event Handler
      semantic (
      OnInvokeHandler(EventInterceptionArgs)
      or equivalent) shall
      not
      be invoked for delegates that have been added from inside the class that declares this event.

See Also
EventInterceptionAspect Class
EventInterceptionAspect Members
PostSharp.Aspects Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


EventInterceptionAspect.OnInvokeHandler Method

EventInterceptionAspect OnInvokeHandler Method PostSharp Documentation
Method invoked when the event to which the current aspect is applied is fired, for each delegate of this event, and instead of invoking this delegate.

Namespace: PostSharp.Aspects
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
public virtual void OnInvokeHandler(
    EventInterceptionArgs args
)
public virtual void OnInvokeHandler(
    EventInterceptionArgs args
)
Parameters
args
Type: PostSharp.Aspects EventInterceptionArgs
Handler arguments.
Implements
IEventInterceptionAspect OnInvokeHandler(EventInterceptionArgs)
Remarks
  Note  Note

      Because of the way how the C# compiler implements
      automatic events
      (i.e. events where you
      don't implement the
      Add
      and
      Remove
      semantics manually), the
      Invoke Event Handler
      semantic (
      OnInvokeHandler(EventInterceptionArgs)
      or equivalent) shall
      not
      be invoked for delegates that have been added from inside the class that declares this event.

  Note  Note

      The
      Invoke Event Handler
      semantic is different from normal event firing.
      Indeed, when you fire an event, all handlers that were added to this event are fired. However, the current method
      invokes only a single handler: the one passed to the
      handler
      parameter.

See Also
EventInterceptionAspect Class
EventInterceptionAspect Members
PostSharp.Aspects Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


EventInterceptionAspect.OnRemoveHandler Method

EventInterceptionAspect OnRemoveHandler Method PostSharp Documentation
Method invoked instead of the Remove semantic of the event to which the current aspect is applied, i.e. when a delegate is removed from this event.

Namespace: PostSharp.Aspects
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
public virtual void OnRemoveHandler(
    EventInterceptionArgs args
)
public virtual void OnRemoveHandler(
    EventInterceptionArgs args
)
Parameters
args
Type: PostSharp.Aspects EventInterceptionArgs
Handler arguments.
Implements
IEventInterceptionAspect OnRemoveHandler(EventInterceptionArgs)
Remarks
  Note  Note

      Because of the way how the C# compiler implements
      automatic events
      (i.e. events where you
      don't implement the
      Add
      and
      Remove
      semantics manually), the
      Invoke Event Handler
      semantic (
      OnInvokeHandler(EventInterceptionArgs)
      or equivalent) shall
      not
      be invoked for delegates that have been added from inside the class that declares this event.

See Also
EventInterceptionAspect Class
EventInterceptionAspect Members
PostSharp.Aspects Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


EventInterceptionAspect Properties

EventInterceptionAspect Properties PostSharp Documentation
The EventInterceptionAspect type exposes the following members.
Properties
 | Name | Description
Public property | AspectPriority | Gets or sets the weaving priority of the aspect. (Inherited from Aspect.)
Public property | AttributeExclude | If true, indicates that this attribute removes all other instances of the same attribute type from the set of elements defined by the current instance. (Inherited from MulticastAttribute.)
Public property | AttributeId | Obsolete. (Inherited from MulticastAttribute.)
Public property | AttributeInheritance | Determines whether this attribute is inherited (Inherited from MulticastAttribute.)
Public property | AttributePriority | Gets or sets the priority of the current attribute in case that multiple instances are defined on the same element (lower values are processed before). (Inherited from MulticastAttribute.)
Public property | AttributeReplace | Determines whether this attribute replaces other attributes found on the target declarations. (Inherited from MulticastAttribute.)
Public property | AttributeTargetAssemblies | Gets or sets the assemblies to which the current attribute apply. (Inherited from MulticastAttribute.)
Public property | AttributeTargetElements | Gets or sets the kind of elements to which this custom attributes applies. (Inherited from MulticastAttribute.)
Public property | AttributeTargetExternalMemberAttributes | Gets or sets the visibilities, scopes, virtualities, and implementation of members to which this attribute applies, when the member is external to the current module. (Inherited from MulticastAttribute.)
Public property | AttributeTargetExternalTypeAttributes | Gets or sets the visibilities of types to which this attribute applies, when this type is external to the current module. (Inherited from MulticastAttribute.)
Public property | AttributeTargetMemberAttributes | Gets or sets the visibilities, scopes, virtualities, and implementation of members to which this attribute applies. (Inherited from MulticastAttribute.)
Public property | AttributeTargetMembers | Gets or sets the expression specifying to which members this instance applies. (Inherited from MulticastAttribute.)
Public property | AttributeTargetParameterAttributes | Gets or sets the passing style (by value, out or ref) of parameters to which this attribute applies. (Inherited from MulticastAttribute.)
Public property | AttributeTargetParameters | Gets or sets the expression specifying to which parameters this instance applies. (Inherited from MulticastAttribute.)
Public property | AttributeTargetTypeAttributes | Gets or sets the visibilities of types to which this attribute applies. (Inherited from MulticastAttribute.)
Public property | AttributeTargetTypes | Gets or sets the expression specifying to which types this instance applies. (Inherited from MulticastAttribute.)
Protected property | SerializerType | Gets or sets the Online Type of the serializer (a type derived from AspectSerializer) used to serialize the aspect instance at build time and deserialize it at runtime. (Inherited from Aspect.)
Back to Top
See Also
EventInterceptionAspect Class
PostSharp.Aspects Namespace

Online Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


EventLevelAspect Class

EventLevelAspect Class PostSharp Documentation
Base class for all aspects applied on events.
Inheritance Hierarchy
Online System Object
Online System Attribute
PostSharp.Extensibility MulticastAttribute
PostSharp.Aspects Aspect
PostSharp.Aspects EventLevelAspect
PostSharp.Aspects EventInterceptionAspect

Namespace: PostSharp.Aspects
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
[SerializableAttribute]
public abstract class EventLevelAspect : Aspect,
    IEventLevelAspect, IAspect, IEventLevelAspectBuildSemantics, IAspectBuildSemantics, IValidableAnnotation
[SerializableAttribute]
public abstract class EventLevelAspect : Aspect,
    IEventLevelAspect, IAspect, IEventLevelAspectBuildSemantics, IAspectBuildSemantics, IValidableAnnotation
Remarks
  Note  Note

      This class does not provide any advice. You may derive your aspect class from a

        class providing
        predefined advice

      , or build a
      composite aspect
      .

  Note  Note

        All classes implementing
        IAspect
        should typically be marked as serializable
        using the custom attribute
          Online SerializableAttribute
        . Fields that
        are only used at runtime (and unknown at compile-time) should be carefully
        marked with the custom attribute
          Online NonSerializedAttribute
        .
        When PostSharp is used on a platform that does not support aspect serialization
        (such as .NET Compact Framework, Silverlight, or Windows Phone), or when
        another aspect serializer is used, it is not necessary to mark the aspect
        class as serializable.
        For more information, see
        Aspect Serialization
        .

See Also
EventLevelAspect Members
PostSharp.Aspects Namespace

      Conceptual Documentation: Aspect Classes

      Conceptual Documentation: Developing Complex Aspects

      Conceptual Documentation: Aspect Serialization

PostSharp.Aspects IEventLevelAspect
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


EventLevelAspect Members

EventLevelAspect Members PostSharp Documentation

The EventLevelAspect type exposes the following members.
Constructors
 | Name | Description
Protected method | EventLevelAspect | Initializes a new instance of the EventLevelAspect class
Back to Top
Methods
 | Name | Description
Public method | CompileTimeInitialize | Method invoked at build time to initialize the instance fields of the current aspect. This method is invoked before any other build-time method.
Public method | CompileTimeValidate | Method invoked at build time to ensure that the aspect has been applied to the right target. (Inherited from Aspect.)
Protected method | CreateAspectConfiguration | Method invoked at build time to create a concrete AspectConfiguration instance specifically for the current Aspect type. (Inherited from Aspect.)
Public method | GetAspectConfiguration | Method invoked at build tome to get the imperative configuration of the current Aspect. (Inherited from Aspect.)
Public method | RuntimeInitialize | Initializes the current aspect.
Protected method | SetAspectConfiguration | Method invoked at build time to set up an AspectConfiguration object according to the current Aspect instance and a specified target element of the current aspect. (Inherited from Aspect.)
Back to Top
Properties
 | Name | Description
Public property | AspectPriority | Gets or sets the weaving priority of the aspect. (Inherited from Aspect.)
Public property | AttributeExclude | If true, indicates that this attribute removes all other instances of the same attribute type from the set of elements defined by the current instance. (Inherited from MulticastAttribute.)
Public property | AttributeId | Obsolete. (Inherited from MulticastAttribute.)
Public property | AttributeInheritance | Determines whether this attribute is inherited (Inherited from MulticastAttribute.)
Public property | AttributePriority | Gets or sets the priority of the current attribute in case that multiple instances are defined on the same element (lower values are processed before). (Inherited from MulticastAttribute.)
Public property | AttributeReplace | Determines whether this attribute replaces other attributes found on the target declarations. (Inherited from MulticastAttribute.)
Public property | AttributeTargetAssemblies | Gets or sets the assemblies to which the current attribute apply. (Inherited from MulticastAttribute.)
Public property | AttributeTargetElements | Gets or sets the kind of elements to which this custom attributes applies. (Inherited from MulticastAttribute.)
Public property | AttributeTargetExternalMemberAttributes | Gets or sets the visibilities, scopes, virtualities, and implementation of members to which this attribute applies, when the member is external to the current module. (Inherited from MulticastAttribute.)
Public property | AttributeTargetExternalTypeAttributes | Gets or sets the visibilities of types to which this attribute applies, when this type is external to the current module. (Inherited from MulticastAttribute.)
Public property | AttributeTargetMemberAttributes | Gets or sets the visibilities, scopes, virtualities, and implementation of members to which this attribute applies. (Inherited from MulticastAttribute.)
Public property | AttributeTargetMembers | Gets or sets the expression specifying to which members this instance applies. (Inherited from MulticastAttribute.)
Public property | AttributeTargetParameterAttributes | Gets or sets the passing style (by value, out or ref) of parameters to which this attribute applies. (Inherited from MulticastAttribute.)
Public property | AttributeTargetParameters | Gets or sets the expression specifying to which parameters this instance applies. (Inherited from MulticastAttribute.)
Public property | AttributeTargetTypeAttributes | Gets or sets the visibilities of types to which this attribute applies. (Inherited from MulticastAttribute.)
Public property | AttributeTargetTypes | Gets or sets the expression specifying to which types this instance applies. (Inherited from MulticastAttribute.)
Protected property | SerializerType | Gets or sets the Online Type of the serializer (a type derived from AspectSerializer) used to serialize the aspect instance at build time and deserialize it at runtime. (Inherited from Aspect.)
Back to Top
See Also
EventLevelAspect Class
PostSharp.Aspects Namespace

Online Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


EventLevelAspect Constructor

EventLevelAspect Constructor PostSharp Documentation
Initializes a new instance of the EventLevelAspect class

Namespace: PostSharp.Aspects
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
protected EventLevelAspect()
protected EventLevelAspect()
See Also
EventLevelAspect Class
EventLevelAspect Members
PostSharp.Aspects Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


EventLevelAspect Methods

EventLevelAspect Methods PostSharp Documentation
The EventLevelAspect type exposes the following members.
Methods
 | Name | Description
Public method | CompileTimeInitialize | Method invoked at build time to initialize the instance fields of the current aspect. This method is invoked before any other build-time method.
Public method | CompileTimeValidate | Method invoked at build time to ensure that the aspect has been applied to the right target. (Inherited from Aspect.)
Protected method | CreateAspectConfiguration | Method invoked at build time to create a concrete AspectConfiguration instance specifically for the current Aspect type. (Inherited from Aspect.)
Public method | GetAspectConfiguration | Method invoked at build tome to get the imperative configuration of the current Aspect. (Inherited from Aspect.)
Public method | RuntimeInitialize | Initializes the current aspect.
Protected method | SetAspectConfiguration | Method invoked at build time to set up an AspectConfiguration object according to the current Aspect instance and a specified target element of the current aspect. (Inherited from Aspect.)
Back to Top
See Also
EventLevelAspect Class
PostSharp.Aspects Namespace

Online Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


EventLevelAspect.CompileTimeInitialize Method

EventLevelAspect CompileTimeInitialize Method PostSharp Documentation
Method invoked at build time to initialize the instance fields of the current aspect. This method is invoked before any other build-time method.

Namespace: PostSharp.Aspects
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
public virtual void CompileTimeInitialize(
    EventInfo targetEvent,
    AspectInfo aspectInfo
)
public virtual void CompileTimeInitialize(
    EventInfo targetEvent,
    AspectInfo aspectInfo
)
Parameters
targetEvent
Type:   Online System.Reflection EventInfo
Event to which the current aspect is applied
aspectInfo
Type: PostSharp.Aspects AspectInfo
Reserved for future usage.
Implements
IEventLevelAspectBuildSemantics CompileTimeInitialize(EventInfo, AspectInfo)
See Also
EventLevelAspect Class
EventLevelAspect Members
PostSharp.Aspects Namespace

      Conceptual Documentation: Initializing Aspects

  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


EventLevelAspect.RuntimeInitialize Method

EventLevelAspect RuntimeInitialize Method PostSharp Documentation
Initializes the current aspect.

Namespace: PostSharp.Aspects
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
public virtual void RuntimeInitialize(
    EventInfo eventInfo
)
public virtual void RuntimeInitialize(
    EventInfo eventInfo
)
Parameters
eventInfo
Type:   Online System.Reflection EventInfo
Event to which the current aspect is applied.
Implements
IEventLevelAspect RuntimeInitialize(EventInfo)
See Also
EventLevelAspect Class
EventLevelAspect Members
PostSharp.Aspects Namespace

      Conceptual Documentation: Initializing Aspects

  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


EventLevelAspect Properties

EventLevelAspect Properties PostSharp Documentation
The EventLevelAspect type exposes the following members.
Properties
 | Name | Description
Public property | AspectPriority | Gets or sets the weaving priority of the aspect. (Inherited from Aspect.)
Public property | AttributeExclude | If true, indicates that this attribute removes all other instances of the same attribute type from the set of elements defined by the current instance. (Inherited from MulticastAttribute.)
Public property | AttributeId | Obsolete. (Inherited from MulticastAttribute.)
Public property | AttributeInheritance | Determines whether this attribute is inherited (Inherited from MulticastAttribute.)
Public property | AttributePriority | Gets or sets the priority of the current attribute in case that multiple instances are defined on the same element (lower values are processed before). (Inherited from MulticastAttribute.)
Public property | AttributeReplace | Determines whether this attribute replaces other attributes found on the target declarations. (Inherited from MulticastAttribute.)
Public property | AttributeTargetAssemblies | Gets or sets the assemblies to which the current attribute apply. (Inherited from MulticastAttribute.)
Public property | AttributeTargetElements | Gets or sets the kind of elements to which this custom attributes applies. (Inherited from MulticastAttribute.)
Public property | AttributeTargetExternalMemberAttributes | Gets or sets the visibilities, scopes, virtualities, and implementation of members to which this attribute applies, when the member is external to the current module. (Inherited from MulticastAttribute.)
Public property | AttributeTargetExternalTypeAttributes | Gets or sets the visibilities of types to which this attribute applies, when this type is external to the current module. (Inherited from MulticastAttribute.)
Public property | AttributeTargetMemberAttributes | Gets or sets the visibilities, scopes, virtualities, and implementation of members to which this attribute applies. (Inherited from MulticastAttribute.)
Public property | AttributeTargetMembers | Gets or sets the expression specifying to which members this instance applies. (Inherited from MulticastAttribute.)
Public property | AttributeTargetParameterAttributes | Gets or sets the passing style (by value, out or ref) of parameters to which this attribute applies. (Inherited from MulticastAttribute.)
Public property | AttributeTargetParameters | Gets or sets the expression specifying to which parameters this instance applies. (Inherited from MulticastAttribute.)
Public property | AttributeTargetTypeAttributes | Gets or sets the visibilities of types to which this attribute applies. (Inherited from MulticastAttribute.)
Public property | AttributeTargetTypes | Gets or sets the expression specifying to which types this instance applies. (Inherited from MulticastAttribute.)
Protected property | SerializerType | Gets or sets the Online Type of the serializer (a type derived from AspectSerializer) used to serialize the aspect instance at build time and deserialize it at runtime. (Inherited from Aspect.)
Back to Top
See Also
EventLevelAspect Class
PostSharp.Aspects Namespace

Online Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


ExternalAspect Class

ExternalAspect Class PostSharp Documentation
Aspect implemented in a different type (implementing the IExternalAspectImplementation interface), typically contained in an external assembly. Classes derived from ExternalAspect must be annotated by the custom attribute ExternalAspectConfigurationAttribute.
Inheritance Hierarchy
Online System Object
Online System Attribute
PostSharp.Extensibility MulticastAttribute
PostSharp.Aspects Aspect
PostSharp.Aspects ExternalAspect

Namespace: PostSharp.Aspects
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
[ObsoleteAttribute("Build-time semantics are now supported for Silverlight, Windows Phone, and WinRT.")]
public abstract class ExternalAspect : Aspect,
    IExternalAspect, IAspect
[ObsoleteAttribute("Build-time semantics are now supported for Silverlight, Windows Phone, and WinRT.")]
public abstract class ExternalAspect : Aspect,
    IExternalAspect, IAspect
Remarks
External aspects are useful when you develop for Silverlight or the .NET Compact Framework.
                Indeed, aspects cannot have build-time semantics on these platforms. If you need to execute logic
                at build time on these platforms, you need to implement this logic in an assembly linked with
                the normal .NET Framework (so not Silverlight or Compact Framework). You must relate an
                aspect with its implementation using the custom attribute ExternalAspectConfigurationAttribute.
See Also
ExternalAspect Members
PostSharp.Aspects Namespace

      Conceptual Documentation: Using PostSharp with Silverlight, Windows Phone, and the Compact .NET Framework

  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


ExternalAspect Members

ExternalAspect Members PostSharp Documentation

The ExternalAspect type exposes the following members.
Constructors
 | Name | Description
Protected method | ExternalAspect | Initializes a new instance of the ExternalAspect class
Back to Top
Methods
 | Name | Description
Public method | CompileTimeValidate | Method invoked at build time to ensure that the aspect has been applied to the right target. (Inherited from Aspect.)
Protected method | CreateAspectConfiguration | Method invoked at build time to create a concrete AspectConfiguration instance specifically for the current Aspect type. (Inherited from Aspect.)
Public method | GetAspectConfiguration | Method invoked at build tome to get the imperative configuration of the current Aspect. (Inherited from Aspect.)
Protected method | SetAspectConfiguration | Method invoked at build time to set up an AspectConfiguration object according to the current Aspect instance and a specified target element of the current aspect. (Inherited from Aspect.)
Back to Top
Properties
 | Name | Description
Public property | AspectPriority | Gets or sets the weaving priority of the aspect. (Inherited from Aspect.)
Public property | AttributeExclude | If true, indicates that this attribute removes all other instances of the same attribute type from the set of elements defined by the current instance. (Inherited from MulticastAttribute.)
Public property | AttributeId | Obsolete. (Inherited from MulticastAttribute.)
Public property | AttributeInheritance | Determines whether this attribute is inherited (Inherited from MulticastAttribute.)
Public property | AttributePriority | Gets or sets the priority of the current attribute in case that multiple instances are defined on the same element (lower values are processed before). (Inherited from MulticastAttribute.)
Public property | AttributeReplace | Determines whether this attribute replaces other attributes found on the target declarations. (Inherited from MulticastAttribute.)
Public property | AttributeTargetAssemblies | Gets or sets the assemblies to which the current attribute apply. (Inherited from MulticastAttribute.)
Public property | AttributeTargetElements | Gets or sets the kind of elements to which this custom attributes applies. (Inherited from MulticastAttribute.)
Public property | AttributeTargetExternalMemberAttributes | Gets or sets the visibilities, scopes, virtualities, and implementation of members to which this attribute applies, when the member is external to the current module. (Inherited from MulticastAttribute.)
Public property | AttributeTargetExternalTypeAttributes | Gets or sets the visibilities of types to which this attribute applies, when this type is external to the current module. (Inherited from MulticastAttribute.)
Public property | AttributeTargetMemberAttributes | Gets or sets the visibilities, scopes, virtualities, and implementation of members to which this attribute applies. (Inherited from MulticastAttribute.)
Public property | AttributeTargetMembers | Gets or sets the expression specifying to which members this instance applies. (Inherited from MulticastAttribute.)
Public property | AttributeTargetParameterAttributes | Gets or sets the passing style (by value, out or ref) of parameters to which this attribute applies. (Inherited from MulticastAttribute.)
Public property | AttributeTargetParameters | Gets or sets the expression specifying to which parameters this instance applies. (Inherited from MulticastAttribute.)
Public property | AttributeTargetTypeAttributes | Gets or sets the visibilities of types to which this attribute applies. (Inherited from MulticastAttribute.)
Public property | AttributeTargetTypes | Gets or sets the expression specifying to which types this instance applies. (Inherited from MulticastAttribute.)
Protected property | SerializerType | Gets or sets the Online Type of the serializer (a type derived from AspectSerializer) used to serialize the aspect instance at build time and deserialize it at runtime. (Inherited from Aspect.)
Back to Top
See Also
ExternalAspect Class
PostSharp.Aspects Namespace

Online Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


ExternalAspect Constructor

ExternalAspect Constructor PostSharp Documentation
Initializes a new instance of the ExternalAspect class

Namespace: PostSharp.Aspects
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
protected ExternalAspect()
protected ExternalAspect()
See Also
ExternalAspect Class
ExternalAspect Members
PostSharp.Aspects Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


ExternalAspect Methods

ExternalAspect Methods PostSharp Documentation
The ExternalAspect type exposes the following members.
Methods
 | Name | Description
Public method | CompileTimeValidate | Method invoked at build time to ensure that the aspect has been applied to the right target. (Inherited from Aspect.)
Protected method | CreateAspectConfiguration | Method invoked at build time to create a concrete AspectConfiguration instance specifically for the current Aspect type. (Inherited from Aspect.)
Public method | GetAspectConfiguration | Method invoked at build tome to get the imperative configuration of the current Aspect. (Inherited from Aspect.)
Protected method | SetAspectConfiguration | Method invoked at build time to set up an AspectConfiguration object according to the current Aspect instance and a specified target element of the current aspect. (Inherited from Aspect.)
Back to Top
See Also
ExternalAspect Class
PostSharp.Aspects Namespace

Online Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


ExternalAspect Properties

ExternalAspect Properties PostSharp Documentation
The ExternalAspect type exposes the following members.
Properties
 | Name | Description
Public property | AspectPriority | Gets or sets the weaving priority of the aspect. (Inherited from Aspect.)
Public property | AttributeExclude | If true, indicates that this attribute removes all other instances of the same attribute type from the set of elements defined by the current instance. (Inherited from MulticastAttribute.)
Public property | AttributeId | Obsolete. (Inherited from MulticastAttribute.)
Public property | AttributeInheritance | Determines whether this attribute is inherited (Inherited from MulticastAttribute.)
Public property | AttributePriority | Gets or sets the priority of the current attribute in case that multiple instances are defined on the same element (lower values are processed before). (Inherited from MulticastAttribute.)
Public property | AttributeReplace | Determines whether this attribute replaces other attributes found on the target declarations. (Inherited from MulticastAttribute.)
Public property | AttributeTargetAssemblies | Gets or sets the assemblies to which the current attribute apply. (Inherited from MulticastAttribute.)
Public property | AttributeTargetElements | Gets or sets the kind of elements to which this custom attributes applies. (Inherited from MulticastAttribute.)
Public property | AttributeTargetExternalMemberAttributes | Gets or sets the visibilities, scopes, virtualities, and implementation of members to which this attribute applies, when the member is external to the current module. (Inherited from MulticastAttribute.)
Public property | AttributeTargetExternalTypeAttributes | Gets or sets the visibilities of types to which this attribute applies, when this type is external to the current module. (Inherited from MulticastAttribute.)
Public property | AttributeTargetMemberAttributes | Gets or sets the visibilities, scopes, virtualities, and implementation of members to which this attribute applies. (Inherited from MulticastAttribute.)
Public property | AttributeTargetMembers | Gets or sets the expression specifying to which members this instance applies. (Inherited from MulticastAttribute.)
Public property | AttributeTargetParameterAttributes | Gets or sets the passing style (by value, out or ref) of parameters to which this attribute applies. (Inherited from MulticastAttribute.)
Public property | AttributeTargetParameters | Gets or sets the expression specifying to which parameters this instance applies. (Inherited from MulticastAttribute.)
Public property | AttributeTargetTypeAttributes | Gets or sets the visibilities of types to which this attribute applies. (Inherited from MulticastAttribute.)
Public property | AttributeTargetTypes | Gets or sets the expression specifying to which types this instance applies. (Inherited from MulticastAttribute.)
Protected property | SerializerType | Gets or sets the Online Type of the serializer (a type derived from AspectSerializer) used to serialize the aspect instance at build time and deserialize it at runtime. (Inherited from Aspect.)
Back to Top
See Also
ExternalAspect Class
PostSharp.Aspects Namespace

Online Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


FieldLevelAspect Class

FieldLevelAspect Class PostSharp Documentation
Base class for all aspects applied on fields.
Inheritance Hierarchy
Online System Object
Online System Attribute
PostSharp.Extensibility MulticastAttribute
PostSharp.Aspects Aspect
PostSharp.Aspects FieldLevelAspect

Namespace: PostSharp.Aspects
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
[SerializableAttribute]
public abstract class FieldLevelAspect : Aspect,
    IFieldLevelAspect, IAspect, IFieldLevelAspectBuildSemantics, IAspectBuildSemantics, IValidableAnnotation
[SerializableAttribute]
public abstract class FieldLevelAspect : Aspect,
    IFieldLevelAspect, IAspect, IFieldLevelAspectBuildSemantics, IAspectBuildSemantics, IValidableAnnotation
Remarks
  Note  Note

                Consider deriving your aspects from LocationLevelAspect; locations can abstract both fields and properties,
            making it possible to apply the same aspect to both.

  Note  Note

      This class does not provide any advice. You may derive your aspect class from a

        class providing
        predefined advice

      , or build a
      composite aspect
      .

  Note  Note

        All classes implementing
        IAspect
        should typically be marked as serializable
        using the custom attribute
          Online SerializableAttribute
        . Fields that
        are only used at runtime (and unknown at compile-time) should be carefully
        marked with the custom attribute
          Online NonSerializedAttribute
        .
        When PostSharp is used on a platform that does not support aspect serialization
        (such as .NET Compact Framework, Silverlight, or Windows Phone), or when
        another aspect serializer is used, it is not necessary to mark the aspect
        class as serializable.
        For more information, see
        Aspect Serialization
        .

See Also
FieldLevelAspect Members
PostSharp.Aspects Namespace
PostSharp.Aspects IFieldLevelAspect

      Conceptual Documentation: Aspect Classes

      Conceptual Documentation: Developing Complex Aspects

      Conceptual Documentation: Aspect Serialization

PostSharp.Aspects LocationLevelAspect
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


FieldLevelAspect Members

FieldLevelAspect Members PostSharp Documentation

The FieldLevelAspect type exposes the following members.
Constructors
 | Name | Description
Protected method | FieldLevelAspect | Initializes a new instance of the FieldLevelAspect class
Back to Top
Methods
 | Name | Description
Public method | CompileTimeInitialize | Method invoked at build time to initialize the instance fields of the current aspect. This method is invoked before any other build-time method.
Public method | CompileTimeValidate | Method invoked at build time to ensure that the aspect has been applied to the right target. (Inherited from Aspect.)
Protected method | CreateAspectConfiguration | Method invoked at build time to create a concrete AspectConfiguration instance specifically for the current Aspect type. (Inherited from Aspect.)
Public method | GetAspectConfiguration | Method invoked at build tome to get the imperative configuration of the current Aspect. (Inherited from Aspect.)
Public method | RuntimeInitialize | Method invoked at runtime before any other method of the aspect is invoked.
Protected method | SetAspectConfiguration | Method invoked at build time to set up an AspectConfiguration object according to the current Aspect instance and a specified target element of the current aspect. (Inherited from Aspect.)
Back to Top
Properties
 | Name | Description
Public property | AspectPriority | Gets or sets the weaving priority of the aspect. (Inherited from Aspect.)
Public property | AttributeExclude | If true, indicates that this attribute removes all other instances of the same attribute type from the set of elements defined by the current instance. (Inherited from MulticastAttribute.)
Public property | AttributeId | Obsolete. (Inherited from MulticastAttribute.)
Public property | AttributeInheritance | Determines whether this attribute is inherited (Inherited from MulticastAttribute.)
Public property | AttributePriority | Gets or sets the priority of the current attribute in case that multiple instances are defined on the same element (lower values are processed before). (Inherited from MulticastAttribute.)
Public property | AttributeReplace | Determines whether this attribute replaces other attributes found on the target declarations. (Inherited from MulticastAttribute.)
Public property | AttributeTargetAssemblies | Gets or sets the assemblies to which the current attribute apply. (Inherited from MulticastAttribute.)
Public property | AttributeTargetElements | Gets or sets the kind of elements to which this custom attributes applies. (Inherited from MulticastAttribute.)
Public property | AttributeTargetExternalMemberAttributes | Gets or sets the visibilities, scopes, virtualities, and implementation of members to which this attribute applies, when the member is external to the current module. (Inherited from MulticastAttribute.)
Public property | AttributeTargetExternalTypeAttributes | Gets or sets the visibilities of types to which this attribute applies, when this type is external to the current module. (Inherited from MulticastAttribute.)
Public property | AttributeTargetMemberAttributes | Gets or sets the visibilities, scopes, virtualities, and implementation of members to which this attribute applies. (Inherited from MulticastAttribute.)
Public property | AttributeTargetMembers | Gets or sets the expression specifying to which members this instance applies. (Inherited from MulticastAttribute.)
Public property | AttributeTargetParameterAttributes | Gets or sets the passing style (by value, out or ref) of parameters to which this attribute applies. (Inherited from MulticastAttribute.)
Public property | AttributeTargetParameters | Gets or sets the expression specifying to which parameters this instance applies. (Inherited from MulticastAttribute.)
Public property | AttributeTargetTypeAttributes | Gets or sets the visibilities of types to which this attribute applies. (Inherited from MulticastAttribute.)
Public property | AttributeTargetTypes | Gets or sets the expression specifying to which types this instance applies. (Inherited from MulticastAttribute.)
Protected property | SerializerType | Gets or sets the Online Type of the serializer (a type derived from AspectSerializer) used to serialize the aspect instance at build time and deserialize it at runtime. (Inherited from Aspect.)
Back to Top
See Also
FieldLevelAspect Class
PostSharp.Aspects Namespace

Online Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


FieldLevelAspect Constructor

FieldLevelAspect Constructor PostSharp Documentation
Initializes a new instance of the FieldLevelAspect class

Namespace: PostSharp.Aspects
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
protected FieldLevelAspect()
protected FieldLevelAspect()
See Also
FieldLevelAspect Class
FieldLevelAspect Members
PostSharp.Aspects Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


FieldLevelAspect Methods

FieldLevelAspect Methods PostSharp Documentation
The FieldLevelAspect type exposes the following members.
Methods
 | Name | Description
Public method | CompileTimeInitialize | Method invoked at build time to initialize the instance fields of the current aspect. This method is invoked before any other build-time method.
Public method | CompileTimeValidate | Method invoked at build time to ensure that the aspect has been applied to the right target. (Inherited from Aspect.)
Protected method | CreateAspectConfiguration | Method invoked at build time to create a concrete AspectConfiguration instance specifically for the current Aspect type. (Inherited from Aspect.)
Public method | GetAspectConfiguration | Method invoked at build tome to get the imperative configuration of the current Aspect. (Inherited from Aspect.)
Public method | RuntimeInitialize | Method invoked at runtime before any other method of the aspect is invoked.
Protected method | SetAspectConfiguration | Method invoked at build time to set up an AspectConfiguration object according to the current Aspect instance and a specified target element of the current aspect. (Inherited from Aspect.)
Back to Top
See Also
FieldLevelAspect Class
PostSharp.Aspects Namespace

Online Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


FieldLevelAspect.CompileTimeInitialize Method

FieldLevelAspect CompileTimeInitialize Method PostSharp Documentation
Method invoked at build time to initialize the instance fields of the current aspect. This method is invoked before any other build-time method.

Namespace: PostSharp.Aspects
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
public virtual void CompileTimeInitialize(
    FieldInfo field,
    AspectInfo aspectInfo
)
public virtual void CompileTimeInitialize(
    FieldInfo field,
    AspectInfo aspectInfo
)
Parameters
field
Type:   Online System.Reflection FieldInfo
Field to which the current aspect is applied
aspectInfo
Type: PostSharp.Aspects AspectInfo
Reserved for future usage.
Implements
IFieldLevelAspectBuildSemantics CompileTimeInitialize(FieldInfo, AspectInfo)
See Also
FieldLevelAspect Class
FieldLevelAspect Members
PostSharp.Aspects Namespace

      Conceptual Documentation: Initializing Aspects

  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


FieldLevelAspect.RuntimeInitialize Method

FieldLevelAspect RuntimeInitialize Method PostSharp Documentation
Method invoked at runtime before any other method of the aspect is invoked.

Namespace: PostSharp.Aspects
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
public virtual void RuntimeInitialize(
    FieldInfo field
)
public virtual void RuntimeInitialize(
    FieldInfo field
)
Parameters
field
Type:   Online System.Reflection FieldInfo
Field on which this instance is applied.
Implements
IFieldLevelAspect RuntimeInitialize(FieldInfo)
See Also
FieldLevelAspect Class
FieldLevelAspect Members
PostSharp.Aspects Namespace

      Conceptual Documentation: Initializing Aspects

  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


FieldLevelAspect Properties

FieldLevelAspect Properties PostSharp Documentation
The FieldLevelAspect type exposes the following members.
Properties
 | Name | Description
Public property | AspectPriority | Gets or sets the weaving priority of the aspect. (Inherited from Aspect.)
Public property | AttributeExclude | If true, indicates that this attribute removes all other instances of the same attribute type from the set of elements defined by the current instance. (Inherited from MulticastAttribute.)
Public property | AttributeId | Obsolete. (Inherited from MulticastAttribute.)
Public property | AttributeInheritance | Determines whether this attribute is inherited (Inherited from MulticastAttribute.)
Public property | AttributePriority | Gets or sets the priority of the current attribute in case that multiple instances are defined on the same element (lower values are processed before). (Inherited from MulticastAttribute.)
Public property | AttributeReplace | Determines whether this attribute replaces other attributes found on the target declarations. (Inherited from MulticastAttribute.)
Public property | AttributeTargetAssemblies | Gets or sets the assemblies to which the current attribute apply. (Inherited from MulticastAttribute.)
Public property | AttributeTargetElements | Gets or sets the kind of elements to which this custom attributes applies. (Inherited from MulticastAttribute.)
Public property | AttributeTargetExternalMemberAttributes | Gets or sets the visibilities, scopes, virtualities, and implementation of members to which this attribute applies, when the member is external to the current module. (Inherited from MulticastAttribute.)
Public property | AttributeTargetExternalTypeAttributes | Gets or sets the visibilities of types to which this attribute applies, when this type is external to the current module. (Inherited from MulticastAttribute.)
Public property | AttributeTargetMemberAttributes | Gets or sets the visibilities, scopes, virtualities, and implementation of members to which this attribute applies. (Inherited from MulticastAttribute.)
Public property | AttributeTargetMembers | Gets or sets the expression specifying to which members this instance applies. (Inherited from MulticastAttribute.)
Public property | AttributeTargetParameterAttributes | Gets or sets the passing style (by value, out or ref) of parameters to which this attribute applies. (Inherited from MulticastAttribute.)
Public property | AttributeTargetParameters | Gets or sets the expression specifying to which parameters this instance applies. (Inherited from MulticastAttribute.)
Public property | AttributeTargetTypeAttributes | Gets or sets the visibilities of types to which this attribute applies. (Inherited from MulticastAttribute.)
Public property | AttributeTargetTypes | Gets or sets the expression specifying to which types this instance applies. (Inherited from MulticastAttribute.)
Protected property | SerializerType | Gets or sets the Online Type of the serializer (a type derived from AspectSerializer) used to serialize the aspect instance at build time and deserialize it at runtime. (Inherited from Aspect.)
Back to Top
See Also
FieldLevelAspect Class
PostSharp.Aspects Namespace

Online Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


FlowBehavior Enumeration

FlowBehavior Enumeration PostSharp Documentation
Enumerates the possible behaviors of the calling method after the calling method has returned.

Namespace: PostSharp.Aspects
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
public enum FlowBehavior
public enum FlowBehavior
Members
Member name | Value | Description
Default | 0 | Default flow behavior for the current method. For OnEntry(MethodExecutionArgs), OnExit(MethodExecutionArgs) and OnSuccess(MethodExecutionArgs), the fault flow is Continue, for OnException(MethodExecutionArgs) it is RethrowException.
Continue | 1 | Continue normally. In an OnException(MethodExecutionArgs) advice, the Continue behavior does not rethrow the exception, but continues the normal execution flow after the block protected by the advise. If there is another OnMethodBoundaryAspect aspect before the current OnMethodBoundaryAspect aspect on the current method, the Continue behavior calls the OnSuccess(MethodExecutionArgs) method of the other aspect.
RethrowException | 2 | The current exception will be rethrown. Available only for OnException(MethodExecutionArgs).
Return | 3 | Return immediately from the current method. Available only for OnEntry(MethodExecutionArgs) and OnException(MethodExecutionArgs). Note that you may want to set the ReturnValue property, otherwise you may get a Online NullReferenceException. If there is another OnMethodBoundaryAspect aspect before the current OnMethodBoundaryAspect aspect on the current method, the Return behavior skips the OnSuccess(MethodExecutionArgs) method of the other aspect. However, the OnExit(MethodExecutionArgs) method of the other aspect will be invoked.
ThrowException | 4 | Throws the exception contained in the Exception property. Available only for OnException(MethodExecutionArgs).
Remarks

              This enumeration is used by the MethodExecutionArgs class.

See Also
PostSharp.Aspects Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


IAspect Interface

IAspect Interface PostSharp Documentation
Base interface for run-time semantics of all aspects.

Namespace: PostSharp.Aspects
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
public interface IAspect
public interface IAspect
See Also
PostSharp.Aspects Namespace
PostSharp.Aspects IAspectBuildSemantics
PostSharp.Aspects.Configuration AspectConfiguration
PostSharp.Aspects Aspect
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


IAspectBuildSemantics Interface

IAspectBuildSemantics Interface PostSharp Documentation
Compile-time semantics of IAspect.

Namespace: PostSharp.Aspects
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
public interface IAspectBuildSemantics : IValidableAnnotation
public interface IAspectBuildSemantics : IValidableAnnotation
See Also
IAspectBuildSemantics Members
PostSharp.Aspects Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


IAspectBuildSemantics Members

IAspectBuildSemantics Members PostSharp Documentation

The IAspectBuildSemantics type exposes the following members.
Methods
 | Name | Description
Public method | CompileTimeValidate | Method invoked at build time to ensure that the aspect has been applied to the right target. (Inherited from IValidableAnnotation.)
Public method | GetAspectConfiguration | Method invoked at build time to get the imperative configuration of the current Aspect.
Back to Top
See Also
IAspectBuildSemantics Interface
PostSharp.Aspects Namespace

Online Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


IAspectBuildSemantics Methods

IAspectBuildSemantics Methods PostSharp Documentation
The IAspectBuildSemantics type exposes the following members.
Methods
 | Name | Description
Public method | CompileTimeValidate | Method invoked at build time to ensure that the aspect has been applied to the right target. (Inherited from IValidableAnnotation.)
Public method | GetAspectConfiguration | Method invoked at build time to get the imperative configuration of the current Aspect.
Back to Top
See Also
IAspectBuildSemantics Interface
PostSharp.Aspects Namespace

Online Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


IAspectBuildSemantics.GetAspectConfiguration Method

IAspectBuildSemantics GetAspectConfiguration Method PostSharp Documentation
Method invoked at build time to get the imperative configuration of the current Aspect.

Namespace: PostSharp.Aspects
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
AspectConfiguration GetAspectConfiguration(
    Object targetElement
)
AspectConfiguration GetAspectConfiguration(
    Object targetElement
)
Parameters
targetElement
Type:   Online System Object
Code element (  Online Assembly,   Online Type,
                Online FieldInfo,   Online MethodBase,   Online PropertyInfo,   Online EventInfo,
                Online ParameterInfo, or LocationInfo) to which the current aspect has been applied.

Return Value
Type: AspectConfiguration
An AspectConfiguration representing the imperative configuration
              of the current Aspect.
See Also
IAspectBuildSemantics Interface
IAspectBuildSemantics Members
PostSharp.Aspects Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


IAspectProvider Interface

IAspectProvider Interface PostSharp Documentation
Interface that, when implemented by an aspect class, allows aspect instances to provide other aspects to the weaver.

Namespace: PostSharp.Aspects
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
public interface IAspectProvider : IAspect,
    IService
public interface IAspectProvider : IAspect,
    IService
Remarks
  Note  Note

      PostSharp Professional Edition is required for this feature.

Examples
Example: Automatically Adding DataContract and DataMember Attributes
See Also
IAspectProvider Members
PostSharp.Aspects Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


IAspectProvider Members

IAspectProvider Members PostSharp Documentation

The IAspectProvider type exposes the following members.
Methods
 | Name | Description
Public method | ProvideAspects | Provides new aspects.
Back to Top
See Also
IAspectProvider Interface
PostSharp.Aspects Namespace

Online Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


IAspectProvider Methods

IAspectProvider Methods PostSharp Documentation
The IAspectProvider type exposes the following members.
Methods
 | Name | Description
Public method | ProvideAspects | Provides new aspects.
Back to Top
See Also
IAspectProvider Interface
PostSharp.Aspects Namespace

Online Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


IAspectProvider.ProvideAspects Method

IAspectProvider ProvideAspects Method PostSharp Documentation
Provides new aspects.

Namespace: PostSharp.Aspects
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
IEnumerable<AspectInstance> ProvideAspects(
    Object targetElement
)
IEnumerable<AspectInstance> ProvideAspects(
    Object targetElement
)
Parameters
targetElement
Type:   Online System Object
Code element (  Online Assembly,   Online Type,
                Online FieldInfo,   Online MethodBase,   Online PropertyInfo,   Online EventInfo,
                Online ParameterInfo, or LocationInfo) to which the current aspect has been applied.

Return Value
Type:   Online IEnumerable  AspectInstance
A set of aspect instances.
Remarks
Implementations of this method are only allowed to return aspect instances applied on elements
                of code located under the target element of code (targetElement).
                For instance, a type-level IAspectProvider can provide aspects on methods of the current type,
                but not of other types.
See Also
IAspectProvider Interface
IAspectProvider Members
PostSharp.Aspects Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


IAssemblyLevelAspect Interface

IAssemblyLevelAspect Interface PostSharp Documentation
Runtime semantics of aspects applied at assembly level.

Namespace: PostSharp.Aspects
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
public interface IAssemblyLevelAspect : IAspect
public interface IAssemblyLevelAspect : IAspect
Remarks

              An assembly-level aspect has no equivalent to RuntimeInitialize since assemblies are never initialized.

See Also
PostSharp.Aspects Namespace
PostSharp.Aspects IAssemblyLevelAspectBuildSemantics
PostSharp.Aspects AssemblyLevelAspect
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


IAssemblyLevelAspectBuildSemantics Interface

IAssemblyLevelAspectBuildSemantics Interface PostSharp Documentation
Build-time semantics of aspects applied at assembly level.

Namespace: PostSharp.Aspects
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
public interface IAssemblyLevelAspectBuildSemantics : IAspect
public interface IAssemblyLevelAspectBuildSemantics : IAspect
See Also
IAssemblyLevelAspectBuildSemantics Members
PostSharp.Aspects Namespace
PostSharp.Aspects AssemblyLevelAspect
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


IAssemblyLevelAspectBuildSemantics Members

IAssemblyLevelAspectBuildSemantics Members PostSharp Documentation

The IAssemblyLevelAspectBuildSemantics type exposes the following members.
Methods
 | Name | Description
Public method | CompileTimeInitialize | Method invoked at build time to initialize the instance fields of the current aspect. This method is invoked before any other build-time method.
Back to Top
See Also
IAssemblyLevelAspectBuildSemantics Interface
PostSharp.Aspects Namespace

Online Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


IAssemblyLevelAspectBuildSemantics Methods

IAssemblyLevelAspectBuildSemantics Methods PostSharp Documentation
The IAssemblyLevelAspectBuildSemantics type exposes the following members.
Methods
 | Name | Description
Public method | CompileTimeInitialize | Method invoked at build time to initialize the instance fields of the current aspect. This method is invoked before any other build-time method.
Back to Top
See Also
IAssemblyLevelAspectBuildSemantics Interface
PostSharp.Aspects Namespace

Online Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


IAssemblyLevelAspectBuildSemantics.CompileTimeInitialize Method

IAssemblyLevelAspectBuildSemantics CompileTimeInitialize Method PostSharp Documentation
Method invoked at build time to initialize the instance fields of the current aspect. This method is invoked before any other build-time method.

Namespace: PostSharp.Aspects
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
void CompileTimeInitialize(
    Assembly assembly,
    AspectInfo aspectInfo
)
void CompileTimeInitialize(
    Assembly assembly,
    AspectInfo aspectInfo
)
Parameters
assembly
Type:   Online System.Reflection Assembly
Assembly to which the current aspect is applied
aspectInfo
Type: PostSharp.Aspects AspectInfo
Reserved for future usage.
See Also
IAssemblyLevelAspectBuildSemantics Interface
IAssemblyLevelAspectBuildSemantics Members
PostSharp.Aspects Namespace

      Conceptual Documentation: Initializing Aspects

      Conceptual Documentation: Initializing Aspects

  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


ICloneAwareAspect Interface

ICloneAwareAspect Interface PostSharp Documentation
Defines the semantics of aspects that require to be notified after a target object is cloned using Online MemberwiseClone .

Namespace: PostSharp.Aspects
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
public interface ICloneAwareAspect : IInstanceScopedAspect,
    IAspect
public interface ICloneAwareAspect : IInstanceScopedAspect,
    IAspect
See Also
ICloneAwareAspect Members
PostSharp.Aspects Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


ICloneAwareAspect Members

ICloneAwareAspect Members PostSharp Documentation

The ICloneAwareAspect type exposes the following members.
Methods
 | Name | Description
Public method | CreateInstance | Creates a new instance of the aspect based on the current instance, serving as a prototype. (Inherited from IInstanceScopedAspect.)
Public method | OnCloned | Method called after the an object enhanced by the current aspect has been cloned using Online MemberwiseClone . The this parameter refers to the new aspect instance in the cloned object.
Public method | RuntimeInitializeInstance | Initializes the aspect instance. This method is invoked when all system elements of the aspect (like member imports) have completed. (Inherited from IInstanceScopedAspect.)
Back to Top
See Also
ICloneAwareAspect Interface
PostSharp.Aspects Namespace

Online Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


ICloneAwareAspect Methods

ICloneAwareAspect Methods PostSharp Documentation
The ICloneAwareAspect type exposes the following members.
Methods
 | Name | Description
Public method | CreateInstance | Creates a new instance of the aspect based on the current instance, serving as a prototype. (Inherited from IInstanceScopedAspect.)
Public method | OnCloned | Method called after the an object enhanced by the current aspect has been cloned using Online MemberwiseClone . The this parameter refers to the new aspect instance in the cloned object.
Public method | RuntimeInitializeInstance | Initializes the aspect instance. This method is invoked when all system elements of the aspect (like member imports) have completed. (Inherited from IInstanceScopedAspect.)
Back to Top
See Also
ICloneAwareAspect Interface
PostSharp.Aspects Namespace

Online Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


ICloneAwareAspect.OnCloned Method

ICloneAwareAspect OnCloned Method PostSharp Documentation
Method called after the an object enhanced by the current aspect has been cloned using Online MemberwiseClone . The this parameter refers to the new aspect instance in the cloned object.

Namespace: PostSharp.Aspects
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
void OnCloned(
    ICloneAwareAspect source
)
void OnCloned(
    ICloneAwareAspect source
)
Parameters
source
Type: PostSharp.Aspects ICloneAwareAspect
Aspect instance corresponding to the current
            aspect instance in the cloned target object.
Remarks
Prior to calling the current method, the aspect framework
            initializes the source object using CreateInstance(AdviceArgs)
            and RuntimeInitializeInstance . That is, the aspect instance
            in the cloned object is not cloned from the source aspect instance, but from the prototype
            aspect instance.

See Also
ICloneAwareAspect Interface
ICloneAwareAspect Members
PostSharp.Aspects Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


IComposed(T) Interface

IComposed T Interface PostSharp Documentation
Interface exposing the implementation of another interface introduced by a CompositionAspect.

Namespace: PostSharp.Aspects
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
public interface IComposed<T>
public interface IComposed<T>
Type Parameters
T
Interface whose implementation is expose.
See Also
IComposed T  Members
PostSharp.Aspects Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


IComposed(T) Members

IComposed T Members PostSharp Documentation

The IComposed T type exposes the following members.
Methods
 | Name | Description
Public method | GetImplementation | Gets the object implementing the interface T on behalf of the current instance.
Back to Top
See Also
IComposed T Interface
PostSharp.Aspects Namespace

Online Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


IComposed(T) Methods

IComposed T Methods PostSharp Documentation
The IComposed T type exposes the following members.
Methods
 | Name | Description
Public method | GetImplementation | Gets the object implementing the interface T on behalf of the current instance.
Back to Top
See Also
IComposed T Interface
PostSharp.Aspects Namespace

Online Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


IComposed(T).GetImplementation Method

IComposed T GetImplementation Method PostSharp Documentation
Gets the object implementing the interface T on behalf of the current instance.

Namespace: PostSharp.Aspects
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
T GetImplementation(
    InstanceCredentials credentials
)
T GetImplementation(
    InstanceCredentials credentials
)
Parameters
credentials
Type: PostSharp.Aspects InstanceCredentials
Credentials provided by the current instance.
Return Value
Type: T
The object implementing the interface T
              on behalf of the current instance.

See Also
IComposed T  Interface
IComposed T  Members
PostSharp.Aspects Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


ICompositionAspect Interface

ICompositionAspect Interface PostSharp Documentation
Defines the semantics of an aspect that, when applied on a type, introduce one or many new interfaces into that type, and let these interfaces be implemented by an object created at runtime.

Namespace: PostSharp.Aspects
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
public interface ICompositionAspect : ITypeLevelAspect,
    IAspect
public interface ICompositionAspect : ITypeLevelAspect,
    IAspect
Remarks

              See CompositionAspect for details.

See Also
ICompositionAspect Members
PostSharp.Aspects Namespace
PostSharp.Aspects CompositionAspect
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


ICompositionAspect Members

ICompositionAspect Members PostSharp Documentation

The ICompositionAspect type exposes the following members.
Methods
 | Name | Description
Public method | CreateImplementationObject | Method invoked at runtime, during the initialization of instances of the target type, to create the composed object.
Public method | RuntimeInitialize | Initializes the current aspect. (Inherited from ITypeLevelAspect.)
Back to Top
See Also
ICompositionAspect Interface
PostSharp.Aspects Namespace

Online Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


ICompositionAspect Methods

ICompositionAspect Methods PostSharp Documentation
The ICompositionAspect type exposes the following members.
Methods
 | Name | Description
Public method | CreateImplementationObject | Method invoked at runtime, during the initialization of instances of the target type, to create the composed object.
Public method | RuntimeInitialize | Initializes the current aspect. (Inherited from ITypeLevelAspect.)
Back to Top
See Also
ICompositionAspect Interface
PostSharp.Aspects Namespace

Online Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


ICompositionAspect.CreateImplementationObject Method

ICompositionAspect CreateImplementationObject Method PostSharp Documentation
Method invoked at runtime, during the initialization of instances of the target type, to create the composed object.

Namespace: PostSharp.Aspects
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
Object CreateImplementationObject(
    AdviceArgs args
)
Object CreateImplementationObject(
    AdviceArgs args
)
Parameters
args
Type: PostSharp.Aspects AdviceArgs
[Missing <param name="args"/> documentation for "M:PostSharp.Aspects.ICompositionAspect.CreateImplementationObject(PostSharp.Aspects.AdviceArgs)"]
Return Value
Type:   Online Object
The composed object. This interface should implement the interfaces specified
              by the PublicInterfaces and
              ProtectedInterfaces collections.
Remarks

              This method is invoked during at runtime after the base constructor has executed, and before
              the constructor of the current type is executed.

See Also
ICompositionAspect Interface
ICompositionAspect Members
PostSharp.Aspects Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


ICustomAttributeIntroductionAspect Interface

ICustomAttributeIntroductionAspect Interface PostSharp Documentation
Semantics of an aspect that, when applied to a target, adds a custom attribute to this target.

Namespace: PostSharp.Aspects
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
public interface ICustomAttributeIntroductionAspect : IAspect
public interface ICustomAttributeIntroductionAspect : IAspect
Remarks

              See CustomAttributeIntroductionAspect for details.

See Also
PostSharp.Aspects Namespace
PostSharp.Aspects CustomAttributeIntroductionAspect
PostSharp.Aspects.Configuration CustomAttributeIntroductionAspectConfiguration
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


IEventBinding Interface

IEventBinding Interface PostSharp Documentation
Interface through which an event-level aspect or advice can invoke the next node in the chain of invocation.

Namespace: PostSharp.Aspects
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
public interface IEventBinding
public interface IEventBinding
See Also
IEventBinding Members
PostSharp.Aspects Namespace
PostSharp.Aspects.Advices ImportMemberAttribute

      Conceptual Documentation: Aspect Bindings

  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


IEventBinding Members

IEventBinding Members PostSharp Documentation

The IEventBinding type exposes the following members.
Methods
 | Name | Description
Public method | AddHandler | Invoke the Add semantic on the next node in the chain of invocation.
Public method | InvokeHandler | Invoke the Invoke semantic on the next node in the chain of invocation.
Public method | RemoveHandler | Invoke the Remove semantic on the next node in the chain of invocation.
Back to Top
See Also
IEventBinding Interface
PostSharp.Aspects Namespace

Online Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


IEventBinding Methods

IEventBinding Methods PostSharp Documentation
The IEventBinding type exposes the following members.
Methods
 | Name | Description
Public method | AddHandler | Invoke the Add semantic on the next node in the chain of invocation.
Public method | InvokeHandler | Invoke the Invoke semantic on the next node in the chain of invocation.
Public method | RemoveHandler | Invoke the Remove semantic on the next node in the chain of invocation.
Back to Top
See Also
IEventBinding Interface
PostSharp.Aspects Namespace

Online Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


IEventBinding.AddHandler Method

IEventBinding AddHandler Method PostSharp Documentation
Invoke the Add semantic on the next node in the chain of invocation.

Namespace: PostSharp.Aspects
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
void AddHandler(
    ref Object instance,
    Delegate handler
)
void AddHandler(
    ref Object instance,
    Delegate handler
)
Parameters
instance
Type:   Online System Object
Target instance on which the event is defined (null if the event is static).
handler
Type:   Online System Delegate
Handler to be added to the event.
Remarks

      The
      instance
      parameter is passed by reference so that instance methods of value types (
      struct
      in C#) are allowed to change the value of the instance.

See Also
IEventBinding Interface
IEventBinding Members
PostSharp.Aspects Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


IEventBinding.InvokeHandler Method

IEventBinding InvokeHandler Method PostSharp Documentation
Invoke the Invoke semantic on the next node in the chain of invocation.

Namespace: PostSharp.Aspects
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
Object InvokeHandler(
    ref Object instance,
    Delegate handler,
    Arguments arguments
)
Object InvokeHandler(
    ref Object instance,
    Delegate handler,
    Arguments arguments
)
Parameters
instance
Type:   Online System Object
Target instance on which the event is defined (null if the event is static).
handler
Type:   Online System Delegate
Handler to be removed from the event.
arguments
Type: PostSharp.Aspects Arguments
Arguments with which the handler should be invoked.
Return Value
Type:   Online Object
The value returned by the handler.
Remarks

      The
      instance
      parameter is passed by reference so that instance methods of value types (
      struct
      in C#) are allowed to change the value of the instance.

  Note  Note

      The
      Invoke Event Handler
      semantic is different from normal event firing.
      Indeed, when you fire an event, all handlers that were added to this event are fired. However, the current method
      invokes only a single handler: the one passed to the
      handler
      parameter.

See Also
IEventBinding Interface
IEventBinding Members
PostSharp.Aspects Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


IEventBinding.RemoveHandler Method

IEventBinding RemoveHandler Method PostSharp Documentation
Invoke the Remove semantic on the next node in the chain of invocation.

Namespace: PostSharp.Aspects
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
void RemoveHandler(
    ref Object instance,
    Delegate handler
)
void RemoveHandler(
    ref Object instance,
    Delegate handler
)
Parameters
instance
Type:   Online System Object
Target instance on which the event is defined (null if the event is static).
handler
Type:   Online System Delegate
Handler to be removed from the event.
Remarks

      The
      instance
      parameter is passed by reference so that instance methods of value types (
      struct
      in C#) are allowed to change the value of the instance.

See Also
IEventBinding Interface
IEventBinding Members
PostSharp.Aspects Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


IEventInterceptionAspect Interface

IEventInterceptionAspect Interface PostSharp Documentation
Runtime semantics of an aspect that, when applied on an event, intercepts invocations of its semantics Add (OnAddHandler(EventInterceptionArgs)), Remove (OnRemoveHandler(EventInterceptionArgs)) and Invoke (OnInvokeHandler(EventInterceptionArgs)) semantics.

Namespace: PostSharp.Aspects
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
public interface IEventInterceptionAspect : IEventLevelAspect,
    IAspect
public interface IEventInterceptionAspect : IEventLevelAspect,
    IAspect
Remarks

                For details, see EventInterceptionAspect
  Note  Note

      PostSharp Professional Edition is required for this feature.

See Also
IEventInterceptionAspect Members
PostSharp.Aspects Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


IEventInterceptionAspect Members

IEventInterceptionAspect Members PostSharp Documentation

The IEventInterceptionAspect type exposes the following members.
Methods
 | Name | Description
Public method | OnAddHandler | Method invoked instead of the Add semantic of the event to which the current aspect is applied, i.e. when a new delegate is added to this event.
Public method | OnInvokeHandler | Method invoked when the event to which the current aspect is applied is fired, for each delegate of this event, and instead of invoking this delegate.
Public method | OnRemoveHandler | Method invoked instead of the Remove semantic of the event to which the current aspect is applied, i.e. when a delegate is removed from this event.
Public method | RuntimeInitialize | Initializes the current aspect. (Inherited from IEventLevelAspect.)
Back to Top
See Also
IEventInterceptionAspect Interface
PostSharp.Aspects Namespace

Online Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


IEventInterceptionAspect Methods

IEventInterceptionAspect Methods PostSharp Documentation
The IEventInterceptionAspect type exposes the following members.
Methods
 | Name | Description
Public method | OnAddHandler | Method invoked instead of the Add semantic of the event to which the current aspect is applied, i.e. when a new delegate is added to this event.
Public method | OnInvokeHandler | Method invoked when the event to which the current aspect is applied is fired, for each delegate of this event, and instead of invoking this delegate.
Public method | OnRemoveHandler | Method invoked instead of the Remove semantic of the event to which the current aspect is applied, i.e. when a delegate is removed from this event.
Public method | RuntimeInitialize | Initializes the current aspect. (Inherited from IEventLevelAspect.)
Back to Top
See Also
IEventInterceptionAspect Interface
PostSharp.Aspects Namespace

Online Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


IEventInterceptionAspect.OnAddHandler Method

IEventInterceptionAspect OnAddHandler Method PostSharp Documentation
Method invoked instead of the Add semantic of the event to which the current aspect is applied, i.e. when a new delegate is added to this event.

Namespace: PostSharp.Aspects
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
void OnAddHandler(
    EventInterceptionArgs args
)
void OnAddHandler(
    EventInterceptionArgs args
)
Parameters
args
Type: PostSharp.Aspects EventInterceptionArgs
Handler arguments.
Remarks
  Note  Note

      Because of the way how the C# compiler implements
      automatic events
      (i.e. events where you
      don't implement the
      Add
      and
      Remove
      semantics manually), the
      Invoke Event Handler
      semantic (
      OnInvokeHandler(EventInterceptionArgs)
      or equivalent) shall
      not
      be invoked for delegates that have been added from inside the class that declares this event.

See Also
IEventInterceptionAspect Interface
IEventInterceptionAspect Members
PostSharp.Aspects Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


IEventInterceptionAspect.OnInvokeHandler Method

IEventInterceptionAspect OnInvokeHandler Method PostSharp Documentation
Method invoked when the event to which the current aspect is applied is fired, for each delegate of this event, and instead of invoking this delegate.

Namespace: PostSharp.Aspects
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
void OnInvokeHandler(
    EventInterceptionArgs args
)
void OnInvokeHandler(
    EventInterceptionArgs args
)
Parameters
args
Type: PostSharp.Aspects EventInterceptionArgs
Handler arguments.
Remarks
  Note  Note

      Because of the way how the C# compiler implements
      automatic events
      (i.e. events where you
      don't implement the
      Add
      and
      Remove
      semantics manually), the
      Invoke Event Handler
      semantic (
      OnInvokeHandler(EventInterceptionArgs)
      or equivalent) shall
      not
      be invoked for delegates that have been added from inside the class that declares this event.

  Note  Note

      The
      Invoke Event Handler
      semantic is different from normal event firing.
      Indeed, when you fire an event, all handlers that were added to this event are fired. However, the current method
      invokes only a single handler: the one passed to the
      handler
      parameter.

See Also
IEventInterceptionAspect Interface
IEventInterceptionAspect Members
PostSharp.Aspects Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


IEventInterceptionAspect.OnRemoveHandler Method

IEventInterceptionAspect OnRemoveHandler Method PostSharp Documentation
Method invoked instead of the Remove semantic of the event to which the current aspect is applied, i.e. when a delegate is removed from this event.

Namespace: PostSharp.Aspects
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
void OnRemoveHandler(
    EventInterceptionArgs args
)
void OnRemoveHandler(
    EventInterceptionArgs args
)
Parameters
args
Type: PostSharp.Aspects EventInterceptionArgs
Handler arguments.
Remarks
  Note  Note

      Because of the way how the C# compiler implements
      automatic events
      (i.e. events where you
      don't implement the
      Add
      and
      Remove
      semantics manually), the
      Invoke Event Handler
      semantic (
      OnInvokeHandler(EventInterceptionArgs)
      or equivalent) shall
      not
      be invoked for delegates that have been added from inside the class that declares this event.

See Also
IEventInterceptionAspect Interface
IEventInterceptionAspect Members
PostSharp.Aspects Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


IEventLevelAspect Interface

IEventLevelAspect Interface PostSharp Documentation
Runtime semantics of aspects that can be applied on events.

Namespace: PostSharp.Aspects
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
public interface IEventLevelAspect : IAspect
public interface IEventLevelAspect : IAspect
See Also
IEventLevelAspect Members
PostSharp.Aspects Namespace
PostSharp.Aspects EventLevelAspect
PostSharp.Aspects IEventLevelAspectBuildSemantics
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


IEventLevelAspect Members

IEventLevelAspect Members PostSharp Documentation

The IEventLevelAspect type exposes the following members.
Methods
 | Name | Description
Public method | RuntimeInitialize | Initializes the current aspect.
Back to Top
See Also
IEventLevelAspect Interface
PostSharp.Aspects Namespace

Online Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


IEventLevelAspect Methods

IEventLevelAspect Methods PostSharp Documentation
The IEventLevelAspect type exposes the following members.
Methods
 | Name | Description
Public method | RuntimeInitialize | Initializes the current aspect.
Back to Top
See Also
IEventLevelAspect Interface
PostSharp.Aspects Namespace

Online Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


IEventLevelAspect.RuntimeInitialize Method

IEventLevelAspect RuntimeInitialize Method PostSharp Documentation
Initializes the current aspect.

Namespace: PostSharp.Aspects
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
void RuntimeInitialize(
    EventInfo eventInfo
)
void RuntimeInitialize(
    EventInfo eventInfo
)
Parameters
eventInfo
Type:   Online System.Reflection EventInfo
Event to which the current aspect is applied.
See Also
IEventLevelAspect Interface
IEventLevelAspect Members
PostSharp.Aspects Namespace

      Conceptual Documentation: Initializing Aspects

  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


IEventLevelAspectBuildSemantics Interface

IEventLevelAspectBuildSemantics Interface PostSharp Documentation
Build-time semantics of aspects that can be applied on events.

Namespace: PostSharp.Aspects
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
public interface IEventLevelAspectBuildSemantics : IAspectBuildSemantics,
    IValidableAnnotation
public interface IEventLevelAspectBuildSemantics : IAspectBuildSemantics,
    IValidableAnnotation
See Also
IEventLevelAspectBuildSemantics Members
PostSharp.Aspects Namespace
PostSharp.Aspects EventLevelAspect
PostSharp.Aspects IEventLevelAspect
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


IEventLevelAspectBuildSemantics Members

IEventLevelAspectBuildSemantics Members PostSharp Documentation

The IEventLevelAspectBuildSemantics type exposes the following members.
Methods
 | Name | Description
Public method | CompileTimeInitialize | Method invoked at build time to initialize the instance fields of the current aspect. This method is invoked before any other build-time method.
Public method | CompileTimeValidate | Method invoked at build time to ensure that the aspect has been applied to the right target. (Inherited from IValidableAnnotation.)
Public method | GetAspectConfiguration | Method invoked at build time to get the imperative configuration of the current Aspect. (Inherited from IAspectBuildSemantics.)
Back to Top
See Also
IEventLevelAspectBuildSemantics Interface
PostSharp.Aspects Namespace

Online Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


IEventLevelAspectBuildSemantics Methods

IEventLevelAspectBuildSemantics Methods PostSharp Documentation
The IEventLevelAspectBuildSemantics type exposes the following members.
Methods
 | Name | Description
Public method | CompileTimeInitialize | Method invoked at build time to initialize the instance fields of the current aspect. This method is invoked before any other build-time method.
Public method | CompileTimeValidate | Method invoked at build time to ensure that the aspect has been applied to the right target. (Inherited from IValidableAnnotation.)
Public method | GetAspectConfiguration | Method invoked at build time to get the imperative configuration of the current Aspect. (Inherited from IAspectBuildSemantics.)
Back to Top
See Also
IEventLevelAspectBuildSemantics Interface
PostSharp.Aspects Namespace

Online Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


IEventLevelAspectBuildSemantics.CompileTimeInitialize Method

IEventLevelAspectBuildSemantics CompileTimeInitialize Method PostSharp Documentation
Method invoked at build time to initialize the instance fields of the current aspect. This method is invoked before any other build-time method.

Namespace: PostSharp.Aspects
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
void CompileTimeInitialize(
    EventInfo targetEvent,
    AspectInfo aspectInfo
)
void CompileTimeInitialize(
    EventInfo targetEvent,
    AspectInfo aspectInfo
)
Parameters
targetEvent
Type:   Online System.Reflection EventInfo
Event to which the current aspect is applied
aspectInfo
Type: PostSharp.Aspects AspectInfo
Reserved for future usage.
See Also
IEventLevelAspectBuildSemantics Interface
IEventLevelAspectBuildSemantics Members
PostSharp.Aspects Namespace

      Conceptual Documentation: Initializing Aspects

  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


IExternalAspect Interface

IExternalAspect Interface PostSharp Documentation
Allows to turn an arbitrary custom attribute into an aspect, while implementing the aspect in a different class. Classes implementing this interface must be annotated with the ExternalAspectConfigurationAttribute custom attribute.

Namespace: PostSharp.Aspects
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
[ObsoleteAttribute("Build-time semantics are now supported for Silverlight, Windows Phone, and WinRT.")]
public interface IExternalAspect : IAspect
[ObsoleteAttribute("Build-time semantics are now supported for Silverlight, Windows Phone, and WinRT.")]
public interface IExternalAspect : IAspect
Remarks

              For details, see ExternalAspect.

See Also
PostSharp.Aspects Namespace
PostSharp.Aspects ExternalAspect
PostSharp.Aspects IExternalAspectImplementation

      Conceptual Documentation: Using PostSharp with Silverlight, Windows Phone, and the Compact .NET Framework

  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


IExternalAspectImplementation Interface

IExternalAspectImplementation Interface PostSharp Documentation
Implementation of an IExternalAspect.

Namespace: PostSharp.Aspects
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
[ObsoleteAttribute("Build-time semantics are now supported for Silverlight, Windows Phone, and WinRT.")]
public interface IExternalAspectImplementation
[ObsoleteAttribute("Build-time semantics are now supported for Silverlight, Windows Phone, and WinRT.")]
public interface IExternalAspectImplementation
Remarks

              Classes implementing this interface are instantiated in the post-compiler and are executed against the full .NET Framework.
              However, when processing a Silverlight or Compact Framework project, classes of this project cannot be instantiated in the
              post-compiler, neither can code be executed. Therefore, all aspects should be represented as object constructions
              (ObjectConstruction), and not aspect instances themselves.

See Also
IExternalAspectImplementation Members
PostSharp.Aspects Namespace

      Conceptual Documentation: Using PostSharp with Silverlight, Windows Phone, and the Compact .NET Framework

  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


IExternalAspectImplementation Members

IExternalAspectImplementation Members PostSharp Documentation

The IExternalAspectImplementation type exposes the following members.
Methods
 | Name | Description
Public method | ProvideImplementationAspects | Returns a set of aspect instances to be added to the project.
Back to Top
See Also
IExternalAspectImplementation Interface
PostSharp.Aspects Namespace

Online Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


IExternalAspectImplementation Methods

IExternalAspectImplementation Methods PostSharp Documentation
The IExternalAspectImplementation type exposes the following members.
Methods
 | Name | Description
Public method | ProvideImplementationAspects | Returns a set of aspect instances to be added to the project.
Back to Top
See Also
IExternalAspectImplementation Interface
PostSharp.Aspects Namespace

Online Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


IExternalAspectImplementation.ProvideImplementationAspects Method

IExternalAspectImplementation ProvideImplementationAspects Method PostSharp Documentation
Returns a set of aspect instances to be added to the project.

Namespace: PostSharp.Aspects
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
IEnumerable<AspectInstance> ProvideImplementationAspects(
    Object target,
    ObjectConstruction aspectConstruction
)
IEnumerable<AspectInstance> ProvideImplementationAspects(
    Object target,
    ObjectConstruction aspectConstruction
)
Parameters
target
Type:   Online System Object
Code element (  Online Type,   Online FieldInfo,   Online MethodInfo,
                Online ConstructorInfo,   Online ParameterInfo, ...) on which the
              aspect is applied.
aspectConstruction
Type: PostSharp.Reflection ObjectConstruction
Representation of the aspect instance (implementing IExternalAspect)
              requiring external implementation.
Return Value
Type:   Online IEnumerable  AspectInstance

              A set of aspect instances to be added to the project. Objects AspectInstance are expected
              to be initialized using a constructor taking a required argument of type ObjectConstruction
              and an optional parameter of type AspectConfiguration.

See Also
IExternalAspectImplementation Interface
IExternalAspectImplementation Members
PostSharp.Aspects Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


IFieldLevelAspect Interface

IFieldLevelAspect Interface PostSharp Documentation
Run-time semantics of aspects applied to fields.

Namespace: PostSharp.Aspects
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
public interface IFieldLevelAspect : IAspect
public interface IFieldLevelAspect : IAspect
See Also
IFieldLevelAspect Members
PostSharp.Aspects Namespace
PostSharp.Aspects IFieldLevelAspectBuildSemantics
PostSharp.Aspects FieldLevelAspect
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


IFieldLevelAspect Members

IFieldLevelAspect Members PostSharp Documentation

The IFieldLevelAspect type exposes the following members.
Methods
 | Name | Description
Public method | RuntimeInitialize | Method invoked at runtime before any other method of the aspect is invoked.
Back to Top
See Also
IFieldLevelAspect Interface
PostSharp.Aspects Namespace

Online Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


IFieldLevelAspect Methods

IFieldLevelAspect Methods PostSharp Documentation
The IFieldLevelAspect type exposes the following members.
Methods
 | Name | Description
Public method | RuntimeInitialize | Method invoked at runtime before any other method of the aspect is invoked.
Back to Top
See Also
IFieldLevelAspect Interface
PostSharp.Aspects Namespace

Online Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


IFieldLevelAspect.RuntimeInitialize Method

IFieldLevelAspect RuntimeInitialize Method PostSharp Documentation
Method invoked at runtime before any other method of the aspect is invoked.

Namespace: PostSharp.Aspects
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
void RuntimeInitialize(
    FieldInfo field
)
void RuntimeInitialize(
    FieldInfo field
)
Parameters
field
Type:   Online System.Reflection FieldInfo
Field on which this instance is applied.
See Also
IFieldLevelAspect Interface
IFieldLevelAspect Members
PostSharp.Aspects Namespace

      Conceptual Documentation: Initializing Aspects

  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


IFieldLevelAspectBuildSemantics Interface

IFieldLevelAspectBuildSemantics Interface PostSharp Documentation
Compile-time semantics of IFieldLevelAspect.

Namespace: PostSharp.Aspects
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
public interface IFieldLevelAspectBuildSemantics : IAspectBuildSemantics,
    IValidableAnnotation
public interface IFieldLevelAspectBuildSemantics : IAspectBuildSemantics,
    IValidableAnnotation
See Also
IFieldLevelAspectBuildSemantics Members
PostSharp.Aspects Namespace
PostSharp.Aspects IFieldLevelAspect
PostSharp.Aspects FieldLevelAspect
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


IFieldLevelAspectBuildSemantics Members

IFieldLevelAspectBuildSemantics Members PostSharp Documentation

The IFieldLevelAspectBuildSemantics type exposes the following members.
Methods
 | Name | Description
Public method | CompileTimeInitialize | Method invoked at build time to initialize the instance fields of the current aspect. This method is invoked before any other build-time method.
Public method | CompileTimeValidate | Method invoked at build time to ensure that the aspect has been applied to the right target. (Inherited from IValidableAnnotation.)
Public method | GetAspectConfiguration | Method invoked at build time to get the imperative configuration of the current Aspect. (Inherited from IAspectBuildSemantics.)
Back to Top
See Also
IFieldLevelAspectBuildSemantics Interface
PostSharp.Aspects Namespace

Online Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


IFieldLevelAspectBuildSemantics Methods

IFieldLevelAspectBuildSemantics Methods PostSharp Documentation
The IFieldLevelAspectBuildSemantics type exposes the following members.
Methods
 | Name | Description
Public method | CompileTimeInitialize | Method invoked at build time to initialize the instance fields of the current aspect. This method is invoked before any other build-time method.
Public method | CompileTimeValidate | Method invoked at build time to ensure that the aspect has been applied to the right target. (Inherited from IValidableAnnotation.)
Public method | GetAspectConfiguration | Method invoked at build time to get the imperative configuration of the current Aspect. (Inherited from IAspectBuildSemantics.)
Back to Top
See Also
IFieldLevelAspectBuildSemantics Interface
PostSharp.Aspects Namespace

Online Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


IFieldLevelAspectBuildSemantics.CompileTimeInitialize Method

IFieldLevelAspectBuildSemantics CompileTimeInitialize Method PostSharp Documentation
Method invoked at build time to initialize the instance fields of the current aspect. This method is invoked before any other build-time method.

Namespace: PostSharp.Aspects
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
void CompileTimeInitialize(
    FieldInfo field,
    AspectInfo aspectInfo
)
void CompileTimeInitialize(
    FieldInfo field,
    AspectInfo aspectInfo
)
Parameters
field
Type:   Online System.Reflection FieldInfo
Field to which the current aspect is applied
aspectInfo
Type: PostSharp.Aspects AspectInfo
Reserved for future usage.
See Also
IFieldLevelAspectBuildSemantics Interface
IFieldLevelAspectBuildSemantics Members
PostSharp.Aspects Namespace

      Conceptual Documentation: Initializing Aspects

  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


IInstanceScopedAspect Interface

IInstanceScopedAspect Interface PostSharp Documentation
Runtime semantics of aspects that have the same lifetime as instance of types to which their are applied (or instance of the declaring type of members to which they are applied).

Namespace: PostSharp.Aspects
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
public interface IInstanceScopedAspect : IAspect
public interface IInstanceScopedAspect : IAspect
Remarks
When an aspect is instance-scoped, a new instance of this aspect is created whenever an instance of the
                type to which it has been applied is created (concretely, before the call to the base constructor and the own constructor of this type).
New aspect instances are obtained using the prototype design pattern. As any other aspect, an instance-scope aspect
                has a static instance initialized at build time, then serialized, deserialized at runtime, and initialized by RuntimeInitialize.
                This static instance then serves as a prototype.  When a new instance of the target type is created, the prototype is cloned
                by the method CreateInstance(AdviceArgs) (typically implemented by a call to   Online MemberwiseClone ). Then some system
                initializations (for instance member import) are performed on the aspect instance, and finally the RuntimeInitializeInstance
                method is invoked.

When an aspect implementing the IInstanceScopedAspect interface is applied on a static method, field, property, or event,
                the aspect will be statically scoped and the interface will be ignored.
See Also
IInstanceScopedAspect Members
PostSharp.Aspects Namespace

      Conceptual Documentation: Understanding Aspect Lifetime and Scope

  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


IInstanceScopedAspect Members

IInstanceScopedAspect Members PostSharp Documentation

The IInstanceScopedAspect type exposes the following members.
Methods
 | Name | Description
Public method | CreateInstance | Creates a new instance of the aspect based on the current instance, serving as a prototype.
Public method | RuntimeInitializeInstance | Initializes the aspect instance. This method is invoked when all system elements of the aspect (like member imports) have completed.
Back to Top
See Also
IInstanceScopedAspect Interface
PostSharp.Aspects Namespace

Online Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


IInstanceScopedAspect Methods

IInstanceScopedAspect Methods PostSharp Documentation
The IInstanceScopedAspect type exposes the following members.
Methods
 | Name | Description
Public method | CreateInstance | Creates a new instance of the aspect based on the current instance, serving as a prototype.
Public method | RuntimeInitializeInstance | Initializes the aspect instance. This method is invoked when all system elements of the aspect (like member imports) have completed.
Back to Top
See Also
IInstanceScopedAspect Interface
PostSharp.Aspects Namespace

Online Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


IInstanceScopedAspect.CreateInstance Method

IInstanceScopedAspect CreateInstance Method PostSharp Documentation
Creates a new instance of the aspect based on the current instance, serving as a prototype.

Namespace: PostSharp.Aspects
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
Object CreateInstance(
    AdviceArgs adviceArgs
)
Object CreateInstance(
    AdviceArgs adviceArgs
)
Parameters
adviceArgs
Type: PostSharp.Aspects AdviceArgs
Aspect arguments.
Return Value
Type:   Online Object
A new instance of the aspect, typically a clone of the current prototype instance.
Remarks

              This method is typically implemented by invoking   Online MemberwiseClone .

See Also
IInstanceScopedAspect Interface
IInstanceScopedAspect Members
PostSharp.Aspects Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


IInstanceScopedAspect.RuntimeInitializeInstance Method

IInstanceScopedAspect RuntimeInitializeInstance Method PostSharp Documentation
Initializes the aspect instance. This method is invoked when all system elements of the aspect (like member imports) have completed.

Namespace: PostSharp.Aspects
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
void RuntimeInitializeInstance()
void RuntimeInitializeInstance()
See Also
IInstanceScopedAspect Interface
IInstanceScopedAspect Members
PostSharp.Aspects Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


ILocationBinding Interface

ILocationBinding Interface PostSharp Documentation
Interface through which a field- or property-level aspect or advice can invoke the next node in the chain of invocation.

Namespace: PostSharp.Aspects
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
public interface ILocationBinding
public interface ILocationBinding
See Also
ILocationBinding Members
PostSharp.Aspects Namespace
PostSharp.Aspects.Advices ImportMemberAttribute

      Conceptual Documentation: Aspect Bindings

  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


ILocationBinding Members

ILocationBinding Members PostSharp Documentation

The ILocationBinding type exposes the following members.
Methods
 | Name | Description
Public method | GetValue | Invokes the Get semantic on the next node in the chain of invocation.
Public method | SetValue | Invokes the Set semantic on the next node in the chain of invocation.
Back to Top
See Also
ILocationBinding Interface
PostSharp.Aspects Namespace

Online Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


ILocationBinding Methods

ILocationBinding Methods PostSharp Documentation
The ILocationBinding type exposes the following members.
Methods
 | Name | Description
Public method | GetValue | Invokes the Get semantic on the next node in the chain of invocation.
Public method | SetValue | Invokes the Set semantic on the next node in the chain of invocation.
Back to Top
See Also
ILocationBinding Interface
PostSharp.Aspects Namespace

Online Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


ILocationBinding.GetValue Method

ILocationBinding GetValue Method PostSharp Documentation
Invokes the Get semantic on the next node in the chain of invocation.

Namespace: PostSharp.Aspects
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
Object GetValue(
    ref Object instance,
    Arguments index
)
Object GetValue(
    ref Object instance,
    Arguments index
)
Parameters
instance
Type:   Online System Object
Target instance from which the field or property should be retrieved (null if the field or property is static).
index
Type: PostSharp.Aspects Arguments
Index arguments, if the location is an indexer property.
Return Value
Type:   Online Object
The value stored at the location.
Remarks

      The
      instance
      parameter is passed by reference so that instance methods of value types (
      struct
      in C#) are allowed to change the value of the instance.

See Also
ILocationBinding Interface
ILocationBinding Members
PostSharp.Aspects Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


ILocationBinding.SetValue Method

ILocationBinding SetValue Method PostSharp Documentation
Invokes the Set semantic on the next node in the chain of invocation.

Namespace: PostSharp.Aspects
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
void SetValue(
    ref Object instance,
    Arguments index,
    Object value
)
void SetValue(
    ref Object instance,
    Arguments index,
    Object value
)
Parameters
instance
Type:   Online System Object
Target instance from which the field or property should be retrieved (null if the field or property is static).
index
Type: PostSharp.Aspects Arguments
Index arguments, if the location is an indexer property.
value
Type:   Online System Object
New value to be stored at the location.
Remarks

      The
      instance
      parameter is passed by reference so that instance methods of value types (
      struct
      in C#) are allowed to change the value of the instance.

See Also
ILocationBinding Interface
ILocationBinding Members
PostSharp.Aspects Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


ILocationInterceptionAspect Interface

ILocationInterceptionAspect Interface PostSharp Documentation
Runtime semantics of an aspect that, when applied on a location (field or property), intercepts invocations of the Get (OnGetValue(LocationInterceptionArgs)) and Set (OnSetValue(LocationInterceptionArgs)) semantics.

Namespace: PostSharp.Aspects
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
public interface ILocationInterceptionAspect : ILocationLevelAspect,
    IAspect
public interface ILocationInterceptionAspect : ILocationLevelAspect,
    IAspect
Remarks

              See LocationInterceptionAspect for details.

See Also
ILocationInterceptionAspect Members
PostSharp.Aspects Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


ILocationInterceptionAspect Members

ILocationInterceptionAspect Members PostSharp Documentation

The ILocationInterceptionAspect type exposes the following members.
Methods
 | Name | Description
Public method | OnGetValue | Method invoked instead of the Get semantic of the field or property to which the current aspect is applied, i.e. when the value of this field or property is retrieved.
Public method | OnSetValue | Method invoked instead of the Set semantic of the field or property to which the current aspect is applied, i.e. when the value of this field or property is changed.
Public method | RuntimeInitialize | Initializes the current aspect. (Inherited from ILocationLevelAspect.)
Back to Top
See Also
ILocationInterceptionAspect Interface
PostSharp.Aspects Namespace

Online Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


ILocationInterceptionAspect Methods

ILocationInterceptionAspect Methods PostSharp Documentation
The ILocationInterceptionAspect type exposes the following members.
Methods
 | Name | Description
Public method | OnGetValue | Method invoked instead of the Get semantic of the field or property to which the current aspect is applied, i.e. when the value of this field or property is retrieved.
Public method | OnSetValue | Method invoked instead of the Set semantic of the field or property to which the current aspect is applied, i.e. when the value of this field or property is changed.
Public method | RuntimeInitialize | Initializes the current aspect. (Inherited from ILocationLevelAspect.)
Back to Top
See Also
ILocationInterceptionAspect Interface
PostSharp.Aspects Namespace

Online Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


ILocationInterceptionAspect.OnGetValue Method

ILocationInterceptionAspect OnGetValue Method PostSharp Documentation
Method invoked instead of the Get semantic of the field or property to which the current aspect is applied, i.e. when the value of this field or property is retrieved.

Namespace: PostSharp.Aspects
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
void OnGetValue(
    LocationInterceptionArgs args
)
void OnGetValue(
    LocationInterceptionArgs args
)
Parameters
args
Type: PostSharp.Aspects LocationInterceptionArgs
Advice arguments.
See Also
ILocationInterceptionAspect Interface
ILocationInterceptionAspect Members
PostSharp.Aspects Namespace
PostSharp.Aspects LocationInterceptionArgs
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


ILocationInterceptionAspect.OnSetValue Method

ILocationInterceptionAspect OnSetValue Method PostSharp Documentation
Method invoked instead of the Set semantic of the field or property to which the current aspect is applied, i.e. when the value of this field or property is changed.

Namespace: PostSharp.Aspects
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
void OnSetValue(
    LocationInterceptionArgs args
)
void OnSetValue(
    LocationInterceptionArgs args
)
Parameters
args
Type: PostSharp.Aspects LocationInterceptionArgs
Advice arguments.
See Also
ILocationInterceptionAspect Interface
ILocationInterceptionAspect Members
PostSharp.Aspects Namespace
PostSharp.Aspects LocationInterceptionArgs
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


ILocationLevelAspect Interface

ILocationLevelAspect Interface PostSharp Documentation
Runtime semantics of aspects defined on a field, property, or parameter.

Namespace: PostSharp.Aspects
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
public interface ILocationLevelAspect : IAspect
public interface ILocationLevelAspect : IAspect
See Also
ILocationLevelAspect Members
PostSharp.Aspects Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


ILocationLevelAspect Members

ILocationLevelAspect Members PostSharp Documentation

The ILocationLevelAspect type exposes the following members.
Methods
 | Name | Description
Public method | RuntimeInitialize | Initializes the current aspect.
Back to Top
See Also
ILocationLevelAspect Interface
PostSharp.Aspects Namespace

Online Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


ILocationLevelAspect Methods

ILocationLevelAspect Methods PostSharp Documentation
The ILocationLevelAspect type exposes the following members.
Methods
 | Name | Description
Public method | RuntimeInitialize | Initializes the current aspect.
Back to Top
See Also
ILocationLevelAspect Interface
PostSharp.Aspects Namespace

Online Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


ILocationLevelAspect.RuntimeInitialize Method

ILocationLevelAspect RuntimeInitialize Method PostSharp Documentation
Initializes the current aspect.

Namespace: PostSharp.Aspects
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
void RuntimeInitialize(
    LocationInfo locationInfo
)
void RuntimeInitialize(
    LocationInfo locationInfo
)
Parameters
locationInfo
Type: PostSharp.Reflection LocationInfo
Location to which the current aspect is applied.
See Also
ILocationLevelAspect Interface
ILocationLevelAspect Members
PostSharp.Aspects Namespace

      Conceptual Documentation: Initializing Aspects

  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


ILocationLevelAspectBuildSemantics Interface

ILocationLevelAspectBuildSemantics Interface PostSharp Documentation
Compile-time semantics of ILocationLevelAspect.

Namespace: PostSharp.Aspects
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
public interface ILocationLevelAspectBuildSemantics : IAspectBuildSemantics,
    IValidableAnnotation
public interface ILocationLevelAspectBuildSemantics : IAspectBuildSemantics,
    IValidableAnnotation
See Also
ILocationLevelAspectBuildSemantics Members
PostSharp.Aspects Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


ILocationLevelAspectBuildSemantics Members

ILocationLevelAspectBuildSemantics Members PostSharp Documentation

The ILocationLevelAspectBuildSemantics type exposes the following members.
Methods
 | Name | Description
Public method | CompileTimeInitialize | Method invoked at build time to initialize the instance fields of the current aspect. This method is invoked before any other build-time method.
Public method | CompileTimeValidate | Method invoked at build time to ensure that the aspect has been applied to the right target. (Inherited from IValidableAnnotation.)
Public method | GetAspectConfiguration | Method invoked at build time to get the imperative configuration of the current Aspect. (Inherited from IAspectBuildSemantics.)
Back to Top
See Also
ILocationLevelAspectBuildSemantics Interface
PostSharp.Aspects Namespace

Online Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


ILocationLevelAspectBuildSemantics Methods

ILocationLevelAspectBuildSemantics Methods PostSharp Documentation
The ILocationLevelAspectBuildSemantics type exposes the following members.
Methods
 | Name | Description
Public method | CompileTimeInitialize | Method invoked at build time to initialize the instance fields of the current aspect. This method is invoked before any other build-time method.
Public method | CompileTimeValidate | Method invoked at build time to ensure that the aspect has been applied to the right target. (Inherited from IValidableAnnotation.)
Public method | GetAspectConfiguration | Method invoked at build time to get the imperative configuration of the current Aspect. (Inherited from IAspectBuildSemantics.)
Back to Top
See Also
ILocationLevelAspectBuildSemantics Interface
PostSharp.Aspects Namespace

Online Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


ILocationLevelAspectBuildSemantics.CompileTimeInitialize Method

ILocationLevelAspectBuildSemantics CompileTimeInitialize Method PostSharp Documentation
Method invoked at build time to initialize the instance fields of the current aspect. This method is invoked before any other build-time method.

Namespace: PostSharp.Aspects
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
void CompileTimeInitialize(
    LocationInfo targetLocation,
    AspectInfo aspectInfo
)
void CompileTimeInitialize(
    LocationInfo targetLocation,
    AspectInfo aspectInfo
)
Parameters
targetLocation
Type: PostSharp.Reflection LocationInfo
Location to which the current aspect is applied
aspectInfo
Type: PostSharp.Aspects AspectInfo
Reserved for future usage.
See Also
ILocationLevelAspectBuildSemantics Interface
ILocationLevelAspectBuildSemantics Members
PostSharp.Aspects Namespace

      Conceptual Documentation: Initializing Aspects

  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


ILocationValidationAspect Interface

ILocationValidationAspect Interface PostSharp Documentation
Ancestor of ILocationValidationAspect T .

Namespace: PostSharp.Aspects
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
public interface ILocationValidationAspect : IAspect
public interface ILocationValidationAspect : IAspect
Remarks
This interface exists only because PostSharp SDK requires a common non-generic interface for ILocationValidationAspect T .
            It should not be used in user code.
See Also
PostSharp.Aspects Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


ILocationValidationAspect(T) Interface

ILocationValidationAspect T Interface PostSharp Documentation
Runtime semantics of an aspect that, when applied on a location (field, property, or parameter), validates the value assigned to this location using method ValidateValue(T, String, LocationKind), and throws the exception returned by this method if any.

Namespace: PostSharp.Aspects
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
public interface ILocationValidationAspect<T> : ILocationValidationAspect,
    IAspect
public interface ILocationValidationAspect<T> : ILocationValidationAspect,
    IAspect
Type Parameters
T
Type of values validated by the current aspect.
Remarks
An aspect will typically implement several generic instances of the current interface,
               with different values of T. The aspect can be applied only to locations
               for which there is an exact type match. PostSharp does not implement any type conversion, even
               when this conversion is implicitely supported by the compiler, for instance int to long.
               Therefore, if your aspect must be able to validate all integers, you may need to implement
               the interface instances for T ranging in long, int, short,
                sbyte and possibly their unsigned variant. However, values of a derived type can be
                validated if T is the base type.

See Also
ILocationValidationAspect T  Members
PostSharp.Aspects Namespace
PostSharp.Aspects.Advices LocationValidationAdvice
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


ILocationValidationAspect(T) Members

ILocationValidationAspect T Members PostSharp Documentation

The ILocationValidationAspect T type exposes the following members.
Methods
 | Name | Description
Public method | ValidateValue | Validates the value being assigned to the location to which the current aspect has been applied.
Back to Top
See Also
ILocationValidationAspect T Interface
PostSharp.Aspects Namespace

Online Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


ILocationValidationAspect(T) Methods

ILocationValidationAspect T Methods PostSharp Documentation
The ILocationValidationAspect T type exposes the following members.
Methods
 | Name | Description
Public method | ValidateValue | Validates the value being assigned to the location to which the current aspect has been applied.
Back to Top
See Also
ILocationValidationAspect T Interface
PostSharp.Aspects Namespace

Online Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


ILocationValidationAspect(T).ValidateValue Method

ILocationValidationAspect T ValidateValue Method PostSharp Documentation
Validates the value being assigned to the location to which the current aspect has been applied.

Namespace: PostSharp.Aspects
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
Exception ValidateValue(
    T value,
    string locationName,
    LocationKind locationKind
)
Exception ValidateValue(
    T value,
    string locationName,
    LocationKind locationKind
)
Parameters
value
Type: T
Value being applied to the location.
locationName
Type:   Online System String
Name of the location.
locationKind
Type: PostSharp.Reflection LocationKind
Location kind (Field, Property, or
            Parameter).

Return Value
Type:   Online Exception
The   Online Exception to be thrown, or null if no exception needs to be thrown.
See Also
ILocationValidationAspect T  Interface
ILocationValidationAspect T  Members
PostSharp.Aspects Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


IManagedResourceIntroductionAspect Interface

IManagedResourceIntroductionAspect Interface PostSharp Documentation
Semantics of an aspect that, when applied to an assembly, adds a managed resource to this assembly.

Namespace: PostSharp.Aspects
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
public interface IManagedResourceIntroductionAspect : IAspect
public interface IManagedResourceIntroductionAspect : IAspect
Remarks

              See ManagedResourceIntroductionAspect for details.

See Also
PostSharp.Aspects Namespace
PostSharp.Aspects ManagedResourceIntroductionAspect
PostSharp.Aspects.Configuration ManagedResourceIntroductionAspectConfiguration
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


IMethodBinding Interface

IMethodBinding Interface PostSharp Documentation
Interface through which a method-level aspect or advice can invoke the next node in the chain of invocation.

Namespace: PostSharp.Aspects
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
public interface IMethodBinding
public interface IMethodBinding
See Also
IMethodBinding Members
PostSharp.Aspects Namespace
PostSharp.Aspects.Advices ImportMemberAttribute

      Conceptual Documentation: Aspect Bindings

  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


IMethodBinding Members

IMethodBinding Members PostSharp Documentation

The IMethodBinding type exposes the following members.
Methods
 | Name | Description
Public method | Invoke | Invokes the next node in the chain of invocation.
Back to Top
See Also
IMethodBinding Interface
PostSharp.Aspects Namespace

Online Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


IMethodBinding Methods

IMethodBinding Methods PostSharp Documentation
The IMethodBinding type exposes the following members.
Methods
 | Name | Description
Public method | Invoke | Invokes the next node in the chain of invocation.
Back to Top
See Also
IMethodBinding Interface
PostSharp.Aspects Namespace

Online Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


IMethodBinding.Invoke Method

IMethodBinding Invoke Method PostSharp Documentation
Invokes the next node in the chain of invocation.

Namespace: PostSharp.Aspects
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
Object Invoke(
    ref Object instance,
    Arguments arguments
)
Object Invoke(
    ref Object instance,
    Arguments arguments
)
Parameters
instance
Type:   Online System Object
Target instance on which the method should be invoked (null if the method is static).
arguments
Type: PostSharp.Aspects Arguments
Method arguments.
Return Value
Type:   Online Object
Return value of the method.
Remarks

      The
      instance
      parameter is passed by reference so that instance methods of value types (
      struct
      in C#) are allowed to change the value of the instance.

See Also
IMethodBinding Interface
IMethodBinding Members
PostSharp.Aspects Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


IMethodInterceptionAspect Interface

IMethodInterceptionAspect Interface PostSharp Documentation
Runtime semantics of an aspect that, when applied on a method, intercepts invocations of this method.

Namespace: PostSharp.Aspects
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
public interface IMethodInterceptionAspect : IMethodLevelAspect,
    IAspect
public interface IMethodInterceptionAspect : IMethodLevelAspect,
    IAspect
Remarks

              See MethodInterceptionAspect for details.

See Also
IMethodInterceptionAspect Members
PostSharp.Aspects Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


IMethodInterceptionAspect Members

IMethodInterceptionAspect Members PostSharp Documentation

The IMethodInterceptionAspect type exposes the following members.
Methods
 | Name | Description
Public method | OnInvoke | Method invoked instead of the method to which the aspect has been applied.
Public method | RuntimeInitialize | Initializes the current aspect. (Inherited from IMethodLevelAspect.)
Back to Top
See Also
IMethodInterceptionAspect Interface
PostSharp.Aspects Namespace

Online Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


IMethodInterceptionAspect Methods

IMethodInterceptionAspect Methods PostSharp Documentation
The IMethodInterceptionAspect type exposes the following members.
Methods
 | Name | Description
Public method | OnInvoke | Method invoked instead of the method to which the aspect has been applied.
Public method | RuntimeInitialize | Initializes the current aspect. (Inherited from IMethodLevelAspect.)
Back to Top
See Also
IMethodInterceptionAspect Interface
PostSharp.Aspects Namespace

Online Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


IMethodInterceptionAspect.OnInvoke Method

IMethodInterceptionAspect OnInvoke Method PostSharp Documentation
Method invoked instead of the method to which the aspect has been applied.

Namespace: PostSharp.Aspects
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
void OnInvoke(
    MethodInterceptionArgs args
)
void OnInvoke(
    MethodInterceptionArgs args
)
Parameters
args
Type: PostSharp.Aspects MethodInterceptionArgs
Advice arguments.
Remarks
The implementation of OnInvoke(MethodInterceptionArgs) may invoke Proceed , may schedule it for invocation from another thread, or
                may completely skip its invocation. Alternatively, it may use Binding. Before returning to the caller, the OnInvoke(MethodInterceptionArgs) method must set the return value (property ReturnValue)
                and all output arguments (property Arguments), otherwise the target method may fail with a   Online NullReferenceException. These
                are normally set by calling Proceed .
See Also
IMethodInterceptionAspect Interface
IMethodInterceptionAspect Members
PostSharp.Aspects Namespace
PostSharp.Aspects MethodInterceptionArgs
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


IMethodLevelAspect Interface

IMethodLevelAspect Interface PostSharp Documentation
Runtime semantics of aspects applied to methods.

Namespace: PostSharp.Aspects
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
public interface IMethodLevelAspect : IAspect
public interface IMethodLevelAspect : IAspect
See Also
IMethodLevelAspect Members
PostSharp.Aspects Namespace
PostSharp.Aspects IMethodLevelAspectBuildSemantics
PostSharp.Aspects MethodLevelAspect
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


IMethodLevelAspect Members

IMethodLevelAspect Members PostSharp Documentation

The IMethodLevelAspect type exposes the following members.
Methods
 | Name | Description
Public method | RuntimeInitialize | Initializes the current aspect.
Back to Top
See Also
IMethodLevelAspect Interface
PostSharp.Aspects Namespace

Online Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


IMethodLevelAspect Methods

IMethodLevelAspect Methods PostSharp Documentation
The IMethodLevelAspect type exposes the following members.
Methods
 | Name | Description
Public method | RuntimeInitialize | Initializes the current aspect.
Back to Top
See Also
IMethodLevelAspect Interface
PostSharp.Aspects Namespace

Online Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


IMethodLevelAspect.RuntimeInitialize Method

IMethodLevelAspect RuntimeInitialize Method PostSharp Documentation
Initializes the current aspect.

Namespace: PostSharp.Aspects
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
void RuntimeInitialize(
    MethodBase method
)
void RuntimeInitialize(
    MethodBase method
)
Parameters
method
Type:   Online System.Reflection MethodBase
Method to which the current aspect is applied.
See Also
IMethodLevelAspect Interface
IMethodLevelAspect Members
PostSharp.Aspects Namespace

      Conceptual Documentation: Initializing Aspects

  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


IMethodLevelAspectBuildSemantics Interface

IMethodLevelAspectBuildSemantics Interface PostSharp Documentation
Compile-time semantics of IMethodLevelAspect.

Namespace: PostSharp.Aspects
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
public interface IMethodLevelAspectBuildSemantics : IAspectBuildSemantics,
    IValidableAnnotation
public interface IMethodLevelAspectBuildSemantics : IAspectBuildSemantics,
    IValidableAnnotation
See Also
IMethodLevelAspectBuildSemantics Members
PostSharp.Aspects Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


IMethodLevelAspectBuildSemantics Members

IMethodLevelAspectBuildSemantics Members PostSharp Documentation

The IMethodLevelAspectBuildSemantics type exposes the following members.
Methods
 | Name | Description
Public method | CompileTimeInitialize | Method invoked at build time to initialize the instance fields of the current aspect. This method is invoked before any other build-time method.
Public method | CompileTimeValidate | Method invoked at build time to ensure that the aspect has been applied to the right target. (Inherited from IValidableAnnotation.)
Public method | GetAspectConfiguration | Method invoked at build time to get the imperative configuration of the current Aspect. (Inherited from IAspectBuildSemantics.)
Back to Top
See Also
IMethodLevelAspectBuildSemantics Interface
PostSharp.Aspects Namespace

Online Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


IMethodLevelAspectBuildSemantics Methods

IMethodLevelAspectBuildSemantics Methods PostSharp Documentation
The IMethodLevelAspectBuildSemantics type exposes the following members.
Methods
 | Name | Description
Public method | CompileTimeInitialize | Method invoked at build time to initialize the instance fields of the current aspect. This method is invoked before any other build-time method.
Public method | CompileTimeValidate | Method invoked at build time to ensure that the aspect has been applied to the right target. (Inherited from IValidableAnnotation.)
Public method | GetAspectConfiguration | Method invoked at build time to get the imperative configuration of the current Aspect. (Inherited from IAspectBuildSemantics.)
Back to Top
See Also
IMethodLevelAspectBuildSemantics Interface
PostSharp.Aspects Namespace

Online Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


IMethodLevelAspectBuildSemantics.CompileTimeInitialize Method

IMethodLevelAspectBuildSemantics CompileTimeInitialize Method PostSharp Documentation
Method invoked at build time to initialize the instance fields of the current aspect. This method is invoked before any other build-time method.

Namespace: PostSharp.Aspects
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
void CompileTimeInitialize(
    MethodBase method,
    AspectInfo aspectInfo
)
void CompileTimeInitialize(
    MethodBase method,
    AspectInfo aspectInfo
)
Parameters
method
Type:   Online System.Reflection MethodBase
Method to which the current aspect is applied
aspectInfo
Type: PostSharp.Aspects AspectInfo
Reserved for future usage.
See Also
IMethodLevelAspectBuildSemantics Interface
IMethodLevelAspectBuildSemantics Members
PostSharp.Aspects Namespace

      Conceptual Documentation: Initializing Aspects

  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


InstanceCredentials Structure

InstanceCredentials Structure PostSharp Documentation
Credentials that give access to 'protected' semantics.

Namespace: PostSharp.Aspects
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
[SerializableAttribute]
public struct InstanceCredentials : IEquatable<InstanceCredentials>
[SerializableAttribute]
public struct InstanceCredentials : IEquatable<InstanceCredentials>
Remarks

            A protected semantic is specified by an interface with public visibility, but
            code can only get this interface when it provides the semantics represented
            by the current type. Instance semantics are typically retrieved by an instance
            method GetInstanceCredentials, which has protected visibility.
            This method is implemented by PostSharp automatically.

  Note  Note

            Instance credentials are considered obsolete. It is suggested to use
            techniques that do not require instance credentials.

See Also
InstanceCredentials Members
PostSharp.Aspects Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


InstanceCredentials Members

InstanceCredentials Members PostSharp Documentation

The InstanceCredentials type exposes the following members.
Methods
 | Name | Description
Public method | AssertEquals | Throws an exception if given credentials are not equal to the current one.
Public method | Equals(Object) | Indicates whether this instance and a specified object are equal. (Overrides Online ValueType Equals(Object).)
Public method | Equals(InstanceCredentials) | Indicates whether the current object is equal to another object of the same type.
Public method | GetHashCode | Returns the hash code for this instance. (Overrides Online ValueType GetHashCode .)
 | MakeNew | Creates a new InstanceCredentials.
Public method | ToString | Returns the fully qualified type name of this instance. (Overrides Online ValueType ToString .)
Back to Top
Operators
Name | Description
Equality | Determines whether two InstanceCredentials are equal.
Inequality | Determines whether two InstanceCredentials are different.
Back to Top
Fields
Name | Description
Null | Gets a null (or empty) InstanceCredentials/
Back to Top
See Also
InstanceCredentials Structure
PostSharp.Aspects Namespace

Online Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


InstanceCredentials Fields

InstanceCredentials Fields PostSharp Documentation
The InstanceCredentials type exposes the following members.
Fields
Name | Description
Null | Gets a null (or empty) InstanceCredentials/
Back to Top
See Also
InstanceCredentials Structure
PostSharp.Aspects Namespace

Online Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


InstanceCredentials.Null Field

InstanceCredentials Null Field PostSharp Documentation
Gets a null (or empty) InstanceCredentials/

Namespace: PostSharp.Aspects
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
public static readonly InstanceCredentials Null
public static readonly InstanceCredentials Null
Field Value
Type: InstanceCredentials
See Also
InstanceCredentials Structure
InstanceCredentials Members
PostSharp.Aspects Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


InstanceCredentials Methods

InstanceCredentials Methods PostSharp Documentation
The InstanceCredentials type exposes the following members.
Methods
 | Name | Description
Public method | AssertEquals | Throws an exception if given credentials are not equal to the current one.
Public method | Equals(Object) | Indicates whether this instance and a specified object are equal. (Overrides Online ValueType Equals(Object).)
Public method | Equals(InstanceCredentials) | Indicates whether the current object is equal to another object of the same type.
Public method | GetHashCode | Returns the hash code for this instance. (Overrides Online ValueType GetHashCode .)
 | MakeNew | Creates a new InstanceCredentials.
Public method | ToString | Returns the fully qualified type name of this instance. (Overrides Online ValueType ToString .)
Back to Top
See Also
InstanceCredentials Structure
PostSharp.Aspects Namespace

Online Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


InstanceCredentials.AssertEquals Method

InstanceCredentials AssertEquals Method PostSharp Documentation
Throws an exception if given credentials are not equal to the current one.

Namespace: PostSharp.Aspects
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
public void AssertEquals(
    InstanceCredentials others
)
public void AssertEquals(
    InstanceCredentials others
)
Parameters
others
Type: PostSharp.Aspects InstanceCredentials
Other credentials.
See Also
InstanceCredentials Structure
InstanceCredentials Members
PostSharp.Aspects Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


InstanceCredentials.Equals Method

InstanceCredentials Equals Method PostSharp Documentation
Overload List
 | Name | Description
Public method | Equals(Object) | Indicates whether this instance and a specified object are equal. (Overrides Online ValueType Equals(Object).)
Public method | Equals(InstanceCredentials) | Indicates whether the current object is equal to another object of the same type.
Back to Top
See Also
InstanceCredentials Structure
InstanceCredentials Members
PostSharp.Aspects Namespace

Online Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


InstanceCredentials.Equals Method (Object)

InstanceCredentials Equals Method (Object) PostSharp Documentation
Indicates whether this instance and a specified object are equal.

Namespace: PostSharp.Aspects
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
public override bool Equals(
    Object obj
)
public override bool Equals(
    Object obj
)
Parameters
obj
Type:   Online System Object
Another object to compare to.
Return Value
Type:   Online Boolean
true if obj and this instance are the same type and represent the same value; otherwise, false.
See Also
InstanceCredentials Structure
InstanceCredentials Members
Equals Overload
PostSharp.Aspects Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


InstanceCredentials.Equals Method (InstanceCredentials)

InstanceCredentials Equals Method (InstanceCredentials) PostSharp Documentation
Indicates whether the current object is equal to another object of the same type.

Namespace: PostSharp.Aspects
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
public bool Equals(
    InstanceCredentials other
)
public bool Equals(
    InstanceCredentials other
)
Parameters
other
Type: PostSharp.Aspects InstanceCredentials
An object to compare with this object.
Return Value
Type:   Online Boolean
true if the current object is equal to the other parameter; otherwise, false.
Implements
  Online IEquatable T  Equals(T)
See Also
InstanceCredentials Structure
InstanceCredentials Members
Equals Overload
PostSharp.Aspects Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


InstanceCredentials.GetHashCode Method

InstanceCredentials GetHashCode Method PostSharp Documentation
Returns the hash code for this instance.

Namespace: PostSharp.Aspects
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
public override int GetHashCode()
public override int GetHashCode()
Return Value
Type:   Online Int32
A 32-bit signed integer that is the hash code for this instance.
See Also
InstanceCredentials Structure
InstanceCredentials Members
PostSharp.Aspects Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


InstanceCredentials.MakeNew Method

InstanceCredentials MakeNew Method PostSharp Documentation
Creates a new InstanceCredentials.

Namespace: PostSharp.Aspects
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
public static InstanceCredentials MakeNew()
public static InstanceCredentials MakeNew()
Return Value
Type: InstanceCredentials
A new InstanceCredentials.
See Also
InstanceCredentials Structure
InstanceCredentials Members
PostSharp.Aspects Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


InstanceCredentials.ToString Method

InstanceCredentials ToString Method PostSharp Documentation
Returns the fully qualified type name of this instance.

Namespace: PostSharp.Aspects
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
public override string ToString()
public override string ToString()
Return Value
Type:   Online String
A   Online String containing a fully qualified type name.
See Also
InstanceCredentials Structure
InstanceCredentials Members
PostSharp.Aspects Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


InstanceCredentials Operators

InstanceCredentials Operators PostSharp Documentation
The InstanceCredentials type exposes the following members.
Operators
Name | Description
Equality | Determines whether two InstanceCredentials are equal.
Inequality | Determines whether two InstanceCredentials are different.
Back to Top
See Also
InstanceCredentials Structure
PostSharp.Aspects Namespace

Online Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


InstanceCredentials.Equality Operator

InstanceCredentials Equality Operator PostSharp Documentation
Determines whether two InstanceCredentials are equal.

Namespace: PostSharp.Aspects
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
public static bool operator ==(
    InstanceCredentials left,
    InstanceCredentials right
)
public static bool operator ==(
    InstanceCredentials left,
    InstanceCredentials right
)
Parameters
left
Type: PostSharp.Aspects InstanceCredentials
An InstanceCredentials object.
right
Type: PostSharp.Aspects InstanceCredentials
An InstanceCredentials object.
Return Value
Type:   Online Boolean
true if left equals right,
              otherwise false.
See Also
InstanceCredentials Structure
InstanceCredentials Members
PostSharp.Aspects Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


InstanceCredentials.Inequality Operator

InstanceCredentials Inequality Operator PostSharp Documentation
Determines whether two InstanceCredentials are different.

Namespace: PostSharp.Aspects
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
public static bool operator !=(
    InstanceCredentials left,
    InstanceCredentials right
)
public static bool operator !=(
    InstanceCredentials left,
    InstanceCredentials right
)
Parameters
left
Type: PostSharp.Aspects InstanceCredentials
An InstanceCredentials object.
right
Type: PostSharp.Aspects InstanceCredentials
An InstanceCredentials object.
Return Value
Type:   Online Boolean
true if left is different than right,
              otherwise false.
See Also
InstanceCredentials Structure
InstanceCredentials Members
PostSharp.Aspects Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


InstanceLevelAspect Class

InstanceLevelAspect Class PostSharp Documentation
Base class for aspects applied on types, but having the same lifetime as instances of the type to which they are applied.
Inheritance Hierarchy
Online System Object
Online System Attribute
PostSharp.Extensibility MulticastAttribute
PostSharp.Aspects Aspect
PostSharp.Aspects TypeLevelAspect
PostSharp.Aspects InstanceLevelAspect
PostSharp.Patterns.Model NotifyPropertyChangedAttribute
PostSharp.Patterns.Threading ReaderWriterSynchronizedAttribute

Namespace: PostSharp.Aspects
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
[SerializableAttribute]
public abstract class InstanceLevelAspect : TypeLevelAspect,
    ICloneAwareAspect, IInstanceScopedAspect, IAspect
[SerializableAttribute]
public abstract class InstanceLevelAspect : TypeLevelAspect,
    ICloneAwareAspect, IInstanceScopedAspect, IAspect
Remarks
This class is provided for convenience. You get the same functionality by deriving your
            aspect class directly from TypeLevelAspect and implementing the interface
            IInstanceScopedAspect

See IInstanceScopedAspect for a discussion of instance-scoped aspects.

  Note  Note

        All classes implementing
        IAspect
        should typically be marked as serializable
        using the custom attribute
          Online SerializableAttribute
        . Fields that
        are only used at runtime (and unknown at compile-time) should be carefully
        marked with the custom attribute
          Online NonSerializedAttribute
        .
        When PostSharp is used on a platform that does not support aspect serialization
        (such as .NET Compact Framework, Silverlight, or Windows Phone), or when
        another aspect serializer is used, it is not necessary to mark the aspect
        class as serializable.
        For more information, see
        Aspect Serialization
        .

See Also
InstanceLevelAspect Members
PostSharp.Aspects Namespace

      Conceptual Documentation: Aspect Serialization

PostSharp.Aspects IInstanceScopedAspect

      Conceptual Documentation: Understanding Aspect Lifetime and Scope

  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


InstanceLevelAspect Members

InstanceLevelAspect Members PostSharp Documentation

The InstanceLevelAspect type exposes the following members.
Constructors
 | Name | Description
Protected method | InstanceLevelAspect | Initializes a new instance of the InstanceLevelAspect class
Back to Top
Methods
 | Name | Description
Public method | CompileTimeInitialize | Method invoked at build time to initialize the instance fields of the current aspect. This method is invoked before any other build-time method. (Inherited from TypeLevelAspect.)
Public method | CompileTimeValidate | Method invoked at build time to ensure that the aspect has been applied to the right target. (Inherited from Aspect.)
Protected method | CreateAspectConfiguration | Method invoked at build time to create a concrete AspectConfiguration instance specifically for the current Aspect type. (Overrides Aspect CreateAspectConfiguration .)
Public method | CreateInstance | Creates a new instance of the aspect based on the current instance, serving as a prototype.
Public method | GetAspectConfiguration | Method invoked at build tome to get the imperative configuration of the current Aspect. (Inherited from Aspect.)
Public method | OnCloned | Method called after the an object enhanced by the current aspect has been cloned using Online MemberwiseClone . The this parameter refers to the new aspect instance in the cloned object.
Public method | RuntimeInitialize | Initializes the current aspect. (Inherited from TypeLevelAspect.)
Public method | RuntimeInitializeInstance | Initializes the aspect instance. This method is invoked when all system elements of the aspect (like member imports) have completed.
Protected method | SetAspectConfiguration | Method invoked at build time to set up an AspectConfiguration object according to the current Aspect instance and a specified target element of the current aspect. (Inherited from Aspect.)
Back to Top
Properties
 | Name | Description
Public property | AspectPriority | Gets or sets the weaving priority of the aspect. (Inherited from Aspect.)
Public property | AttributeExclude | If true, indicates that this attribute removes all other instances of the same attribute type from the set of elements defined by the current instance. (Inherited from MulticastAttribute.)
Public property | AttributeId | Obsolete. (Inherited from MulticastAttribute.)
Public property | AttributeInheritance | Determines whether this attribute is inherited (Inherited from MulticastAttribute.)
Public property | AttributePriority | Gets or sets the priority of the current attribute in case that multiple instances are defined on the same element (lower values are processed before). (Inherited from MulticastAttribute.)
Public property | AttributeReplace | Determines whether this attribute replaces other attributes found on the target declarations. (Inherited from MulticastAttribute.)
Public property | AttributeTargetAssemblies | Gets or sets the assemblies to which the current attribute apply. (Inherited from MulticastAttribute.)
Public property | AttributeTargetElements | Gets or sets the kind of elements to which this custom attributes applies. (Inherited from MulticastAttribute.)
Public property | AttributeTargetExternalMemberAttributes | Gets or sets the visibilities, scopes, virtualities, and implementation of members to which this attribute applies, when the member is external to the current module. (Inherited from MulticastAttribute.)
Public property | AttributeTargetExternalTypeAttributes | Gets or sets the visibilities of types to which this attribute applies, when this type is external to the current module. (Inherited from MulticastAttribute.)
Public property | AttributeTargetMemberAttributes | Gets or sets the visibilities, scopes, virtualities, and implementation of members to which this attribute applies. (Inherited from MulticastAttribute.)
Public property | AttributeTargetMembers | Gets or sets the expression specifying to which members this instance applies. (Inherited from MulticastAttribute.)
Public property | AttributeTargetParameterAttributes | Gets or sets the passing style (by value, out or ref) of parameters to which this attribute applies. (Inherited from MulticastAttribute.)
Public property | AttributeTargetParameters | Gets or sets the expression specifying to which parameters this instance applies. (Inherited from MulticastAttribute.)
Public property | AttributeTargetTypeAttributes | Gets or sets the visibilities of types to which this attribute applies. (Inherited from MulticastAttribute.)
Public property | AttributeTargetTypes | Gets or sets the expression specifying to which types this instance applies. (Inherited from MulticastAttribute.)
Public property | Instance | Gets the object to which the current aspect has been applied.
Protected property | SerializerType | Gets or sets the Online Type of the serializer (a type derived from AspectSerializer) used to serialize the aspect instance at build time and deserialize it at runtime. (Inherited from Aspect.)
Back to Top
See Also
InstanceLevelAspect Class
PostSharp.Aspects Namespace

Online Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


InstanceLevelAspect Constructor

InstanceLevelAspect Constructor PostSharp Documentation
Initializes a new instance of the InstanceLevelAspect class

Namespace: PostSharp.Aspects
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
protected InstanceLevelAspect()
protected InstanceLevelAspect()
See Also
InstanceLevelAspect Class
InstanceLevelAspect Members
PostSharp.Aspects Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


InstanceLevelAspect Methods

InstanceLevelAspect Methods PostSharp Documentation
The InstanceLevelAspect type exposes the following members.
Methods
 | Name | Description
Public method | CompileTimeInitialize | Method invoked at build time to initialize the instance fields of the current aspect. This method is invoked before any other build-time method. (Inherited from TypeLevelAspect.)
Public method | CompileTimeValidate | Method invoked at build time to ensure that the aspect has been applied to the right target. (Inherited from Aspect.)
Protected method | CreateAspectConfiguration | Method invoked at build time to create a concrete AspectConfiguration instance specifically for the current Aspect type. (Overrides Aspect CreateAspectConfiguration .)
Public method | CreateInstance | Creates a new instance of the aspect based on the current instance, serving as a prototype.
Public method | GetAspectConfiguration | Method invoked at build tome to get the imperative configuration of the current Aspect. (Inherited from Aspect.)
Public method | OnCloned | Method called after the an object enhanced by the current aspect has been cloned using Online MemberwiseClone . The this parameter refers to the new aspect instance in the cloned object.
Public method | RuntimeInitialize | Initializes the current aspect. (Inherited from TypeLevelAspect.)
Public method | RuntimeInitializeInstance | Initializes the aspect instance. This method is invoked when all system elements of the aspect (like member imports) have completed.
Protected method | SetAspectConfiguration | Method invoked at build time to set up an AspectConfiguration object according to the current Aspect instance and a specified target element of the current aspect. (Inherited from Aspect.)
Back to Top
See Also
InstanceLevelAspect Class
PostSharp.Aspects Namespace

Online Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


InstanceLevelAspect.CreateAspectConfiguration Method

InstanceLevelAspect CreateAspectConfiguration Method PostSharp Documentation
Method invoked at build time to create a concrete AspectConfiguration instance specifically for the current Aspect type.

Namespace: PostSharp.Aspects
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
protected override AspectConfiguration CreateAspectConfiguration()
protected override AspectConfiguration CreateAspectConfiguration()
Return Value
Type: AspectConfiguration
A new and empty instance of AspectConfiguration, whose concrete type corresponds to
              the concrete type of the Aspect.
Remarks

              This method should not set up the returned AspectConfiguration. After the current method has
              returned, the SetAspectConfiguration(AspectConfiguration, Object) method will be invoked, and this method is responsible
              for setting up the AspectConfigurationobject.

See Also
InstanceLevelAspect Class
InstanceLevelAspect Members
PostSharp.Aspects Namespace

      Conceptual Documentation: Configuring Aspects

  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


InstanceLevelAspect.CreateInstance Method

InstanceLevelAspect CreateInstance Method PostSharp Documentation
Creates a new instance of the aspect based on the current instance, serving as a prototype.

Namespace: PostSharp.Aspects
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
public virtual Object CreateInstance(
    AdviceArgs adviceArgs
)
public virtual Object CreateInstance(
    AdviceArgs adviceArgs
)
Parameters
adviceArgs
Type: PostSharp.Aspects AdviceArgs
Aspect arguments.
Return Value
Type:   Online 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   Online MemberwiseClone .

See Also
InstanceLevelAspect Class
InstanceLevelAspect Members
PostSharp.Aspects Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


InstanceLevelAspect.OnCloned Method

InstanceLevelAspect OnCloned Method PostSharp Documentation
Method called after the an object enhanced by the current aspect has been cloned using Online MemberwiseClone . The this parameter refers to the new aspect instance in the cloned object.

Namespace: PostSharp.Aspects
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
public virtual void OnCloned(
    ICloneAwareAspect source
)
public virtual void OnCloned(
    ICloneAwareAspect source
)
Parameters
source
Type: PostSharp.Aspects ICloneAwareAspect
Aspect instance corresponding to the current
            aspect instance in the cloned target object.
Implements
ICloneAwareAspect OnCloned(ICloneAwareAspect)
Remarks
Prior to calling the current method, the aspect framework
            initializes the source object using CreateInstance(AdviceArgs)
            and RuntimeInitializeInstance . That is, the aspect instance
            in the cloned object is not cloned from the source aspect instance, but from the prototype
            aspect instance.

See Also
InstanceLevelAspect Class
InstanceLevelAspect Members
PostSharp.Aspects Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


InstanceLevelAspect.RuntimeInitializeInstance Method

InstanceLevelAspect RuntimeInitializeInstance Method PostSharp Documentation
Initializes the aspect instance. This method is invoked when all system elements of the aspect (like member imports) have completed.

Namespace: PostSharp.Aspects
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
public virtual void RuntimeInitializeInstance()
public virtual void RuntimeInitializeInstance()
Implements
IInstanceScopedAspect RuntimeInitializeInstance
See Also
InstanceLevelAspect Class
InstanceLevelAspect Members
PostSharp.Aspects Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


InstanceLevelAspect Properties

InstanceLevelAspect Properties PostSharp Documentation
The InstanceLevelAspect type exposes the following members.
Properties
 | Name | Description
Public property | AspectPriority | Gets or sets the weaving priority of the aspect. (Inherited from Aspect.)
Public property | AttributeExclude | If true, indicates that this attribute removes all other instances of the same attribute type from the set of elements defined by the current instance. (Inherited from MulticastAttribute.)
Public property | AttributeId | Obsolete. (Inherited from MulticastAttribute.)
Public property | AttributeInheritance | Determines whether this attribute is inherited (Inherited from MulticastAttribute.)
Public property | AttributePriority | Gets or sets the priority of the current attribute in case that multiple instances are defined on the same element (lower values are processed before). (Inherited from MulticastAttribute.)
Public property | AttributeReplace | Determines whether this attribute replaces other attributes found on the target declarations. (Inherited from MulticastAttribute.)
Public property | AttributeTargetAssemblies | Gets or sets the assemblies to which the current attribute apply. (Inherited from MulticastAttribute.)
Public property | AttributeTargetElements | Gets or sets the kind of elements to which this custom attributes applies. (Inherited from MulticastAttribute.)
Public property | AttributeTargetExternalMemberAttributes | Gets or sets the visibilities, scopes, virtualities, and implementation of members to which this attribute applies, when the member is external to the current module. (Inherited from MulticastAttribute.)
Public property | AttributeTargetExternalTypeAttributes | Gets or sets the visibilities of types to which this attribute applies, when this type is external to the current module. (Inherited from MulticastAttribute.)
Public property | AttributeTargetMemberAttributes | Gets or sets the visibilities, scopes, virtualities, and implementation of members to which this attribute applies. (Inherited from MulticastAttribute.)
Public property | AttributeTargetMembers | Gets or sets the expression specifying to which members this instance applies. (Inherited from MulticastAttribute.)
Public property | AttributeTargetParameterAttributes | Gets or sets the passing style (by value, out or ref) of parameters to which this attribute applies. (Inherited from MulticastAttribute.)
Public property | AttributeTargetParameters | Gets or sets the expression specifying to which parameters this instance applies. (Inherited from MulticastAttribute.)
Public property | AttributeTargetTypeAttributes | Gets or sets the visibilities of types to which this attribute applies. (Inherited from MulticastAttribute.)
Public property | AttributeTargetTypes | Gets or sets the expression specifying to which types this instance applies. (Inherited from MulticastAttribute.)
Public property | Instance | Gets the object to which the current aspect has been applied.
Protected property | SerializerType | Gets or sets the Online Type of the serializer (a type derived from AspectSerializer) used to serialize the aspect instance at build time and deserialize it at runtime. (Inherited from Aspect.)
Back to Top
See Also
InstanceLevelAspect Class
PostSharp.Aspects Namespace

Online Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


InstanceLevelAspect.Instance Property

InstanceLevelAspect Instance Property PostSharp Documentation
Gets the object to which the current aspect has been applied.

Namespace: PostSharp.Aspects
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
public Object Instance { get; }
public Object Instance { get; }
Property Value
Type:   Online Object
See Also
InstanceLevelAspect Class
InstanceLevelAspect Members
PostSharp.Aspects Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


IOnExceptionAspect Interface

IOnExceptionAspect Interface PostSharp Documentation
Runtime semantics of an aspect that, when applied on a method, defines an exception handler around the whole method body and let the implementation of this interface handle the exception.

Namespace: PostSharp.Aspects
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
public interface IOnExceptionAspect : IMethodLevelAspect,
    IAspect
public interface IOnExceptionAspect : IMethodLevelAspect,
    IAspect
Remarks
See OnExceptionAspect for details.
See Also
IOnExceptionAspect Members
PostSharp.Aspects Namespace
PostSharp.Aspects OnExceptionAspect
PostSharp.Aspects.Configuration OnExceptionAspectConfiguration
PostSharp.Aspects.Configuration OnExceptionAspectConfigurationAttribute
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


IOnExceptionAspect Members

IOnExceptionAspect Members PostSharp Documentation

The IOnExceptionAspect type exposes the following members.
Methods
 | Name | Description
Public method | OnException | Method executed after the body of methods to which this aspect is applied, in case that the method resulted with an exception (i.e., in a catch block).
Public method | RuntimeInitialize | Initializes the current aspect. (Inherited from IMethodLevelAspect.)
Back to Top
See Also
IOnExceptionAspect Interface
PostSharp.Aspects Namespace

Online Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


IOnExceptionAspect Methods

IOnExceptionAspect Methods PostSharp Documentation
The IOnExceptionAspect type exposes the following members.
Methods
 | Name | Description
Public method | OnException | Method executed after the body of methods to which this aspect is applied, in case that the method resulted with an exception (i.e., in a catch block).
Public method | RuntimeInitialize | Initializes the current aspect. (Inherited from IMethodLevelAspect.)
Back to Top
See Also
IOnExceptionAspect Interface
PostSharp.Aspects Namespace

Online Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


IOnExceptionAspect.OnException Method

IOnExceptionAspect OnException Method PostSharp Documentation
Method executed after the body of methods to which this aspect is applied, in case that the method resulted with an exception (i.e., in a catch block).

Namespace: PostSharp.Aspects
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
void OnException(
    MethodExecutionArgs args
)
void OnException(
    MethodExecutionArgs args
)
Parameters
args
Type: PostSharp.Aspects MethodExecutionArgs
Advice arguments.
See Also
IOnExceptionAspect Interface
IOnExceptionAspect Members
PostSharp.Aspects Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


IOnMethodBoundaryAspect Interface

IOnMethodBoundaryAspect Interface PostSharp Documentation
Runtime semantics of OnMethodBoundaryAspect.

Namespace: PostSharp.Aspects
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
public interface IOnMethodBoundaryAspect : IMethodLevelAspect,
    IAspect
public interface IOnMethodBoundaryAspect : IMethodLevelAspect,
    IAspect
Remarks
See OnMethodBoundaryAspect for details.
See Also
IOnMethodBoundaryAspect Members
PostSharp.Aspects Namespace
PostSharp.Aspects OnMethodBoundaryAspect
PostSharp.Aspects.Configuration OnMethodBoundaryAspectConfiguration
PostSharp.Aspects.Configuration OnMethodBoundaryAspectConfigurationAttribute
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


IOnMethodBoundaryAspect Members

IOnMethodBoundaryAspect Members PostSharp Documentation

The IOnMethodBoundaryAspect type exposes the following members.
Methods
 | Name | Description
Public method | OnEntry | Method executed before the body of methods to which this aspect is applied.
Public method | OnException | Method executed after the body of methods to which this aspect is applied, in case that the method resulted with an exception.
Public method | OnExit | Method executed after the body of methods to which this aspect is applied, even when the method exists with an exception (this method is invoked from the finally block).
Public method | OnSuccess | Method executed after the body of methods to which this aspect is applied, but only when the method successfully returns (i.e. when no exception flies out the method.).
Public method | RuntimeInitialize | Initializes the current aspect. (Inherited from IMethodLevelAspect.)
Back to Top
See Also
IOnMethodBoundaryAspect Interface
PostSharp.Aspects Namespace

Online Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


IOnMethodBoundaryAspect Methods

IOnMethodBoundaryAspect Methods PostSharp Documentation
The IOnMethodBoundaryAspect type exposes the following members.
Methods
 | Name | Description
Public method | OnEntry | Method executed before the body of methods to which this aspect is applied.
Public method | OnException | Method executed after the body of methods to which this aspect is applied, in case that the method resulted with an exception.
Public method | OnExit | Method executed after the body of methods to which this aspect is applied, even when the method exists with an exception (this method is invoked from the finally block).
Public method | OnSuccess | Method executed after the body of methods to which this aspect is applied, but only when the method successfully returns (i.e. when no exception flies out the method.).
Public method | RuntimeInitialize | Initializes the current aspect. (Inherited from IMethodLevelAspect.)
Back to Top
See Also
IOnMethodBoundaryAspect Interface
PostSharp.Aspects Namespace

Online Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


IOnMethodBoundaryAspect.OnEntry Method

IOnMethodBoundaryAspect OnEntry Method PostSharp Documentation
Method executed before the body of methods to which this aspect is applied.

Namespace: PostSharp.Aspects
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
void OnEntry(
    MethodExecutionArgs args
)
void OnEntry(
    MethodExecutionArgs args
)
Parameters
args
Type: PostSharp.Aspects MethodExecutionArgs
Event arguments specifying which method
              is being executed, which are its arguments, and how should the execution continue
              after the execution of OnEntry(MethodExecutionArgs).
Remarks

              If the aspect is applied to a constructor, the current method is invoked
              after the this pointer has been initialized, that is, after
              the base constructor has been called.

See Also
IOnMethodBoundaryAspect Interface
IOnMethodBoundaryAspect Members
PostSharp.Aspects Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


IOnMethodBoundaryAspect.OnException Method

IOnMethodBoundaryAspect OnException Method PostSharp Documentation
Method executed after the body of methods to which this aspect is applied, in case that the method resulted with an exception.

Namespace: PostSharp.Aspects
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
void OnException(
    MethodExecutionArgs args
)
void OnException(
    MethodExecutionArgs args
)
Parameters
args
Type: PostSharp.Aspects MethodExecutionArgs
Event arguments specifying which method
              is being executed and which are its arguments.
See Also
IOnMethodBoundaryAspect Interface
IOnMethodBoundaryAspect Members
PostSharp.Aspects Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


IOnMethodBoundaryAspect.OnExit Method

IOnMethodBoundaryAspect OnExit Method PostSharp Documentation
Method executed after the body of methods to which this aspect is applied, even when the method exists with an exception (this method is invoked from the finally block).

Namespace: PostSharp.Aspects
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
void OnExit(
    MethodExecutionArgs args
)
void OnExit(
    MethodExecutionArgs args
)
Parameters
args
Type: PostSharp.Aspects MethodExecutionArgs
Event arguments specifying which method
              is being executed and which are its arguments.
See Also
IOnMethodBoundaryAspect Interface
IOnMethodBoundaryAspect Members
PostSharp.Aspects Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


IOnMethodBoundaryAspect.OnSuccess Method

IOnMethodBoundaryAspect OnSuccess Method PostSharp Documentation
Method executed after the body of methods to which this aspect is applied, but only when the method successfully returns (i.e. when no exception flies out the method.).

Namespace: PostSharp.Aspects
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
void OnSuccess(
    MethodExecutionArgs args
)
void OnSuccess(
    MethodExecutionArgs args
)
Parameters
args
Type: PostSharp.Aspects MethodExecutionArgs
Event arguments specifying which method
              is being executed and which are its arguments.
See Also
IOnMethodBoundaryAspect Interface
IOnMethodBoundaryAspect Members
PostSharp.Aspects Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


IProtectedInterface(T) Interface

IProtectedInterface T Interface PostSharp Documentation
Gives access to a 'protected' interface, typically introduced by a CompositionAspect or a IntroduceInterfaceAttribute

Namespace: PostSharp.Aspects
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
public interface IProtectedInterface<T>
public interface IProtectedInterface<T>
Type Parameters
T
Exposed interface.
Remarks

                A 'protected' interface is not directly implemented by the type.
                Instead, the type exposes it through the IProtectedInterface T  interface. When an object
                wants access to a protected interface, it must provide valid InstanceCredentials.
                Since the method providing InstanceCredentials is protected, it
                allows an instance to control which code can have access to protected semantics.

  Note  Note

                Protected interfaces are considered obsolete. It is suggested to use
                techniques that do not require instance credentials.

See Also
IProtectedInterface T  Members
PostSharp.Aspects Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


IProtectedInterface(T) Members

IProtectedInterface T Members PostSharp Documentation

The IProtectedInterface T type exposes the following members.
Methods
 | Name | Description
Public method | GetInterface | Gets a protected interface.
Back to Top
See Also
IProtectedInterface T Interface
PostSharp.Aspects Namespace

Online Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


IProtectedInterface(T) Methods

IProtectedInterface T Methods PostSharp Documentation
The IProtectedInterface T type exposes the following members.
Methods
 | Name | Description
Public method | GetInterface | Gets a protected interface.
Back to Top
See Also
IProtectedInterface T Interface
PostSharp.Aspects Namespace

Online Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


IProtectedInterface(T).GetInterface Method

IProtectedInterface T GetInterface Method PostSharp Documentation
Gets a protected interface.

Namespace: PostSharp.Aspects
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
T GetInterface(
    InstanceCredentials credentials
)
T GetInterface(
    InstanceCredentials credentials
)
Parameters
credentials
Type: PostSharp.Aspects InstanceCredentials
Credentials of the current instance.
Return Value
Type: T
The implementation of the interface T.
See Also
IProtectedInterface T  Interface
IProtectedInterface T  Members
PostSharp.Aspects Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


ITypeLevelAspect Interface

ITypeLevelAspect Interface PostSharp Documentation
Run-time semantics of aspects applied to types.

Namespace: PostSharp.Aspects
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
public interface ITypeLevelAspect : IAspect
public interface ITypeLevelAspect : IAspect
See Also
ITypeLevelAspect Members
PostSharp.Aspects Namespace
PostSharp.Aspects ITypeLevelAspectBuildSemantics
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


ITypeLevelAspect Members

ITypeLevelAspect Members PostSharp Documentation

The ITypeLevelAspect type exposes the following members.
Methods
 | Name | Description
Public method | RuntimeInitialize | Initializes the current aspect.
Back to Top
See Also
ITypeLevelAspect Interface
PostSharp.Aspects Namespace

Online Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


ITypeLevelAspect Methods

ITypeLevelAspect Methods PostSharp Documentation
The ITypeLevelAspect type exposes the following members.
Methods
 | Name | Description
Public method | RuntimeInitialize | Initializes the current aspect.
Back to Top
See Also
ITypeLevelAspect Interface
PostSharp.Aspects Namespace

Online Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


ITypeLevelAspect.RuntimeInitialize Method

ITypeLevelAspect RuntimeInitialize Method PostSharp Documentation
Initializes the current aspect.

Namespace: PostSharp.Aspects
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
void RuntimeInitialize(
    Type type
)
void RuntimeInitialize(
    Type type
)
Parameters
type
Type:   Online System Type
Type to which the current aspect is applied.
See Also
ITypeLevelAspect Interface
ITypeLevelAspect Members
PostSharp.Aspects Namespace

      Conceptual Documentation: Initializing Aspects

  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


ITypeLevelAspectBuildSemantics Interface

ITypeLevelAspectBuildSemantics Interface PostSharp Documentation
Compile-time semantics of ITypeLevelAspect.

Namespace: PostSharp.Aspects
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
public interface ITypeLevelAspectBuildSemantics : IAspectBuildSemantics,
    IValidableAnnotation
public interface ITypeLevelAspectBuildSemantics : IAspectBuildSemantics,
    IValidableAnnotation
See Also
ITypeLevelAspectBuildSemantics Members
PostSharp.Aspects Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


ITypeLevelAspectBuildSemantics Members

ITypeLevelAspectBuildSemantics Members PostSharp Documentation

The ITypeLevelAspectBuildSemantics type exposes the following members.
Methods
 | Name | Description
Public method | CompileTimeInitialize | Method invoked at build time to initialize the instance fields of the current aspect. This method is invoked before any other build-time method.
Public method | CompileTimeValidate | Method invoked at build time to ensure that the aspect has been applied to the right target. (Inherited from IValidableAnnotation.)
Public method | GetAspectConfiguration | Method invoked at build time to get the imperative configuration of the current Aspect. (Inherited from IAspectBuildSemantics.)
Back to Top
See Also
ITypeLevelAspectBuildSemantics Interface
PostSharp.Aspects Namespace

Online Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


ITypeLevelAspectBuildSemantics Methods

ITypeLevelAspectBuildSemantics Methods PostSharp Documentation
The ITypeLevelAspectBuildSemantics type exposes the following members.
Methods
 | Name | Description
Public method | CompileTimeInitialize | Method invoked at build time to initialize the instance fields of the current aspect. This method is invoked before any other build-time method.
Public method | CompileTimeValidate | Method invoked at build time to ensure that the aspect has been applied to the right target. (Inherited from IValidableAnnotation.)
Public method | GetAspectConfiguration | Method invoked at build time to get the imperative configuration of the current Aspect. (Inherited from IAspectBuildSemantics.)
Back to Top
See Also
ITypeLevelAspectBuildSemantics Interface
PostSharp.Aspects Namespace

Online Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


ITypeLevelAspectBuildSemantics.CompileTimeInitialize Method

ITypeLevelAspectBuildSemantics CompileTimeInitialize Method PostSharp Documentation
Method invoked at build time to initialize the instance fields of the current aspect. This method is invoked before any other build-time method.

Namespace: PostSharp.Aspects
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
void CompileTimeInitialize(
    Type type,
    AspectInfo aspectInfo
)
void CompileTimeInitialize(
    Type type,
    AspectInfo aspectInfo
)
Parameters
type
Type:   Online System Type
Type to which the current aspect is applied
aspectInfo
Type: PostSharp.Aspects AspectInfo
Reserved for future usage.
See Also
ITypeLevelAspectBuildSemantics Interface
ITypeLevelAspectBuildSemantics Members
PostSharp.Aspects Namespace

      Conceptual Documentation: Initializing Aspects

  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


LocationInterceptionArgs Class

LocationInterceptionArgs Class PostSharp Documentation
Arguments of advices of aspect type LocationInterceptionAspect.
Inheritance Hierarchy
Online System Object
PostSharp.Aspects AdviceArgs
PostSharp.Aspects LocationInterceptionArgs

Namespace: PostSharp.Aspects
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
public abstract class LocationInterceptionArgs : AdviceArgs
public abstract class LocationInterceptionArgs : AdviceArgs
Remarks
  Note  Note

      As a result of weaving optimizations, instances of classes derived from
      AdviceArgs
      may be shared among different aspects. Therefore,
      aspect code should not attempt to access this object once the control has been given over to the next node in the chain of invocation. Consider working
      with
      aspect bindings
      if you need such deferred execution.

See Also
LocationInterceptionArgs Members
PostSharp.Aspects Namespace

      Conceptual Documentation: Aspect Bindings

PostSharp.Aspects LocationInterceptionAspect
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


LocationInterceptionArgs Members

LocationInterceptionArgs Members PostSharp Documentation

The LocationInterceptionArgs type exposes the following members.
Methods
 | Name | Description
Public method | GetCurrentValue | Retrieves the current value of the location without overwriting the Value property.
Public method | ProceedGetValue | Invokes the Get Location Value semantic on the next node in the chain of invocation and stores the location value in the Value property.
Public method | ProceedSetValue | Invokes the Set Location Value semantic on the next node in the chain of invocation and stores the value of the Value property into the location.
Public method | SetNewValue | Sets the value of the location without overwriting the Value property.
Back to Top
Properties
 | Name | Description
Public property | Binding | Gets an interface that allows to invoke the next node in the chain of invocation of the intercepted method.
Public property | Index | Gets the current index arguments (in case of a property with parameters).
Public property | Instance | Gets or sets the object instance on which the method is being executed. (Inherited from AdviceArgs.)
Public property | InstanceCredentials | Obsolete. (Inherited from AdviceArgs.)
Public property | Location | Gets the location (field, property or parameter) related to the aspect or advice being executed.
Public property | LocationFullName | Gets the full name (including the full name of the declaring type) of the location (field, property or parameter) related to the aspect or advice being executed.
Public property | LocationName | Gets the name of the location (field, property or parameter) related to the aspect or advice being executed.
Public property | Value | Gets or sets the location value.
Back to Top
See Also
LocationInterceptionArgs Class
PostSharp.Aspects Namespace

Online Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


LocationInterceptionArgs Methods

LocationInterceptionArgs Methods PostSharp Documentation
The LocationInterceptionArgs type exposes the following members.
Methods
 | Name | Description
Public method | GetCurrentValue | Retrieves the current value of the location without overwriting the Value property.
Public method | ProceedGetValue | Invokes the Get Location Value semantic on the next node in the chain of invocation and stores the location value in the Value property.
Public method | ProceedSetValue | Invokes the Set Location Value semantic on the next node in the chain of invocation and stores the value of the Value property into the location.
Public method | SetNewValue | Sets the value of the location without overwriting the Value property.
Back to Top
See Also
LocationInterceptionArgs Class
PostSharp.Aspects Namespace

Online Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


LocationInterceptionArgs.GetCurrentValue Method

LocationInterceptionArgs GetCurrentValue Method PostSharp Documentation
Retrieves the current value of the location without overwriting the Value property.

Namespace: PostSharp.Aspects
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
public abstract Object GetCurrentValue()
public abstract Object GetCurrentValue()
Return Value
Type:   Online Object
The current value of the location, as returned by the next node in the chain of invocation (see Binding).
Remarks
  Note  Note

      This method is designed to be invoked during the execution of the advice. If you need to retrieve or store the value of the location at a different time, it is
      recommended to use the
      Binding
      . Indeed, a binding is stateless, while
      LocationInterceptionArgs
      instances may be shared
      among different aspects.

See Also
LocationInterceptionArgs Class
LocationInterceptionArgs Members
PostSharp.Aspects Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


LocationInterceptionArgs.ProceedGetValue Method

LocationInterceptionArgs ProceedGetValue Method PostSharp Documentation
Invokes the Get Location Value semantic on the next node in the chain of invocation and stores the location value in the Value property.

Namespace: PostSharp.Aspects
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
public abstract void ProceedGetValue()
public abstract void ProceedGetValue()
Remarks

                Note that this method overwrites the content of the Value property. Therefore, you should not call this invoke
                from a OnSetValue(LocationInterceptionArgs) advice unless you store the value before. If you need to retrieve
                the current value of the location from a OnSetValue(LocationInterceptionArgs) advice, it is recommended you
                use the GetCurrentValue  method.

  Note  Note

      This method is designed to be invoked during the execution of the advice. If you need to retrieve or store the value of the location at a different time, it is
      recommended to use the
      Binding
      . Indeed, a binding is stateless, while
      LocationInterceptionArgs
      instances may be shared
      among different aspects.

See Also
LocationInterceptionArgs Class
LocationInterceptionArgs Members
PostSharp.Aspects Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


LocationInterceptionArgs.ProceedSetValue Method

LocationInterceptionArgs ProceedSetValue Method PostSharp Documentation
Invokes the Set Location Value semantic on the next node in the chain of invocation and stores the value of the Value property into the location.

Namespace: PostSharp.Aspects
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
public abstract void ProceedSetValue()
public abstract void ProceedSetValue()
Remarks
Note that this method requires the value to be stored in the Value property. If you need to retrieve
                the current value of the location from a OnSetValue(LocationInterceptionArgs) advice, it is recommended you
                use the GetCurrentValue  method.

  Note  Note

      This method is designed to be invoked during the execution of the advice. If you need to retrieve or store the value of the location at a different time, it is
      recommended to use the
      Binding
      . Indeed, a binding is stateless, while
      LocationInterceptionArgs
      instances may be shared
      among different aspects.

See Also
LocationInterceptionArgs Class
LocationInterceptionArgs Members
PostSharp.Aspects Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


LocationInterceptionArgs.SetNewValue Method

LocationInterceptionArgs SetNewValue Method PostSharp Documentation
Sets the value of the location without overwriting the Value property.

Namespace: PostSharp.Aspects
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
public abstract void SetNewValue(
    Object value
)
public abstract void SetNewValue(
    Object value
)
Parameters
value
Type:   Online System Object
The value to be passed to the next node in the chain of invocation (see Binding).
Remarks

  Note  Note

      This method is designed to be invoked during the execution of the advice. If you need to retrieve or store the value of the location at a different time, it is
      recommended to use the
      Binding
      . Indeed, a binding is stateless, while
      LocationInterceptionArgs
      instances may be shared
      among different aspects.

See Also
LocationInterceptionArgs Class
LocationInterceptionArgs Members
PostSharp.Aspects Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


LocationInterceptionArgs Properties

LocationInterceptionArgs Properties PostSharp Documentation
The LocationInterceptionArgs type exposes the following members.
Properties
 | Name | Description
Public property | Binding | Gets an interface that allows to invoke the next node in the chain of invocation of the intercepted method.
Public property | Index | Gets the current index arguments (in case of a property with parameters).
Public property | Instance | Gets or sets the object instance on which the method is being executed. (Inherited from AdviceArgs.)
Public property | InstanceCredentials | Obsolete. (Inherited from AdviceArgs.)
Public property | Location | Gets the location (field, property or parameter) related to the aspect or advice being executed.
Public property | LocationFullName | Gets the full name (including the full name of the declaring type) of the location (field, property or parameter) related to the aspect or advice being executed.
Public property | LocationName | Gets the name of the location (field, property or parameter) related to the aspect or advice being executed.
Public property | Value | Gets or sets the location value.
Back to Top
See Also
LocationInterceptionArgs Class
PostSharp.Aspects Namespace

Online Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


LocationInterceptionArgs.Binding Property

LocationInterceptionArgs Binding Property PostSharp Documentation
Gets an interface that allows to invoke the next node in the chain of invocation of the intercepted method.

Namespace: PostSharp.Aspects
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
public abstract ILocationBinding Binding { get; }
public abstract ILocationBinding Binding { get; }
Property Value
Type: ILocationBinding
Remarks

      Bindings are thread-safe and context-free singleton instances exposing the next node in the chain of invocation.

See Also
LocationInterceptionArgs Class
LocationInterceptionArgs Members
PostSharp.Aspects Namespace

      Conceptual Documentation: Aspect Bindings

  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


LocationInterceptionArgs.Index Property

LocationInterceptionArgs Index Property PostSharp Documentation
Gets the current index arguments (in case of a property with parameters).

Namespace: PostSharp.Aspects
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
public Arguments Index { get; private set; }
public Arguments Index { get; private set; }
Property Value
Type: Arguments
See Also
LocationInterceptionArgs Class
LocationInterceptionArgs Members
PostSharp.Aspects Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


LocationInterceptionArgs.Location Property

LocationInterceptionArgs Location Property PostSharp Documentation
Gets the location (field, property or parameter) related to the aspect or advice being executed.

Namespace: PostSharp.Aspects
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
public LocationInfo Location { get; set; }
public LocationInfo Location { get; set; }
Property Value
Type: LocationInfo
Remarks
  Note  Note

                Using this property causes the aspect weaver to generate code that has non-trivial runtime overhead. Avoid using
                this property whenever possible. One of the possible solution is to use compile-time initialization of
                aspect instances and to make use of reflection only at build time.

See Also
LocationInterceptionArgs Class
LocationInterceptionArgs Members
PostSharp.Aspects Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


LocationInterceptionArgs.LocationFullName Property

LocationInterceptionArgs LocationFullName Property PostSharp Documentation
Gets the full name (including the full name of the declaring type) of the location (field, property or parameter) related to the aspect or advice being executed.

Namespace: PostSharp.Aspects
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
public string LocationFullName { get; set; }
public string LocationFullName { get; set; }
Property Value
Type:   Online String
See Also
LocationInterceptionArgs Class
LocationInterceptionArgs Members
PostSharp.Aspects Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


LocationInterceptionArgs.LocationName Property

LocationInterceptionArgs LocationName Property PostSharp Documentation
Gets the name of the location (field, property or parameter) related to the aspect or advice being executed.

Namespace: PostSharp.Aspects
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
public string LocationName { get; set; }
public string LocationName { get; set; }
Property Value
Type:   Online String
See Also
LocationInterceptionArgs Class
LocationInterceptionArgs Members
PostSharp.Aspects Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


LocationInterceptionArgs.Value Property

LocationInterceptionArgs Value Property PostSharp Documentation
Gets or sets the location value.

Namespace: PostSharp.Aspects
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
public abstract Object Value { get; set; }
public abstract Object Value { get; set; }
Property Value
Type:   Online Object
Remarks

                Inside an OnGetValue(LocationInterceptionArgs) advice, this property is available after
                the next advice in chain has been invoked using ProceedGetValue . However,
                inside an OnSetValue(LocationInterceptionArgs) advice, the value is available immediately,
                and is used as input by ProceedSetValue .

                See GetCurrentValue  and SetNewValue(Object)
                to get or set the value of the location without affecting the value of this property.

See Also
LocationInterceptionArgs Class
LocationInterceptionArgs Members
PostSharp.Aspects Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


LocationInterceptionAspect Class

LocationInterceptionAspect Class PostSharp Documentation
Aspect that, when applied on a location (field or property), intercepts invocations of the Get (OnGetValue(LocationInterceptionArgs)) and Set (OnSetValue(LocationInterceptionArgs)) semantics.
Inheritance Hierarchy
Online System Object
Online System Attribute
PostSharp.Extensibility MulticastAttribute
PostSharp.Aspects Aspect
PostSharp.Aspects LocationLevelAspect
PostSharp.Aspects LocationInterceptionAspect

Namespace: PostSharp.Aspects
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
[SerializableAttribute]
public abstract class LocationInterceptionAspect : LocationLevelAspect,
    ILocationInterceptionAspect, ILocationLevelAspect, IAspect
[SerializableAttribute]
public abstract class LocationInterceptionAspect : LocationLevelAspect,
    ILocationInterceptionAspect, ILocationLevelAspect, IAspect
Remarks

            This aspect can be applied indifferently to fields and properties, called locations
            because they both have the semantics of a slot where a value can be stored and retrieved.

Applying the Aspect on Properties
Applying an aspect of type LocationInterceptionAspect to a property results in the accessors of this property to be replaced by a call to the method OnGetValue(LocationInterceptionArgs)
            or OnSetValue(LocationInterceptionArgs) of the current class. The original body of the accessor is moved into a new method,
            which can be called by the aspect by invoking one of the methods
            ProceedGetValue , ProceedSetValue ,
            GetCurrentValue  or SetNewValue(Object),
            or by using the Binding object.
For details about the implementation of this aspect, see Interception Aspects.
Applying the Aspect on Fields
Applying this aspect on a field transforms the field into a property of the same name,
            scope and visibility as the original field. The original field is removed. Aspect code can get or set the
            value of the fied by calling the methods ProceedGetValue ,
            ProceedSetValue ,  GetCurrentValue
            or SetNewValue(Object), or by using the Binding object.
For details about the implementation of this aspect, see Interception Aspects.
  Note  Note

            Remember to use
              Online PropertyInfo instead of   Online FieldInfo at runtime to reflect the original field.
            For this reason, you cannot store a   Online FieldInfo in the aspect.
            Store a LocationInfo
            instead; even if a LocationInfo represents a field at build time, it will represent
            the corresponding   Online PropertyInfo at runtime.
  Note  Note

            When you apply an aspect derived from LocationInterceptionAspect to a value-type field,
            you should not pass the value of this field by reference (as an argument to out and ref parameters in C#).
            Indeed, PostSharp is unable to detect read and write accesses through references.

  Note  Note

        All classes implementing
        IAspect
        should typically be marked as serializable
        using the custom attribute
          Online SerializableAttribute
        . Fields that
        are only used at runtime (and unknown at compile-time) should be carefully
        marked with the custom attribute
          Online NonSerializedAttribute
        .
        When PostSharp is used on a platform that does not support aspect serialization
        (such as .NET Compact Framework, Silverlight, or Windows Phone), or when
        another aspect serializer is used, it is not necessary to mark the aspect
        class as serializable.
        For more information, see
        Aspect Serialization
        .

Examples
Example: Backing a Property with a Registry Value
See Also
LocationInterceptionAspect Members
PostSharp.Aspects Namespace
PostSharp.Aspects.Configuration LocationInterceptionAspectConfigurationAttribute

      Conceptual Documentation: Aspect Serialization

      Conceptual Documentation: Interception Aspects

  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


LocationInterceptionAspect Members

LocationInterceptionAspect Members PostSharp Documentation

The LocationInterceptionAspect type exposes the following members.
Constructors
 | Name | Description
Protected method | LocationInterceptionAspect | Initializes a new instance of the LocationInterceptionAspect class
Back to Top
Methods
 | Name | Description
Public method | CompileTimeInitialize | Method invoked at build time to initialize the instance fields of the current aspect. This method is invoked before any other build-time method. (Inherited from LocationLevelAspect.)
Public method | CompileTimeValidate | Method invoked at build time to ensure that the aspect has been applied to the right target. (Inherited from Aspect.)
Protected method | CreateAspectConfiguration | Method invoked at build time to create a concrete AspectConfiguration instance specifically for the current Aspect type. (Overrides Aspect CreateAspectConfiguration .)
Public method | GetAspectConfiguration | Method invoked at build tome to get the imperative configuration of the current Aspect. (Inherited from Aspect.)
Public method | OnGetValue | Method invoked instead of the Get semantic of the field or property to which the current aspect is applied, i.e. when the value of this field or property is retrieved.
Public method | OnSetValue | Method invoked instead of the Set semantic of the field or property to which the current aspect is applied, i.e. when the value of this field or property is changed.
Public method | RuntimeInitialize | Initializes the current aspect. (Inherited from LocationLevelAspect.)
Protected method | SetAspectConfiguration | Method invoked at build time to set up an AspectConfiguration object according to the current Aspect instance and a specified target element of the current aspect. (Inherited from Aspect.)
Back to Top
Properties
 | Name | Description
Public property | AspectPriority | Gets or sets the weaving priority of the aspect. (Inherited from Aspect.)
Public property | AttributeExclude | If true, indicates that this attribute removes all other instances of the same attribute type from the set of elements defined by the current instance. (Inherited from MulticastAttribute.)
Public property | AttributeId | Obsolete. (Inherited from MulticastAttribute.)
Public property | AttributeInheritance | Determines whether this attribute is inherited (Inherited from MulticastAttribute.)
Public property | AttributePriority | Gets or sets the priority of the current attribute in case that multiple instances are defined on the same element (lower values are processed before). (Inherited from MulticastAttribute.)
Public property | AttributeReplace | Determines whether this attribute replaces other attributes found on the target declarations. (Inherited from MulticastAttribute.)
Public property | AttributeTargetAssemblies | Gets or sets the assemblies to which the current attribute apply. (Inherited from MulticastAttribute.)
Public property | AttributeTargetElements | Gets or sets the kind of elements to which this custom attributes applies. (Inherited from MulticastAttribute.)
Public property | AttributeTargetExternalMemberAttributes | Gets or sets the visibilities, scopes, virtualities, and implementation of members to which this attribute applies, when the member is external to the current module. (Inherited from MulticastAttribute.)
Public property | AttributeTargetExternalTypeAttributes | Gets or sets the visibilities of types to which this attribute applies, when this type is external to the current module. (Inherited from MulticastAttribute.)
Public property | AttributeTargetMemberAttributes | Gets or sets the visibilities, scopes, virtualities, and implementation of members to which this attribute applies. (Inherited from MulticastAttribute.)
Public property | AttributeTargetMembers | Gets or sets the expression specifying to which members this instance applies. (Inherited from MulticastAttribute.)
Public property | AttributeTargetParameterAttributes | Gets or sets the passing style (by value, out or ref) of parameters to which this attribute applies. (Inherited from MulticastAttribute.)
Public property | AttributeTargetParameters | Gets or sets the expression specifying to which parameters this instance applies. (Inherited from MulticastAttribute.)
Public property | AttributeTargetTypeAttributes | Gets or sets the visibilities of types to which this attribute applies. (Inherited from MulticastAttribute.)
Public property | AttributeTargetTypes | Gets or sets the expression specifying to which types this instance applies. (Inherited from MulticastAttribute.)
Protected property | SerializerType | Gets or sets the Online Type of the serializer (a type derived from AspectSerializer) used to serialize the aspect instance at build time and deserialize it at runtime. (Inherited from Aspect.)
Back to Top
See Also
LocationInterceptionAspect Class
PostSharp.Aspects Namespace

Online Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


LocationInterceptionAspect Constructor

LocationInterceptionAspect Constructor PostSharp Documentation
Initializes a new instance of the LocationInterceptionAspect class

Namespace: PostSharp.Aspects
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
protected LocationInterceptionAspect()
protected LocationInterceptionAspect()
See Also
LocationInterceptionAspect Class
LocationInterceptionAspect Members
PostSharp.Aspects Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


LocationInterceptionAspect Methods

LocationInterceptionAspect Methods PostSharp Documentation
The LocationInterceptionAspect type exposes the following members.
Methods
 | Name | Description
Public method | CompileTimeInitialize | Method invoked at build time to initialize the instance fields of the current aspect. This method is invoked before any other build-time method. (Inherited from LocationLevelAspect.)
Public method | CompileTimeValidate | Method invoked at build time to ensure that the aspect has been applied to the right target. (Inherited from Aspect.)
Protected method | CreateAspectConfiguration | Method invoked at build time to create a concrete AspectConfiguration instance specifically for the current Aspect type. (Overrides Aspect CreateAspectConfiguration .)
Public method | GetAspectConfiguration | Method invoked at build tome to get the imperative configuration of the current Aspect. (Inherited from Aspect.)
Public method | OnGetValue | Method invoked instead of the Get semantic of the field or property to which the current aspect is applied, i.e. when the value of this field or property is retrieved.
Public method | OnSetValue | Method invoked instead of the Set semantic of the field or property to which the current aspect is applied, i.e. when the value of this field or property is changed.
Public method | RuntimeInitialize | Initializes the current aspect. (Inherited from LocationLevelAspect.)
Protected method | SetAspectConfiguration | Method invoked at build time to set up an AspectConfiguration object according to the current Aspect instance and a specified target element of the current aspect. (Inherited from Aspect.)
Back to Top
See Also
LocationInterceptionAspect Class
PostSharp.Aspects Namespace

Online Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


LocationInterceptionAspect.CreateAspectConfiguration Method

LocationInterceptionAspect CreateAspectConfiguration Method PostSharp Documentation
Method invoked at build time to create a concrete AspectConfiguration instance specifically for the current Aspect type.

Namespace: PostSharp.Aspects
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
protected override sealed AspectConfiguration CreateAspectConfiguration()
protected override sealed AspectConfiguration CreateAspectConfiguration()
Return Value
Type: AspectConfiguration
A new and empty instance of AspectConfiguration, whose concrete type corresponds to
              the concrete type of the Aspect.
Remarks

              This method should not set up the returned AspectConfiguration. After the current method has
              returned, the SetAspectConfiguration(AspectConfiguration, Object) method will be invoked, and this method is responsible
              for setting up the AspectConfigurationobject.

See Also
LocationInterceptionAspect Class
LocationInterceptionAspect Members
PostSharp.Aspects Namespace

      Conceptual Documentation: Configuring Aspects

  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


LocationInterceptionAspect.OnGetValue Method

LocationInterceptionAspect OnGetValue Method PostSharp Documentation
Method invoked instead of the Get semantic of the field or property to which the current aspect is applied, i.e. when the value of this field or property is retrieved.

Namespace: PostSharp.Aspects
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
public virtual void OnGetValue(
    LocationInterceptionArgs args
)
public virtual void OnGetValue(
    LocationInterceptionArgs args
)
Parameters
args
Type: PostSharp.Aspects LocationInterceptionArgs
Advice arguments.
Implements
ILocationInterceptionAspect OnGetValue(LocationInterceptionArgs)
See Also
LocationInterceptionAspect Class
LocationInterceptionAspect Members
PostSharp.Aspects Namespace
PostSharp.Aspects LocationInterceptionArgs
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


LocationInterceptionAspect.OnSetValue Method

LocationInterceptionAspect OnSetValue Method PostSharp Documentation
Method invoked instead of the Set semantic of the field or property to which the current aspect is applied, i.e. when the value of this field or property is changed.

Namespace: PostSharp.Aspects
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
public virtual void OnSetValue(
    LocationInterceptionArgs args
)
public virtual void OnSetValue(
    LocationInterceptionArgs args
)
Parameters
args
Type: PostSharp.Aspects LocationInterceptionArgs
Advice arguments.
Implements
ILocationInterceptionAspect OnSetValue(LocationInterceptionArgs)
See Also
LocationInterceptionAspect Class
LocationInterceptionAspect Members
PostSharp.Aspects Namespace
PostSharp.Aspects LocationInterceptionArgs
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


LocationInterceptionAspect Properties

LocationInterceptionAspect Properties PostSharp Documentation
The LocationInterceptionAspect type exposes the following members.
Properties
 | Name | Description
Public property | AspectPriority | Gets or sets the weaving priority of the aspect. (Inherited from Aspect.)
Public property | AttributeExclude | If true, indicates that this attribute removes all other instances of the same attribute type from the set of elements defined by the current instance. (Inherited from MulticastAttribute.)
Public property | AttributeId | Obsolete. (Inherited from MulticastAttribute.)
Public property | AttributeInheritance | Determines whether this attribute is inherited (Inherited from MulticastAttribute.)
Public property | AttributePriority | Gets or sets the priority of the current attribute in case that multiple instances are defined on the same element (lower values are processed before). (Inherited from MulticastAttribute.)
Public property | AttributeReplace | Determines whether this attribute replaces other attributes found on the target declarations. (Inherited from MulticastAttribute.)
Public property | AttributeTargetAssemblies | Gets or sets the assemblies to which the current attribute apply. (Inherited from MulticastAttribute.)
Public property | AttributeTargetElements | Gets or sets the kind of elements to which this custom attributes applies. (Inherited from MulticastAttribute.)
Public property | AttributeTargetExternalMemberAttributes | Gets or sets the visibilities, scopes, virtualities, and implementation of members to which this attribute applies, when the member is external to the current module. (Inherited from MulticastAttribute.)
Public property | AttributeTargetExternalTypeAttributes | Gets or sets the visibilities of types to which this attribute applies, when this type is external to the current module. (Inherited from MulticastAttribute.)
Public property | AttributeTargetMemberAttributes | Gets or sets the visibilities, scopes, virtualities, and implementation of members to which this attribute applies. (Inherited from MulticastAttribute.)
Public property | AttributeTargetMembers | Gets or sets the expression specifying to which members this instance applies. (Inherited from MulticastAttribute.)
Public property | AttributeTargetParameterAttributes | Gets or sets the passing style (by value, out or ref) of parameters to which this attribute applies. (Inherited from MulticastAttribute.)
Public property | AttributeTargetParameters | Gets or sets the expression specifying to which parameters this instance applies. (Inherited from MulticastAttribute.)
Public property | AttributeTargetTypeAttributes | Gets or sets the visibilities of types to which this attribute applies. (Inherited from MulticastAttribute.)
Public property | AttributeTargetTypes | Gets or sets the expression specifying to which types this instance applies. (Inherited from MulticastAttribute.)
Protected property | SerializerType | Gets or sets the Online Type of the serializer (a type derived from AspectSerializer) used to serialize the aspect instance at build time and deserialize it at runtime. (Inherited from Aspect.)
Back to Top
See Also
LocationInterceptionAspect Class
PostSharp.Aspects Namespace

Online Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


LocationLevelAspect Class

LocationLevelAspect Class PostSharp Documentation
Base class for aspects defined in fields, properties, or parameters.
Inheritance Hierarchy
Online System Object
Online System Attribute
PostSharp.Extensibility MulticastAttribute
PostSharp.Aspects Aspect
PostSharp.Aspects LocationLevelAspect
PostSharp.Aspects LocationInterceptionAspect

Namespace: PostSharp.Aspects
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
[SerializableAttribute]
public abstract class LocationLevelAspect : Aspect,
    ILocationLevelAspect, IAspect, ILocationLevelAspectBuildSemantics, IAspectBuildSemantics, IValidableAnnotation
[SerializableAttribute]
public abstract class LocationLevelAspect : Aspect,
    ILocationLevelAspect, IAspect, ILocationLevelAspectBuildSemantics, IAspectBuildSemantics, IValidableAnnotation
Remarks
  Note  Note

      This class does not provide any advice. You may derive your aspect class from a

        class providing
        predefined advice

      , or build a
      composite aspect
      .

  Note  Note

        All classes implementing
        IAspect
        should typically be marked as serializable
        using the custom attribute
          Online SerializableAttribute
        . Fields that
        are only used at runtime (and unknown at compile-time) should be carefully
        marked with the custom attribute
          Online NonSerializedAttribute
        .
        When PostSharp is used on a platform that does not support aspect serialization
        (such as .NET Compact Framework, Silverlight, or Windows Phone), or when
        another aspect serializer is used, it is not necessary to mark the aspect
        class as serializable.
        For more information, see
        Aspect Serialization
        .

See Also
LocationLevelAspect Members
PostSharp.Aspects Namespace

      Conceptual Documentation: Aspect Classes

      Conceptual Documentation: Developing Complex Aspects

      Conceptual Documentation: Aspect Serialization

PostSharp.Aspects ILocationLevelAspect
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


LocationLevelAspect Members

LocationLevelAspect Members PostSharp Documentation

The LocationLevelAspect type exposes the following members.
Constructors
 | Name | Description
Protected method | LocationLevelAspect | Initializes a new instance of the LocationLevelAspect class
Back to Top
Methods
 | Name | Description
Public method | CompileTimeInitialize | Method invoked at build time to initialize the instance fields of the current aspect. This method is invoked before any other build-time method.
Public method | CompileTimeValidate | Method invoked at build time to ensure that the aspect has been applied to the right target. (Inherited from Aspect.)
Protected method | CreateAspectConfiguration | Method invoked at build time to create a concrete AspectConfiguration instance specifically for the current Aspect type. (Inherited from Aspect.)
Public method | GetAspectConfiguration | Method invoked at build tome to get the imperative configuration of the current Aspect. (Inherited from Aspect.)
Public method | RuntimeInitialize | Initializes the current aspect.
Protected method | SetAspectConfiguration | Method invoked at build time to set up an AspectConfiguration object according to the current Aspect instance and a specified target element of the current aspect. (Inherited from Aspect.)
Back to Top
Properties
 | Name | Description
Public property | AspectPriority | Gets or sets the weaving priority of the aspect. (Inherited from Aspect.)
Public property | AttributeExclude | If true, indicates that this attribute removes all other instances of the same attribute type from the set of elements defined by the current instance. (Inherited from MulticastAttribute.)
Public property | AttributeId | Obsolete. (Inherited from MulticastAttribute.)
Public property | AttributeInheritance | Determines whether this attribute is inherited (Inherited from MulticastAttribute.)
Public property | AttributePriority | Gets or sets the priority of the current attribute in case that multiple instances are defined on the same element (lower values are processed before). (Inherited from MulticastAttribute.)
Public property | AttributeReplace | Determines whether this attribute replaces other attributes found on the target declarations. (Inherited from MulticastAttribute.)
Public property | AttributeTargetAssemblies | Gets or sets the assemblies to which the current attribute apply. (Inherited from MulticastAttribute.)
Public property | AttributeTargetElements | Gets or sets the kind of elements to which this custom attributes applies. (Inherited from MulticastAttribute.)
Public property | AttributeTargetExternalMemberAttributes | Gets or sets the visibilities, scopes, virtualities, and implementation of members to which this attribute applies, when the member is external to the current module. (Inherited from MulticastAttribute.)
Public property | AttributeTargetExternalTypeAttributes | Gets or sets the visibilities of types to which this attribute applies, when this type is external to the current module. (Inherited from MulticastAttribute.)
Public property | AttributeTargetMemberAttributes | Gets or sets the visibilities, scopes, virtualities, and implementation of members to which this attribute applies. (Inherited from MulticastAttribute.)
Public property | AttributeTargetMembers | Gets or sets the expression specifying to which members this instance applies. (Inherited from MulticastAttribute.)
Public property | AttributeTargetParameterAttributes | Gets or sets the passing style (by value, out or ref) of parameters to which this attribute applies. (Inherited from MulticastAttribute.)
Public property | AttributeTargetParameters | Gets or sets the expression specifying to which parameters this instance applies. (Inherited from MulticastAttribute.)
Public property | AttributeTargetTypeAttributes | Gets or sets the visibilities of types to which this attribute applies. (Inherited from MulticastAttribute.)
Public property | AttributeTargetTypes | Gets or sets the expression specifying to which types this instance applies. (Inherited from MulticastAttribute.)
Protected property | SerializerType | Gets or sets the Online Type of the serializer (a type derived from AspectSerializer) used to serialize the aspect instance at build time and deserialize it at runtime. (Inherited from Aspect.)
Back to Top
See Also
LocationLevelAspect Class
PostSharp.Aspects Namespace

Online Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


LocationLevelAspect Constructor

LocationLevelAspect Constructor PostSharp Documentation
Initializes a new instance of the LocationLevelAspect class

Namespace: PostSharp.Aspects
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
protected LocationLevelAspect()
protected LocationLevelAspect()
See Also
LocationLevelAspect Class
LocationLevelAspect Members
PostSharp.Aspects Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


LocationLevelAspect Methods

LocationLevelAspect Methods PostSharp Documentation
The LocationLevelAspect type exposes the following members.
Methods
 | Name | Description
Public method | CompileTimeInitialize | Method invoked at build time to initialize the instance fields of the current aspect. This method is invoked before any other build-time method.
Public method | CompileTimeValidate | Method invoked at build time to ensure that the aspect has been applied to the right target. (Inherited from Aspect.)
Protected method | CreateAspectConfiguration | Method invoked at build time to create a concrete AspectConfiguration instance specifically for the current Aspect type. (Inherited from Aspect.)
Public method | GetAspectConfiguration | Method invoked at build tome to get the imperative configuration of the current Aspect. (Inherited from Aspect.)
Public method | RuntimeInitialize | Initializes the current aspect.
Protected method | SetAspectConfiguration | Method invoked at build time to set up an AspectConfiguration object according to the current Aspect instance and a specified target element of the current aspect. (Inherited from Aspect.)
Back to Top
See Also
LocationLevelAspect Class
PostSharp.Aspects Namespace

Online Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


LocationLevelAspect.CompileTimeInitialize Method

LocationLevelAspect CompileTimeInitialize Method PostSharp Documentation
Method invoked at build time to initialize the instance fields of the current aspect. This method is invoked before any other build-time method.

Namespace: PostSharp.Aspects
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
public virtual void CompileTimeInitialize(
    LocationInfo targetLocation,
    AspectInfo aspectInfo
)
public virtual void CompileTimeInitialize(
    LocationInfo targetLocation,
    AspectInfo aspectInfo
)
Parameters
targetLocation
Type: PostSharp.Reflection LocationInfo
Location to which the current aspect is applied
aspectInfo
Type: PostSharp.Aspects AspectInfo
Reserved for future usage.
Implements
ILocationLevelAspectBuildSemantics CompileTimeInitialize(LocationInfo, AspectInfo)
See Also
LocationLevelAspect Class
LocationLevelAspect Members
PostSharp.Aspects Namespace

      Conceptual Documentation: Initializing Aspects

  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


LocationLevelAspect.RuntimeInitialize Method

LocationLevelAspect RuntimeInitialize Method PostSharp Documentation
Initializes the current aspect.

Namespace: PostSharp.Aspects
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
public virtual void RuntimeInitialize(
    LocationInfo locationInfo
)
public virtual void RuntimeInitialize(
    LocationInfo locationInfo
)
Parameters
locationInfo
Type: PostSharp.Reflection LocationInfo
Location to which the current aspect is applied.
Implements
ILocationLevelAspect RuntimeInitialize(LocationInfo)
See Also
LocationLevelAspect Class
LocationLevelAspect Members
PostSharp.Aspects Namespace

      Conceptual Documentation: Initializing Aspects

  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


LocationLevelAspect Properties

LocationLevelAspect Properties PostSharp Documentation
The LocationLevelAspect type exposes the following members.
Properties
 | Name | Description
Public property | AspectPriority | Gets or sets the weaving priority of the aspect. (Inherited from Aspect.)
Public property | AttributeExclude | If true, indicates that this attribute removes all other instances of the same attribute type from the set of elements defined by the current instance. (Inherited from MulticastAttribute.)
Public property | AttributeId | Obsolete. (Inherited from MulticastAttribute.)
Public property | AttributeInheritance | Determines whether this attribute is inherited (Inherited from MulticastAttribute.)
Public property | AttributePriority | Gets or sets the priority of the current attribute in case that multiple instances are defined on the same element (lower values are processed before). (Inherited from MulticastAttribute.)
Public property | AttributeReplace | Determines whether this attribute replaces other attributes found on the target declarations. (Inherited from MulticastAttribute.)
Public property | AttributeTargetAssemblies | Gets or sets the assemblies to which the current attribute apply. (Inherited from MulticastAttribute.)
Public property | AttributeTargetElements | Gets or sets the kind of elements to which this custom attributes applies. (Inherited from MulticastAttribute.)
Public property | AttributeTargetExternalMemberAttributes | Gets or sets the visibilities, scopes, virtualities, and implementation of members to which this attribute applies, when the member is external to the current module. (Inherited from MulticastAttribute.)
Public property | AttributeTargetExternalTypeAttributes | Gets or sets the visibilities of types to which this attribute applies, when this type is external to the current module. (Inherited from MulticastAttribute.)
Public property | AttributeTargetMemberAttributes | Gets or sets the visibilities, scopes, virtualities, and implementation of members to which this attribute applies. (Inherited from MulticastAttribute.)
Public property | AttributeTargetMembers | Gets or sets the expression specifying to which members this instance applies. (Inherited from MulticastAttribute.)
Public property | AttributeTargetParameterAttributes | Gets or sets the passing style (by value, out or ref) of parameters to which this attribute applies. (Inherited from MulticastAttribute.)
Public property | AttributeTargetParameters | Gets or sets the expression specifying to which parameters this instance applies. (Inherited from MulticastAttribute.)
Public property | AttributeTargetTypeAttributes | Gets or sets the visibilities of types to which this attribute applies. (Inherited from MulticastAttribute.)
Public property | AttributeTargetTypes | Gets or sets the expression specifying to which types this instance applies. (Inherited from MulticastAttribute.)
Protected property | SerializerType | Gets or sets the Online Type of the serializer (a type derived from AspectSerializer) used to serialize the aspect instance at build time and deserialize it at runtime. (Inherited from Aspect.)
Back to Top
See Also
LocationLevelAspect Class
PostSharp.Aspects Namespace

Online Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


ManagedResourceIntroductionAspect Class

ManagedResourceIntroductionAspect Class PostSharp Documentation
Aspect that, when applied to an assembly, adds a custom attribute to this assembly.
Inheritance Hierarchy
Online System Object
PostSharp.Aspects ManagedResourceIntroductionAspect

Namespace: PostSharp.Aspects
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
public sealed class ManagedResourceIntroductionAspect : IManagedResourceIntroductionAspect,
    IAspect, IAspectBuildSemantics, IValidableAnnotation
public sealed class ManagedResourceIntroductionAspect : IManagedResourceIntroductionAspect,
    IAspect, IAspectBuildSemantics, IValidableAnnotation
See Also
ManagedResourceIntroductionAspect Members
PostSharp.Aspects Namespace

      Conceptual Documentation: Adding Aspects Dynamically

  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


ManagedResourceIntroductionAspect Members

ManagedResourceIntroductionAspect Members PostSharp Documentation

The ManagedResourceIntroductionAspect type exposes the following members.
Constructors
 | Name | Description
Public method | ManagedResourceIntroductionAspect | Initializes a new ManagedResourceIntroductionAspect.
Back to Top
Properties
 | Name | Description
Public property | Data | Gets the content of the managed resource.
Public property | Name | Gets the name of the managed resource.
Back to Top
See Also
ManagedResourceIntroductionAspect Class
PostSharp.Aspects Namespace

Online Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


ManagedResourceIntroductionAspect Constructor

ManagedResourceIntroductionAspect Constructor PostSharp Documentation
Initializes a new ManagedResourceIntroductionAspect.

Namespace: PostSharp.Aspects
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
public ManagedResourceIntroductionAspect(
    string name,
    byte[] data
)
public ManagedResourceIntroductionAspect(
    string name,
    byte[] data
)
Parameters
name
Type:   Online System String
Name of the managed resource.
data
Type:    Online System Byte
Content of the managed resource.
See Also
ManagedResourceIntroductionAspect Class
ManagedResourceIntroductionAspect Members
PostSharp.Aspects Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


ManagedResourceIntroductionAspect Properties

ManagedResourceIntroductionAspect Properties PostSharp Documentation
The ManagedResourceIntroductionAspect type exposes the following members.
Properties
 | Name | Description
Public property | Data | Gets the content of the managed resource.
Public property | Name | Gets the name of the managed resource.
Back to Top
See Also
ManagedResourceIntroductionAspect Class
PostSharp.Aspects Namespace

Online Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


ManagedResourceIntroductionAspect.Data Property

ManagedResourceIntroductionAspect Data Property PostSharp Documentation
Gets the content of the managed resource.

Namespace: PostSharp.Aspects
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
public byte[] Data { get; private set; }
public byte[] Data { get; private set; }
Property Value
Type:    Online Byte
See Also
ManagedResourceIntroductionAspect Class
ManagedResourceIntroductionAspect Members
PostSharp.Aspects Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


ManagedResourceIntroductionAspect.Name Property

ManagedResourceIntroductionAspect Name Property PostSharp Documentation
Gets the name of the managed resource.

Namespace: PostSharp.Aspects
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
public string Name { get; private set; }
public string Name { get; private set; }
Property Value
Type:   Online String
See Also
ManagedResourceIntroductionAspect Class
ManagedResourceIntroductionAspect Members
PostSharp.Aspects Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


MethodExecutionArgs Class

MethodExecutionArgs Class PostSharp Documentation
Arguments of advices of aspects of type OnMethodBoundaryAspect and OnExceptionAspect
Inheritance Hierarchy
Online System Object
PostSharp.Aspects AdviceArgs
PostSharp.Aspects MethodExecutionArgs

Namespace: PostSharp.Aspects
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
public sealed class MethodExecutionArgs : AdviceArgs
public sealed class MethodExecutionArgs : AdviceArgs
Remarks
  Note  Note

      As a result of weaving optimizations, instances of classes derived from
      AdviceArgs
      may be shared among different aspects. Therefore,
      aspect code should not attempt to access this object once the control has been given over to the next node in the chain of invocation. Consider working
      with
      aspect bindings
      if you need such deferred execution.

See Also
MethodExecutionArgs Members
PostSharp.Aspects Namespace

      Conceptual Documentation: Aspect Bindings

  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


MethodExecutionArgs Members

MethodExecutionArgs Members PostSharp Documentation

The MethodExecutionArgs type exposes the following members.
Properties
 | Name | Description
Public property | Arguments | Gets the arguments with which the method has been invoked.
Public property | Exception | Gets the exception currently flying.
Public property | FlowBehavior | Determines the control flow of the target method once the advice is exited.
Public property | Instance | Gets or sets the object instance on which the method is being executed. (Inherited from AdviceArgs.)
Public property | InstanceCredentials | Obsolete. (Inherited from AdviceArgs.)
Public property | Method | Gets the method being executed.
Public property | MethodExecutionTag | User-defined state information whose lifetime is linked to the current method execution. Aspects derived from IOnMethodBoundaryAspect should use this property to save state information between different events (OnEntry(MethodExecutionArgs), OnExit(MethodExecutionArgs) and OnException(MethodExecutionArgs)).
Public property | ReturnValue | Gets or sets the method return value.
Back to Top
See Also
MethodExecutionArgs Class
PostSharp.Aspects Namespace

Online Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


MethodExecutionArgs Properties

MethodExecutionArgs Properties PostSharp Documentation
The MethodExecutionArgs type exposes the following members.
Properties
 | Name | Description
Public property | Arguments | Gets the arguments with which the method has been invoked.
Public property | Exception | Gets the exception currently flying.
Public property | FlowBehavior | Determines the control flow of the target method once the advice is exited.
Public property | Instance | Gets or sets the object instance on which the method is being executed. (Inherited from AdviceArgs.)
Public property | InstanceCredentials | Obsolete. (Inherited from AdviceArgs.)
Public property | Method | Gets the method being executed.
Public property | MethodExecutionTag | User-defined state information whose lifetime is linked to the current method execution. Aspects derived from IOnMethodBoundaryAspect should use this property to save state information between different events (OnEntry(MethodExecutionArgs), OnExit(MethodExecutionArgs) and OnException(MethodExecutionArgs)).
Public property | ReturnValue | Gets or sets the method return value.
Back to Top
See Also
MethodExecutionArgs Class
PostSharp.Aspects Namespace

Online Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


MethodExecutionArgs.Arguments Property

MethodExecutionArgs Arguments Property PostSharp Documentation
Gets the arguments with which the method has been invoked.

Namespace: PostSharp.Aspects
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
public Arguments Arguments { get; set; }
public Arguments Arguments { get; set; }
Property Value
Type: Arguments
Remarks
  Note  Note
The property setter should never be used in user code.
See Also
MethodExecutionArgs Class
MethodExecutionArgs Members
PostSharp.Aspects Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


MethodExecutionArgs.Exception Property

MethodExecutionArgs Exception Property PostSharp Documentation
Gets the exception currently flying.

Namespace: PostSharp.Aspects
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
public Exception Exception { get; set; }
public Exception Exception { get; set; }
Property Value
Type:   Online Exception
An Exception, or null if the method is exiting normally.
Remarks
You cannot replace the exception by setting this property. Throw a new exception from the aspect if you need to replace the current exception.
See Also
MethodExecutionArgs Class
MethodExecutionArgs Members
PostSharp.Aspects Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


MethodExecutionArgs.FlowBehavior Property

MethodExecutionArgs FlowBehavior Property PostSharp Documentation
Determines the control flow of the target method once the advice is exited.

Namespace: PostSharp.Aspects
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
public FlowBehavior FlowBehavior { get; set; }
public FlowBehavior FlowBehavior { get; set; }
Property Value
Type: FlowBehavior
See Also
MethodExecutionArgs Class
MethodExecutionArgs Members
PostSharp.Aspects Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


MethodExecutionArgs.Method Property

MethodExecutionArgs Method Property PostSharp Documentation
Gets the method being executed.

Namespace: PostSharp.Aspects
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
public MethodBase Method { get; set; }
public MethodBase Method { get; set; }
Property Value
Type:   Online MethodBase
Remarks
If the executed method is generic or if its declaring type is generic,
                the current property contains the generic instance being executed.
  Note  Note

                Using this property causes the aspect weaver to generate code that has non-trivial runtime overhead. Avoid using
                this property whenever possible. One of the possible solution is to use compile-time initialization of
                aspect instances and to make use of reflection only at build time. See CompileTimeInitialize(MethodBase, AspectInfo)
                for details.

See Also
MethodExecutionArgs Class
MethodExecutionArgs Members
PostSharp.Aspects Namespace
MethodLevelAspect CompileTimeInitialize(MethodBase, AspectInfo)
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


MethodExecutionArgs.MethodExecutionTag Property

MethodExecutionArgs MethodExecutionTag Property PostSharp Documentation
User-defined state information whose lifetime is linked to the current method execution. Aspects derived from IOnMethodBoundaryAspect should use this property to save state information between different events (OnEntry(MethodExecutionArgs), OnExit(MethodExecutionArgs) and OnException(MethodExecutionArgs)).

Namespace: PostSharp.Aspects
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
public Object MethodExecutionTag { get; set; }
public Object MethodExecutionTag { get; set; }
Property Value
Type:   Online Object
See Also
MethodExecutionArgs Class
MethodExecutionArgs Members
PostSharp.Aspects Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


MethodExecutionArgs.ReturnValue Property

MethodExecutionArgs ReturnValue Property PostSharp Documentation
Gets or sets the method return value.

Namespace: PostSharp.Aspects
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
public Object ReturnValue { get; set; }
public Object ReturnValue { get; set; }
Property Value
Type:   Online Object
Remarks

              You can modify the return value only when the join point is located
              after a method execution (OnSuccess(MethodExecutionArgs),
              OnException(MethodExecutionArgs) or OnExit(MethodExecutionArgs),
              or in case you force the method to exit using the FlowBehavior property.

See Also
MethodExecutionArgs Class
MethodExecutionArgs Members
PostSharp.Aspects Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


MethodImplementationAspect Class

MethodImplementationAspect Class PostSharp Documentation
Aspect that, when applied on an abstract or extern method, creates an implementation for this method.
Inheritance Hierarchy
Online System Object
Online System Attribute
PostSharp.Extensibility MulticastAttribute
PostSharp.Aspects Aspect
PostSharp.Aspects MethodLevelAspect
PostSharp.Aspects MethodImplementationAspect

Namespace: PostSharp.Aspects
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
[SerializableAttribute]
public abstract class MethodImplementationAspect : MethodLevelAspect,
    IMethodInterceptionAspect, IMethodLevelAspect, IAspect
[SerializableAttribute]
public abstract class MethodImplementationAspect : MethodLevelAspect,
    IMethodInterceptionAspect, IMethodLevelAspect, IAspect
Remarks
This aspect is exactly identical to MethodInterceptionAspect, with the difference
            that it applies to abstract methods.

  Note  Note

        All classes implementing
        IAspect
        should typically be marked as serializable
        using the custom attribute
          Online SerializableAttribute
        . Fields that
        are only used at runtime (and unknown at compile-time) should be carefully
        marked with the custom attribute
          Online NonSerializedAttribute
        .
        When PostSharp is used on a platform that does not support aspect serialization
        (such as .NET Compact Framework, Silverlight, or Windows Phone), or when
        another aspect serializer is used, it is not necessary to mark the aspect
        class as serializable.
        For more information, see
        Aspect Serialization
        .

See Also
MethodImplementationAspect Members
PostSharp.Aspects Namespace
PostSharp.Aspects.Configuration MethodInterceptionAspectConfigurationAttribute

      Conceptual Documentation: Aspect Serialization

  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


MethodImplementationAspect Members

MethodImplementationAspect Members PostSharp Documentation

The MethodImplementationAspect type exposes the following members.
Constructors
 | Name | Description
Protected method | MethodImplementationAspect | Initializes a new instance of the MethodImplementationAspect class
Back to Top
Methods
 | Name | Description
Public method | CompileTimeInitialize | Method invoked at build time to initialize the instance fields of the current aspect. This method is invoked before any other build-time method. (Inherited from MethodLevelAspect.)
Public method | CompileTimeValidate | Method invoked at build time to ensure that the aspect has been applied to the right target. (Inherited from Aspect.)
Protected method | CreateAspectConfiguration | Method invoked at build time to create a concrete AspectConfiguration instance specifically for the current Aspect type. (Overrides Aspect CreateAspectConfiguration .)
Public method | GetAspectConfiguration | Method invoked at build tome to get the imperative configuration of the current Aspect. (Inherited from Aspect.)
Public method | OnInvoke | Method invoked instead of the method to which the aspect has been applied.
Public method | RuntimeInitialize | Initializes the current aspect. (Inherited from MethodLevelAspect.)
Protected method | SetAspectConfiguration | Method invoked at build time to set up an AspectConfiguration object according to the current Aspect instance and a specified target element of the current aspect. (Inherited from Aspect.)
Back to Top
Properties
 | Name | Description
Public property | AspectPriority | Gets or sets the weaving priority of the aspect. (Inherited from Aspect.)
Public property | AttributeExclude | If true, indicates that this attribute removes all other instances of the same attribute type from the set of elements defined by the current instance. (Inherited from MulticastAttribute.)
Public property | AttributeId | Obsolete. (Inherited from MulticastAttribute.)
Public property | AttributeInheritance | Determines whether this attribute is inherited (Inherited from MulticastAttribute.)
Public property | AttributePriority | Gets or sets the priority of the current attribute in case that multiple instances are defined on the same element (lower values are processed before). (Inherited from MulticastAttribute.)
Public property | AttributeReplace | Determines whether this attribute replaces other attributes found on the target declarations. (Inherited from MulticastAttribute.)
Public property | AttributeTargetAssemblies | Gets or sets the assemblies to which the current attribute apply. (Inherited from MulticastAttribute.)
Public property | AttributeTargetElements | Gets or sets the kind of elements to which this custom attributes applies. (Inherited from MulticastAttribute.)
Public property | AttributeTargetExternalMemberAttributes | Gets or sets the visibilities, scopes, virtualities, and implementation of members to which this attribute applies, when the member is external to the current module. (Inherited from MulticastAttribute.)
Public property | AttributeTargetExternalTypeAttributes | Gets or sets the visibilities of types to which this attribute applies, when this type is external to the current module. (Inherited from MulticastAttribute.)
Public property | AttributeTargetMemberAttributes | Gets or sets the visibilities, scopes, virtualities, and implementation of members to which this attribute applies. (Inherited from MulticastAttribute.)
Public property | AttributeTargetMembers | Gets or sets the expression specifying to which members this instance applies. (Inherited from MulticastAttribute.)
Public property | AttributeTargetParameterAttributes | Gets or sets the passing style (by value, out or ref) of parameters to which this attribute applies. (Inherited from MulticastAttribute.)
Public property | AttributeTargetParameters | Gets or sets the expression specifying to which parameters this instance applies. (Inherited from MulticastAttribute.)
Public property | AttributeTargetTypeAttributes | Gets or sets the visibilities of types to which this attribute applies. (Inherited from MulticastAttribute.)
Public property | AttributeTargetTypes | Gets or sets the expression specifying to which types this instance applies. (Inherited from MulticastAttribute.)
Protected property | SerializerType | Gets or sets the Online Type of the serializer (a type derived from AspectSerializer) used to serialize the aspect instance at build time and deserialize it at runtime. (Inherited from Aspect.)
Back to Top
See Also
MethodImplementationAspect Class
PostSharp.Aspects Namespace

Online Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


MethodImplementationAspect Constructor

MethodImplementationAspect Constructor PostSharp Documentation
Initializes a new instance of the MethodImplementationAspect class

Namespace: PostSharp.Aspects
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
protected MethodImplementationAspect()
protected MethodImplementationAspect()
See Also
MethodImplementationAspect Class
MethodImplementationAspect Members
PostSharp.Aspects Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


MethodImplementationAspect Methods

MethodImplementationAspect Methods PostSharp Documentation
The MethodImplementationAspect type exposes the following members.
Methods
 | Name | Description
Public method | CompileTimeInitialize | Method invoked at build time to initialize the instance fields of the current aspect. This method is invoked before any other build-time method. (Inherited from MethodLevelAspect.)
Public method | CompileTimeValidate | Method invoked at build time to ensure that the aspect has been applied to the right target. (Inherited from Aspect.)
Protected method | CreateAspectConfiguration | Method invoked at build time to create a concrete AspectConfiguration instance specifically for the current Aspect type. (Overrides Aspect CreateAspectConfiguration .)
Public method | GetAspectConfiguration | Method invoked at build tome to get the imperative configuration of the current Aspect. (Inherited from Aspect.)
Public method | OnInvoke | Method invoked instead of the method to which the aspect has been applied.
Public method | RuntimeInitialize | Initializes the current aspect. (Inherited from MethodLevelAspect.)
Protected method | SetAspectConfiguration | Method invoked at build time to set up an AspectConfiguration object according to the current Aspect instance and a specified target element of the current aspect. (Inherited from Aspect.)
Back to Top
See Also
MethodImplementationAspect Class
PostSharp.Aspects Namespace

Online Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


MethodImplementationAspect.CreateAspectConfiguration Method

MethodImplementationAspect CreateAspectConfiguration Method PostSharp Documentation
Method invoked at build time to create a concrete AspectConfiguration instance specifically for the current Aspect type.

Namespace: PostSharp.Aspects
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
protected override AspectConfiguration CreateAspectConfiguration()
protected override AspectConfiguration CreateAspectConfiguration()
Return Value
Type: AspectConfiguration
A new and empty instance of AspectConfiguration, whose concrete type corresponds to
              the concrete type of the Aspect.
Remarks

              This method should not set up the returned AspectConfiguration. After the current method has
              returned, the SetAspectConfiguration(AspectConfiguration, Object) method will be invoked, and this method is responsible
              for setting up the AspectConfigurationobject.

See Also
MethodImplementationAspect Class
MethodImplementationAspect Members
PostSharp.Aspects Namespace

      Conceptual Documentation: Configuring Aspects

  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


MethodImplementationAspect.OnInvoke Method

MethodImplementationAspect OnInvoke Method PostSharp Documentation
Method invoked instead of the method to which the aspect has been applied.

Namespace: PostSharp.Aspects
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
public abstract void OnInvoke(
    MethodInterceptionArgs args
)
public abstract void OnInvoke(
    MethodInterceptionArgs args
)
Parameters
args
Type: PostSharp.Aspects MethodInterceptionArgs
Advice arguments.
Implements
IMethodInterceptionAspect OnInvoke(MethodInterceptionArgs)
Remarks
The implementation of OnInvoke(MethodInterceptionArgs) may invoke Proceed , may schedule it for invocation from another thread, or
                may completely skip its invocation. Alternatively, it may use Binding. Before returning to the caller, the OnInvoke(MethodInterceptionArgs) method must set the return value (property ReturnValue)
                and all output arguments (property Arguments), otherwise the target method may fail with a   Online NullReferenceException. These
                are normally set by calling Proceed .
See Also
MethodImplementationAspect Class
MethodImplementationAspect Members
PostSharp.Aspects Namespace
PostSharp.Aspects MethodInterceptionArgs
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


MethodImplementationAspect Properties

MethodImplementationAspect Properties PostSharp Documentation
The MethodImplementationAspect type exposes the following members.
Properties
 | Name | Description
Public property | AspectPriority | Gets or sets the weaving priority of the aspect. (Inherited from Aspect.)
Public property | AttributeExclude | If true, indicates that this attribute removes all other instances of the same attribute type from the set of elements defined by the current instance. (Inherited from MulticastAttribute.)
Public property | AttributeId | Obsolete. (Inherited from MulticastAttribute.)
Public property | AttributeInheritance | Determines whether this attribute is inherited (Inherited from MulticastAttribute.)
Public property | AttributePriority | Gets or sets the priority of the current attribute in case that multiple instances are defined on the same element (lower values are processed before). (Inherited from MulticastAttribute.)
Public property | AttributeReplace | Determines whether this attribute replaces other attributes found on the target declarations. (Inherited from MulticastAttribute.)
Public property | AttributeTargetAssemblies | Gets or sets the assemblies to which the current attribute apply. (Inherited from MulticastAttribute.)
Public property | AttributeTargetElements | Gets or sets the kind of elements to which this custom attributes applies. (Inherited from MulticastAttribute.)
Public property | AttributeTargetExternalMemberAttributes | Gets or sets the visibilities, scopes, virtualities, and implementation of members to which this attribute applies, when the member is external to the current module. (Inherited from MulticastAttribute.)
Public property | AttributeTargetExternalTypeAttributes | Gets or sets the visibilities of types to which this attribute applies, when this type is external to the current module. (Inherited from MulticastAttribute.)
Public property | AttributeTargetMemberAttributes | Gets or sets the visibilities, scopes, virtualities, and implementation of members to which this attribute applies. (Inherited from MulticastAttribute.)
Public property | AttributeTargetMembers | Gets or sets the expression specifying to which members this instance applies. (Inherited from MulticastAttribute.)
Public property | AttributeTargetParameterAttributes | Gets or sets the passing style (by value, out or ref) of parameters to which this attribute applies. (Inherited from MulticastAttribute.)
Public property | AttributeTargetParameters | Gets or sets the expression specifying to which parameters this instance applies. (Inherited from MulticastAttribute.)
Public property | AttributeTargetTypeAttributes | Gets or sets the visibilities of types to which this attribute applies. (Inherited from MulticastAttribute.)
Public property | AttributeTargetTypes | Gets or sets the expression specifying to which types this instance applies. (Inherited from MulticastAttribute.)
Protected property | SerializerType | Gets or sets the Online Type of the serializer (a type derived from AspectSerializer) used to serialize the aspect instance at build time and deserialize it at runtime. (Inherited from Aspect.)
Back to Top
See Also
MethodImplementationAspect Class
PostSharp.Aspects Namespace

Online Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


MethodInterceptionArgs Class

MethodInterceptionArgs Class PostSharp Documentation
Arguments of advices of aspect type MethodInterceptionAspect.
Inheritance Hierarchy
Online System Object
PostSharp.Aspects AdviceArgs
PostSharp.Aspects MethodInterceptionArgs

Namespace: PostSharp.Aspects
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
public abstract class MethodInterceptionArgs : AdviceArgs
public abstract class MethodInterceptionArgs : AdviceArgs
Remarks
  Note  Note

      As a result of weaving optimizations, instances of classes derived from
      AdviceArgs
      may be shared among different aspects. Therefore,
      aspect code should not attempt to access this object once the control has been given over to the next node in the chain of invocation. Consider working
      with
      aspect bindings
      if you need such deferred execution.

See Also
MethodInterceptionArgs Members
PostSharp.Aspects Namespace

      Conceptual Documentation: Aspect Bindings

PostSharp.Aspects MethodInterceptionAspect
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


MethodInterceptionArgs Members

MethodInterceptionArgs Members PostSharp Documentation

The MethodInterceptionArgs type exposes the following members.
Methods
 | Name | Description
Public method | Invoke | Invokes the method that has been intercepted by calling the next node in the chain of invocation with given arguments, without affecting the property ReturnValue.
Public method | Proceed | Proceeds with invocation of the method that has been intercepted by calling the next node in the chain of invocation, passing the current Arguments to that method and storing its return value into the property ReturnValue.
Back to Top
Properties
 | Name | Description
Public property | Arguments | Gets the list of arguments with which the method has been invoked.
Public property | Binding | Gets an interface that allows to invoke the next node in the chain of invocation of the intercepted method.
Public property | Instance | Gets or sets the object instance on which the method is being executed. (Inherited from AdviceArgs.)
Public property | InstanceCredentials | Obsolete. (Inherited from AdviceArgs.)
Public property | Method | Gets the method being executed.
Public property | ReturnValue | Gets or sets the return value of the method.
Back to Top
See Also
MethodInterceptionArgs Class
PostSharp.Aspects Namespace

Online Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


MethodInterceptionArgs Methods

MethodInterceptionArgs Methods PostSharp Documentation
The MethodInterceptionArgs type exposes the following members.
Methods
 | Name | Description
Public method | Invoke | Invokes the method that has been intercepted by calling the next node in the chain of invocation with given arguments, without affecting the property ReturnValue.
Public method | Proceed | Proceeds with invocation of the method that has been intercepted by calling the next node in the chain of invocation, passing the current Arguments to that method and storing its return value into the property ReturnValue.
Back to Top
See Also
MethodInterceptionArgs Class
PostSharp.Aspects Namespace

Online Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


MethodInterceptionArgs.Invoke Method

MethodInterceptionArgs Invoke Method PostSharp Documentation
Invokes the method that has been intercepted by calling the next node in the chain of invocation with given arguments, without affecting the property ReturnValue.

Namespace: PostSharp.Aspects
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
public abstract Object Invoke(
    Arguments arguments
)
public abstract Object Invoke(
    Arguments arguments
)
Parameters
arguments
Type: PostSharp.Aspects Arguments
Arguments passed to the intercepted method.
Return Value
Type:   Online Object
Value returned by the intercepted method.
See Also
MethodInterceptionArgs Class
MethodInterceptionArgs Members
PostSharp.Aspects Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


MethodInterceptionArgs.Proceed Method

MethodInterceptionArgs Proceed Method PostSharp Documentation
Proceeds with invocation of the method that has been intercepted by calling the next node in the chain of invocation, passing the current Arguments to that method and storing its return value into the property ReturnValue.

Namespace: PostSharp.Aspects
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
public abstract void Proceed()
public abstract void Proceed()
See Also
MethodInterceptionArgs Class
MethodInterceptionArgs Members
PostSharp.Aspects Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


MethodInterceptionArgs Properties

MethodInterceptionArgs Properties PostSharp Documentation
The MethodInterceptionArgs type exposes the following members.
Properties
 | Name | Description
Public property | Arguments | Gets the list of arguments with which the method has been invoked.
Public property | Binding | Gets an interface that allows to invoke the next node in the chain of invocation of the intercepted method.
Public property | Instance | Gets or sets the object instance on which the method is being executed. (Inherited from AdviceArgs.)
Public property | InstanceCredentials | Obsolete. (Inherited from AdviceArgs.)
Public property | Method | Gets the method being executed.
Public property | ReturnValue | Gets or sets the return value of the method.
Back to Top
See Also
MethodInterceptionArgs Class
PostSharp.Aspects Namespace

Online Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


MethodInterceptionArgs.Arguments Property

MethodInterceptionArgs Arguments Property PostSharp Documentation
Gets the list of arguments with which the method has been invoked.

Namespace: PostSharp.Aspects
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
public Arguments Arguments { get; protected set; }
public Arguments Arguments { get; protected set; }
Property Value
Type: Arguments
See Also
MethodInterceptionArgs Class
MethodInterceptionArgs Members
PostSharp.Aspects Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


MethodInterceptionArgs.Binding Property

MethodInterceptionArgs Binding Property PostSharp Documentation
Gets an interface that allows to invoke the next node in the chain of invocation of the intercepted method.

Namespace: PostSharp.Aspects
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
public abstract IMethodBinding Binding { get; }
public abstract IMethodBinding Binding { get; }
Property Value
Type: IMethodBinding
Remarks

      Bindings are thread-safe and context-free singleton instances exposing the next node in the chain of invocation.

See Also
MethodInterceptionArgs Class
MethodInterceptionArgs Members
PostSharp.Aspects Namespace

      Conceptual Documentation: Aspect Bindings

  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


MethodInterceptionArgs.Method Property

MethodInterceptionArgs Method Property PostSharp Documentation
Gets the method being executed.

Namespace: PostSharp.Aspects
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
public MethodBase Method { get; set; }
public MethodBase Method { get; set; }
Property Value
Type:   Online MethodBase
Remarks
If the executed method is generic or if its declaring type is generic,
                the current property contains the generic instance being executed.
  Note  Note

                Using this property causes the aspect weaver to generate code that has non-trivial runtime overhead. Avoid using
                this property whenever possible. One of the possible solution is to use compile-time initialization of
                aspect instances and to make use of reflection only at build time. See CompileTimeInitialize(MethodBase, AspectInfo)
                for details.

See Also
MethodInterceptionArgs Class
MethodInterceptionArgs Members
PostSharp.Aspects Namespace
MethodLevelAspect CompileTimeInitialize(MethodBase, AspectInfo)
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


MethodInterceptionArgs.ReturnValue Property

MethodInterceptionArgs ReturnValue Property PostSharp Documentation
Gets or sets the return value of the method.

Namespace: PostSharp.Aspects
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
public abstract Object ReturnValue { get; set; }
public abstract Object ReturnValue { get; set; }
Property Value
Type:   Online Object
See Also
MethodInterceptionArgs Class
MethodInterceptionArgs Members
PostSharp.Aspects Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


MethodInterceptionAspect Class

MethodInterceptionAspect Class PostSharp Documentation
Aspect that, when applied on a method, intercepts invocations of this method.
Inheritance Hierarchy
Online System Object
Online System Attribute
PostSharp.Extensibility MulticastAttribute
PostSharp.Aspects Aspect
PostSharp.Aspects MethodLevelAspect
PostSharp.Aspects MethodInterceptionAspect
PostSharp.Patterns.Threading BackgroundAttribute

Namespace: PostSharp.Aspects
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
[SerializableAttribute]
public abstract class MethodInterceptionAspect : MethodLevelAspect,
    IMethodInterceptionAspect, IMethodLevelAspect, IAspect
[SerializableAttribute]
public abstract class MethodInterceptionAspect : MethodLevelAspect,
    IMethodInterceptionAspect, IMethodLevelAspect, IAspect
Remarks
Applying a MethodInterceptionAspect to a method results in the body of this method to be replaced by a call to the aspect OnInvoke(MethodInterceptionArgs) method of the current class.
            The original method body is moved into a new method, which can be called by the aspect by invoking the Proceed  method,
            or by using the object Binding.
For details about the implementation of this aspect, see Interception Aspects.

  Note  Note

        All classes implementing
        IAspect
        should typically be marked as serializable
        using the custom attribute
          Online SerializableAttribute
        . Fields that
        are only used at runtime (and unknown at compile-time) should be carefully
        marked with the custom attribute
          Online NonSerializedAttribute
        .
        When PostSharp is used on a platform that does not support aspect serialization
        (such as .NET Compact Framework, Silverlight, or Windows Phone), or when
        another aspect serializer is used, it is not necessary to mark the aspect
        class as serializable.
        For more information, see
        Aspect Serialization
        .

Examples
Example: Dispatching a Method Execution to the GUI Thread
See Also
MethodInterceptionAspect Members
PostSharp.Aspects Namespace
PostSharp.Aspects.Configuration MethodInterceptionAspectConfigurationAttribute

      Conceptual Documentation: Aspect Serialization

      Conceptual Documentation: Interception Aspects

  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


MethodInterceptionAspect Members

MethodInterceptionAspect Members PostSharp Documentation

The MethodInterceptionAspect type exposes the following members.
Constructors
 | Name | Description
Protected method | MethodInterceptionAspect | Initializes a new instance of the MethodInterceptionAspect class
Back to Top
Methods
 | Name | Description
Public method | CompileTimeInitialize | Method invoked at build time to initialize the instance fields of the current aspect. This method is invoked before any other build-time method. (Inherited from MethodLevelAspect.)
Public method | CompileTimeValidate | Method invoked at build time to ensure that the aspect has been applied to the right target. (Inherited from Aspect.)
Protected method | CreateAspectConfiguration | Method invoked at build time to create a concrete AspectConfiguration instance specifically for the current Aspect type. (Overrides Aspect CreateAspectConfiguration .)
Public method | GetAspectConfiguration | Method invoked at build tome to get the imperative configuration of the current Aspect. (Inherited from Aspect.)
Public method | OnInvoke | Method invoked instead of the method to which the aspect has been applied.
Public method | RuntimeInitialize | Initializes the current aspect. (Inherited from MethodLevelAspect.)
Protected method | SetAspectConfiguration | Method invoked at build time to set up an AspectConfiguration object according to the current Aspect instance and a specified target element of the current aspect. (Inherited from Aspect.)
Back to Top
Properties
 | Name | Description
Public property | AspectPriority | Gets or sets the weaving priority of the aspect. (Inherited from Aspect.)
Public property | AttributeExclude | If true, indicates that this attribute removes all other instances of the same attribute type from the set of elements defined by the current instance. (Inherited from MulticastAttribute.)
Public property | AttributeId | Obsolete. (Inherited from MulticastAttribute.)
Public property | AttributeInheritance | Determines whether this attribute is inherited (Inherited from MulticastAttribute.)
Public property | AttributePriority | Gets or sets the priority of the current attribute in case that multiple instances are defined on the same element (lower values are processed before). (Inherited from MulticastAttribute.)
Public property | AttributeReplace | Determines whether this attribute replaces other attributes found on the target declarations. (Inherited from MulticastAttribute.)
Public property | AttributeTargetAssemblies | Gets or sets the assemblies to which the current attribute apply. (Inherited from MulticastAttribute.)
Public property | AttributeTargetElements | Gets or sets the kind of elements to which this custom attributes applies. (Inherited from MulticastAttribute.)
Public property | AttributeTargetExternalMemberAttributes | Gets or sets the visibilities, scopes, virtualities, and implementation of members to which this attribute applies, when the member is external to the current module. (Inherited from MulticastAttribute.)
Public property | AttributeTargetExternalTypeAttributes | Gets or sets the visibilities of types to which this attribute applies, when this type is external to the current module. (Inherited from MulticastAttribute.)
Public property | AttributeTargetMemberAttributes | Gets or sets the visibilities, scopes, virtualities, and implementation of members to which this attribute applies. (Inherited from MulticastAttribute.)
Public property | AttributeTargetMembers | Gets or sets the expression specifying to which members this instance applies. (Inherited from MulticastAttribute.)
Public property | AttributeTargetParameterAttributes | Gets or sets the passing style (by value, out or ref) of parameters to which this attribute applies. (Inherited from MulticastAttribute.)
Public property | AttributeTargetParameters | Gets or sets the expression specifying to which parameters this instance applies. (Inherited from MulticastAttribute.)
Public property | AttributeTargetTypeAttributes | Gets or sets the visibilities of types to which this attribute applies. (Inherited from MulticastAttribute.)
Public property | AttributeTargetTypes | Gets or sets the expression specifying to which types this instance applies. (Inherited from MulticastAttribute.)
Protected property | SerializerType | Gets or sets the Online Type of the serializer (a type derived from AspectSerializer) used to serialize the aspect instance at build time and deserialize it at runtime. (Inherited from Aspect.)
Back to Top
See Also
MethodInterceptionAspect Class
PostSharp.Aspects Namespace

Online Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


MethodInterceptionAspect Constructor

MethodInterceptionAspect Constructor PostSharp Documentation
Initializes a new instance of the MethodInterceptionAspect class

Namespace: PostSharp.Aspects
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
protected MethodInterceptionAspect()
protected MethodInterceptionAspect()
See Also
MethodInterceptionAspect Class
MethodInterceptionAspect Members
PostSharp.Aspects Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


MethodInterceptionAspect Methods

MethodInterceptionAspect Methods PostSharp Documentation
The MethodInterceptionAspect type exposes the following members.
Methods
 | Name | Description
Public method | CompileTimeInitialize | Method invoked at build time to initialize the instance fields of the current aspect. This method is invoked before any other build-time method. (Inherited from MethodLevelAspect.)
Public method | CompileTimeValidate | Method invoked at build time to ensure that the aspect has been applied to the right target. (Inherited from Aspect.)
Protected method | CreateAspectConfiguration | Method invoked at build time to create a concrete AspectConfiguration instance specifically for the current Aspect type. (Overrides Aspect CreateAspectConfiguration .)
Public method | GetAspectConfiguration | Method invoked at build tome to get the imperative configuration of the current Aspect. (Inherited from Aspect.)
Public method | OnInvoke | Method invoked instead of the method to which the aspect has been applied.
Public method | RuntimeInitialize | Initializes the current aspect. (Inherited from MethodLevelAspect.)
Protected method | SetAspectConfiguration | Method invoked at build time to set up an AspectConfiguration object according to the current Aspect instance and a specified target element of the current aspect. (Inherited from Aspect.)
Back to Top
See Also
MethodInterceptionAspect Class
PostSharp.Aspects Namespace

Online Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


MethodInterceptionAspect.CreateAspectConfiguration Method

MethodInterceptionAspect CreateAspectConfiguration Method PostSharp Documentation
Method invoked at build time to create a concrete AspectConfiguration instance specifically for the current Aspect type.

Namespace: PostSharp.Aspects
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
protected override AspectConfiguration CreateAspectConfiguration()
protected override AspectConfiguration CreateAspectConfiguration()
Return Value
Type: AspectConfiguration
A new and empty instance of AspectConfiguration, whose concrete type corresponds to
              the concrete type of the Aspect.
Remarks

              This method should not set up the returned AspectConfiguration. After the current method has
              returned, the SetAspectConfiguration(AspectConfiguration, Object) method will be invoked, and this method is responsible
              for setting up the AspectConfigurationobject.

See Also
MethodInterceptionAspect Class
MethodInterceptionAspect Members
PostSharp.Aspects Namespace

      Conceptual Documentation: Configuring Aspects

  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


MethodInterceptionAspect.OnInvoke Method

MethodInterceptionAspect OnInvoke Method PostSharp Documentation
Method invoked instead of the method to which the aspect has been applied.

Namespace: PostSharp.Aspects
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
public virtual void OnInvoke(
    MethodInterceptionArgs args
)
public virtual void OnInvoke(
    MethodInterceptionArgs args
)
Parameters
args
Type: PostSharp.Aspects MethodInterceptionArgs
Advice arguments.
Implements
IMethodInterceptionAspect OnInvoke(MethodInterceptionArgs)
Remarks
The implementation of OnInvoke(MethodInterceptionArgs) may invoke Proceed , may schedule it for invocation from another thread, or
                may completely skip its invocation. Alternatively, it may use Binding. Before returning to the caller, the OnInvoke(MethodInterceptionArgs) method must set the return value (property ReturnValue)
                and all output arguments (property Arguments), otherwise the target method may fail with a   Online NullReferenceException. These
                are normally set by calling Proceed .
See Also
MethodInterceptionAspect Class
MethodInterceptionAspect Members
PostSharp.Aspects Namespace
PostSharp.Aspects MethodInterceptionArgs
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


MethodInterceptionAspect Properties

MethodInterceptionAspect Properties PostSharp Documentation
The MethodInterceptionAspect type exposes the following members.
Properties
 | Name | Description
Public property | AspectPriority | Gets or sets the weaving priority of the aspect. (Inherited from Aspect.)
Public property | AttributeExclude | If true, indicates that this attribute removes all other instances of the same attribute type from the set of elements defined by the current instance. (Inherited from MulticastAttribute.)
Public property | AttributeId | Obsolete. (Inherited from MulticastAttribute.)
Public property | AttributeInheritance | Determines whether this attribute is inherited (Inherited from MulticastAttribute.)
Public property | AttributePriority | Gets or sets the priority of the current attribute in case that multiple instances are defined on the same element (lower values are processed before). (Inherited from MulticastAttribute.)
Public property | AttributeReplace | Determines whether this attribute replaces other attributes found on the target declarations. (Inherited from MulticastAttribute.)
Public property | AttributeTargetAssemblies | Gets or sets the assemblies to which the current attribute apply. (Inherited from MulticastAttribute.)
Public property | AttributeTargetElements | Gets or sets the kind of elements to which this custom attributes applies. (Inherited from MulticastAttribute.)
Public property | AttributeTargetExternalMemberAttributes | Gets or sets the visibilities, scopes, virtualities, and implementation of members to which this attribute applies, when the member is external to the current module. (Inherited from MulticastAttribute.)
Public property | AttributeTargetExternalTypeAttributes | Gets or sets the visibilities of types to which this attribute applies, when this type is external to the current module. (Inherited from MulticastAttribute.)
Public property | AttributeTargetMemberAttributes | Gets or sets the visibilities, scopes, virtualities, and implementation of members to which this attribute applies. (Inherited from MulticastAttribute.)
Public property | AttributeTargetMembers | Gets or sets the expression specifying to which members this instance applies. (Inherited from MulticastAttribute.)
Public property | AttributeTargetParameterAttributes | Gets or sets the passing style (by value, out or ref) of parameters to which this attribute applies. (Inherited from MulticastAttribute.)
Public property | AttributeTargetParameters | Gets or sets the expression specifying to which parameters this instance applies. (Inherited from MulticastAttribute.)
Public property | AttributeTargetTypeAttributes | Gets or sets the visibilities of types to which this attribute applies. (Inherited from MulticastAttribute.)
Public property | AttributeTargetTypes | Gets or sets the expression specifying to which types this instance applies. (Inherited from MulticastAttribute.)
Protected property | SerializerType | Gets or sets the Online Type of the serializer (a type derived from AspectSerializer) used to serialize the aspect instance at build time and deserialize it at runtime. (Inherited from Aspect.)
Back to Top
See Also
MethodInterceptionAspect Class
PostSharp.Aspects Namespace

Online Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


MethodLevelAspect Class

MethodLevelAspect Class PostSharp Documentation
Base class for all aspects applied on methods.
Inheritance Hierarchy
Online System Object
Online System Attribute
PostSharp.Extensibility MulticastAttribute
PostSharp.Aspects Aspect
PostSharp.Aspects MethodLevelAspect
PostSharp.Aspects MethodImplementationAspect
PostSharp.Aspects MethodInterceptionAspect
PostSharp.Aspects OnExceptionAspect
PostSharp.Aspects OnMethodBoundaryAspect
PostSharp.Patterns.Diagnostics LogAttributeBase
PostSharp.Patterns.Threading DispatchedAttribute

Namespace: PostSharp.Aspects
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
[SerializableAttribute]
public abstract class MethodLevelAspect : Aspect,
    IMethodLevelAspect, IAspect, IMethodLevelAspectBuildSemantics, IAspectBuildSemantics, IValidableAnnotation
[SerializableAttribute]
public abstract class MethodLevelAspect : Aspect,
    IMethodLevelAspect, IAspect, IMethodLevelAspectBuildSemantics, IAspectBuildSemantics, IValidableAnnotation
Remarks
  Note  Note

      This class does not provide any advice. You may derive your aspect class from a

        class providing
        predefined advice

      , or build a
      composite aspect
      .

  Note  Note

        All classes implementing
        IAspect
        should typically be marked as serializable
        using the custom attribute
          Online SerializableAttribute
        . Fields that
        are only used at runtime (and unknown at compile-time) should be carefully
        marked with the custom attribute
          Online NonSerializedAttribute
        .
        When PostSharp is used on a platform that does not support aspect serialization
        (such as .NET Compact Framework, Silverlight, or Windows Phone), or when
        another aspect serializer is used, it is not necessary to mark the aspect
        class as serializable.
        For more information, see
        Aspect Serialization
        .

See Also
MethodLevelAspect Members
PostSharp.Aspects Namespace
PostSharp.Aspects IMethodLevelAspect

      Conceptual Documentation: Aspect Classes

      Conceptual Documentation: Developing Complex Aspects

      Conceptual Documentation: Aspect Serialization

  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


MethodLevelAspect Members

MethodLevelAspect Members PostSharp Documentation

The MethodLevelAspect type exposes the following members.
Constructors
 | Name | Description
Protected method | MethodLevelAspect | Initializes a new instance of the MethodLevelAspect class
Back to Top
Methods
 | Name | Description
Public method | CompileTimeInitialize | Method invoked at build time to initialize the instance fields of the current aspect. This method is invoked before any other build-time method.
Public method | CompileTimeValidate | Method invoked at build time to ensure that the aspect has been applied to the right target. (Inherited from Aspect.)
Protected method | CreateAspectConfiguration | Method invoked at build time to create a concrete AspectConfiguration instance specifically for the current Aspect type. (Inherited from Aspect.)
Public method | GetAspectConfiguration | Method invoked at build tome to get the imperative configuration of the current Aspect. (Inherited from Aspect.)
Public method | RuntimeInitialize | Initializes the current aspect.
Protected method | SetAspectConfiguration | Method invoked at build time to set up an AspectConfiguration object according to the current Aspect instance and a specified target element of the current aspect. (Inherited from Aspect.)
Back to Top
Properties
 | Name | Description
Public property | AspectPriority | Gets or sets the weaving priority of the aspect. (Inherited from Aspect.)
Public property | AttributeExclude | If true, indicates that this attribute removes all other instances of the same attribute type from the set of elements defined by the current instance. (Inherited from MulticastAttribute.)
Public property | AttributeId | Obsolete. (Inherited from MulticastAttribute.)
Public property | AttributeInheritance | Determines whether this attribute is inherited (Inherited from MulticastAttribute.)
Public property | AttributePriority | Gets or sets the priority of the current attribute in case that multiple instances are defined on the same element (lower values are processed before). (Inherited from MulticastAttribute.)
Public property | AttributeReplace | Determines whether this attribute replaces other attributes found on the target declarations. (Inherited from MulticastAttribute.)
Public property | AttributeTargetAssemblies | Gets or sets the assemblies to which the current attribute apply. (Inherited from MulticastAttribute.)
Public property | AttributeTargetElements | Gets or sets the kind of elements to which this custom attributes applies. (Inherited from MulticastAttribute.)
Public property | AttributeTargetExternalMemberAttributes | Gets or sets the visibilities, scopes, virtualities, and implementation of members to which this attribute applies, when the member is external to the current module. (Inherited from MulticastAttribute.)
Public property | AttributeTargetExternalTypeAttributes | Gets or sets the visibilities of types to which this attribute applies, when this type is external to the current module. (Inherited from MulticastAttribute.)
Public property | AttributeTargetMemberAttributes | Gets or sets the visibilities, scopes, virtualities, and implementation of members to which this attribute applies. (Inherited from MulticastAttribute.)
Public property | AttributeTargetMembers | Gets or sets the expression specifying to which members this instance applies. (Inherited from MulticastAttribute.)
Public property | AttributeTargetParameterAttributes | Gets or sets the passing style (by value, out or ref) of parameters to which this attribute applies. (Inherited from MulticastAttribute.)
Public property | AttributeTargetParameters | Gets or sets the expression specifying to which parameters this instance applies. (Inherited from MulticastAttribute.)
Public property | AttributeTargetTypeAttributes | Gets or sets the visibilities of types to which this attribute applies. (Inherited from MulticastAttribute.)
Public property | AttributeTargetTypes | Gets or sets the expression specifying to which types this instance applies. (Inherited from MulticastAttribute.)
Protected property | SerializerType | Gets or sets the Online Type of the serializer (a type derived from AspectSerializer) used to serialize the aspect instance at build time and deserialize it at runtime. (Inherited from Aspect.)
Back to Top
See Also
MethodLevelAspect Class
PostSharp.Aspects Namespace

Online Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


MethodLevelAspect Constructor

MethodLevelAspect Constructor PostSharp Documentation
Initializes a new instance of the MethodLevelAspect class

Namespace: PostSharp.Aspects
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
protected MethodLevelAspect()
protected MethodLevelAspect()
See Also
MethodLevelAspect Class
MethodLevelAspect Members
PostSharp.Aspects Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


MethodLevelAspect Methods

MethodLevelAspect Methods PostSharp Documentation
The MethodLevelAspect type exposes the following members.
Methods
 | Name | Description
Public method | CompileTimeInitialize | Method invoked at build time to initialize the instance fields of the current aspect. This method is invoked before any other build-time method.
Public method | CompileTimeValidate | Method invoked at build time to ensure that the aspect has been applied to the right target. (Inherited from Aspect.)
Protected method | CreateAspectConfiguration | Method invoked at build time to create a concrete AspectConfiguration instance specifically for the current Aspect type. (Inherited from Aspect.)
Public method | GetAspectConfiguration | Method invoked at build tome to get the imperative configuration of the current Aspect. (Inherited from Aspect.)
Public method | RuntimeInitialize | Initializes the current aspect.
Protected method | SetAspectConfiguration | Method invoked at build time to set up an AspectConfiguration object according to the current Aspect instance and a specified target element of the current aspect. (Inherited from Aspect.)
Back to Top
See Also
MethodLevelAspect Class
PostSharp.Aspects Namespace

Online Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


MethodLevelAspect.CompileTimeInitialize Method

MethodLevelAspect CompileTimeInitialize Method PostSharp Documentation
Method invoked at build time to initialize the instance fields of the current aspect. This method is invoked before any other build-time method.

Namespace: PostSharp.Aspects
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
public virtual void CompileTimeInitialize(
    MethodBase method,
    AspectInfo aspectInfo
)
public virtual void CompileTimeInitialize(
    MethodBase method,
    AspectInfo aspectInfo
)
Parameters
method
Type:   Online System.Reflection MethodBase
Method to which the current aspect is applied
aspectInfo
Type: PostSharp.Aspects AspectInfo
Reserved for future usage.
Implements
IMethodLevelAspectBuildSemantics CompileTimeInitialize(MethodBase, AspectInfo)
See Also
MethodLevelAspect Class
MethodLevelAspect Members
PostSharp.Aspects Namespace

      Conceptual Documentation: Initializing Aspects

  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


MethodLevelAspect.RuntimeInitialize Method

MethodLevelAspect RuntimeInitialize Method PostSharp Documentation
Initializes the current aspect.

Namespace: PostSharp.Aspects
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
public virtual void RuntimeInitialize(
    MethodBase method
)
public virtual void RuntimeInitialize(
    MethodBase method
)
Parameters
method
Type:   Online System.Reflection MethodBase
Method to which the current aspect is applied.
Implements
IMethodLevelAspect RuntimeInitialize(MethodBase)
See Also
MethodLevelAspect Class
MethodLevelAspect Members
PostSharp.Aspects Namespace

      Conceptual Documentation: Initializing Aspects

  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


MethodLevelAspect Properties

MethodLevelAspect Properties PostSharp Documentation
The MethodLevelAspect type exposes the following members.
Properties
 | Name | Description
Public property | AspectPriority | Gets or sets the weaving priority of the aspect. (Inherited from Aspect.)
Public property | AttributeExclude | If true, indicates that this attribute removes all other instances of the same attribute type from the set of elements defined by the current instance. (Inherited from MulticastAttribute.)
Public property | AttributeId | Obsolete. (Inherited from MulticastAttribute.)
Public property | AttributeInheritance | Determines whether this attribute is inherited (Inherited from MulticastAttribute.)
Public property | AttributePriority | Gets or sets the priority of the current attribute in case that multiple instances are defined on the same element (lower values are processed before). (Inherited from MulticastAttribute.)
Public property | AttributeReplace | Determines whether this attribute replaces other attributes found on the target declarations. (Inherited from MulticastAttribute.)
Public property | AttributeTargetAssemblies | Gets or sets the assemblies to which the current attribute apply. (Inherited from MulticastAttribute.)
Public property | AttributeTargetElements | Gets or sets the kind of elements to which this custom attributes applies. (Inherited from MulticastAttribute.)
Public property | AttributeTargetExternalMemberAttributes | Gets or sets the visibilities, scopes, virtualities, and implementation of members to which this attribute applies, when the member is external to the current module. (Inherited from MulticastAttribute.)
Public property | AttributeTargetExternalTypeAttributes | Gets or sets the visibilities of types to which this attribute applies, when this type is external to the current module. (Inherited from MulticastAttribute.)
Public property | AttributeTargetMemberAttributes | Gets or sets the visibilities, scopes, virtualities, and implementation of members to which this attribute applies. (Inherited from MulticastAttribute.)
Public property | AttributeTargetMembers | Gets or sets the expression specifying to which members this instance applies. (Inherited from MulticastAttribute.)
Public property | AttributeTargetParameterAttributes | Gets or sets the passing style (by value, out or ref) of parameters to which this attribute applies. (Inherited from MulticastAttribute.)
Public property | AttributeTargetParameters | Gets or sets the expression specifying to which parameters this instance applies. (Inherited from MulticastAttribute.)
Public property | AttributeTargetTypeAttributes | Gets or sets the visibilities of types to which this attribute applies. (Inherited from MulticastAttribute.)
Public property | AttributeTargetTypes | Gets or sets the expression specifying to which types this instance applies. (Inherited from MulticastAttribute.)
Protected property | SerializerType | Gets or sets the Online Type of the serializer (a type derived from AspectSerializer) used to serialize the aspect instance at build time and deserialize it at runtime. (Inherited from Aspect.)
Back to Top
See Also
MethodLevelAspect Class
PostSharp.Aspects Namespace

Online Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


OnExceptionAspect Class

OnExceptionAspect Class PostSharp Documentation
Aspect that, when applied to a method, defines an exception handler around the whole method and calls a custom method in this exception handler.
Inheritance Hierarchy
Online System Object
Online System Attribute
PostSharp.Extensibility MulticastAttribute
PostSharp.Aspects Aspect
PostSharp.Aspects MethodLevelAspect
PostSharp.Aspects OnExceptionAspect

Namespace: PostSharp.Aspects
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
[SerializableAttribute]
public abstract class OnExceptionAspect : MethodLevelAspect,
    IOnExceptionAspect, IMethodLevelAspect, IAspect
[SerializableAttribute]
public abstract class OnExceptionAspect : MethodLevelAspect,
    IOnExceptionAspect, IMethodLevelAspect, IAspect
Remarks

            The OnExceptionAspect aspect adds an exception handler to the method to which it is applied.
            It allows you to easily encapsulate exception handling policies as a custom attribute.
The most important method is OnException(MethodExecutionArgs). It is the exception handler in itself.
 The current exception is available from the Exception property of the MethodExecutionArgs>
            object. This property is read-only. If you need to  replace the current exception by another one, you should throw a new exception
            from the handler. If you need to ignore the exception, set the FlowBehavior property to
            Continue.

      An object of type
      MethodExecutionArgs
      is passed to every advice of this aspect. This object allows you to:

  • Get or set arguments
        .
        Input and output arguments are available on the property
        Arguments
        . You can change output (
        out
        ) and by-reference (
        ref
        )
        arguments, but not input arguments. If you need to modify arguments passed by value, consider using a
        MethodInterceptionAspect
        .
        (see property );

  •
          Get the current exception

        .
        The current exception is available on property
        Exception
        , but from the
        OnException(MethodExecutionArgs)
        advice.
        You cannot replace the exception by setting this property. Throw a new exception from the aspect if you need to replace the current exception.

  •
          Get or set the return value

        . The return value is available on the
        ReturnValue
        property.

  •
          Change the method control flow

        . You can change the value of the
        FlowBehavior
        property to specify
        whether the target method should execute after the execution of the current advice. This may be useful to implement a caching aspect or an exception handler.

  •
          Share state between advices

        . You can use the
        MethodExecutionTag
        property to store state between the execution of
        different advices related to the same execution of a method. For instance, you can store a cache key in
        OnEntry(MethodExecutionArgs)
        and find it back on
        OnSuccess(MethodExecutionArgs)
        . Using
        MethodExecutionTag
        is the only way to share state that is both thread-safe and reentrant. All other implementations are buggy.

  Note  Note

        All classes implementing
        IAspect
        should typically be marked as serializable
        using the custom attribute
          Online SerializableAttribute
        . Fields that
        are only used at runtime (and unknown at compile-time) should be carefully
        marked with the custom attribute
          Online NonSerializedAttribute
        .
        When PostSharp is used on a platform that does not support aspect serialization
        (such as .NET Compact Framework, Silverlight, or Windows Phone), or when
        another aspect serializer is used, it is not necessary to mark the aspect
        class as serializable.
        For more information, see
        Aspect Serialization
        .

Examples
Example: Handling Exceptions
See Also
OnExceptionAspect Members
PostSharp.Aspects Namespace
PostSharp.Aspects.Configuration OnExceptionAspectConfigurationAttribute

      Conceptual Documentation: Aspect Serialization

  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


OnExceptionAspect Members

OnExceptionAspect Members PostSharp Documentation

The OnExceptionAspect type exposes the following members.
Constructors
 | Name | Description
Protected method | OnExceptionAspect | Initializes a new instance of the OnExceptionAspect class
Back to Top
Methods
 | Name | Description
Public method | CompileTimeInitialize | Method invoked at build time to initialize the instance fields of the current aspect. This method is invoked before any other build-time method. (Inherited from MethodLevelAspect.)
Public method | CompileTimeValidate | Method invoked at build time to ensure that the aspect has been applied to the right target. (Inherited from Aspect.)
Protected method | CreateAspectConfiguration | Method invoked at build time to create a concrete AspectConfiguration instance specifically for the current Aspect type. (Overrides Aspect CreateAspectConfiguration .)
Public method | GetAspectConfiguration | Method invoked at build tome to get the imperative configuration of the current Aspect. (Inherited from Aspect.)
Public method | GetExceptionType | Gets the type of exception handled by this aspect.
Public method | OnException | Method executed after the body of methods to which this aspect is applied, in case that the method resulted with an exception (i.e., in a catch block).
Public method | RuntimeInitialize | Initializes the current aspect. (Inherited from MethodLevelAspect.)
Protected method | SetAspectConfiguration(AspectConfiguration, Object) | Method invoked at build time to set up an AspectConfiguration object according to the current Aspect instance and a specified target element of the current aspect. (Inherited from Aspect.)
Protected method | SetAspectConfiguration(AspectConfiguration, MethodBase) | Method invoked at build time to set up an AspectConfiguration object according to the current Aspect instance and a specified target element of the current aspect. (Overrides MethodLevelAspectSetAspectConfiguration(AspectConfiguration, MethodBase).)
Back to Top
Properties
 | Name | Description
Public property | AspectPriority | Gets or sets the weaving priority of the aspect. (Inherited from Aspect.)
Public property | AttributeExclude | If true, indicates that this attribute removes all other instances of the same attribute type from the set of elements defined by the current instance. (Inherited from MulticastAttribute.)
Public property | AttributeId | Obsolete. (Inherited from MulticastAttribute.)
Public property | AttributeInheritance | Determines whether this attribute is inherited (Inherited from MulticastAttribute.)
Public property | AttributePriority | Gets or sets the priority of the current attribute in case that multiple instances are defined on the same element (lower values are processed before). (Inherited from MulticastAttribute.)
Public property | AttributeReplace | Determines whether this attribute replaces other attributes found on the target declarations. (Inherited from MulticastAttribute.)
Public property | AttributeTargetAssemblies | Gets or sets the assemblies to which the current attribute apply. (Inherited from MulticastAttribute.)
Public property | AttributeTargetElements | Gets or sets the kind of elements to which this custom attributes applies. (Inherited from MulticastAttribute.)
Public property | AttributeTargetExternalMemberAttributes | Gets or sets the visibilities, scopes, virtualities, and implementation of members to which this attribute applies, when the member is external to the current module. (Inherited from MulticastAttribute.)
Public property | AttributeTargetExternalTypeAttributes | Gets or sets the visibilities of types to which this attribute applies, when this type is external to the current module. (Inherited from MulticastAttribute.)
Public property | AttributeTargetMemberAttributes | Gets or sets the visibilities, scopes, virtualities, and implementation of members to which this attribute applies. (Inherited from MulticastAttribute.)
Public property | AttributeTargetMembers | Gets or sets the expression specifying to which members this instance applies. (Inherited from MulticastAttribute.)
Public property | AttributeTargetParameterAttributes | Gets or sets the passing style (by value, out or ref) of parameters to which this attribute applies. (Inherited from MulticastAttribute.)
Public property | AttributeTargetParameters | Gets or sets the expression specifying to which parameters this instance applies. (Inherited from MulticastAttribute.)
Public property | AttributeTargetTypeAttributes | Gets or sets the visibilities of types to which this attribute applies. (Inherited from MulticastAttribute.)
Public property | AttributeTargetTypes | Gets or sets the expression specifying to which types this instance applies. (Inherited from MulticastAttribute.)
Protected property | SerializerType | Gets or sets the Online Type of the serializer (a type derived from AspectSerializer) used to serialize the aspect instance at build time and deserialize it at runtime. (Inherited from Aspect.)
Back to Top
See Also
OnExceptionAspect Class
PostSharp.Aspects Namespace

Online Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


OnExceptionAspect Constructor

OnExceptionAspect Constructor PostSharp Documentation
Initializes a new instance of the OnExceptionAspect class

Namespace: PostSharp.Aspects
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
protected OnExceptionAspect()
protected OnExceptionAspect()
See Also
OnExceptionAspect Class
OnExceptionAspect Members
PostSharp.Aspects Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


OnExceptionAspect Methods

OnExceptionAspect Methods PostSharp Documentation
The OnExceptionAspect type exposes the following members.
Methods
 | Name | Description
Public method | CompileTimeInitialize | Method invoked at build time to initialize the instance fields of the current aspect. This method is invoked before any other build-time method. (Inherited from MethodLevelAspect.)
Public method | CompileTimeValidate | Method invoked at build time to ensure that the aspect has been applied to the right target. (Inherited from Aspect.)
Protected method | CreateAspectConfiguration | Method invoked at build time to create a concrete AspectConfiguration instance specifically for the current Aspect type. (Overrides Aspect CreateAspectConfiguration .)
Public method | GetAspectConfiguration | Method invoked at build tome to get the imperative configuration of the current Aspect. (Inherited from Aspect.)
Public method | GetExceptionType | Gets the type of exception handled by this aspect.
Public method | OnException | Method executed after the body of methods to which this aspect is applied, in case that the method resulted with an exception (i.e., in a catch block).
Public method | RuntimeInitialize | Initializes the current aspect. (Inherited from MethodLevelAspect.)
Protected method | SetAspectConfiguration(AspectConfiguration, Object) | Method invoked at build time to set up an AspectConfiguration object according to the current Aspect instance and a specified target element of the current aspect. (Inherited from Aspect.)
Protected method | SetAspectConfiguration(AspectConfiguration, MethodBase) | Method invoked at build time to set up an AspectConfiguration object according to the current Aspect instance and a specified target element of the current aspect. (Overrides MethodLevelAspectSetAspectConfiguration(AspectConfiguration, MethodBase).)
Back to Top
See Also
OnExceptionAspect Class
PostSharp.Aspects Namespace

Online Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


OnExceptionAspect.CreateAspectConfiguration Method

OnExceptionAspect CreateAspectConfiguration Method PostSharp Documentation
Method invoked at build time to create a concrete AspectConfiguration instance specifically for the current Aspect type.

Namespace: PostSharp.Aspects
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
protected override sealed AspectConfiguration CreateAspectConfiguration()
protected override sealed AspectConfiguration CreateAspectConfiguration()
Return Value
Type: AspectConfiguration
A new and empty instance of AspectConfiguration, whose concrete type corresponds to
              the concrete type of the Aspect.
Remarks

              This method should not set up the returned AspectConfiguration. After the current method has
              returned, the SetAspectConfiguration(AspectConfiguration, Object) method will be invoked, and this method is responsible
              for setting up the AspectConfigurationobject.

See Also
OnExceptionAspect Class
OnExceptionAspect Members
PostSharp.Aspects Namespace

      Conceptual Documentation: Configuring Aspects

  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


OnExceptionAspect.GetExceptionType Method

OnExceptionAspect GetExceptionType Method PostSharp Documentation
Gets the type of exception handled by this aspect.

Namespace: PostSharp.Aspects
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
public virtual Type GetExceptionType(
    MethodBase targetMethod
)
public virtual Type GetExceptionType(
    MethodBase targetMethod
)
Parameters
targetMethod
Type:   Online System.Reflection MethodBase
Method to which the current aspect is applied.
Return Value
Type:   Online Type
The type (derived from   Online Exception) of exceptions handled
              by this aspect.
See Also
OnExceptionAspect Class
OnExceptionAspect Members
PostSharp.Aspects Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


OnExceptionAspect.OnException Method

OnExceptionAspect OnException Method PostSharp Documentation
Method executed after the body of methods to which this aspect is applied, in case that the method resulted with an exception (i.e., in a catch block).

Namespace: PostSharp.Aspects
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
public virtual void OnException(
    MethodExecutionArgs args
)
public virtual void OnException(
    MethodExecutionArgs args
)
Parameters
args
Type: PostSharp.Aspects MethodExecutionArgs
Advice arguments.
Implements
IOnExceptionAspect OnException(MethodExecutionArgs)
See Also
OnExceptionAspect Class
OnExceptionAspect Members
PostSharp.Aspects Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


OnExceptionAspect.SetAspectConfiguration Method

OnExceptionAspect SetAspectConfiguration Method PostSharp Documentation
Overload List
 | Name | Description
Protected method | SetAspectConfiguration(AspectConfiguration, Object) | Method invoked at build time to set up an AspectConfiguration object according to the current Aspect instance and a specified target element of the current aspect. (Inherited from Aspect.)
Protected method | SetAspectConfiguration(AspectConfiguration, MethodBase) | Method invoked at build time to set up an AspectConfiguration object according to the current Aspect instance and a specified target element of the current aspect. (Overrides MethodLevelAspectSetAspectConfiguration(AspectConfiguration, MethodBase).)
Back to Top
See Also
OnExceptionAspect Class
OnExceptionAspect Members
PostSharp.Aspects Namespace

Online Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


OnExceptionAspect.SetAspectConfiguration Method (AspectConfiguration, MethodBase)

OnExceptionAspect SetAspectConfiguration Method (AspectConfiguration, MethodBase) PostSharp Documentation
Method invoked at build time to set up an AspectConfiguration object according to the current Aspect instance and a specified target element of the current aspect.

Namespace: PostSharp.Aspects
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
protected override void SetAspectConfiguration(
    AspectConfiguration aspectConfiguration,
    MethodBase targetMethod
)
protected override void SetAspectConfiguration(
    AspectConfiguration aspectConfiguration,
    MethodBase targetMethod
)
Parameters
aspectConfiguration
Type: PostSharp.Aspects.Configuration AspectConfiguration
The AspectConfiguration instance previously returned  by the
              CreateAspectConfiguration  method.
targetMethod
Type:   Online System.Reflection MethodBase
Method to which the current aspect has been applied.
Remarks
Classes overriding this method must always invoke the base implementation before performing their own
                changes to the
                AspectConfiguration.
See Also
OnExceptionAspect Class
OnExceptionAspect Members
SetAspectConfiguration Overload
PostSharp.Aspects Namespace

      Conceptual Documentation: Configuring Aspects

  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


OnExceptionAspect Properties

OnExceptionAspect Properties PostSharp Documentation
The OnExceptionAspect type exposes the following members.
Properties
 | Name | Description
Public property | AspectPriority | Gets or sets the weaving priority of the aspect. (Inherited from Aspect.)
Public property | AttributeExclude | If true, indicates that this attribute removes all other instances of the same attribute type from the set of elements defined by the current instance. (Inherited from MulticastAttribute.)
Public property | AttributeId | Obsolete. (Inherited from MulticastAttribute.)
Public property | AttributeInheritance | Determines whether this attribute is inherited (Inherited from MulticastAttribute.)
Public property | AttributePriority | Gets or sets the priority of the current attribute in case that multiple instances are defined on the same element (lower values are processed before). (Inherited from MulticastAttribute.)
Public property | AttributeReplace | Determines whether this attribute replaces other attributes found on the target declarations. (Inherited from MulticastAttribute.)
Public property | AttributeTargetAssemblies | Gets or sets the assemblies to which the current attribute apply. (Inherited from MulticastAttribute.)
Public property | AttributeTargetElements | Gets or sets the kind of elements to which this custom attributes applies. (Inherited from MulticastAttribute.)
Public property | AttributeTargetExternalMemberAttributes | Gets or sets the visibilities, scopes, virtualities, and implementation of members to which this attribute applies, when the member is external to the current module. (Inherited from MulticastAttribute.)
Public property | AttributeTargetExternalTypeAttributes | Gets or sets the visibilities of types to which this attribute applies, when this type is external to the current module. (Inherited from MulticastAttribute.)
Public property | AttributeTargetMemberAttributes | Gets or sets the visibilities, scopes, virtualities, and implementation of members to which this attribute applies. (Inherited from MulticastAttribute.)
Public property | AttributeTargetMembers | Gets or sets the expression specifying to which members this instance applies. (Inherited from MulticastAttribute.)
Public property | AttributeTargetParameterAttributes | Gets or sets the passing style (by value, out or ref) of parameters to which this attribute applies. (Inherited from MulticastAttribute.)
Public property | AttributeTargetParameters | Gets or sets the expression specifying to which parameters this instance applies. (Inherited from MulticastAttribute.)
Public property | AttributeTargetTypeAttributes | Gets or sets the visibilities of types to which this attribute applies. (Inherited from MulticastAttribute.)
Public property | AttributeTargetTypes | Gets or sets the expression specifying to which types this instance applies. (Inherited from MulticastAttribute.)
Protected property | SerializerType | Gets or sets the Online Type of the serializer (a type derived from AspectSerializer) used to serialize the aspect instance at build time and deserialize it at runtime. (Inherited from Aspect.)
Back to Top
See Also
OnExceptionAspect Class
PostSharp.Aspects Namespace

Online Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


OnMethodBoundaryAspect Class

OnMethodBoundaryAspect Class PostSharp Documentation
Aspect that, when applied to a method defined in the current assembly, inserts a piece of code before and after the body of these methods.
Inheritance Hierarchy
Online System Object
Online System Attribute
PostSharp.Extensibility MulticastAttribute
PostSharp.Aspects Aspect
PostSharp.Aspects MethodLevelAspect
PostSharp.Aspects OnMethodBoundaryAspect
PostSharp.Patterns.Threading ReaderWriterLockAttribute

Namespace: PostSharp.Aspects
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
[SerializableAttribute]
public abstract class OnMethodBoundaryAspect : MethodLevelAspect,
    IOnMethodBoundaryAspect, IMethodLevelAspect, IAspect
[SerializableAttribute]
public abstract class OnMethodBoundaryAspect : MethodLevelAspect,
    IOnMethodBoundaryAspect, IMethodLevelAspect, IAspect
Remarks
The OnMethodBoundaryAspect aspect results in the target method to
            be wrapped into a try ... catch ... finally block. You can
            implement four advices: OnEntry(MethodExecutionArgs), executed at the beginning of the block;
            OnSuccess(MethodExecutionArgs), executed only when the method is successful (i.e. does not
            result in an exception); OnException(MethodExecutionArgs), invoked when the method results in
            an exception; and OnExit(MethodExecutionArgs), always executed after method execution
            (whether the method resulted in an exception or not).
Schematically, the aspect transforms the original method as follows:
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
int MyMethod(object arg0, int arg1)
{
  OnEntry();
  try
  {
    // Original method body.
    OnSuccess();
    return returnValue;
  }
  catch ( Exception e )
  {
    OnException();
  }
  finally
  {
    OnExit();
  }
}
int MyMethod(object arg0, int arg1)
{
  OnEntry();
  try
  {
    // Original method body.
    OnSuccess();
    return returnValue;
  }
  catch ( Exception e )
  {
    OnException();
  }
  finally
  {
    OnExit();
  }
}
Note that this code is only schematic; actually generated instructions are
            more complex because they have to cope with parameter boxing and control flow
            modification, among others.

      An object of type
      MethodExecutionArgs
      is passed to every advice of this aspect. This object allows you to:

  • Get or set arguments
        .
        Input and output arguments are available on the property
        Arguments
        . You can change output (
        out
        ) and by-reference (
        ref
        )
        arguments, but not input arguments. If you need to modify arguments passed by value, consider using a
        MethodInterceptionAspect
        .
        (see property );

  •
          Get the current exception

        .
        The current exception is available on property
        Exception
        , but from the
        OnException(MethodExecutionArgs)
        advice.
        You cannot replace the exception by setting this property. Throw a new exception from the aspect if you need to replace the current exception.

  •
          Get or set the return value

        . The return value is available on the
        ReturnValue
        property.

  •
          Change the method control flow

        . You can change the value of the
        FlowBehavior
        property to specify
        whether the target method should execute after the execution of the current advice. This may be useful to implement a caching aspect or an exception handler.

  •
          Share state between advices

        . You can use the
        MethodExecutionTag
        property to store state between the execution of
        different advices related to the same execution of a method. For instance, you can store a cache key in
        OnEntry(MethodExecutionArgs)
        and find it back on
        OnSuccess(MethodExecutionArgs)
        . Using
        MethodExecutionTag
        is the only way to share state that is both thread-safe and reentrant. All other implementations are buggy.

  Note  Note

        All classes implementing
        IAspect
        should typically be marked as serializable
        using the custom attribute
          Online SerializableAttribute
        . Fields that
        are only used at runtime (and unknown at compile-time) should be carefully
        marked with the custom attribute
          Online NonSerializedAttribute
        .
        When PostSharp is used on a platform that does not support aspect serialization
        (such as .NET Compact Framework, Silverlight, or Windows Phone), or when
        another aspect serializer is used, it is not necessary to mark the aspect
        class as serializable.
        For more information, see
        Aspect Serialization
        .

Examples
Example: Tracing Method Execution
Example: Caching the Result of a Method
See Also
OnMethodBoundaryAspect Members
PostSharp.Aspects Namespace

      Conceptual Documentation: Aspect Serialization

  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


OnMethodBoundaryAspect Members

OnMethodBoundaryAspect Members PostSharp Documentation

The OnMethodBoundaryAspect type exposes the following members.
Constructors
 | Name | Description
Protected method | OnMethodBoundaryAspect | Initializes a new instance of the OnMethodBoundaryAspect class
Back to Top
Methods
 | Name | Description
Public method | CompileTimeInitialize | Method invoked at build time to initialize the instance fields of the current aspect. This method is invoked before any other build-time method. (Inherited from MethodLevelAspect.)
Public method | CompileTimeValidate | Method invoked at build time to ensure that the aspect has been applied to the right target. (Inherited from Aspect.)
Protected method | CreateAspectConfiguration | Method invoked at build time to create a concrete AspectConfiguration instance specifically for the current Aspect type. (Overrides Aspect CreateAspectConfiguration .)
Public method | GetAspectConfiguration | Method invoked at build tome to get the imperative configuration of the current Aspect. (Inherited from Aspect.)
Public method | OnEntry | Method executed before the body of methods to which this aspect is applied.
Public method | OnException | Method executed after the body of methods to which this aspect is applied, in case that the method resulted with an exception.
Public method | OnExit | Method executed after the body of methods to which this aspect is applied, even when the method exists with an exception (this method is invoked from the finally block).
Public method | OnSuccess | Method executed after the body of methods to which this aspect is applied, but only when the method successfully returns (i.e. when no exception flies out the method.).
Public method | RuntimeInitialize | Initializes the current aspect. (Inherited from MethodLevelAspect.)
Protected method | SetAspectConfiguration | Method invoked at build time to set up an AspectConfiguration object according to the current Aspect instance and a specified target element of the current aspect. (Inherited from Aspect.)
Back to Top
Properties
 | Name | Description
Public property | AspectPriority | Gets or sets the weaving priority of the aspect. (Inherited from Aspect.)
Public property | AttributeExclude | If true, indicates that this attribute removes all other instances of the same attribute type from the set of elements defined by the current instance. (Inherited from MulticastAttribute.)
Public property | AttributeId | Obsolete. (Inherited from MulticastAttribute.)
Public property | AttributeInheritance | Determines whether this attribute is inherited (Inherited from MulticastAttribute.)
Public property | AttributePriority | Gets or sets the priority of the current attribute in case that multiple instances are defined on the same element (lower values are processed before). (Inherited from MulticastAttribute.)
Public property | AttributeReplace | Determines whether this attribute replaces other attributes found on the target declarations. (Inherited from MulticastAttribute.)
Public property | AttributeTargetAssemblies | Gets or sets the assemblies to which the current attribute apply. (Inherited from MulticastAttribute.)
Public property | AttributeTargetElements | Gets or sets the kind of elements to which this custom attributes applies. (Inherited from MulticastAttribute.)
Public property | AttributeTargetExternalMemberAttributes | Gets or sets the visibilities, scopes, virtualities, and implementation of members to which this attribute applies, when the member is external to the current module. (Inherited from MulticastAttribute.)
Public property | AttributeTargetExternalTypeAttributes | Gets or sets the visibilities of types to which this attribute applies, when this type is external to the current module. (Inherited from MulticastAttribute.)
Public property | AttributeTargetMemberAttributes | Gets or sets the visibilities, scopes, virtualities, and implementation of members to which this attribute applies. (Inherited from MulticastAttribute.)
Public property | AttributeTargetMembers | Gets or sets the expression specifying to which members this instance applies. (Inherited from MulticastAttribute.)
Public property | AttributeTargetParameterAttributes | Gets or sets the passing style (by value, out or ref) of parameters to which this attribute applies. (Inherited from MulticastAttribute.)
Public property | AttributeTargetParameters | Gets or sets the expression specifying to which parameters this instance applies. (Inherited from MulticastAttribute.)
Public property | AttributeTargetTypeAttributes | Gets or sets the visibilities of types to which this attribute applies. (Inherited from MulticastAttribute.)
Public property | AttributeTargetTypes | Gets or sets the expression specifying to which types this instance applies. (Inherited from MulticastAttribute.)
Protected property | SerializerType | Gets or sets the Online Type of the serializer (a type derived from AspectSerializer) used to serialize the aspect instance at build time and deserialize it at runtime. (Inherited from Aspect.)
Back to Top
See Also
OnMethodBoundaryAspect Class
PostSharp.Aspects Namespace

Online Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


OnMethodBoundaryAspect Constructor

OnMethodBoundaryAspect Constructor PostSharp Documentation
Initializes a new instance of the OnMethodBoundaryAspect class

Namespace: PostSharp.Aspects
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
protected OnMethodBoundaryAspect()
protected OnMethodBoundaryAspect()
See Also
OnMethodBoundaryAspect Class
OnMethodBoundaryAspect Members
PostSharp.Aspects Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


OnMethodBoundaryAspect Methods

OnMethodBoundaryAspect Methods PostSharp Documentation
The OnMethodBoundaryAspect type exposes the following members.
Methods
 | Name | Description
Public method | CompileTimeInitialize | Method invoked at build time to initialize the instance fields of the current aspect. This method is invoked before any other build-time method. (Inherited from MethodLevelAspect.)
Public method | CompileTimeValidate | Method invoked at build time to ensure that the aspect has been applied to the right target. (Inherited from Aspect.)
Protected method | CreateAspectConfiguration | Method invoked at build time to create a concrete AspectConfiguration instance specifically for the current Aspect type. (Overrides Aspect CreateAspectConfiguration .)
Public method | GetAspectConfiguration | Method invoked at build tome to get the imperative configuration of the current Aspect. (Inherited from Aspect.)
Public method | OnEntry | Method executed before the body of methods to which this aspect is applied.
Public method | OnException | Method executed after the body of methods to which this aspect is applied, in case that the method resulted with an exception.
Public method | OnExit | Method executed after the body of methods to which this aspect is applied, even when the method exists with an exception (this method is invoked from the finally block).
Public method | OnSuccess | Method executed after the body of methods to which this aspect is applied, but only when the method successfully returns (i.e. when no exception flies out the method.).
Public method | RuntimeInitialize | Initializes the current aspect. (Inherited from MethodLevelAspect.)
Protected method | SetAspectConfiguration | Method invoked at build time to set up an AspectConfiguration object according to the current Aspect instance and a specified target element of the current aspect. (Inherited from Aspect.)
Back to Top
See Also
OnMethodBoundaryAspect Class
PostSharp.Aspects Namespace

Online Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


OnMethodBoundaryAspect.CreateAspectConfiguration Method

OnMethodBoundaryAspect CreateAspectConfiguration Method PostSharp Documentation
Method invoked at build time to create a concrete AspectConfiguration instance specifically for the current Aspect type.

Namespace: PostSharp.Aspects
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
protected override sealed AspectConfiguration CreateAspectConfiguration()
protected override sealed AspectConfiguration CreateAspectConfiguration()
Return Value
Type: AspectConfiguration
A new and empty instance of AspectConfiguration, whose concrete type corresponds to
              the concrete type of the Aspect.
Remarks

              This method should not set up the returned AspectConfiguration. After the current method has
              returned, the SetAspectConfiguration(AspectConfiguration, Object) method will be invoked, and this method is responsible
              for setting up the AspectConfigurationobject.

See Also
OnMethodBoundaryAspect Class
OnMethodBoundaryAspect Members
PostSharp.Aspects Namespace

      Conceptual Documentation: Configuring Aspects

  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


OnMethodBoundaryAspect.OnEntry Method

OnMethodBoundaryAspect OnEntry Method PostSharp Documentation
Method executed before the body of methods to which this aspect is applied.

Namespace: PostSharp.Aspects
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
public virtual void OnEntry(
    MethodExecutionArgs args
)
public virtual void OnEntry(
    MethodExecutionArgs args
)
Parameters
args
Type: PostSharp.Aspects MethodExecutionArgs
Event arguments specifying which method
              is being executed, which are its arguments, and how should the execution continue
              after the execution of OnEntry(MethodExecutionArgs).
Implements
IOnMethodBoundaryAspect OnEntry(MethodExecutionArgs)
Remarks

              If the aspect is applied to a constructor, the current method is invoked
              after the this pointer has been initialized, that is, after
              the base constructor has been called.

See Also
OnMethodBoundaryAspect Class
OnMethodBoundaryAspect Members
PostSharp.Aspects Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


OnMethodBoundaryAspect.OnException Method

OnMethodBoundaryAspect OnException Method PostSharp Documentation
Method executed after the body of methods to which this aspect is applied, in case that the method resulted with an exception.

Namespace: PostSharp.Aspects
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
public virtual void OnException(
    MethodExecutionArgs args
)
public virtual void OnException(
    MethodExecutionArgs args
)
Parameters
args
Type: PostSharp.Aspects MethodExecutionArgs
Event arguments specifying which method
              is being executed and which are its arguments.
Implements
IOnMethodBoundaryAspect OnException(MethodExecutionArgs)
See Also
OnMethodBoundaryAspect Class
OnMethodBoundaryAspect Members
PostSharp.Aspects Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


OnMethodBoundaryAspect.OnExit Method

OnMethodBoundaryAspect OnExit Method PostSharp Documentation
Method executed after the body of methods to which this aspect is applied, even when the method exists with an exception (this method is invoked from the finally block).

Namespace: PostSharp.Aspects
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
public virtual void OnExit(
    MethodExecutionArgs args
)
public virtual void OnExit(
    MethodExecutionArgs args
)
Parameters
args
Type: PostSharp.Aspects MethodExecutionArgs
Event arguments specifying which method
              is being executed and which are its arguments.
Implements
IOnMethodBoundaryAspect OnExit(MethodExecutionArgs)
See Also
OnMethodBoundaryAspect Class
OnMethodBoundaryAspect Members
PostSharp.Aspects Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


OnMethodBoundaryAspect.OnSuccess Method

OnMethodBoundaryAspect OnSuccess Method PostSharp Documentation
Method executed after the body of methods to which this aspect is applied, but only when the method successfully returns (i.e. when no exception flies out the method.).

Namespace: PostSharp.Aspects
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
public virtual void OnSuccess(
    MethodExecutionArgs args
)
public virtual void OnSuccess(
    MethodExecutionArgs args
)
Parameters
args
Type: PostSharp.Aspects MethodExecutionArgs
Event arguments specifying which method
              is being executed and which are its arguments.
Implements
IOnMethodBoundaryAspect OnSuccess(MethodExecutionArgs)
See Also
OnMethodBoundaryAspect Class
OnMethodBoundaryAspect Members
PostSharp.Aspects Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


OnMethodBoundaryAspect Properties

OnMethodBoundaryAspect Properties PostSharp Documentation
The OnMethodBoundaryAspect type exposes the following members.
Properties
 | Name | Description
Public property | AspectPriority | Gets or sets the weaving priority of the aspect. (Inherited from Aspect.)
Public property | AttributeExclude | If true, indicates that this attribute removes all other instances of the same attribute type from the set of elements defined by the current instance. (Inherited from MulticastAttribute.)
Public property | AttributeId | Obsolete. (Inherited from MulticastAttribute.)
Public property | AttributeInheritance | Determines whether this attribute is inherited (Inherited from MulticastAttribute.)
Public property | AttributePriority | Gets or sets the priority of the current attribute in case that multiple instances are defined on the same element (lower values are processed before). (Inherited from MulticastAttribute.)
Public property | AttributeReplace | Determines whether this attribute replaces other attributes found on the target declarations. (Inherited from MulticastAttribute.)
Public property | AttributeTargetAssemblies | Gets or sets the assemblies to which the current attribute apply. (Inherited from MulticastAttribute.)
Public property | AttributeTargetElements | Gets or sets the kind of elements to which this custom attributes applies. (Inherited from MulticastAttribute.)
Public property | AttributeTargetExternalMemberAttributes | Gets or sets the visibilities, scopes, virtualities, and implementation of members to which this attribute applies, when the member is external to the current module. (Inherited from MulticastAttribute.)
Public property | AttributeTargetExternalTypeAttributes | Gets or sets the visibilities of types to which this attribute applies, when this type is external to the current module. (Inherited from MulticastAttribute.)
Public property | AttributeTargetMemberAttributes | Gets or sets the visibilities, scopes, virtualities, and implementation of members to which this attribute applies. (Inherited from MulticastAttribute.)
Public property | AttributeTargetMembers | Gets or sets the expression specifying to which members this instance applies. (Inherited from MulticastAttribute.)
Public property | AttributeTargetParameterAttributes | Gets or sets the passing style (by value, out or ref) of parameters to which this attribute applies. (Inherited from MulticastAttribute.)
Public property | AttributeTargetParameters | Gets or sets the expression specifying to which parameters this instance applies. (Inherited from MulticastAttribute.)
Public property | AttributeTargetTypeAttributes | Gets or sets the visibilities of types to which this attribute applies. (Inherited from MulticastAttribute.)
Public property | AttributeTargetTypes | Gets or sets the expression specifying to which types this instance applies. (Inherited from MulticastAttribute.)
Protected property | SerializerType | Gets or sets the Online Type of the serializer (a type derived from AspectSerializer) used to serialize the aspect instance at build time and deserialize it at runtime. (Inherited from Aspect.)
Back to Top
See Also
OnMethodBoundaryAspect Class
PostSharp.Aspects Namespace

Online Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


TypeIdentity Class

TypeIdentity Class PostSharp Documentation
Wraps a Type or a type name.
Inheritance Hierarchy
Online System Object
PostSharp.Aspects TypeIdentity

Namespace: PostSharp.Aspects
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
public class TypeIdentity
public class TypeIdentity
See Also
TypeIdentity Members
PostSharp.Aspects Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


TypeIdentity Members

TypeIdentity Members PostSharp Documentation

The TypeIdentity type exposes the following members.
Methods
 | Name | Description
 | FromType | Wraps a Type into a TypeIdentity.
 | FromTypeName | Wraps a type name into a TypeIdentity.
 | FromTypeNames | Wraps an array of type names into an array of TypeIdentity.
 | FromTypes | Wraps an array of Type into an array of TypeIdentity.
Public method | ToType | Converts a TypeIdentity into a Online Type.
Back to Top
Properties
 | Name | Description
Public property | Type | Gets the wrapped Type, or null it the TypeName property is set.
Public property | TypeName | Gets the wrapped type name, or null it the Type property is set.
Back to Top
See Also
TypeIdentity Class
PostSharp.Aspects Namespace

Online Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


TypeIdentity Methods

TypeIdentity Methods PostSharp Documentation
The TypeIdentity type exposes the following members.
Methods
 | Name | Description
 | FromType | Wraps a Type into a TypeIdentity.
 | FromTypeName | Wraps a type name into a TypeIdentity.
 | FromTypeNames | Wraps an array of type names into an array of TypeIdentity.
 | FromTypes | Wraps an array of Type into an array of TypeIdentity.
Public method | ToType | Converts a TypeIdentity into a Online Type.
Back to Top
See Also
TypeIdentity Class
PostSharp.Aspects Namespace

Online Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


TypeIdentity.FromType Method

TypeIdentity FromType Method PostSharp Documentation
Wraps a Type into a TypeIdentity.

Namespace: PostSharp.Aspects
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
public static TypeIdentity FromType(
    Type type
)
public static TypeIdentity FromType(
    Type type
)
Parameters
type
Type:   Online System Type
A Type.
Return Value
Type: TypeIdentity
A TypeIdentity wrapping .
See Also
TypeIdentity Class
TypeIdentity Members
PostSharp.Aspects Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


TypeIdentity.FromTypeName Method

TypeIdentity FromTypeName Method PostSharp Documentation
Wraps a type name into a TypeIdentity.

Namespace: PostSharp.Aspects
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
public static TypeIdentity FromTypeName(
    string typeName
)
public static TypeIdentity FromTypeName(
    string typeName
)
Parameters
typeName
Type:   Online System String
The type name.
Return Value
Type: TypeIdentity
A TypeIdentity wrapping the type name.
See Also
TypeIdentity Class
TypeIdentity Members
PostSharp.Aspects Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


TypeIdentity.FromTypeNames Method

TypeIdentity FromTypeNames Method PostSharp Documentation
Wraps an array of type names into an array of TypeIdentity.

Namespace: PostSharp.Aspects
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
public static TypeIdentity[] FromTypeNames(
    string[] typeNames
)
public static TypeIdentity[] FromTypeNames(
    string[] typeNames
)
Parameters
typeNames
Type:    Online System String
An array of type names.
Return Value
Type:  TypeIdentity
An array of TypeIdentity wrapping typeNames.
See Also
TypeIdentity Class
TypeIdentity Members
PostSharp.Aspects Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


TypeIdentity.FromTypes Method

TypeIdentity FromTypes Method PostSharp Documentation
Wraps an array of Type into an array of TypeIdentity.

Namespace: PostSharp.Aspects
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
public static TypeIdentity[] FromTypes(
    Type[] types
)
public static TypeIdentity[] FromTypes(
    Type[] types
)
Parameters
types
Type:    Online System Type
An array of Type.
Return Value
Type:  TypeIdentity
An array of TypeIdentity wrapping types.
See Also
TypeIdentity Class
TypeIdentity Members
PostSharp.Aspects Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


TypeIdentity.ToType Method

TypeIdentity ToType Method PostSharp Documentation
Converts a TypeIdentity into a Online Type.

Namespace: PostSharp.Aspects
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
public Type ToType()
public Type ToType()
Return Value
Type:   Online Type
[Missing <returns> documentation for "M:PostSharp.Aspects.TypeIdentity.ToType"]
See Also
TypeIdentity Class
TypeIdentity Members
PostSharp.Aspects Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


TypeIdentity Properties

TypeIdentity Properties PostSharp Documentation
The TypeIdentity type exposes the following members.
Properties
 | Name | Description
Public property | Type | Gets the wrapped Type, or null it the TypeName property is set.
Public property | TypeName | Gets the wrapped type name, or null it the Type property is set.
Back to Top
See Also
TypeIdentity Class
PostSharp.Aspects Namespace

Online Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


TypeIdentity.Type Property

TypeIdentity Type Property PostSharp Documentation
Gets the wrapped Type, or null it the TypeName property is set.

Namespace: PostSharp.Aspects
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
public Type Type { get; }
public Type Type { get; }
Property Value
Type:   Online Type
See Also
TypeIdentity Class
TypeIdentity Members
PostSharp.Aspects Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


TypeIdentity.TypeName Property

TypeIdentity TypeName Property PostSharp Documentation
Gets the wrapped type name, or null it the Type property is set.

Namespace: PostSharp.Aspects
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
public string TypeName { get; }
public string TypeName { get; }
Property Value
Type:   Online String
See Also
TypeIdentity Class
TypeIdentity Members
PostSharp.Aspects Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


TypeLevelAspect Class

TypeLevelAspect Class PostSharp Documentation
Base class for all aspects applied on types.
Inheritance Hierarchy
Online System Object
Online System Attribute
PostSharp.Extensibility MulticastAttribute
PostSharp.Aspects Aspect
PostSharp.Aspects TypeLevelAspect
PostSharp.Aspects CompositionAspect
PostSharp.Aspects InstanceLevelAspect
PostSharp.Patterns.Threading ThreadUnsafeAttribute

Namespace: PostSharp.Aspects
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
[SerializableAttribute]
public abstract class TypeLevelAspect : Aspect,
    ITypeLevelAspect, IAspect, ITypeLevelAspectBuildSemantics, IAspectBuildSemantics, IValidableAnnotation
[SerializableAttribute]
public abstract class TypeLevelAspect : Aspect,
    ITypeLevelAspect, IAspect, ITypeLevelAspectBuildSemantics, IAspectBuildSemantics, IValidableAnnotation
Remarks
  Note  Note

      This class does not provide any advice. You may derive your aspect class from a

        class providing
        predefined advice

      , or build a
      composite aspect
      .

  Note  Note

        All classes implementing
        IAspect
        should typically be marked as serializable
        using the custom attribute
          Online SerializableAttribute
        . Fields that
        are only used at runtime (and unknown at compile-time) should be carefully
        marked with the custom attribute
          Online NonSerializedAttribute
        .
        When PostSharp is used on a platform that does not support aspect serialization
        (such as .NET Compact Framework, Silverlight, or Windows Phone), or when
        another aspect serializer is used, it is not necessary to mark the aspect
        class as serializable.
        For more information, see
        Aspect Serialization
        .

See Also
TypeLevelAspect Members
PostSharp.Aspects Namespace
PostSharp.Aspects ITypeLevelAspect

      Conceptual Documentation: Aspect Classes

      Conceptual Documentation: Developing Complex Aspects

      Conceptual Documentation: Aspect Serialization

  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


TypeLevelAspect Members

TypeLevelAspect Members PostSharp Documentation

The TypeLevelAspect type exposes the following members.
Constructors
 | Name | Description
Protected method | TypeLevelAspect | Initializes a new instance of the TypeLevelAspect class
Back to Top
Methods
 | Name | Description
Public method | CompileTimeInitialize | Method invoked at build time to initialize the instance fields of the current aspect. This method is invoked before any other build-time method.
Public method | CompileTimeValidate | Method invoked at build time to ensure that the aspect has been applied to the right target. (Inherited from Aspect.)
Protected method | CreateAspectConfiguration | Method invoked at build time to create a concrete AspectConfiguration instance specifically for the current Aspect type. (Inherited from Aspect.)
Public method | GetAspectConfiguration | Method invoked at build tome to get the imperative configuration of the current Aspect. (Inherited from Aspect.)
Public method | RuntimeInitialize | Initializes the current aspect.
Protected method | SetAspectConfiguration | Method invoked at build time to set up an AspectConfiguration object according to the current Aspect instance and a specified target element of the current aspect. (Inherited from Aspect.)
Back to Top
Properties
 | Name | Description
Public property | AspectPriority | Gets or sets the weaving priority of the aspect. (Inherited from Aspect.)
Public property | AttributeExclude | If true, indicates that this attribute removes all other instances of the same attribute type from the set of elements defined by the current instance. (Inherited from MulticastAttribute.)
Public property | AttributeId | Obsolete. (Inherited from MulticastAttribute.)
Public property | AttributeInheritance | Determines whether this attribute is inherited (Inherited from MulticastAttribute.)
Public property | AttributePriority | Gets or sets the priority of the current attribute in case that multiple instances are defined on the same element (lower values are processed before). (Inherited from MulticastAttribute.)
Public property | AttributeReplace | Determines whether this attribute replaces other attributes found on the target declarations. (Inherited from MulticastAttribute.)
Public property | AttributeTargetAssemblies | Gets or sets the assemblies to which the current attribute apply. (Inherited from MulticastAttribute.)
Public property | AttributeTargetElements | Gets or sets the kind of elements to which this custom attributes applies. (Inherited from MulticastAttribute.)
Public property | AttributeTargetExternalMemberAttributes | Gets or sets the visibilities, scopes, virtualities, and implementation of members to which this attribute applies, when the member is external to the current module. (Inherited from MulticastAttribute.)
Public property | AttributeTargetExternalTypeAttributes | Gets or sets the visibilities of types to which this attribute applies, when this type is external to the current module. (Inherited from MulticastAttribute.)
Public property | AttributeTargetMemberAttributes | Gets or sets the visibilities, scopes, virtualities, and implementation of members to which this attribute applies. (Inherited from MulticastAttribute.)
Public property | AttributeTargetMembers | Gets or sets the expression specifying to which members this instance applies. (Inherited from MulticastAttribute.)
Public property | AttributeTargetParameterAttributes | Gets or sets the passing style (by value, out or ref) of parameters to which this attribute applies. (Inherited from MulticastAttribute.)
Public property | AttributeTargetParameters | Gets or sets the expression specifying to which parameters this instance applies. (Inherited from MulticastAttribute.)
Public property | AttributeTargetTypeAttributes | Gets or sets the visibilities of types to which this attribute applies. (Inherited from MulticastAttribute.)
Public property | AttributeTargetTypes | Gets or sets the expression specifying to which types this instance applies. (Inherited from MulticastAttribute.)
Protected property | SerializerType | Gets or sets the Online Type of the serializer (a type derived from AspectSerializer) used to serialize the aspect instance at build time and deserialize it at runtime. (Inherited from Aspect.)
Back to Top
See Also
TypeLevelAspect Class
PostSharp.Aspects Namespace

Online Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


TypeLevelAspect Constructor

TypeLevelAspect Constructor PostSharp Documentation
Initializes a new instance of the TypeLevelAspect class

Namespace: PostSharp.Aspects
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
protected TypeLevelAspect()
protected TypeLevelAspect()
See Also
TypeLevelAspect Class
TypeLevelAspect Members
PostSharp.Aspects Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


TypeLevelAspect Methods

TypeLevelAspect Methods PostSharp Documentation
The TypeLevelAspect type exposes the following members.
Methods
 | Name | Description
Public method | CompileTimeInitialize | Method invoked at build time to initialize the instance fields of the current aspect. This method is invoked before any other build-time method.
Public method | CompileTimeValidate | Method invoked at build time to ensure that the aspect has been applied to the right target. (Inherited from Aspect.)
Protected method | CreateAspectConfiguration | Method invoked at build time to create a concrete AspectConfiguration instance specifically for the current Aspect type. (Inherited from Aspect.)
Public method | GetAspectConfiguration | Method invoked at build tome to get the imperative configuration of the current Aspect. (Inherited from Aspect.)
Public method | RuntimeInitialize | Initializes the current aspect.
Protected method | SetAspectConfiguration | Method invoked at build time to set up an AspectConfiguration object according to the current Aspect instance and a specified target element of the current aspect. (Inherited from Aspect.)
Back to Top
See Also
TypeLevelAspect Class
PostSharp.Aspects Namespace

Online Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


TypeLevelAspect.CompileTimeInitialize Method

TypeLevelAspect CompileTimeInitialize Method PostSharp Documentation
Method invoked at build time to initialize the instance fields of the current aspect. This method is invoked before any other build-time method.

Namespace: PostSharp.Aspects
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
public virtual void CompileTimeInitialize(
    Type type,
    AspectInfo aspectInfo
)
public virtual void CompileTimeInitialize(
    Type type,
    AspectInfo aspectInfo
)
Parameters
type
Type:   Online System Type
Type to which the current aspect is applied
aspectInfo
Type: PostSharp.Aspects AspectInfo
Reserved for future usage.
Implements
ITypeLevelAspectBuildSemantics CompileTimeInitialize(Type, AspectInfo)
See Also
TypeLevelAspect Class
TypeLevelAspect Members
PostSharp.Aspects Namespace

      Conceptual Documentation: Initializing Aspects

  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


TypeLevelAspect.RuntimeInitialize Method

TypeLevelAspect RuntimeInitialize Method PostSharp Documentation
Initializes the current aspect.

Namespace: PostSharp.Aspects
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
public virtual void RuntimeInitialize(
    Type type
)
public virtual void RuntimeInitialize(
    Type type
)
Parameters
type
Type:   Online System Type
Type to which the current aspect is applied.
Implements
ITypeLevelAspect RuntimeInitialize(Type)
See Also
TypeLevelAspect Class
TypeLevelAspect Members
PostSharp.Aspects Namespace

      Conceptual Documentation: Initializing Aspects

  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


TypeLevelAspect Properties

TypeLevelAspect Properties PostSharp Documentation
The TypeLevelAspect type exposes the following members.
Properties
 | Name | Description
Public property | AspectPriority | Gets or sets the weaving priority of the aspect. (Inherited from Aspect.)
Public property | AttributeExclude | If true, indicates that this attribute removes all other instances of the same attribute type from the set of elements defined by the current instance. (Inherited from MulticastAttribute.)
Public property | AttributeId | Obsolete. (Inherited from MulticastAttribute.)
Public property | AttributeInheritance | Determines whether this attribute is inherited (Inherited from MulticastAttribute.)
Public property | AttributePriority | Gets or sets the priority of the current attribute in case that multiple instances are defined on the same element (lower values are processed before). (Inherited from MulticastAttribute.)
Public property | AttributeReplace | Determines whether this attribute replaces other attributes found on the target declarations. (Inherited from MulticastAttribute.)
Public property | AttributeTargetAssemblies | Gets or sets the assemblies to which the current attribute apply. (Inherited from MulticastAttribute.)
Public property | AttributeTargetElements | Gets or sets the kind of elements to which this custom attributes applies. (Inherited from MulticastAttribute.)
Public property | AttributeTargetExternalMemberAttributes | Gets or sets the visibilities, scopes, virtualities, and implementation of members to which this attribute applies, when the member is external to the current module. (Inherited from MulticastAttribute.)
Public property | AttributeTargetExternalTypeAttributes | Gets or sets the visibilities of types to which this attribute applies, when this type is external to the current module. (Inherited from MulticastAttribute.)
Public property | AttributeTargetMemberAttributes | Gets or sets the visibilities, scopes, virtualities, and implementation of members to which this attribute applies. (Inherited from MulticastAttribute.)
Public property | AttributeTargetMembers | Gets or sets the expression specifying to which members this instance applies. (Inherited from MulticastAttribute.)
Public property | AttributeTargetParameterAttributes | Gets or sets the passing style (by value, out or ref) of parameters to which this attribute applies. (Inherited from MulticastAttribute.)
Public property | AttributeTargetParameters | Gets or sets the expression specifying to which parameters this instance applies. (Inherited from MulticastAttribute.)
Public property | AttributeTargetTypeAttributes | Gets or sets the visibilities of types to which this attribute applies. (Inherited from MulticastAttribute.)
Public property | AttributeTargetTypes | Gets or sets the expression specifying to which types this instance applies. (Inherited from MulticastAttribute.)
Protected property | SerializerType | Gets or sets the Online Type of the serializer (a type derived from AspectSerializer) used to serialize the aspect instance at build time and deserialize it at runtime. (Inherited from Aspect.)
Back to Top
See Also
TypeLevelAspect Class
PostSharp.Aspects Namespace

Online Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


PostSharp.Aspects.Advices Namespace

PostSharp.Aspects.Advices Namespace PostSharp Documentation
The PostSharp.Aspects.Advices provides custom attributes that allow developing composite aspects with advices and pointcuts.
Classes
 | Class | Description
Public class | Advice | Base class for all custom attributes representing an advice.
Public class | CopyCustomAttributesAttribute | Custom attribute that, when applied on an aspect class, requires custom attributes present on the aspect class to be copied to the target of this class. When applied on an introduced member (see IntroduceMemberAttribute), this custom attribute requires custom attributes present on the aspect member to be copied to the introduced member.
Public class | Event TDelegate | Exposes the semantics of an event for use with the ImportMemberAttribute aspect extension.
Public class | GroupingAdvice | Base class for all advices that are possibly composed of multiple advices that can be grouped together using the Master property.
Public class | ImportMemberAttribute | Custom attribute that, when applied to an instance field of an aspect class, determines that this field should be bound to a method, event or property, of the target class of this aspect. Valid types for fields are a concrete Online Delegate (to bind to a method), Property TValue or Property TValue, TIndex (to bind to a property), or Event TDelegate (to bind to an event).
Public class | IntroduceInterfaceAttribute | Custom attribute that, when applied to an aspect class, specifies that the aspect should introduce a given interface into the type to which the aspect is applied.
Public class | IntroduceMemberAttribute | Custom attribute that, when applied on a method, event or property of an aspect class, specifies that this method, event or property should be introduced into the types to which the aspect is applied.
Public class | LocationValidationAdvice | Custom attribute that, when applied on a method of an aspect class, specifies that this method has the same semantic as the ValidateValue(T, String, LocationKind) method of the ILocationValidationAspect T interface.
Public class | MethodPointcut | Custom attribute that, when applied on an advice method, specifies the name of the method that will be invoked at build-time to return the set of elements of code to which the advice applies.
Public class | MulticastPointcut | Custom attribute that, when applied on an advice method, specifies to which elements of code this advice applies, based on the kind, name and attributes of code elements. Works similarly as MulticastAttribute.
Public class | OnEventAddHandlerAdvice | Custom attribute that, when applied on a method of an aspect class, specifies that this method is an advice having the same semantics as OnAddHandler(EventInterceptionArgs).
Public class | OnEventInvokeHandlerAdvice | Custom attribute that, when applied on a method of an aspect class, specifies that this method is an advice having the same semantics as OnInvokeHandler(EventInterceptionArgs).
Public class | OnEventRemoveHandlerAdvice | Custom attribute that, when applied on a method of an aspect class, specifies that this method is an advice having the same semantics as OnRemoveHandler(EventInterceptionArgs).
Public class | OnLocationGetValueAdvice | Custom attribute that, when applied on a method of an aspect class, specifies that this method is an advice having the same semantics as OnGetValue(LocationInterceptionArgs).
Public class | OnLocationSetValueAdvice | Custom attribute that, when applied on a method of an aspect class, specifies that this method is an advice having the same semantics as OnSetValue(LocationInterceptionArgs).
Public class | OnMethodEntryAdvice | Custom attribute that, when applied on a method of an aspect class, specifies that this method is an advice having the same semantics as OnEntry(MethodExecutionArgs).
Public class | OnMethodExceptionAdvice | Custom attribute that, when applied on a method of an aspect class, specifies that this method is an advice having the same semantics as OnException(MethodExecutionArgs).
Public class | OnMethodExitAdvice | Custom attribute that, when applied on a method of an aspect class, specifies that this method is an advice having the same semantics as OnExit(MethodExecutionArgs).
Public class | OnMethodInvokeAdvice | Custom attribute that, when applied on a method of an aspect class, specifies that this method is an advice having the same semantics as OnInvoke(MethodInterceptionArgs).
Public class | OnMethodSuccessAdvice | Custom attribute that, when applied on a method of an aspect class, specifies that this method is an advice having the same semantics as OnSuccess(MethodExecutionArgs).
Public class | Pointcut | Custom attribute, typically accompanying an advice, specifying to which code elements the advice applies.
Public class | Property TValue | Exposes the semantics of a parameterless property for use with the ImportMemberAttribute aspect extension.
Public class | Property TValue, TIndex | Mimics the semantics of a property accepting a single index parameter, for use with the ImportMemberAttribute aspect extension.
Public class | SelfPointcut | Pointcut that selects exactly the aspect target.
Delegates
 | Delegate | Description
Public delegate | EventAccessor TDelegate | Defines the signature of methods implementing the Add and Remove semantics of an event.
Public delegate | PropertyGetter TValue | Defines the signature of methods implementing the Get semantic of a parameterless property.
Public delegate | PropertyGetter TValue, TIndex | Defines the signature of methods implementing the Get semantic of a property with a single index parameter.
Public delegate | PropertySetter TValue | Defines the signature of methods implementing the Set semantic of a parameterless property.
Public delegate | PropertySetter TValue, TIndex | Defines the signature of methods implementing the Set semantic of a property with a single index parameter.
Enumerations
 | Enumeration | Description
Public enumeration | CustomAttributeOverrideAction | Behavior of CopyCustomAttributesAttribute when a custom attribute of the same type already exists on the target declaration.
Public enumeration | ImportMemberOrder | Enumeration of moments when members should be imported into an aspect.
Public enumeration | InterfaceOverrideAction | Enumeration of actions to be overtaken when an interface that should be introduced into a type is already implemented by that type.
Public enumeration | MemberOverrideAction | Enumeration of actions to be overtaken by the IntroduceMemberAttribute aspect extension when the member to be introduced already exists in the aspect target type or its base type.

Online Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


Advice Class

Advice Class PostSharp Documentation
Base class for all custom attributes representing an advice.
Inheritance Hierarchy
Online System Object
Online System Attribute
PostSharp.Aspects.Advices Advice
PostSharp.Aspects.Advices CopyCustomAttributesAttribute
PostSharp.Aspects.Advices GroupingAdvice
PostSharp.Aspects.Advices ImportMemberAttribute
PostSharp.Aspects.Advices IntroduceInterfaceAttribute
PostSharp.Aspects.Advices IntroduceMemberAttribute
PostSharp.Aspects.Advices OnMethodInvokeAdvice

Namespace: PostSharp.Aspects.Advices
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
public abstract class Advice : Attribute
public abstract class Advice : Attribute
Remarks
Advices are behaviors added to aspects by the way of custom
                attributes. Other ways to add behaviors is to implement interface methods.

                Advice custom attributes are typically used on aspect classes,
                or on members of aspect classes.

  Note  Note

      PostSharp Professional Edition is required for this feature.

See Also
Advice Members
PostSharp.Aspects.Advices Namespace

      Conceptual Documentation: Developing Complex Aspects

  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


Advice Members

Advice Members PostSharp Documentation

The Advice type exposes the following members.
Constructors
 | Name | Description
Protected method | Advice | Initializes a new instance of the Advice class
Back to Top
See Also
Advice Class
PostSharp.Aspects.Advices Namespace

Online Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


Advice Constructor

Advice Constructor PostSharp Documentation
Initializes a new instance of the Advice class

Namespace: PostSharp.Aspects.Advices
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
protected Advice()
protected Advice()
See Also
Advice Class
Advice Members
PostSharp.Aspects.Advices Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


CopyCustomAttributesAttribute Class

CopyCustomAttributesAttribute Class PostSharp Documentation
Custom attribute that, when applied on an aspect class, requires custom attributes present on the aspect class to be copied to the target of this class. When applied on an introduced member (see IntroduceMemberAttribute), this custom attribute requires custom attributes present on the aspect member to be copied to the introduced member.
Inheritance Hierarchy
Online System Object
Online System Attribute
PostSharp.Aspects.Advices Advice
PostSharp.Aspects.Advices CopyCustomAttributesAttribute

Namespace: PostSharp.Aspects.Advices
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
public sealed class CopyCustomAttributesAttribute : Advice
public sealed class CopyCustomAttributesAttribute : Advice
Remarks
  Note  Note

      PostSharp Professional Edition is required for this feature.

See Also
CopyCustomAttributesAttribute Members
PostSharp.Aspects.Advices Namespace
PostSharp.Aspects.Advices IntroduceMemberAttribute

      Conceptual Documentation: Introducing, Overriding and Importing Members

  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


CopyCustomAttributesAttribute Members

CopyCustomAttributesAttribute Members PostSharp Documentation

The CopyCustomAttributesAttribute type exposes the following members.
Constructors
 | Name | Description
Public method | CopyCustomAttributesAttribute(Type) | Requires custom attributes present on the aspect class or aspect class member to be copied to the aspect target or to the introduced member, respectively.
Public method | CopyCustomAttributesAttribute( Type ) | Requires custom attributes present on the aspect class or aspect class member to be copied to the aspect target or to the introduced member, respectively.
Back to Top
Properties
 | Name | Description
Public property | OverrideAction | Determines what should happen when a custom attribute of the same type is already present on the target declaration.
Public property | Types | Gets the list of custom attribute types to be copied.
Back to Top
See Also
CopyCustomAttributesAttribute Class
PostSharp.Aspects.Advices Namespace

Online Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


CopyCustomAttributesAttribute Constructor

CopyCustomAttributesAttribute Constructor PostSharp Documentation
Overload List
 | Name | Description
Public method | CopyCustomAttributesAttribute(Type) | Requires custom attributes present on the aspect class or aspect class member to be copied to the aspect target or to the introduced member, respectively.
Public method | CopyCustomAttributesAttribute( Type ) | Requires custom attributes present on the aspect class or aspect class member to be copied to the aspect target or to the introduced member, respectively.
Back to Top
See Also
CopyCustomAttributesAttribute Class
CopyCustomAttributesAttribute Members
PostSharp.Aspects.Advices Namespace

Online Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


CopyCustomAttributesAttribute Constructor (Type)

CopyCustomAttributesAttribute Constructor (Type) PostSharp Documentation
Requires custom attributes present on the aspect class or aspect class member to be copied to the aspect target or to the introduced member, respectively.

Namespace: PostSharp.Aspects.Advices
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
public CopyCustomAttributesAttribute(
    Type type
)
public CopyCustomAttributesAttribute(
    Type type
)
Parameters
type
Type:   Online System Type
Base type of custom attributes to be copied.
See Also
CopyCustomAttributesAttribute Class
CopyCustomAttributesAttribute Members
CopyCustomAttributesAttribute Overload
PostSharp.Aspects.Advices Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


CopyCustomAttributesAttribute Constructor (Type[])

CopyCustomAttributesAttribute Constructor ( Type ) PostSharp Documentation
Requires custom attributes present on the aspect class or aspect class member to be copied to the aspect target or to the introduced member, respectively.

Namespace: PostSharp.Aspects.Advices
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
public CopyCustomAttributesAttribute(
    params Type[] types
)
public CopyCustomAttributesAttribute(
    params Type[] types
)
Parameters
types
Type:    Online System Type
Base types of custom attributes to be copied.
See Also
CopyCustomAttributesAttribute Class
CopyCustomAttributesAttribute Members
CopyCustomAttributesAttribute Overload
PostSharp.Aspects.Advices Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


CopyCustomAttributesAttribute Properties

CopyCustomAttributesAttribute Properties PostSharp Documentation
The CopyCustomAttributesAttribute type exposes the following members.
Properties
 | Name | Description
Public property | OverrideAction | Determines what should happen when a custom attribute of the same type is already present on the target declaration.
Public property | Types | Gets the list of custom attribute types to be copied.
Back to Top
See Also
CopyCustomAttributesAttribute Class
PostSharp.Aspects.Advices Namespace

Online Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


CopyCustomAttributesAttribute.OverrideAction Property

CopyCustomAttributesAttribute OverrideAction Property PostSharp Documentation
Determines what should happen when a custom attribute of the same type is already present on the target declaration.

Namespace: PostSharp.Aspects.Advices
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
public CustomAttributeOverrideAction OverrideAction { get; set; }
public CustomAttributeOverrideAction OverrideAction { get; set; }
Property Value
Type: CustomAttributeOverrideAction
See Also
CopyCustomAttributesAttribute Class
CopyCustomAttributesAttribute Members
PostSharp.Aspects.Advices Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


CopyCustomAttributesAttribute.Types Property

CopyCustomAttributesAttribute Types Property PostSharp Documentation
Gets the list of custom attribute types to be copied.

Namespace: PostSharp.Aspects.Advices
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
public Type[] Types { get; private set; }
public Type[] Types { get; private set; }
Property Value
Type:    Online Type
See Also
CopyCustomAttributesAttribute Class
CopyCustomAttributesAttribute Members
PostSharp.Aspects.Advices Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


CustomAttributeOverrideAction Enumeration

CustomAttributeOverrideAction Enumeration PostSharp Documentation
Behavior of CopyCustomAttributesAttribute when a custom attribute of the same type already exists on the target declaration.

Namespace: PostSharp.Aspects.Advices
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
public enum CustomAttributeOverrideAction
public enum CustomAttributeOverrideAction
Members
Member name | Value | Description
Default | 0 | Default (Fail).
Fail | 0 | Emits an error message.
Ignore | 1 | Silently ignore this custom attribute (does not copy it, without error message).
Add | 2 | Adds a new copy (possibly duplicate) of the custom attribute.
MergeAddProperty | 3 | Merges the existing custom attribute with the template custom attribute by adding properties and fields. If the existing custom attribute defines the same properties and fields as the template custom attribute, they are not overridden.
MergeReplaceProperty | 4 | Merges the exising custom attribute with the template custom attribute by adding and replacing properties and fields. If the existing custom attribute defines the same properties and fields as the template custom attribute, they are replaced by the values defined in the template custom attribute.
See Also
PostSharp.Aspects.Advices Namespace
PostSharp.Aspects.Advices CopyCustomAttributesAttribute
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


Event(TDelegate) Class

Event TDelegate Class PostSharp Documentation
Exposes the semantics of an event for use with the ImportMemberAttribute aspect extension.
Inheritance Hierarchy
Online System Object
PostSharp.Aspects.Advices Event TDelegate

Namespace: PostSharp.Aspects.Advices
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
[SerializableAttribute]
public sealed class Event<TDelegate>
[SerializableAttribute]
public sealed class Event<TDelegate>
Type Parameters
TDelegate
Handler type (derived from   Online Delegate).
Remarks
See Also
Event TDelegate  Members
PostSharp.Aspects.Advices Namespace
PostSharp.Aspects.Advices ImportMemberAttribute

      Conceptual Documentation: Introducing, Overriding and Importing Members

  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


Event(TDelegate) Members

Event TDelegate Members PostSharp Documentation

The Event TDelegate type exposes the following members.
Properties
 | Name | Description
Public property | Add | Gets a delegate enabling to invoke the add accessor of the imported event.
Public property | Remove | Gets a delegate enabling to invoke the remove accessor of the imported event.
Back to Top
See Also
Event TDelegate Class
PostSharp.Aspects.Advices Namespace

Online Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


Event(TDelegate) Properties

Event TDelegate Properties PostSharp Documentation
The Event TDelegate type exposes the following members.
Properties
 | Name | Description
Public property | Add | Gets a delegate enabling to invoke the add accessor of the imported event.
Public property | Remove | Gets a delegate enabling to invoke the remove accessor of the imported event.
Back to Top
See Also
Event TDelegate Class
PostSharp.Aspects.Advices Namespace

Online Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


Event(TDelegate).Add Property

Event TDelegate Add Property PostSharp Documentation
Gets a delegate enabling to invoke the add accessor of the imported event.

Namespace: PostSharp.Aspects.Advices
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
public EventAccessor<TDelegate> Add { get; private set; }
public EventAccessor<TDelegate> Add { get; private set; }
Property Value
Type: EventAccessor  TDelegate
See Also
Event TDelegate  Class
Event TDelegate  Members
PostSharp.Aspects.Advices Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


Event(TDelegate).Remove Property

Event TDelegate Remove Property PostSharp Documentation
Gets a delegate enabling to invoke the remove accessor of the imported event.

Namespace: PostSharp.Aspects.Advices
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
public EventAccessor<TDelegate> Remove { get; private set; }
public EventAccessor<TDelegate> Remove { get; private set; }
Property Value
Type: EventAccessor  TDelegate
See Also
Event TDelegate  Class
Event TDelegate  Members
PostSharp.Aspects.Advices Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


EventAccessor(TDelegate) Delegate

EventAccessor TDelegate Delegate PostSharp Documentation
Defines the signature of methods implementing the Add and Remove semantics of an event.

Namespace: PostSharp.Aspects.Advices
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
public delegate void EventAccessor<TDelegate>(
    TDelegate delegate
)
public delegate void EventAccessor<TDelegate>(
    TDelegate delegate
)
Parameters
delegate
Type: TDelegate
Handler.
Type Parameters
TDelegate
Handler type (derived from   Online Delegate).
See Also
PostSharp.Aspects.Advices Namespace
PostSharp.Aspects.Advices Event TDelegate
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


GroupingAdvice Class

GroupingAdvice Class PostSharp Documentation
Base class for all advices that are possibly composed of multiple advices that can be grouped together using the Master property.
Inheritance Hierarchy
Online System Object
Online System Attribute
PostSharp.Aspects.Advices Advice
PostSharp.Aspects.Advices GroupingAdvice
PostSharp.Aspects.Advices LocationValidationAdvice
PostSharp.Aspects.Advices OnEventAddHandlerAdvice
PostSharp.Aspects.Advices OnEventInvokeHandlerAdvice
PostSharp.Aspects.Advices OnEventRemoveHandlerAdvice
PostSharp.Aspects.Advices OnLocationGetValueAdvice
PostSharp.Aspects.Advices OnLocationSetValueAdvice
PostSharp.Aspects.Advices OnMethodEntryAdvice
PostSharp.Aspects.Advices OnMethodExceptionAdvice
PostSharp.Aspects.Advices OnMethodExitAdvice
PostSharp.Aspects.Advices OnMethodSuccessAdvice

Namespace: PostSharp.Aspects.Advices
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
public abstract class GroupingAdvice : Advice
public abstract class GroupingAdvice : Advice
Remarks
  Note  Note

      PostSharp Professional Edition is required for this feature.

See Also
GroupingAdvice Members
PostSharp.Aspects.Advices Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


GroupingAdvice Members

GroupingAdvice Members PostSharp Documentation

The GroupingAdvice type exposes the following members.
Constructors
 | Name | Description
Protected method | GroupingAdvice | Initializes a new instance of the GroupingAdvice class
Back to Top
Properties
 | Name | Description
Public property | Master | Name of the master advice method. If this property is not set, the current method is itself the master of the group. Only master methods can define selectors (Pointcut) and dependencies (AspectDependencyAttribute).
Back to Top
See Also
GroupingAdvice Class
PostSharp.Aspects.Advices Namespace

Online Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


GroupingAdvice Constructor

GroupingAdvice Constructor PostSharp Documentation
Initializes a new instance of the GroupingAdvice class

Namespace: PostSharp.Aspects.Advices
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
protected GroupingAdvice()
protected GroupingAdvice()
See Also
GroupingAdvice Class
GroupingAdvice Members
PostSharp.Aspects.Advices Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


GroupingAdvice Properties

GroupingAdvice Properties PostSharp Documentation
The GroupingAdvice type exposes the following members.
Properties
 | Name | Description
Public property | Master | Name of the master advice method. If this property is not set, the current method is itself the master of the group. Only master methods can define selectors (Pointcut) and dependencies (AspectDependencyAttribute).
Back to Top
See Also
GroupingAdvice Class
PostSharp.Aspects.Advices Namespace

Online Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


GroupingAdvice.Master Property

GroupingAdvice Master Property PostSharp Documentation
Name of the master advice method. If this property is not set, the current method is itself the master of the group. Only master methods can define selectors (Pointcut) and dependencies (AspectDependencyAttribute).

Namespace: PostSharp.Aspects.Advices
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
public string Master { get; set; }
public string Master { get; set; }
Property Value
Type:   Online String
See Also
GroupingAdvice Class
GroupingAdvice Members
PostSharp.Aspects.Advices Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


ImportMemberAttribute Class

ImportMemberAttribute Class PostSharp Documentation
Custom attribute that, when applied to an instance field of an aspect class, determines that this field should be bound to a method, event or property, of the target class of this aspect. Valid types for fields are a concrete Online Delegate (to bind to a method), Property TValue or Property TValue, TIndex (to bind to a property), or Event TDelegate (to bind to an event).
Inheritance Hierarchy
Online System Object
Online System Attribute
PostSharp.Aspects.Advices Advice
PostSharp.Aspects.Advices ImportMemberAttribute

Namespace: PostSharp.Aspects.Advices
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
public sealed class ImportMemberAttribute : Advice
public sealed class ImportMemberAttribute : Advice
Remarks
Fields annotated with the ImportMemberAttribute
                custom attribute must be public and must not be read only.
At runtime, these fields are assigned to a delegate (in case
                of method binding) or a pair of delegates (in case of event or property
                binding) allowing to invoke the imported member.
When the target type does not contain a member of the required
                name and signature
  Note  Note

      PostSharp Professional Edition is required for this feature.

See Also
ImportMemberAttribute Members
PostSharp.Aspects.Advices Namespace

      Conceptual Documentation: Introducing, Overriding and Importing Members

  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


ImportMemberAttribute Members

ImportMemberAttribute Members PostSharp Documentation

The ImportMemberAttribute type exposes the following members.
Constructors
 | Name | Description
Public method | ImportMemberAttribute | Initializes a new ImportMemberAttribute.
Back to Top
Properties
 | Name | Description
Public property | IsRequired | Determines whether a build time error must be issued if the member to be imported is absent. If false, the binding field will be null in case the imported member is absent.
Public property | MemberName | Name of the imported member.
Public property | Order | Determines when the member should be imported: either before (BeforeIntroductions) or after (AfterIntroductions) members have been introduced by the current aspect. Default is BeforeIntroductions.
Back to Top
See Also
ImportMemberAttribute Class
PostSharp.Aspects.Advices Namespace

Online Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


ImportMemberAttribute Constructor

ImportMemberAttribute Constructor PostSharp Documentation
Initializes a new ImportMemberAttribute.

Namespace: PostSharp.Aspects.Advices
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
public ImportMemberAttribute(
    string memberName
)
public ImportMemberAttribute(
    string memberName
)
Parameters
memberName
Type:   Online System String
Name of the member to import.
See Also
ImportMemberAttribute Class
ImportMemberAttribute Members
PostSharp.Aspects.Advices Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


ImportMemberAttribute Properties

ImportMemberAttribute Properties PostSharp Documentation
The ImportMemberAttribute type exposes the following members.
Properties
 | Name | Description
Public property | IsRequired | Determines whether a build time error must be issued if the member to be imported is absent. If false, the binding field will be null in case the imported member is absent.
Public property | MemberName | Name of the imported member.
Public property | Order | Determines when the member should be imported: either before (BeforeIntroductions) or after (AfterIntroductions) members have been introduced by the current aspect. Default is BeforeIntroductions.
Back to Top
See Also
ImportMemberAttribute Class
PostSharp.Aspects.Advices Namespace

Online Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


ImportMemberAttribute.IsRequired Property

ImportMemberAttribute IsRequired Property PostSharp Documentation
Determines whether a build time error must be issued if the member to be imported is absent. If false, the binding field will be null in case the imported member is absent.

Namespace: PostSharp.Aspects.Advices
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
public bool IsRequired { get; set; }
public bool IsRequired { get; set; }
Property Value
Type:   Online Boolean
See Also
ImportMemberAttribute Class
ImportMemberAttribute Members
PostSharp.Aspects.Advices Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


ImportMemberAttribute.MemberName Property

ImportMemberAttribute MemberName Property PostSharp Documentation
Name of the imported member.

Namespace: PostSharp.Aspects.Advices
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
public string MemberName { get; private set; }
public string MemberName { get; private set; }
Property Value
Type:   Online String
See Also
ImportMemberAttribute Class
ImportMemberAttribute Members
PostSharp.Aspects.Advices Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


ImportMemberAttribute.Order Property

ImportMemberAttribute Order Property PostSharp Documentation
Determines when the member should be imported: either before (BeforeIntroductions) or after (AfterIntroductions) members have been introduced by the current aspect. Default is BeforeIntroductions.

Namespace: PostSharp.Aspects.Advices
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
public ImportMemberOrder Order { get; set; }
public ImportMemberOrder Order { get; set; }
Property Value
Type: ImportMemberOrder
Remarks

              Sometimes it makes sense for an aspect to import a member after the same aspect has introduced member.
              This allows the aspect to invoke a member that could be overridden by later aspects.

See Also
ImportMemberAttribute Class
ImportMemberAttribute Members
PostSharp.Aspects.Advices Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


ImportMemberOrder Enumeration

ImportMemberOrder Enumeration PostSharp Documentation
Enumeration of moments when members should be imported into an aspect.

Namespace: PostSharp.Aspects.Advices
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
public enum ImportMemberOrder
public enum ImportMemberOrder
Members
Member name | Value | Description
Default | 0 | AfterIntroductions
BeforeIntroductions | 1 | Before the aspect introduces its own members. This is similar to calling the overridden method using the base keyword in C#. The overridden method implementation is always selected, even if the method is virtual.
AfterIntroductions | 0 | After the aspect introduces its own members. Note that importing a member introduced by the current aspect makes sense only if the member has been introduced as virtual; in this case, the the imported member is dynamically resolved using the virtual table of the target object.
See Also
PostSharp.Aspects.Advices Namespace
PostSharp.Aspects.Advices ImportMemberAttribute
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


InterfaceOverrideAction Enumeration

InterfaceOverrideAction Enumeration PostSharp Documentation
Enumeration of actions to be overtaken when an interface that should be introduced into a type is already implemented by that type.

Namespace: PostSharp.Aspects.Advices
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
public enum InterfaceOverrideAction
public enum InterfaceOverrideAction
Members
Member name | Value | Description
Default | 0 | Fail.
Fail | 0 | Fails and emits an error message.
Ignore | 1 | Silently ignore this interface (does not introduct it).
Remarks
  Note  Note

      PostSharp Professional Edition is required for this feature.

See Also
PostSharp.Aspects.Advices Namespace
PostSharp.Aspects.Advices IntroduceInterfaceAttribute
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


IntroduceInterfaceAttribute Class

IntroduceInterfaceAttribute Class PostSharp Documentation
Custom attribute that, when applied to an aspect class, specifies that the aspect should introduce a given interface into the type to which the aspect is applied.

[Missing <include> target documentation in 'T:PostSharp.Aspects.Advices.IntroduceInterfaceAttribute'. File: '../../Documentation.xml' Path: '/documentation/section[@name='seeAlsoIntroduceInterface']/*']

Inheritance Hierarchy
Online System Object
Online System Attribute
PostSharp.Aspects.Advices Advice
PostSharp.Aspects.Advices IntroduceInterfaceAttribute

Namespace: PostSharp.Aspects.Advices
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
public sealed class IntroduceInterfaceAttribute : Advice
public sealed class IntroduceInterfaceAttribute : Advice
Remarks
See Also
IntroduceInterfaceAttribute Members
PostSharp.Aspects.Advices Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


IntroduceInterfaceAttribute Members

IntroduceInterfaceAttribute Members PostSharp Documentation

The IntroduceInterfaceAttribute type exposes the following members.
Constructors
 | Name | Description
Public method | IntroduceInterfaceAttribute | Initializes a new IntroduceInterfaceAttribute.
Back to Top
Properties
 | Name | Description
Public property | AncestorOverrideAction | Specifies the action (Fail or Ignore) to be overtaken when an ancestor of the interface specified in the constructor of this custom attribute is already implemented by the type to which the current aspect is applied.
Public property | IsProtected | Determines whether the interface should be exposed indirectly through the IProtectedInterface T interface. If false, the interface will be implemented directly by the type.
Public property | OverrideAction | Specifies the action (Fail or Ignore) to be overtaken when the interface specified in the constructor of this custom attribute is already implemented by the type to which the current aspect is applied.
Back to Top
See Also
IntroduceInterfaceAttribute Class
PostSharp.Aspects.Advices Namespace

Online Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


IntroduceInterfaceAttribute Constructor

IntroduceInterfaceAttribute Constructor PostSharp Documentation
Initializes a new IntroduceInterfaceAttribute.

Namespace: PostSharp.Aspects.Advices
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
public IntroduceInterfaceAttribute(
    Type interfaceType
)
public IntroduceInterfaceAttribute(
    Type interfaceType
)
Parameters
interfaceType
Type:   Online System Type
Interface that should be introduced into the types
              to which the aspect is applied.
See Also
IntroduceInterfaceAttribute Class
IntroduceInterfaceAttribute Members
PostSharp.Aspects.Advices Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


IntroduceInterfaceAttribute Properties

IntroduceInterfaceAttribute Properties PostSharp Documentation
The IntroduceInterfaceAttribute type exposes the following members.
Properties
 | Name | Description
Public property | AncestorOverrideAction | Specifies the action (Fail or Ignore) to be overtaken when an ancestor of the interface specified in the constructor of this custom attribute is already implemented by the type to which the current aspect is applied.
Public property | IsProtected | Determines whether the interface should be exposed indirectly through the IProtectedInterface T interface. If false, the interface will be implemented directly by the type.
Public property | OverrideAction | Specifies the action (Fail or Ignore) to be overtaken when the interface specified in the constructor of this custom attribute is already implemented by the type to which the current aspect is applied.
Back to Top
See Also
IntroduceInterfaceAttribute Class
PostSharp.Aspects.Advices Namespace

Online Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


IntroduceInterfaceAttribute.AncestorOverrideAction Property

IntroduceInterfaceAttribute AncestorOverrideAction Property PostSharp Documentation
Specifies the action (Fail or Ignore) to be overtaken when an ancestor of the interface specified in the constructor of this custom attribute is already implemented by the type to which the current aspect is applied.

Namespace: PostSharp.Aspects.Advices
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
public InterfaceOverrideAction AncestorOverrideAction { get; set; }
public InterfaceOverrideAction AncestorOverrideAction { get; set; }
Property Value
Type: InterfaceOverrideAction
See Also
IntroduceInterfaceAttribute Class
IntroduceInterfaceAttribute Members
PostSharp.Aspects.Advices Namespace
IntroduceInterfaceAttribute OverrideAction
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


IntroduceInterfaceAttribute.IsProtected Property

IntroduceInterfaceAttribute IsProtected Property PostSharp Documentation
Determines whether the interface should be exposed indirectly through the IProtectedInterface T interface. If false, the interface will be implemented directly by the type.

Namespace: PostSharp.Aspects.Advices
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
public bool IsProtected { get; set; }
public bool IsProtected { get; set; }
Property Value
Type:   Online Boolean
See Also
IntroduceInterfaceAttribute Class
IntroduceInterfaceAttribute Members
PostSharp.Aspects.Advices Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


IntroduceInterfaceAttribute.OverrideAction Property

IntroduceInterfaceAttribute OverrideAction Property PostSharp Documentation
Specifies the action (Fail or Ignore) to be overtaken when the interface specified in the constructor of this custom attribute is already implemented by the type to which the current aspect is applied.

Namespace: PostSharp.Aspects.Advices
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
public InterfaceOverrideAction OverrideAction { get; set; }
public InterfaceOverrideAction OverrideAction { get; set; }
Property Value
Type: InterfaceOverrideAction
See Also
IntroduceInterfaceAttribute Class
IntroduceInterfaceAttribute Members
PostSharp.Aspects.Advices Namespace
IntroduceInterfaceAttribute AncestorOverrideAction
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


IntroduceMemberAttribute Class

IntroduceMemberAttribute Class PostSharp Documentation
Custom attribute that, when applied on a method, event or property of an aspect class, specifies that this method, event or property should be introduced into the types to which the aspect is applied.
Inheritance Hierarchy
Online System Object
Online System Attribute
PostSharp.Aspects.Advices Advice
PostSharp.Aspects.Advices IntroduceMemberAttribute

Namespace: PostSharp.Aspects.Advices
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
public sealed class IntroduceMemberAttribute : Advice
public sealed class IntroduceMemberAttribute : Advice
Remarks

              Methods, properties and events annotated with IntroduceMemberAttribute must be public.

  Note  Note

      PostSharp Professional Edition is required for this feature.

See Also
IntroduceMemberAttribute Members
PostSharp.Aspects.Advices Namespace
PostSharp.Aspects.Advices CopyCustomAttributesAttribute

      Conceptual Documentation: Introducing, Overriding and Importing Members

  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


IntroduceMemberAttribute Members

IntroduceMemberAttribute Members PostSharp Documentation

The IntroduceMemberAttribute type exposes the following members.
Constructors
 | Name | Description
Public method | IntroduceMemberAttribute | Initializes a new instance of the IntroduceMemberAttribute class
Back to Top
Properties
 | Name | Description
Public property | IsIsVirtualSpecified | Determines whether the IsVirtual property has been specified.
Public property | IsVirtual | Determines whether the introduced member should be virtual.
Public property | OverrideAction | Determines the action to be overtaken when the member to be introduced already exists in the type to which the aspect is applied, or to a base type.
Public property | Visibility | Determines the visibility (Public, (Family, ...) of the introduced member.
Back to Top
See Also
IntroduceMemberAttribute Class
PostSharp.Aspects.Advices Namespace

Online Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


IntroduceMemberAttribute Constructor

IntroduceMemberAttribute Constructor PostSharp Documentation
Initializes a new instance of the IntroduceMemberAttribute class

Namespace: PostSharp.Aspects.Advices
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
public IntroduceMemberAttribute()
public IntroduceMemberAttribute()
See Also
IntroduceMemberAttribute Class
IntroduceMemberAttribute Members
PostSharp.Aspects.Advices Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


IntroduceMemberAttribute Properties

IntroduceMemberAttribute Properties PostSharp Documentation
The IntroduceMemberAttribute type exposes the following members.
Properties
 | Name | Description
Public property | IsIsVirtualSpecified | Determines whether the IsVirtual property has been specified.
Public property | IsVirtual | Determines whether the introduced member should be virtual.
Public property | OverrideAction | Determines the action to be overtaken when the member to be introduced already exists in the type to which the aspect is applied, or to a base type.
Public property | Visibility | Determines the visibility (Public, (Family, ...) of the introduced member.
Back to Top
See Also
IntroduceMemberAttribute Class
PostSharp.Aspects.Advices Namespace

Online Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


IntroduceMemberAttribute.IsIsVirtualSpecified Property

IntroduceMemberAttribute IsIsVirtualSpecified Property PostSharp Documentation
Determines whether the IsVirtual property has been specified.

Namespace: PostSharp.Aspects.Advices
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
public bool IsIsVirtualSpecified { get; }
public bool IsIsVirtualSpecified { get; }
Property Value
Type:   Online Boolean
See Also
IntroduceMemberAttribute Class
IntroduceMemberAttribute Members
PostSharp.Aspects.Advices Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


IntroduceMemberAttribute.IsVirtual Property

IntroduceMemberAttribute IsVirtual Property PostSharp Documentation
Determines whether the introduced member should be virtual.

Namespace: PostSharp.Aspects.Advices
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
public bool IsVirtual { get; set; }
public bool IsVirtual { get; set; }
Property Value
Type:   Online Boolean
Remarks

                When this property is false and the member already exists in a base type
                and is virtual, the member is overridden and marked as sealed.

                When this property is not set, the introduced member is virtual if it exists in a base
                type as a virtual member, otherwise non-virtual.

See Also
IntroduceMemberAttribute Class
IntroduceMemberAttribute Members
PostSharp.Aspects.Advices Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


IntroduceMemberAttribute.OverrideAction Property

IntroduceMemberAttribute OverrideAction Property PostSharp Documentation
Determines the action to be overtaken when the member to be introduced already exists in the type to which the aspect is applied, or to a base type.

Namespace: PostSharp.Aspects.Advices
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
public MemberOverrideAction OverrideAction { get; set; }
public MemberOverrideAction OverrideAction { get; set; }
Property Value
Type: MemberOverrideAction
See Also
IntroduceMemberAttribute Class
IntroduceMemberAttribute Members
PostSharp.Aspects.Advices Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


IntroduceMemberAttribute.Visibility Property

IntroduceMemberAttribute Visibility Property PostSharp Documentation
Determines the visibility (Public, (Family, ...) of the introduced member.

Namespace: PostSharp.Aspects.Advices
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
public Visibility Visibility { get; set; }
public Visibility Visibility { get; set; }
Property Value
Type: Visibility
See Also
IntroduceMemberAttribute Class
IntroduceMemberAttribute Members
PostSharp.Aspects.Advices Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


LocationValidationAdvice Class

LocationValidationAdvice Class PostSharp Documentation
Custom attribute that, when applied on a method of an aspect class, specifies that this method has the same semantic as the ValidateValue(T, String, LocationKind) method of the ILocationValidationAspect T interface.
Inheritance Hierarchy
Online System Object
Online System Attribute
PostSharp.Aspects.Advices Advice
PostSharp.Aspects.Advices GroupingAdvice
PostSharp.Aspects.Advices LocationValidationAdvice

Namespace: PostSharp.Aspects.Advices
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
public class LocationValidationAdvice : GroupingAdvice
public class LocationValidationAdvice : GroupingAdvice
Remarks

                The method to which this custom attribute is applied must be public and must have the same signature as
                ValidateValue(T, String, LocationKind), where T can be any type. However, the method can be static.

  Note  Note

      PostSharp Professional Edition is required for this feature.

See Also
LocationValidationAdvice Members
PostSharp.Aspects.Advices Namespace
PostSharp.Aspects ILocationValidationAspect T

      Conceptual Documentation: Adding Behaviors to Members

  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


LocationValidationAdvice Members

LocationValidationAdvice Members PostSharp Documentation

The LocationValidationAdvice type exposes the following members.
Constructors
 | Name | Description
Public method | LocationValidationAdvice | Initializes a new instance of the LocationValidationAdvice class
Back to Top
Properties
 | Name | Description
Public property | Master | Name of the master advice method. If this property is not set, the current method is itself the master of the group. Only master methods can define selectors (Pointcut) and dependencies (AspectDependencyAttribute). (Inherited from GroupingAdvice.)
Back to Top
See Also
LocationValidationAdvice Class
PostSharp.Aspects.Advices Namespace

Online Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


LocationValidationAdvice Constructor

LocationValidationAdvice Constructor PostSharp Documentation
Initializes a new instance of the LocationValidationAdvice class

Namespace: PostSharp.Aspects.Advices
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
public LocationValidationAdvice()
public LocationValidationAdvice()
See Also
LocationValidationAdvice Class
LocationValidationAdvice Members
PostSharp.Aspects.Advices Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


LocationValidationAdvice Properties

LocationValidationAdvice Properties PostSharp Documentation
The LocationValidationAdvice type exposes the following members.
Properties
 | Name | Description
Public property | Master | Name of the master advice method. If this property is not set, the current method is itself the master of the group. Only master methods can define selectors (Pointcut) and dependencies (AspectDependencyAttribute). (Inherited from GroupingAdvice.)
Back to Top
See Also
LocationValidationAdvice Class
PostSharp.Aspects.Advices Namespace

Online Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


MemberOverrideAction Enumeration

MemberOverrideAction Enumeration PostSharp Documentation
Enumeration of actions to be overtaken by the IntroduceMemberAttribute aspect extension when the member to be introduced already exists in the aspect target type or its base type.

Namespace: PostSharp.Aspects.Advices
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
public enum MemberOverrideAction
public enum MemberOverrideAction
Members
Member name | Value | Description
Default | 0 | Fail
Fail | 0 | Emits a build time error.
Ignore | 1 | Silently ignore the member introduction.
OverrideOrFail | 2 | Tries to override the member, and fails if it is impossible (i.e. if the existing member is defined in a base type and is sealed or non-virtual).
OverrideOrIgnore | 3 | Tries to override the member, and silently ignore if it is impossible (i.e. if the existing member is defined in a base type and is sealed or non-virtual).
See Also
PostSharp.Aspects.Advices Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


MethodPointcut Class

MethodPointcut Class PostSharp Documentation
Custom attribute that, when applied on an advice method, specifies the name of the method that will be invoked at build-time to return the set of elements of code to which the advice applies.
Inheritance Hierarchy
Online System Object
Online System Attribute
PostSharp.Aspects.Advices Pointcut
PostSharp.Aspects.Advices MethodPointcut

Namespace: PostSharp.Aspects.Advices
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
public sealed class MethodPointcut : Pointcut
public sealed class MethodPointcut : Pointcut
Remarks

                This method should have the signature
                IEnumerable<AdviceTargetType> SelectCodeElements(AspectTargetType target) ,
                where AspectTargetType is either object either a reflection type
                corresponding to the kind of targets of the aspect (for instance System.Type
                for a type-level aspect), and AdviceTargetType is either object either
                a reflection type of the kind of targets of the advice (for instance System.MethodInfo for a method-level advice).

  Note  Note

      PostSharp Professional Edition is required for this feature.

See Also
MethodPointcut Members
PostSharp.Aspects.Advices Namespace

      Conceptual Documentation: Adding Behaviors to Members

  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


MethodPointcut Members

MethodPointcut Members PostSharp Documentation

The MethodPointcut type exposes the following members.
Constructors
 | Name | Description
Public method | MethodPointcut | Initializes a new MethodPointcut.
Back to Top
Properties
 | Name | Description
Public property | MethodName | Gets the name of the method returning the set of code elements.
Back to Top
See Also
MethodPointcut Class
PostSharp.Aspects.Advices Namespace

Online Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


MethodPointcut Constructor

MethodPointcut Constructor PostSharp Documentation
Initializes a new MethodPointcut.

Namespace: PostSharp.Aspects.Advices
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
public MethodPointcut(
    string methodName
)
public MethodPointcut(
    string methodName
)
Parameters
methodName
Type:   Online System String
Name of the method returning the set of targets. This method should have
              a specific signature as discussed in the class documentation.
See Also
MethodPointcut Class
MethodPointcut Members
PostSharp.Aspects.Advices Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


MethodPointcut Properties

MethodPointcut Properties PostSharp Documentation
The MethodPointcut type exposes the following members.
Properties
 | Name | Description
Public property | MethodName | Gets the name of the method returning the set of code elements.
Back to Top
See Also
MethodPointcut Class
PostSharp.Aspects.Advices Namespace

Online Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


MethodPointcut.MethodName Property

MethodPointcut MethodName Property PostSharp Documentation
Gets the name of the method returning the set of code elements.

Namespace: PostSharp.Aspects.Advices
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
public string MethodName { get; private set; }
public string MethodName { get; private set; }
Property Value
Type:   Online String
See Also
MethodPointcut Class
MethodPointcut Members
PostSharp.Aspects.Advices Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


MulticastPointcut Class

MulticastPointcut Class PostSharp Documentation
Custom attribute that, when applied on an advice method, specifies to which elements of code this advice applies, based on the kind, name and attributes of code elements. Works similarly as MulticastAttribute.
Inheritance Hierarchy
Online System Object
Online System Attribute
PostSharp.Aspects.Advices Pointcut
PostSharp.Aspects.Advices MulticastPointcut

Namespace: PostSharp.Aspects.Advices
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
public sealed class MulticastPointcut : Pointcut
public sealed class MulticastPointcut : Pointcut
Remarks
  Note  Note

      PostSharp Professional Edition is required for this feature.

See Also
MulticastPointcut Members
PostSharp.Aspects.Advices Namespace

      Conceptual Documentation: Adding Behaviors to Members

  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


MulticastPointcut Members

MulticastPointcut Members PostSharp Documentation

The MulticastPointcut type exposes the following members.
Constructors
 | Name | Description
Public method | MulticastPointcut | Initializes a new instance of the MulticastPointcut class
Back to Top
Properties
 | Name | Description
Public property | Attributes | Gets or sets the visibilities, scopes, virtualities, and implementation of members to which this attribute applies.
Public property | MemberName | Gets or sets the expression specifying to which members the aspect extension applies.
Public property | Targets | Gets or sets the kind of elements to which this aspect extension applies.
Back to Top
See Also
MulticastPointcut Class
PostSharp.Aspects.Advices Namespace

Online Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


MulticastPointcut Constructor

MulticastPointcut Constructor PostSharp Documentation
Initializes a new instance of the MulticastPointcut class

Namespace: PostSharp.Aspects.Advices
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
public MulticastPointcut()
public MulticastPointcut()
See Also
MulticastPointcut Class
MulticastPointcut Members
PostSharp.Aspects.Advices Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


MulticastPointcut Properties

MulticastPointcut Properties PostSharp Documentation
The MulticastPointcut type exposes the following members.
Properties
 | Name | Description
Public property | Attributes | Gets or sets the visibilities, scopes, virtualities, and implementation of members to which this attribute applies.
Public property | MemberName | Gets or sets the expression specifying to which members the aspect extension applies.
Public property | Targets | Gets or sets the kind of elements to which this aspect extension applies.
Back to Top
See Also
MulticastPointcut Class
PostSharp.Aspects.Advices Namespace

Online Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


MulticastPointcut.Attributes Property

MulticastPointcut Attributes Property PostSharp Documentation
Gets or sets the visibilities, scopes, virtualities, and implementation of members to which this attribute applies.

Namespace: PostSharp.Aspects.Advices
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
public MulticastAttributes Attributes { get; set; }
public MulticastAttributes Attributes { get; set; }
Property Value
Type: MulticastAttributes
Remarks

                The MulticastAttributes enumeration is a multi-part flag: there is one
                part for visibility, one for scope, one for virtuality, and one for implementation.
                If you specify one part, it will override the values defined on the custom attribute definition.

See Also
MulticastPointcut Class
MulticastPointcut Members
PostSharp.Aspects.Advices Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


MulticastPointcut.MemberName Property

MulticastPointcut MemberName Property PostSharp Documentation
Gets or sets the expression specifying to which members the aspect extension applies.

Namespace: PostSharp.Aspects.Advices
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
public string MemberName { get; set; }
public string MemberName { get; set; }
Property Value
Type:   Online String

              A wildcard or regular expression specifying to which members
              this instance applies, or null this instance
              applies either to all members whose kind is given in Targets.
              Regular expressions should start with the regex: prefix.

See Also
MulticastPointcut Class
MulticastPointcut Members
PostSharp.Aspects.Advices Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


MulticastPointcut.Targets Property

MulticastPointcut Targets Property PostSharp Documentation
Gets or sets the kind of elements to which this aspect extension applies.

Namespace: PostSharp.Aspects.Advices
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
public MulticastTargets Targets { get; set; }
public MulticastTargets Targets { get; set; }
Property Value
Type: MulticastTargets
See Also
MulticastPointcut Class
MulticastPointcut Members
PostSharp.Aspects.Advices Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


OnEventAddHandlerAdvice Class

OnEventAddHandlerAdvice Class PostSharp Documentation
Custom attribute that, when applied on a method of an aspect class, specifies that this method is an advice having the same semantics as OnAddHandler(EventInterceptionArgs).
Inheritance Hierarchy
Online System Object
Online System Attribute
PostSharp.Aspects.Advices Advice
PostSharp.Aspects.Advices GroupingAdvice
PostSharp.Aspects.Advices OnEventAddHandlerAdvice

Namespace: PostSharp.Aspects.Advices
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
public sealed class OnEventAddHandlerAdvice : GroupingAdvice
public sealed class OnEventAddHandlerAdvice : GroupingAdvice
Remarks

                The method to which this custom attribute is applied must be public and must have the same signature as
                OnAddHandler(EventInterceptionArgs). However, it can be static.

      If an aspect defines many advices (among
      OnEventAddHandlerAdvice
      ,
      OnEventRemoveHandlerAdvice
      and
      OnEventInvokeHandlerAdvice
      ) that are meant to be applied to the same events with consistent ordering, these advices should be
      grouped together (see
      Master
      property).

  Note  Note

      Standalone advices or group masters should also be annotated by a custom attribute derived from
      Pointcut
      .

  Note  Note

      Because of the way how the C# compiler implements
      automatic events
      (i.e. events where you
      don't implement the
      Add
      and
      Remove
      semantics manually), the
      Invoke Event Handler
      semantic (
      OnInvokeHandler(EventInterceptionArgs)
      or equivalent) shall
      not
      be invoked for delegates that have been added from inside the class that declares this event.

  Note  Note

      PostSharp Professional Edition is required for this feature.

See Also
OnEventAddHandlerAdvice Members
PostSharp.Aspects.Advices Namespace
PostSharp.Aspects IEventInterceptionAspect
PostSharp.Aspects.Advices OnEventAddHandlerAdvice
PostSharp.Aspects.Advices OnEventInvokeHandlerAdvice
PostSharp.Aspects EventInterceptionAspect
PostSharp.Aspects.Advices OnEventRemoveHandlerAdvice
PostSharp.Aspects.Advices OnEventInvokeHandlerAdvice

      Conceptual Documentation: Adding Behaviors to Members

  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


OnEventAddHandlerAdvice Members

OnEventAddHandlerAdvice Members PostSharp Documentation

The OnEventAddHandlerAdvice type exposes the following members.
Constructors
 | Name | Description
Public method | OnEventAddHandlerAdvice | Initializes a new instance of the OnEventAddHandlerAdvice class
Back to Top
Properties
 | Name | Description
Public property | Master | Name of the master advice method. If this property is not set, the current method is itself the master of the group. Only master methods can define selectors (Pointcut) and dependencies (AspectDependencyAttribute). (Inherited from GroupingAdvice.)
Back to Top
See Also
OnEventAddHandlerAdvice Class
PostSharp.Aspects.Advices Namespace

Online Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


OnEventAddHandlerAdvice Constructor

OnEventAddHandlerAdvice Constructor PostSharp Documentation
Initializes a new instance of the OnEventAddHandlerAdvice class

Namespace: PostSharp.Aspects.Advices
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
public OnEventAddHandlerAdvice()
public OnEventAddHandlerAdvice()
See Also
OnEventAddHandlerAdvice Class
OnEventAddHandlerAdvice Members
PostSharp.Aspects.Advices Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


OnEventAddHandlerAdvice Properties

OnEventAddHandlerAdvice Properties PostSharp Documentation
The OnEventAddHandlerAdvice type exposes the following members.
Properties
 | Name | Description
Public property | Master | Name of the master advice method. If this property is not set, the current method is itself the master of the group. Only master methods can define selectors (Pointcut) and dependencies (AspectDependencyAttribute). (Inherited from GroupingAdvice.)
Back to Top
See Also
OnEventAddHandlerAdvice Class
PostSharp.Aspects.Advices Namespace

Online Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


OnEventInvokeHandlerAdvice Class

OnEventInvokeHandlerAdvice Class PostSharp Documentation
Custom attribute that, when applied on a method of an aspect class, specifies that this method is an advice having the same semantics as OnInvokeHandler(EventInterceptionArgs).
Inheritance Hierarchy
Online System Object
Online System Attribute
PostSharp.Aspects.Advices Advice
PostSharp.Aspects.Advices GroupingAdvice
PostSharp.Aspects.Advices OnEventInvokeHandlerAdvice

Namespace: PostSharp.Aspects.Advices
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
public sealed class OnEventInvokeHandlerAdvice : GroupingAdvice
public sealed class OnEventInvokeHandlerAdvice : GroupingAdvice
Remarks

                The method to which this custom attribute is applied must be public and must have the same signature as
                OnInvokeHandler(EventInterceptionArgs). However, it can be static.

      If an aspect defines many advices (among
      OnEventAddHandlerAdvice
      ,
      OnEventRemoveHandlerAdvice
      and
      OnEventInvokeHandlerAdvice
      ) that are meant to be applied to the same events with consistent ordering, these advices should be
      grouped together (see
      Master
      property).

  Note  Note

      Standalone advices or group masters should also be annotated by a custom attribute derived from
      Pointcut
      .

  Note  Note

      Because of the way how the C# compiler implements
      automatic events
      (i.e. events where you
      don't implement the
      Add
      and
      Remove
      semantics manually), the
      Invoke Event Handler
      semantic (
      OnInvokeHandler(EventInterceptionArgs)
      or equivalent) shall
      not
      be invoked for delegates that have been added from inside the class that declares this event.

  Note  Note

      PostSharp Professional Edition is required for this feature.

See Also
OnEventInvokeHandlerAdvice Members
PostSharp.Aspects.Advices Namespace
PostSharp.Aspects IEventInterceptionAspect
PostSharp.Aspects.Advices OnEventAddHandlerAdvice
PostSharp.Aspects.Advices OnEventInvokeHandlerAdvice
PostSharp.Aspects EventInterceptionAspect
PostSharp.Aspects.Advices OnEventRemoveHandlerAdvice
PostSharp.Aspects.Advices OnEventAddHandlerAdvice

      Conceptual Documentation: Adding Behaviors to Members

  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


OnEventInvokeHandlerAdvice Members

OnEventInvokeHandlerAdvice Members PostSharp Documentation

The OnEventInvokeHandlerAdvice type exposes the following members.
Constructors
 | Name | Description
Public method | OnEventInvokeHandlerAdvice | Initializes a new instance of the OnEventInvokeHandlerAdvice class
Back to Top
Properties
 | Name | Description
Public property | Master | Name of the master advice method. If this property is not set, the current method is itself the master of the group. Only master methods can define selectors (Pointcut) and dependencies (AspectDependencyAttribute). (Inherited from GroupingAdvice.)
Back to Top
See Also
OnEventInvokeHandlerAdvice Class
PostSharp.Aspects.Advices Namespace

Online Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


OnEventInvokeHandlerAdvice Constructor

OnEventInvokeHandlerAdvice Constructor PostSharp Documentation
Initializes a new instance of the OnEventInvokeHandlerAdvice class

Namespace: PostSharp.Aspects.Advices
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
public OnEventInvokeHandlerAdvice()
public OnEventInvokeHandlerAdvice()
See Also
OnEventInvokeHandlerAdvice Class
OnEventInvokeHandlerAdvice Members
PostSharp.Aspects.Advices Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


OnEventInvokeHandlerAdvice Properties

OnEventInvokeHandlerAdvice Properties PostSharp Documentation
The OnEventInvokeHandlerAdvice type exposes the following members.
Properties
 | Name | Description
Public property | Master | Name of the master advice method. If this property is not set, the current method is itself the master of the group. Only master methods can define selectors (Pointcut) and dependencies (AspectDependencyAttribute). (Inherited from GroupingAdvice.)
Back to Top
See Also
OnEventInvokeHandlerAdvice Class
PostSharp.Aspects.Advices Namespace

Online Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


OnEventRemoveHandlerAdvice Class

OnEventRemoveHandlerAdvice Class PostSharp Documentation
Custom attribute that, when applied on a method of an aspect class, specifies that this method is an advice having the same semantics as OnRemoveHandler(EventInterceptionArgs).
Inheritance Hierarchy
Online System Object
Online System Attribute
PostSharp.Aspects.Advices Advice
PostSharp.Aspects.Advices GroupingAdvice
PostSharp.Aspects.Advices OnEventRemoveHandlerAdvice

Namespace: PostSharp.Aspects.Advices
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
public sealed class OnEventRemoveHandlerAdvice : GroupingAdvice
public sealed class OnEventRemoveHandlerAdvice : GroupingAdvice
Remarks

                The method to which this custom attribute is applied must be public and must have the same signature as
                OnRemoveHandler(EventInterceptionArgs). However, it can be static.

      If an aspect defines many advices (among
      OnEventAddHandlerAdvice
      ,
      OnEventRemoveHandlerAdvice
      and
      OnEventInvokeHandlerAdvice
      ) that are meant to be applied to the same events with consistent ordering, these advices should be
      grouped together (see
      Master
      property).

  Note  Note

      Standalone advices or group masters should also be annotated by a custom attribute derived from
      Pointcut
      .

  Note  Note

      Because of the way how the C# compiler implements
      automatic events
      (i.e. events where you
      don't implement the
      Add
      and
      Remove
      semantics manually), the
      Invoke Event Handler
      semantic (
      OnInvokeHandler(EventInterceptionArgs)
      or equivalent) shall
      not
      be invoked for delegates that have been added from inside the class that declares this event.

Remarks
  Note  Note

      PostSharp Professional Edition is required for this feature.

See Also
OnEventRemoveHandlerAdvice Members
PostSharp.Aspects.Advices Namespace
PostSharp.Aspects IEventInterceptionAspect
PostSharp.Aspects.Advices OnEventAddHandlerAdvice
PostSharp.Aspects.Advices OnEventInvokeHandlerAdvice
PostSharp.Aspects EventInterceptionAspect
PostSharp.Aspects.Advices OnEventAddHandlerAdvice
PostSharp.Aspects.Advices OnEventInvokeHandlerAdvice

      Conceptual Documentation: Adding Behaviors to Members

  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


OnEventRemoveHandlerAdvice Members

OnEventRemoveHandlerAdvice Members PostSharp Documentation

The OnEventRemoveHandlerAdvice type exposes the following members.
Constructors
 | Name | Description
Public method | OnEventRemoveHandlerAdvice | Initializes a new instance of the OnEventRemoveHandlerAdvice class
Back to Top
Properties
 | Name | Description
Public property | Master | Name of the master advice method. If this property is not set, the current method is itself the master of the group. Only master methods can define selectors (Pointcut) and dependencies (AspectDependencyAttribute). (Inherited from GroupingAdvice.)
Back to Top
See Also
OnEventRemoveHandlerAdvice Class
PostSharp.Aspects.Advices Namespace

Online Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


OnEventRemoveHandlerAdvice Constructor

OnEventRemoveHandlerAdvice Constructor PostSharp Documentation
Initializes a new instance of the OnEventRemoveHandlerAdvice class

Namespace: PostSharp.Aspects.Advices
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
public OnEventRemoveHandlerAdvice()
public OnEventRemoveHandlerAdvice()
See Also
OnEventRemoveHandlerAdvice Class
OnEventRemoveHandlerAdvice Members
PostSharp.Aspects.Advices Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


OnEventRemoveHandlerAdvice Properties

OnEventRemoveHandlerAdvice Properties PostSharp Documentation
The OnEventRemoveHandlerAdvice type exposes the following members.
Properties
 | Name | Description
Public property | Master | Name of the master advice method. If this property is not set, the current method is itself the master of the group. Only master methods can define selectors (Pointcut) and dependencies (AspectDependencyAttribute). (Inherited from GroupingAdvice.)
Back to Top
See Also
OnEventRemoveHandlerAdvice Class
PostSharp.Aspects.Advices Namespace

Online Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


OnLocationGetValueAdvice Class

OnLocationGetValueAdvice Class PostSharp Documentation
Custom attribute that, when applied on a method of an aspect class, specifies that this method is an advice having the same semantics as OnGetValue(LocationInterceptionArgs).
Inheritance Hierarchy
Online System Object
Online System Attribute
PostSharp.Aspects.Advices Advice
PostSharp.Aspects.Advices GroupingAdvice
PostSharp.Aspects.Advices OnLocationGetValueAdvice

Namespace: PostSharp.Aspects.Advices
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
public sealed class OnLocationGetValueAdvice : GroupingAdvice
public sealed class OnLocationGetValueAdvice : GroupingAdvice
Remarks

                The method to which this custom attribute is applied must be public and must have the same signature as
                OnGetValue(LocationInterceptionArgs). However, it can be static.

                If an aspect defines many advices (among OnLocationSetValueAdvice,
                OnLocationGetValueAdvice) and if these advices
                are meant to be applied to the same properties with consistent ordering, they should be
                grouped together (see Master property).

                Standalone advices or group masters should also be annotated by a custom attribute derived from
                Pointcut.

  Note  Note

      PostSharp Professional Edition is required for this feature.

See Also
OnLocationGetValueAdvice Members
PostSharp.Aspects.Advices Namespace
PostSharp.Aspects LocationLevelAspect
PostSharp.Aspects.Advices OnLocationSetValueAdvice

      Conceptual Documentation: Adding Behaviors to Members

  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


OnLocationGetValueAdvice Members

OnLocationGetValueAdvice Members PostSharp Documentation

The OnLocationGetValueAdvice type exposes the following members.
Constructors
 | Name | Description
Public method | OnLocationGetValueAdvice | Initializes a new instance of the OnLocationGetValueAdvice class
Back to Top
Properties
 | Name | Description
Public property | Master | Name of the master advice method. If this property is not set, the current method is itself the master of the group. Only master methods can define selectors (Pointcut) and dependencies (AspectDependencyAttribute). (Inherited from GroupingAdvice.)
Back to Top
See Also
OnLocationGetValueAdvice Class
PostSharp.Aspects.Advices Namespace

Online Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


OnLocationGetValueAdvice Constructor

OnLocationGetValueAdvice Constructor PostSharp Documentation
Initializes a new instance of the OnLocationGetValueAdvice class

Namespace: PostSharp.Aspects.Advices
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
public OnLocationGetValueAdvice()
public OnLocationGetValueAdvice()
See Also
OnLocationGetValueAdvice Class
OnLocationGetValueAdvice Members
PostSharp.Aspects.Advices Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


OnLocationGetValueAdvice Properties

OnLocationGetValueAdvice Properties PostSharp Documentation
The OnLocationGetValueAdvice type exposes the following members.
Properties
 | Name | Description
Public property | Master | Name of the master advice method. If this property is not set, the current method is itself the master of the group. Only master methods can define selectors (Pointcut) and dependencies (AspectDependencyAttribute). (Inherited from GroupingAdvice.)
Back to Top
See Also
OnLocationGetValueAdvice Class
PostSharp.Aspects.Advices Namespace

Online Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


OnLocationSetValueAdvice Class

OnLocationSetValueAdvice Class PostSharp Documentation
Custom attribute that, when applied on a method of an aspect class, specifies that this method is an advice having the same semantics as OnSetValue(LocationInterceptionArgs).
Inheritance Hierarchy
Online System Object
Online System Attribute
PostSharp.Aspects.Advices Advice
PostSharp.Aspects.Advices GroupingAdvice
PostSharp.Aspects.Advices OnLocationSetValueAdvice

Namespace: PostSharp.Aspects.Advices
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
public sealed class OnLocationSetValueAdvice : GroupingAdvice
public sealed class OnLocationSetValueAdvice : GroupingAdvice
Remarks

                The method to which this custom attribute is applied must be public and must have the same signature as
                OnSetValue(LocationInterceptionArgs). However, it can be static.

                If an aspect defines many advices (among OnLocationSetValueAdvice,
                OnLocationGetValueAdvice) and if these advices
                are meant to be applied to the same properties with consistent ordering, they should be
                grouped together (see Master property).

                Standalone advices or group masters should also be annotated by a custom attribute derived from
                Pointcut.

  Note  Note

      PostSharp Professional Edition is required for this feature.

See Also
OnLocationSetValueAdvice Members
PostSharp.Aspects.Advices Namespace
PostSharp.Aspects LocationLevelAspect
PostSharp.Aspects.Advices OnLocationGetValueAdvice

      Conceptual Documentation: Adding Behaviors to Members

  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


OnLocationSetValueAdvice Members

OnLocationSetValueAdvice Members PostSharp Documentation

The OnLocationSetValueAdvice type exposes the following members.
Constructors
 | Name | Description
Public method | OnLocationSetValueAdvice | Initializes a new instance of the OnLocationSetValueAdvice class
Back to Top
Properties
 | Name | Description
Public property | Master | Name of the master advice method. If this property is not set, the current method is itself the master of the group. Only master methods can define selectors (Pointcut) and dependencies (AspectDependencyAttribute). (Inherited from GroupingAdvice.)
Back to Top
See Also
OnLocationSetValueAdvice Class
PostSharp.Aspects.Advices Namespace

Online Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


OnLocationSetValueAdvice Constructor

OnLocationSetValueAdvice Constructor PostSharp Documentation
Initializes a new instance of the OnLocationSetValueAdvice class

Namespace: PostSharp.Aspects.Advices
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
public OnLocationSetValueAdvice()
public OnLocationSetValueAdvice()
See Also
OnLocationSetValueAdvice Class
OnLocationSetValueAdvice Members
PostSharp.Aspects.Advices Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


OnLocationSetValueAdvice Properties

OnLocationSetValueAdvice Properties PostSharp Documentation
The OnLocationSetValueAdvice type exposes the following members.
Properties
 | Name | Description
Public property | Master | Name of the master advice method. If this property is not set, the current method is itself the master of the group. Only master methods can define selectors (Pointcut) and dependencies (AspectDependencyAttribute). (Inherited from GroupingAdvice.)
Back to Top
See Also
OnLocationSetValueAdvice Class
PostSharp.Aspects.Advices Namespace

Online Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


OnMethodEntryAdvice Class

OnMethodEntryAdvice Class PostSharp Documentation
Custom attribute that, when applied on a method of an aspect class, specifies that this method is an advice having the same semantics as OnEntry(MethodExecutionArgs).
Inheritance Hierarchy
Online System Object
Online System Attribute
PostSharp.Aspects.Advices Advice
PostSharp.Aspects.Advices GroupingAdvice
PostSharp.Aspects.Advices OnMethodEntryAdvice

Namespace: PostSharp.Aspects.Advices
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
public sealed class OnMethodEntryAdvice : GroupingAdvice
public sealed class OnMethodEntryAdvice : GroupingAdvice
Remarks

                The method to which this custom attribute is applied must be public and must have the same signature as
                OnEntry(MethodExecutionArgs). However, it can be static.

      If an aspect defines many advices (among
      OnMethodEntryAdvice
      ,
      OnMethodExitAdvice
      ,
      OnMethodSuccessAdvice
      and
      OnMethodExceptionAdvice
      ) that are meant to be applied to the same methods with consistent ordering, these advices should be
      grouped together (see
      Master
      property).

  Note  Note

      Standalone advices or group masters should also be annotated by a custom attribute derived from
      Pointcut
      .

  Note  Note

      PostSharp Professional Edition is required for this feature.

See Also
OnMethodEntryAdvice Members
PostSharp.Aspects.Advices Namespace
PostSharp.Aspects OnMethodBoundaryAspect
PostSharp.Aspects.Advices OnMethodExitAdvice
PostSharp.Aspects.Advices OnMethodSuccessAdvice
PostSharp.Aspects.Advices OnMethodExceptionAdvice

      Conceptual Documentation: Adding Behaviors to Members

  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


OnMethodEntryAdvice Members

OnMethodEntryAdvice Members PostSharp Documentation

The OnMethodEntryAdvice type exposes the following members.
Constructors
 | Name | Description
Public method | OnMethodEntryAdvice | Initializes a new instance of the OnMethodEntryAdvice class
Back to Top
Properties
 | Name | Description
Public property | Master | Name of the master advice method. If this property is not set, the current method is itself the master of the group. Only master methods can define selectors (Pointcut) and dependencies (AspectDependencyAttribute). (Inherited from GroupingAdvice.)
Back to Top
See Also
OnMethodEntryAdvice Class
PostSharp.Aspects.Advices Namespace

Online Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


OnMethodEntryAdvice Constructor

OnMethodEntryAdvice Constructor PostSharp Documentation
Initializes a new instance of the OnMethodEntryAdvice class

Namespace: PostSharp.Aspects.Advices
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
public OnMethodEntryAdvice()
public OnMethodEntryAdvice()
See Also
OnMethodEntryAdvice Class
OnMethodEntryAdvice Members
PostSharp.Aspects.Advices Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


OnMethodEntryAdvice Properties

OnMethodEntryAdvice Properties PostSharp Documentation
The OnMethodEntryAdvice type exposes the following members.
Properties
 | Name | Description
Public property | Master | Name of the master advice method. If this property is not set, the current method is itself the master of the group. Only master methods can define selectors (Pointcut) and dependencies (AspectDependencyAttribute). (Inherited from GroupingAdvice.)
Back to Top
See Also
OnMethodEntryAdvice Class
PostSharp.Aspects.Advices Namespace

Online Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


OnMethodExceptionAdvice Class

OnMethodExceptionAdvice Class PostSharp Documentation
Custom attribute that, when applied on a method of an aspect class, specifies that this method is an advice having the same semantics as OnException(MethodExecutionArgs).
Inheritance Hierarchy
Online System Object
Online System Attribute
PostSharp.Aspects.Advices Advice
PostSharp.Aspects.Advices GroupingAdvice
PostSharp.Aspects.Advices OnMethodExceptionAdvice

Namespace: PostSharp.Aspects.Advices
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
public sealed class OnMethodExceptionAdvice : GroupingAdvice
public sealed class OnMethodExceptionAdvice : GroupingAdvice
Remarks

                The method to which this custom attribute is applied must be public and must have the same signature as
                OnException(MethodExecutionArgs). However, it can be static.

      If an aspect defines many advices (among
      OnMethodEntryAdvice
      ,
      OnMethodExitAdvice
      ,
      OnMethodSuccessAdvice
      and
      OnMethodExceptionAdvice
      ) that are meant to be applied to the same methods with consistent ordering, these advices should be
      grouped together (see
      Master
      property).

  Note  Note

      Standalone advices or group masters should also be annotated by a custom attribute derived from
      Pointcut
      .

  Note  Note

      PostSharp Professional Edition is required for this feature.

See Also
OnMethodExceptionAdvice Members
PostSharp.Aspects.Advices Namespace
PostSharp.Aspects OnMethodBoundaryAspect
PostSharp.Aspects.Advices OnMethodExitAdvice
PostSharp.Aspects.Advices OnMethodSuccessAdvice
PostSharp.Aspects.Advices OnMethodEntryAdvice

      Conceptual Documentation: Adding Behaviors to Members

  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


OnMethodExceptionAdvice Members

OnMethodExceptionAdvice Members PostSharp Documentation

The OnMethodExceptionAdvice type exposes the following members.
Constructors
 | Name | Description
Public method | OnMethodExceptionAdvice | Initializes a new instance of the OnMethodExceptionAdvice class
Back to Top
Properties
 | Name | Description
Public property | Master | Name of the master advice method. If this property is not set, the current method is itself the master of the group. Only master methods can define selectors (Pointcut) and dependencies (AspectDependencyAttribute). (Inherited from GroupingAdvice.)
Back to Top
See Also
OnMethodExceptionAdvice Class
PostSharp.Aspects.Advices Namespace

Online Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


OnMethodExceptionAdvice Constructor

OnMethodExceptionAdvice Constructor PostSharp Documentation
Initializes a new instance of the OnMethodExceptionAdvice class

Namespace: PostSharp.Aspects.Advices
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
public OnMethodExceptionAdvice()
public OnMethodExceptionAdvice()
See Also
OnMethodExceptionAdvice Class
OnMethodExceptionAdvice Members
PostSharp.Aspects.Advices Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


OnMethodExceptionAdvice Properties

OnMethodExceptionAdvice Properties PostSharp Documentation
The OnMethodExceptionAdvice type exposes the following members.
Properties
 | Name | Description
Public property | Master | Name of the master advice method. If this property is not set, the current method is itself the master of the group. Only master methods can define selectors (Pointcut) and dependencies (AspectDependencyAttribute). (Inherited from GroupingAdvice.)
Back to Top
See Also
OnMethodExceptionAdvice Class
PostSharp.Aspects.Advices Namespace

Online Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


OnMethodExitAdvice Class

OnMethodExitAdvice Class PostSharp Documentation
Custom attribute that, when applied on a method of an aspect class, specifies that this method is an advice having the same semantics as OnExit(MethodExecutionArgs).
Inheritance Hierarchy
Online System Object
Online System Attribute
PostSharp.Aspects.Advices Advice
PostSharp.Aspects.Advices GroupingAdvice
PostSharp.Aspects.Advices OnMethodExitAdvice

Namespace: PostSharp.Aspects.Advices
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
public sealed class OnMethodExitAdvice : GroupingAdvice
public sealed class OnMethodExitAdvice : GroupingAdvice
Remarks

                The method to which this custom attribute is applied must be public and must have the same signature as
                OnExit(MethodExecutionArgs). However, it can be static.

      If an aspect defines many advices (among
      OnMethodEntryAdvice
      ,
      OnMethodExitAdvice
      ,
      OnMethodSuccessAdvice
      and
      OnMethodExceptionAdvice
      ) that are meant to be applied to the same methods with consistent ordering, these advices should be
      grouped together (see
      Master
      property).

  Note  Note

      Standalone advices or group masters should also be annotated by a custom attribute derived from
      Pointcut
      .

  Note  Note

      PostSharp Professional Edition is required for this feature.

See Also
OnMethodExitAdvice Members
PostSharp.Aspects.Advices Namespace
PostSharp.Aspects OnMethodBoundaryAspect
PostSharp.Aspects.Advices OnMethodExceptionAdvice
PostSharp.Aspects.Advices OnMethodSuccessAdvice
PostSharp.Aspects.Advices OnMethodEntryAdvice

      Conceptual Documentation: Adding Behaviors to Members

  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


OnMethodExitAdvice Members

OnMethodExitAdvice Members PostSharp Documentation

The OnMethodExitAdvice type exposes the following members.
Constructors
 | Name | Description
Public method | OnMethodExitAdvice | Initializes a new instance of the OnMethodExitAdvice class
Back to Top
Properties
 | Name | Description
Public property | Master | Name of the master advice method. If this property is not set, the current method is itself the master of the group. Only master methods can define selectors (Pointcut) and dependencies (AspectDependencyAttribute). (Inherited from GroupingAdvice.)
Back to Top
See Also
OnMethodExitAdvice Class
PostSharp.Aspects.Advices Namespace

Online Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


OnMethodExitAdvice Constructor

OnMethodExitAdvice Constructor PostSharp Documentation
Initializes a new instance of the OnMethodExitAdvice class

Namespace: PostSharp.Aspects.Advices
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
public OnMethodExitAdvice()
public OnMethodExitAdvice()
See Also
OnMethodExitAdvice Class
OnMethodExitAdvice Members
PostSharp.Aspects.Advices Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


OnMethodExitAdvice Properties

OnMethodExitAdvice Properties PostSharp Documentation
The OnMethodExitAdvice type exposes the following members.
Properties
 | Name | Description
Public property | Master | Name of the master advice method. If this property is not set, the current method is itself the master of the group. Only master methods can define selectors (Pointcut) and dependencies (AspectDependencyAttribute). (Inherited from GroupingAdvice.)
Back to Top
See Also
OnMethodExitAdvice Class
PostSharp.Aspects.Advices Namespace

Online Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


OnMethodInvokeAdvice Class

OnMethodInvokeAdvice Class PostSharp Documentation
Custom attribute that, when applied on a method of an aspect class, specifies that this method is an advice having the same semantics as OnInvoke(MethodInterceptionArgs).
Inheritance Hierarchy
Online System Object
Online System Attribute
PostSharp.Aspects.Advices Advice
PostSharp.Aspects.Advices OnMethodInvokeAdvice

Namespace: PostSharp.Aspects.Advices
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
public sealed class OnMethodInvokeAdvice : Advice
public sealed class OnMethodInvokeAdvice : Advice
Remarks

                The method to which this custom attribute is applied must be public and must have the same signature as
                OnInvoke(MethodInterceptionArgs). However, it can be static.

  Note  Note

      PostSharp Professional Edition is required for this feature.

See Also
OnMethodInvokeAdvice Members
PostSharp.Aspects.Advices Namespace
PostSharp.Aspects MethodInterceptionAspect

      Conceptual Documentation: Adding Behaviors to Members

  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


OnMethodInvokeAdvice Members

OnMethodInvokeAdvice Members PostSharp Documentation

The OnMethodInvokeAdvice type exposes the following members.
Constructors
 | Name | Description
Public method | OnMethodInvokeAdvice | Initializes a new instance of the OnMethodInvokeAdvice class
Back to Top
See Also
OnMethodInvokeAdvice Class
PostSharp.Aspects.Advices Namespace

Online Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


OnMethodInvokeAdvice Constructor

OnMethodInvokeAdvice Constructor PostSharp Documentation
Initializes a new instance of the OnMethodInvokeAdvice class

Namespace: PostSharp.Aspects.Advices
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
public OnMethodInvokeAdvice()
public OnMethodInvokeAdvice()
See Also
OnMethodInvokeAdvice Class
OnMethodInvokeAdvice Members
PostSharp.Aspects.Advices Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


OnMethodSuccessAdvice Class

OnMethodSuccessAdvice Class PostSharp Documentation
Custom attribute that, when applied on a method of an aspect class, specifies that this method is an advice having the same semantics as OnSuccess(MethodExecutionArgs).
Inheritance Hierarchy
Online System Object
Online System Attribute
PostSharp.Aspects.Advices Advice
PostSharp.Aspects.Advices GroupingAdvice
PostSharp.Aspects.Advices OnMethodSuccessAdvice

Namespace: PostSharp.Aspects.Advices
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
public sealed class OnMethodSuccessAdvice : GroupingAdvice
public sealed class OnMethodSuccessAdvice : GroupingAdvice
Remarks

                The method to which this custom attribute is applied must be public and must have the same signature as
                OnSuccess(MethodExecutionArgs). However, it can be static.

      If an aspect defines many advices (among
      OnMethodEntryAdvice
      ,
      OnMethodExitAdvice
      ,
      OnMethodSuccessAdvice
      and
      OnMethodExceptionAdvice
      ) that are meant to be applied to the same methods with consistent ordering, these advices should be
      grouped together (see
      Master
      property).

  Note  Note

      Standalone advices or group masters should also be annotated by a custom attribute derived from
      Pointcut
      .

  Note  Note

      PostSharp Professional Edition is required for this feature.

See Also
OnMethodSuccessAdvice Members
PostSharp.Aspects.Advices Namespace
PostSharp.Aspects OnMethodBoundaryAspect
PostSharp.Aspects.Advices OnMethodExitAdvice
PostSharp.Aspects.Advices OnMethodExceptionAdvice
PostSharp.Aspects.Advices OnMethodEntryAdvice

      Conceptual Documentation: Adding Behaviors to Members

  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


OnMethodSuccessAdvice Members

OnMethodSuccessAdvice Members PostSharp Documentation

The OnMethodSuccessAdvice type exposes the following members.
Constructors
 | Name | Description
Public method | OnMethodSuccessAdvice | Initializes a new instance of the OnMethodSuccessAdvice class
Back to Top
Properties
 | Name | Description
Public property | Master | Name of the master advice method. If this property is not set, the current method is itself the master of the group. Only master methods can define selectors (Pointcut) and dependencies (AspectDependencyAttribute). (Inherited from GroupingAdvice.)
Back to Top
See Also
OnMethodSuccessAdvice Class
PostSharp.Aspects.Advices Namespace

Online Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


OnMethodSuccessAdvice Constructor

OnMethodSuccessAdvice Constructor PostSharp Documentation
Initializes a new instance of the OnMethodSuccessAdvice class

Namespace: PostSharp.Aspects.Advices
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
public OnMethodSuccessAdvice()
public OnMethodSuccessAdvice()
See Also
OnMethodSuccessAdvice Class
OnMethodSuccessAdvice Members
PostSharp.Aspects.Advices Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


OnMethodSuccessAdvice Properties

OnMethodSuccessAdvice Properties PostSharp Documentation
The OnMethodSuccessAdvice type exposes the following members.
Properties
 | Name | Description
Public property | Master | Name of the master advice method. If this property is not set, the current method is itself the master of the group. Only master methods can define selectors (Pointcut) and dependencies (AspectDependencyAttribute). (Inherited from GroupingAdvice.)
Back to Top
See Also
OnMethodSuccessAdvice Class
PostSharp.Aspects.Advices Namespace

Online Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


Pointcut Class

Pointcut Class PostSharp Documentation
Custom attribute, typically accompanying an advice, specifying to which code elements the advice applies.
Inheritance Hierarchy
Online System Object
Online System Attribute
PostSharp.Aspects.Advices Pointcut
PostSharp.Aspects.Advices MethodPointcut
PostSharp.Aspects.Advices MulticastPointcut
PostSharp.Aspects.Advices SelfPointcut

Namespace: PostSharp.Aspects.Advices
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
public abstract class Pointcut : Attribute
public abstract class Pointcut : Attribute
Remarks
  Note  Note

      PostSharp Professional Edition is required for this feature.

See Also
Pointcut Members
PostSharp.Aspects.Advices Namespace

      Conceptual Documentation: Adding Behaviors to Members

  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


Pointcut Members

Pointcut Members PostSharp Documentation

The Pointcut type exposes the following members.
Constructors
 | Name | Description
Protected method | Pointcut | Initializes a new instance of the Pointcut class
Back to Top
See Also
Pointcut Class
PostSharp.Aspects.Advices Namespace

Online Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


Pointcut Constructor

Pointcut Constructor PostSharp Documentation
Initializes a new instance of the Pointcut class

Namespace: PostSharp.Aspects.Advices
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
protected Pointcut()
protected Pointcut()
See Also
Pointcut Class
Pointcut Members
PostSharp.Aspects.Advices Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


Property(TValue) Class

Property TValue Class PostSharp Documentation
Exposes the semantics of a parameterless property for use with the ImportMemberAttribute aspect extension.
Inheritance Hierarchy
Online System Object
PostSharp.Aspects.Advices Property TValue

Namespace: PostSharp.Aspects.Advices
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
[SerializableAttribute]
public sealed class Property<TValue>
[SerializableAttribute]
public sealed class Property<TValue>
Type Parameters
TValue
Property value type.
Remarks
  Note  Note

      PostSharp Professional Edition is required for this feature.

See Also
Property TValue  Members
PostSharp.Aspects.Advices Namespace
PostSharp.Aspects.Advices Property TValue, TIndex
PostSharp.Aspects.Advices PropertyGetter TValue
PostSharp.Aspects.Advices PropertySetter TValue
PostSharp.Aspects.Advices ImportMemberAttribute

      Conceptual Documentation: Introducing, Overriding and Importing Members

  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


Property(TValue) Members

Property TValue Members PostSharp Documentation

The Property TValue type exposes the following members.
Properties
 | Name | Description
Public property | Get | Gets a delegate enabling to invoke the get accessor of the imported property.
Public property | Set | Gets a delegate enabling to invoke the set accessor of the imported property.
Back to Top
See Also
Property TValue Class
PostSharp.Aspects.Advices Namespace

Online Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


Property(TValue) Properties

Property TValue Properties PostSharp Documentation
The Property TValue type exposes the following members.
Properties
 | Name | Description
Public property | Get | Gets a delegate enabling to invoke the get accessor of the imported property.
Public property | Set | Gets a delegate enabling to invoke the set accessor of the imported property.
Back to Top
See Also
Property TValue Class
PostSharp.Aspects.Advices Namespace

Online Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


Property(TValue).Get Property

Property TValue Get Property PostSharp Documentation
Gets a delegate enabling to invoke the get accessor of the imported property.

Namespace: PostSharp.Aspects.Advices
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
public PropertyGetter<TValue> Get { get; private set; }
public PropertyGetter<TValue> Get { get; private set; }
Property Value
Type: PropertyGetter  TValue
See Also
Property TValue  Class
Property TValue  Members
PostSharp.Aspects.Advices Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


Property(TValue).Set Property

Property TValue Set Property PostSharp Documentation
Gets a delegate enabling to invoke the set accessor of the imported property.

Namespace: PostSharp.Aspects.Advices
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
public PropertySetter<TValue> Set { get; private set; }
public PropertySetter<TValue> Set { get; private set; }
Property Value
Type: PropertySetter  TValue
See Also
Property TValue  Class
Property TValue  Members
PostSharp.Aspects.Advices Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


Property(TValue, TIndex) Class

Property TValue, TIndex Class PostSharp Documentation
Mimics the semantics of a property accepting a single index parameter, for use with the ImportMemberAttribute aspect extension.
Inheritance Hierarchy
Online System Object
PostSharp.Aspects.Advices Property TValue, TIndex

Namespace: PostSharp.Aspects.Advices
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
[SerializableAttribute]
public sealed class Property<TValue, TIndex>
[SerializableAttribute]
public sealed class Property<TValue, TIndex>
Type Parameters
TValue
Property value type.
TIndex
Property index type.
See Also
Property TValue, TIndex  Members
PostSharp.Aspects.Advices Namespace
PostSharp.Aspects.Advices Property TValue
PostSharp.Aspects.Advices PropertyGetter TValue, TIndex
PostSharp.Aspects.Advices PropertySetter TValue, TIndex
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


Property(TValue, TIndex) Members

Property TValue, TIndex Members PostSharp Documentation

The Property TValue, TIndex type exposes the following members.
Properties
 | Name | Description
Public property | Get | Gets a delegate enabling to invoke the get accessor of the imported property.
Public property | Set | Gets a delegate enabling to invoke the set accessor of the imported property.
Back to Top
See Also
Property TValue, TIndex Class
PostSharp.Aspects.Advices Namespace

Online Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


Property(TValue, TIndex) Properties

Property TValue, TIndex Properties PostSharp Documentation
The Property TValue, TIndex type exposes the following members.
Properties
 | Name | Description
Public property | Get | Gets a delegate enabling to invoke the get accessor of the imported property.
Public property | Set | Gets a delegate enabling to invoke the set accessor of the imported property.
Back to Top
See Also
Property TValue, TIndex Class
PostSharp.Aspects.Advices Namespace

Online Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


Property(TValue, TIndex).Get Property

Property TValue, TIndex Get Property PostSharp Documentation
Gets a delegate enabling to invoke the get accessor of the imported property.

Namespace: PostSharp.Aspects.Advices
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
public PropertyGetter<TValue, TIndex> Get { get; private set; }
public PropertyGetter<TValue, TIndex> Get { get; private set; }
Property Value
Type: PropertyGetter  TValue, TIndex
See Also
Property TValue, TIndex  Class
Property TValue, TIndex  Members
PostSharp.Aspects.Advices Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


Property(TValue, TIndex).Set Property

Property TValue, TIndex Set Property PostSharp Documentation
Gets a delegate enabling to invoke the set accessor of the imported property.

Namespace: PostSharp.Aspects.Advices
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
public PropertySetter<TValue, TIndex> Set { get; private set; }
public PropertySetter<TValue, TIndex> Set { get; private set; }
Property Value
Type: PropertySetter  TValue, TIndex
See Also
Property TValue, TIndex  Class
Property TValue, TIndex  Members
PostSharp.Aspects.Advices Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


PropertyGetter(TValue) Delegate

PropertyGetter TValue Delegate PostSharp Documentation
Defines the signature of methods implementing the Get semantic of a parameterless property.

Namespace: PostSharp.Aspects.Advices
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
public delegate TValue PropertyGetter<TValue>()
public delegate TValue PropertyGetter<TValue>()
Type Parameters
TValue
Property value type.
Return Value
Type: TValue
The property value.
See Also
PostSharp.Aspects.Advices Namespace
PostSharp.Aspects.Advices Property TValue
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


PropertyGetter(TValue, TIndex) Delegate

PropertyGetter TValue, TIndex Delegate PostSharp Documentation
Defines the signature of methods implementing the Get semantic of a property with a single index parameter.

Namespace: PostSharp.Aspects.Advices
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
public delegate TValue PropertyGetter<TValue, TIndex>(
    TIndex index
)
public delegate TValue PropertyGetter<TValue, TIndex>(
    TIndex index
)
Parameters
index
Type: TIndex
Index.
Type Parameters
TValue
Property value type.
TIndex
Property index type.
Return Value
Type: TValue
The property value.
See Also
PostSharp.Aspects.Advices Namespace
PostSharp.Aspects.Advices Property TValue, TIndex
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


PropertySetter(TValue) Delegate

PropertySetter TValue Delegate PostSharp Documentation
Defines the signature of methods implementing the Set semantic of a parameterless property.

Namespace: PostSharp.Aspects.Advices
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
public delegate void PropertySetter<TValue>(
    TValue value
)
public delegate void PropertySetter<TValue>(
    TValue value
)
Parameters
value
Type: TValue
The property value.
Type Parameters
TValue
Property value type.
See Also
PostSharp.Aspects.Advices Namespace
PostSharp.Aspects.Advices Property TValue
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


PropertySetter(TValue, TIndex) Delegate

PropertySetter TValue, TIndex Delegate PostSharp Documentation
Defines the signature of methods implementing the Set semantic of a property with a single index parameter.

Namespace: PostSharp.Aspects.Advices
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
public delegate void PropertySetter<TValue, TIndex>(
    TIndex index,
    TValue value
)
public delegate void PropertySetter<TValue, TIndex>(
    TIndex index,
    TValue value
)
Parameters
index
Type: TIndex
Index.
value
Type: TValue
The property value.
Type Parameters
TValue
Property value type.
TIndex
Property index type.
See Also
PostSharp.Aspects.Advices Namespace
PostSharp.Aspects.Advices Property TValue, TIndex
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


SelfPointcut Class

SelfPointcut Class PostSharp Documentation
Pointcut that selects exactly the aspect target.
Inheritance Hierarchy
Online System Object
Online System Attribute
PostSharp.Aspects.Advices Pointcut
PostSharp.Aspects.Advices SelfPointcut

Namespace: PostSharp.Aspects.Advices
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
public sealed class SelfPointcut : Pointcut
public sealed class SelfPointcut : Pointcut
Remarks
  Note  Note

      PostSharp Professional Edition is required for this feature.

See Also
SelfPointcut Members
PostSharp.Aspects.Advices Namespace

      Conceptual Documentation: Adding Behaviors to Members

  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


SelfPointcut Members

SelfPointcut Members PostSharp Documentation

The SelfPointcut type exposes the following members.
Constructors
 | Name | Description
Public method | SelfPointcut | Initializes a new instance of the SelfPointcut class
Back to Top
See Also
SelfPointcut Class
PostSharp.Aspects.Advices Namespace

Online Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


SelfPointcut Constructor

SelfPointcut Constructor PostSharp Documentation
Initializes a new instance of the SelfPointcut class

Namespace: PostSharp.Aspects.Advices
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
public SelfPointcut()
public SelfPointcut()
See Also
SelfPointcut Class
SelfPointcut Members
PostSharp.Aspects.Advices Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


PostSharp.Aspects.Configuration Namespace

PostSharp.Aspects.Configuration Namespace PostSharp Documentation
The PostSharp.Aspects.Configuration namespace contains classes and custom attributes configuring the aspects of the PostSharp.Aspects namespace.
Classes
 | Class | Description
Public class | AspectConfiguration | Configuration of an IAspect.
Public class | AspectConfigurationAttribute | Configures an aspect of type IAspect.
Public class | AspectConfigurationAttributeTypeAttribute | Custom attribute that, when applied to an aspect, specifies which custom attribute type (derived from AspectConfigurationAttribute) can provide declarative configuration for the aspect.
Public class | CompositionAspectConfiguration | Configuration of aspects of type ICompositionAspect.
Public class | CompositionAspectConfigurationAttribute | Custom attribute that, when applied on a class implementing ICompositionAspect, defines the declarative configuration of that aspect.
Public class | CustomAttributeIntroductionAspectConfiguration | Configuration of aspects of type CustomAttributeIntroductionAspect.
Public class | EventInterceptionAspectConfiguration | Configuration of aspects of type IEventInterceptionAspect.
Public class | EventInterceptionAspectConfigurationAttribute | Custom attribute that, when applied on a class implementing IEventInterceptionAspect, defines the declarative configuration of that aspect.
Public class | ExternalAspectConfiguration | Configuration of aspects of type IExternalAspect.
Public class | ExternalAspectConfigurationAttribute | Obsolete. Specifies the type name of the implementation of external aspects (IExternalAspect).
Public class | LocationInterceptionAspectConfiguration | Configuration of aspects of type ILocationLevelAspect.
Public class | LocationInterceptionAspectConfigurationAttribute | Custom attribute that, when applied on a class implementing ILocationInterceptionAspect, defines the declarative configuration of that aspect.
Public class | ManagedResourceIntroductionAspectConfiguration | Configuration of aspects of type ManagedResourceIntroductionAspect.
Public class | MethodInterceptionAspectConfiguration | Configuration of aspects of type IMethodInterceptionAspect.
Public class | MethodInterceptionAspectConfigurationAttribute | Custom attribute that, when applied on a class implementing IMethodInterceptionAspect, defines the declarative configuration of that aspect.
Public class | OnExceptionAspectConfiguration | Configuration of the IOnExceptionAspect aspect.
Public class | OnExceptionAspectConfigurationAttribute | Custom attribute that, when applied on a class implementing IOnExceptionAspect, defines the configuration of that aspect.
Public class | OnMethodBoundaryAspectConfiguration | Configuration of the IOnMethodBoundaryAspect aspect.
Public class | OnMethodBoundaryAspectConfigurationAttribute | Custom attribute that, when applied on a class implementing IOnMethodBoundaryAspect, defines the configuration of that aspect.
Interfaces
 | Interface | Description
Public interface | IProfileAwareConfiguration | Allows an AspectConfiguration to depend on a profile, i.e. an external piece of configuration stored as a resource in the project file. Classes derived from AspectConfiguration may implement this interface.

Online Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


AspectConfiguration Class

AspectConfiguration Class PostSharp Documentation
Configuration of an IAspect.
Inheritance Hierarchy
Online System Object
PostSharp.Aspects.Configuration AspectConfiguration
PostSharp.Aspects.Configuration CompositionAspectConfiguration
PostSharp.Aspects.Configuration CustomAttributeIntroductionAspectConfiguration
PostSharp.Aspects.Configuration EventInterceptionAspectConfiguration
PostSharp.Aspects.Configuration ExternalAspectConfiguration
PostSharp.Aspects.Configuration LocationInterceptionAspectConfiguration
PostSharp.Aspects.Configuration ManagedResourceIntroductionAspectConfiguration
PostSharp.Aspects.Configuration MethodInterceptionAspectConfiguration
PostSharp.Aspects.Configuration OnExceptionAspectConfiguration
PostSharp.Aspects.Configuration OnMethodBoundaryAspectConfiguration
PostSharp.Patterns.Diagnostics LogAspectConfiguration

Namespace: PostSharp.Aspects.Configuration
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
public class AspectConfiguration
public class AspectConfiguration
Remarks

              Every concrete aspect class has a corresponding configuration class derived from AspectConfiguration.

See Also
AspectConfiguration Members
PostSharp.Aspects.Configuration Namespace

      Conceptual Documentation: Configuring Aspects

  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


AspectConfiguration Members

AspectConfiguration Members PostSharp Documentation

The AspectConfiguration type exposes the following members.
Constructors
 | Name | Description
Public method | AspectConfiguration | Initializes a new instance of the AspectConfiguration class
Back to Top
Properties
 | Name | Description
Public property | AspectPriority | Gets or sets the aspect priority. Aspects with smaller priority are processed first. The default priority is zero.
Public property | Dependencies | Gets or sets the collection of dependencies.
Public property | SerializerType | Gets or sets the type of the serializer that will be used to configure the current aspect.
Back to Top
See Also
AspectConfiguration Class
PostSharp.Aspects.Configuration Namespace

Online Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


AspectConfiguration Constructor

AspectConfiguration Constructor PostSharp Documentation
Initializes a new instance of the AspectConfiguration class

Namespace: PostSharp.Aspects.Configuration
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
public AspectConfiguration()
public AspectConfiguration()
See Also
AspectConfiguration Class
AspectConfiguration Members
PostSharp.Aspects.Configuration Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


AspectConfiguration Properties

AspectConfiguration Properties PostSharp Documentation
The AspectConfiguration type exposes the following members.
Properties
 | Name | Description
Public property | AspectPriority | Gets or sets the aspect priority. Aspects with smaller priority are processed first. The default priority is zero.
Public property | Dependencies | Gets or sets the collection of dependencies.
Public property | SerializerType | Gets or sets the type of the serializer that will be used to configure the current aspect.
Back to Top
See Also
AspectConfiguration Class
PostSharp.Aspects.Configuration Namespace

Online Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


AspectConfiguration.AspectPriority Property

AspectConfiguration AspectPriority Property PostSharp Documentation
Gets or sets the aspect priority. Aspects with smaller priority are processed first. The default priority is zero.

Namespace: PostSharp.Aspects.Configuration
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
public Nullable<int> AspectPriority { get; set; }
public Nullable<int> AspectPriority { get; set; }
Property Value
Type:   Online Nullable    Online Int32
Remarks

              Whenever possible, use dependencies (Dependencies collection) to specify the ordering of aspects.
              Unlike priorities, dependencies scale up in complexity, which can be important in larger projects.

See Also
AspectConfiguration Class
AspectConfiguration Members
PostSharp.Aspects.Configuration Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


AspectConfiguration.Dependencies Property

AspectConfiguration Dependencies Property PostSharp Documentation
Gets or sets the collection of dependencies.

Namespace: PostSharp.Aspects.Configuration
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
public AspectDependencyAttributeCollection Dependencies { get; set; }
public AspectDependencyAttributeCollection Dependencies { get; set; }
Property Value
Type: AspectDependencyAttributeCollection
See Also
AspectConfiguration Class
AspectConfiguration Members
PostSharp.Aspects.Configuration Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


AspectConfiguration.SerializerType Property

AspectConfiguration SerializerType Property PostSharp Documentation
Gets or sets the type of the serializer that will be used to configure the current aspect.

Namespace: PostSharp.Aspects.Configuration
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
public TypeIdentity SerializerType { get; set; }
public TypeIdentity SerializerType { get; set; }
Property Value
Type: TypeIdentity
Remarks

              This type should have derive from AspectSerializer
              and have a default constructor. Use null to specify that the aspect will not
              be serialized, but will be constructed using MSIL instructions.

See Also
AspectConfiguration Class
AspectConfiguration Members
PostSharp.Aspects.Configuration Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


AspectConfigurationAttribute Class

AspectConfigurationAttribute Class PostSharp Documentation
Configures an aspect of type IAspect.
Inheritance Hierarchy
Online System Object
Online System Attribute
PostSharp.Aspects.Configuration AspectConfigurationAttribute
PostSharp.Aspects.Configuration CompositionAspectConfigurationAttribute
PostSharp.Aspects.Configuration EventInterceptionAspectConfigurationAttribute
PostSharp.Aspects.Configuration ExternalAspectConfigurationAttribute
PostSharp.Aspects.Configuration LocationInterceptionAspectConfigurationAttribute
PostSharp.Aspects.Configuration MethodInterceptionAspectConfigurationAttribute
PostSharp.Aspects.Configuration OnExceptionAspectConfigurationAttribute
PostSharp.Aspects.Configuration OnMethodBoundaryAspectConfigurationAttribute
PostSharp.Patterns.Diagnostics LogAspectConfigurationAttribute

Namespace: PostSharp.Aspects.Configuration
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
public class AspectConfigurationAttribute : Attribute
public class AspectConfigurationAttribute : Attribute
See Also
AspectConfigurationAttribute Members
PostSharp.Aspects.Configuration Namespace

      Conceptual Documentation: Configuring Aspects

  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


AspectConfigurationAttribute Members

AspectConfigurationAttribute Members PostSharp Documentation

The AspectConfigurationAttribute type exposes the following members.
Constructors
 | Name | Description
Public method | AspectConfigurationAttribute | Initializes a new instance of the AspectConfigurationAttribute class
Back to Top
Methods
 | Name | Description
Protected method | CreateAspectConfiguration | Creates a concrete AspectConfiguration instance specifically for the current AspectConfigurationAttribute type.
Public method | GetAspectConfiguration | Gets the AspectConfiguration corresponding to the current custom attribute.
Protected method | SetAspectConfiguration | Sets up an AspectConfiguration object according to the current custom attribute instance.
Back to Top
Properties
 | Name | Description
Public property | AspectPriority | Gets or sets the weaving priority of the aspect.
Public property | SerializerType | Gets or sets the Online Type of the serializer that will be used to configure the current aspect.
Back to Top
See Also
AspectConfigurationAttribute Class
PostSharp.Aspects.Configuration Namespace

Online Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


AspectConfigurationAttribute Constructor

AspectConfigurationAttribute Constructor PostSharp Documentation
Initializes a new instance of the AspectConfigurationAttribute class

Namespace: PostSharp.Aspects.Configuration
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
public AspectConfigurationAttribute()
public AspectConfigurationAttribute()
See Also
AspectConfigurationAttribute Class
AspectConfigurationAttribute Members
PostSharp.Aspects.Configuration Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


AspectConfigurationAttribute Methods

AspectConfigurationAttribute Methods PostSharp Documentation
The AspectConfigurationAttribute type exposes the following members.
Methods
 | Name | Description
Protected method | CreateAspectConfiguration | Creates a concrete AspectConfiguration instance specifically for the current AspectConfigurationAttribute type.
Public method | GetAspectConfiguration | Gets the AspectConfiguration corresponding to the current custom attribute.
Protected method | SetAspectConfiguration | Sets up an AspectConfiguration object according to the current custom attribute instance.
Back to Top
See Also
AspectConfigurationAttribute Class
PostSharp.Aspects.Configuration Namespace

Online Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


AspectConfigurationAttribute.CreateAspectConfiguration Method

AspectConfigurationAttribute CreateAspectConfiguration Method PostSharp Documentation
Creates a concrete AspectConfiguration instance specifically for the current AspectConfigurationAttribute type.

Namespace: PostSharp.Aspects.Configuration
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
protected virtual AspectConfiguration CreateAspectConfiguration()
protected virtual AspectConfiguration CreateAspectConfiguration()
Return Value
Type: AspectConfiguration
A new and empty instance of AspectConfiguration, whose concrete type corresponds to
              the concrete type of the AspectConfigurationAttribute.
Remarks

              This method should not set up the returned AspectConfiguration. After the current method has
              returned, the SetAspectConfiguration(AspectConfiguration) method will be invoked, and this method is responsible
              for setting up the AspectConfigurationobject.

See Also
AspectConfigurationAttribute Class
AspectConfigurationAttribute Members
PostSharp.Aspects.Configuration Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


AspectConfigurationAttribute.GetAspectConfiguration Method

AspectConfigurationAttribute GetAspectConfiguration Method PostSharp Documentation
Gets the AspectConfiguration corresponding to the current custom attribute.

Namespace: PostSharp.Aspects.Configuration
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
public AspectConfiguration GetAspectConfiguration()
public AspectConfiguration GetAspectConfiguration()
Return Value
Type: AspectConfiguration
An AspectConfiguration corresponding to the current custom attribute.
Remarks
This method can be customized by overriding CreateAspectConfiguration  and/or
                SetAspectConfiguration(AspectConfiguration)
.

See Also
AspectConfigurationAttribute Class
AspectConfigurationAttribute Members
PostSharp.Aspects.Configuration Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


AspectConfigurationAttribute.SetAspectConfiguration Method

AspectConfigurationAttribute SetAspectConfiguration Method PostSharp Documentation
Sets up an AspectConfiguration object according to the current custom attribute instance.

Namespace: PostSharp.Aspects.Configuration
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
protected virtual void SetAspectConfiguration(
    AspectConfiguration aspectConfiguration
)
protected virtual void SetAspectConfiguration(
    AspectConfiguration aspectConfiguration
)
Parameters
aspectConfiguration
Type: PostSharp.Aspects.Configuration AspectConfiguration
The AspectConfiguration instance previously returned  by the
              CreateAspectConfiguration  method.
Remarks
Classes overriding this method must always invoke the base implementation before performing their own
                changes to the AspectConfiguration.
See Also
AspectConfigurationAttribute Class
AspectConfigurationAttribute Members
PostSharp.Aspects.Configuration Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


AspectConfigurationAttribute Properties

AspectConfigurationAttribute Properties PostSharp Documentation
The AspectConfigurationAttribute type exposes the following members.
Properties
 | Name | Description
Public property | AspectPriority | Gets or sets the weaving priority of the aspect.
Public property | SerializerType | Gets or sets the Online Type of the serializer that will be used to configure the current aspect.
Back to Top
See Also
AspectConfigurationAttribute Class
PostSharp.Aspects.Configuration Namespace

Online Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


AspectConfigurationAttribute.AspectPriority Property

AspectConfigurationAttribute AspectPriority Property PostSharp Documentation
Gets or sets the weaving priority of the aspect.

Namespace: PostSharp.Aspects.Configuration
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
public int AspectPriority { get; set; }
public int AspectPriority { get; set; }
Property Value
Type:   Online Int32
The aspect priority, or null if the aspect priority is not specified.
Remarks
Advices with lower priority are executed before in case of 'entry' semantics (entering or invoking a
                method, setting a field value), but this order is inverted for advices of 'exit' semantics (leaving a
                method, getting a field value).

This property must not be confused with AttributePriority, which
                solely influences the multicasting process.
See Also
AspectConfigurationAttribute Class
AspectConfigurationAttribute Members
PostSharp.Aspects.Configuration Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


AspectConfigurationAttribute.SerializerType Property

AspectConfigurationAttribute SerializerType Property PostSharp Documentation
Gets or sets the Online Type of the serializer that will be used to configure the current aspect.

Namespace: PostSharp.Aspects.Configuration
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
public Type SerializerType { get; set; }
public Type SerializerType { get; set; }
Property Value
Type:   Online Type
Remarks
This type should have derive from AspectSerializer
                and have a default constructor. Use null to specify that the aspect will not
                be serialized, but will be constructed using MSIL instructions.

See Also
AspectConfigurationAttribute Class
AspectConfigurationAttribute Members
PostSharp.Aspects.Configuration Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


AspectConfigurationAttributeTypeAttribute Class

AspectConfigurationAttributeTypeAttribute Class PostSharp Documentation
Custom attribute that, when applied to an aspect, specifies which custom attribute type (derived from AspectConfigurationAttribute) can provide declarative configuration for the aspect.
Inheritance Hierarchy
Online System Object
Online System Attribute
PostSharp.Aspects.Configuration AspectConfigurationAttributeTypeAttribute

Namespace: PostSharp.Aspects.Configuration
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
public sealed class AspectConfigurationAttributeTypeAttribute : Attribute
public sealed class AspectConfigurationAttributeTypeAttribute : Attribute
See Also
AspectConfigurationAttributeTypeAttribute Members
PostSharp.Aspects.Configuration Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


AspectConfigurationAttributeTypeAttribute Members

AspectConfigurationAttributeTypeAttribute Members PostSharp Documentation

The AspectConfigurationAttributeTypeAttribute type exposes the following members.
Constructors
 | Name | Description
Public method | AspectConfigurationAttributeTypeAttribute | Initializes a new AspectConfigurationAttribute.
Back to Top
See Also
AspectConfigurationAttributeTypeAttribute Class
PostSharp.Aspects.Configuration Namespace

Online Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


AspectConfigurationAttributeTypeAttribute Constructor

AspectConfigurationAttributeTypeAttribute Constructor PostSharp Documentation
Initializes a new AspectConfigurationAttribute.

Namespace: PostSharp.Aspects.Configuration
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
public AspectConfigurationAttributeTypeAttribute(
    Type type
)
public AspectConfigurationAttributeTypeAttribute(
    Type type
)
Parameters
type
Type:   Online System Type
Custom attribute type
            (derived from AspectConfigurationAttribute).
See Also
AspectConfigurationAttributeTypeAttribute Class
AspectConfigurationAttributeTypeAttribute Members
PostSharp.Aspects.Configuration Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


CompositionAspectConfiguration Class

CompositionAspectConfiguration Class PostSharp Documentation
Configuration of aspects of type ICompositionAspect.
Inheritance Hierarchy
Online System Object
PostSharp.Aspects.Configuration AspectConfiguration
PostSharp.Aspects.Configuration CompositionAspectConfiguration

Namespace: PostSharp.Aspects.Configuration
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
public sealed class CompositionAspectConfiguration : AspectConfiguration
public sealed class CompositionAspectConfiguration : AspectConfiguration
See Also
CompositionAspectConfiguration Members
PostSharp.Aspects.Configuration Namespace
PostSharp.Aspects.Configuration CompositionAspectConfigurationAttribute

      Conceptual Documentation: Configuring Aspects

  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


CompositionAspectConfiguration Members

CompositionAspectConfiguration Members PostSharp Documentation

The CompositionAspectConfiguration type exposes the following members.
Constructors
 | Name | Description
Public method | CompositionAspectConfiguration | Initializes a new instance of the CompositionAspectConfiguration class
Back to Top
Properties
 | Name | Description
Public property | AncestorOverrideAction | Specifies the action (Fail or Ignore) to be overtaken when an ancestor of one of the interfaces specified by PublicInterfaces is already implemented by the type to which the current aspect is applied.
Public property | AspectPriority | Gets or sets the aspect priority. Aspects with smaller priority are processed first. The default priority is zero. (Inherited from AspectConfiguration.)
Public property | Dependencies | Gets or sets the collection of dependencies. (Inherited from AspectConfiguration.)
Public property | GenerateImplementationAccessor | Determines whether the interface IComposed T should be introduced into the type to which the aspect is applied for each interface specified by the PublicInterfaces property.
Public property | NonSerializedImplementation | Determines whether the field containing the interface implementation (and storing the object returned by CreateImplementationObject(AdviceArgs)) should be excluded from serialization by Online BinaryFormatter. The same effect is typically obtained by applying the Online NonSerializedAttribute custom attribute to the field.
Public property | OverrideAction | Specifies the action (Fail or Ignore) to be overtaken when one of the interfaces specified by PublicInterfaces or ProtectedInterfaces is already implemented by the type to which the aspect is applied.
Public property | ProtectedInterfaces | Gets or sets the array of interfaces to be introduced indirectly into the target type of the aspect. These interfaces will become accessible through the IProtectedInterface T interface.
Public property | PublicInterfaces | Gets or sets the array of interfaces that should be introduced publicly into the target type of the aspect.
Public property | SerializerType | Gets or sets the type of the serializer that will be used to configure the current aspect. (Inherited from AspectConfiguration.)
Back to Top
See Also
CompositionAspectConfiguration Class
PostSharp.Aspects.Configuration Namespace

Online Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


CompositionAspectConfiguration Constructor

CompositionAspectConfiguration Constructor PostSharp Documentation
Initializes a new instance of the CompositionAspectConfiguration class

Namespace: PostSharp.Aspects.Configuration
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
public CompositionAspectConfiguration()
public CompositionAspectConfiguration()
See Also
CompositionAspectConfiguration Class
CompositionAspectConfiguration Members
PostSharp.Aspects.Configuration Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


CompositionAspectConfiguration Properties

CompositionAspectConfiguration Properties PostSharp Documentation
The CompositionAspectConfiguration type exposes the following members.
Properties
 | Name | Description
Public property | AncestorOverrideAction | Specifies the action (Fail or Ignore) to be overtaken when an ancestor of one of the interfaces specified by PublicInterfaces is already implemented by the type to which the current aspect is applied.
Public property | AspectPriority | Gets or sets the aspect priority. Aspects with smaller priority are processed first. The default priority is zero. (Inherited from AspectConfiguration.)
Public property | Dependencies | Gets or sets the collection of dependencies. (Inherited from AspectConfiguration.)
Public property | GenerateImplementationAccessor | Determines whether the interface IComposed T should be introduced into the type to which the aspect is applied for each interface specified by the PublicInterfaces property.
Public property | NonSerializedImplementation | Determines whether the field containing the interface implementation (and storing the object returned by CreateImplementationObject(AdviceArgs)) should be excluded from serialization by Online BinaryFormatter. The same effect is typically obtained by applying the Online NonSerializedAttribute custom attribute to the field.
Public property | OverrideAction | Specifies the action (Fail or Ignore) to be overtaken when one of the interfaces specified by PublicInterfaces or ProtectedInterfaces is already implemented by the type to which the aspect is applied.
Public property | ProtectedInterfaces | Gets or sets the array of interfaces to be introduced indirectly into the target type of the aspect. These interfaces will become accessible through the IProtectedInterface T interface.
Public property | PublicInterfaces | Gets or sets the array of interfaces that should be introduced publicly into the target type of the aspect.
Public property | SerializerType | Gets or sets the type of the serializer that will be used to configure the current aspect. (Inherited from AspectConfiguration.)
Back to Top
See Also
CompositionAspectConfiguration Class
PostSharp.Aspects.Configuration Namespace

Online Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


CompositionAspectConfiguration.AncestorOverrideAction Property

CompositionAspectConfiguration AncestorOverrideAction Property PostSharp Documentation
Specifies the action (Fail or Ignore) to be overtaken when an ancestor of one of the interfaces specified by PublicInterfaces is already implemented by the type to which the current aspect is applied.

Namespace: PostSharp.Aspects.Configuration
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
public Nullable<InterfaceOverrideAction> AncestorOverrideAction { get; set; }
public Nullable<InterfaceOverrideAction> AncestorOverrideAction { get; set; }
Property Value
Type:   Online Nullable  InterfaceOverrideAction
See Also
CompositionAspectConfiguration Class
CompositionAspectConfiguration Members
PostSharp.Aspects.Configuration Namespace
CompositionAspectConfiguration OverrideAction
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


CompositionAspectConfiguration.GenerateImplementationAccessor Property

CompositionAspectConfiguration GenerateImplementationAccessor Property PostSharp Documentation
Determines whether the interface IComposed T should be introduced into the type to which the aspect is applied for each interface specified by the PublicInterfaces property.

Namespace: PostSharp.Aspects.Configuration
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
public Nullable<bool> GenerateImplementationAccessor { get; set; }
public Nullable<bool> GenerateImplementationAccessor { get; set; }
Property Value
Type:   Online Nullable    Online Boolean
See Also
CompositionAspectConfiguration Class
CompositionAspectConfiguration Members
PostSharp.Aspects.Configuration Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


CompositionAspectConfiguration.NonSerializedImplementation Property

CompositionAspectConfiguration NonSerializedImplementation Property PostSharp Documentation
Determines whether the field containing the interface implementation (and storing the object returned by CreateImplementationObject(AdviceArgs)) should be excluded from serialization by Online BinaryFormatter. The same effect is typically obtained by applying the Online NonSerializedAttribute custom attribute to the field.

Namespace: PostSharp.Aspects.Configuration
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
public Nullable<bool> NonSerializedImplementation { get; set; }
public Nullable<bool> NonSerializedImplementation { get; set; }
Property Value
Type:   Online Nullable    Online Boolean
See Also
CompositionAspectConfiguration Class
CompositionAspectConfiguration Members
PostSharp.Aspects.Configuration Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


CompositionAspectConfiguration.OverrideAction Property

CompositionAspectConfiguration OverrideAction Property PostSharp Documentation
Specifies the action (Fail or Ignore) to be overtaken when one of the interfaces specified by PublicInterfaces or ProtectedInterfaces is already implemented by the type to which the aspect is applied.

Namespace: PostSharp.Aspects.Configuration
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
public Nullable<InterfaceOverrideAction> OverrideAction { get; set; }
public Nullable<InterfaceOverrideAction> OverrideAction { get; set; }
Property Value
Type:   Online Nullable  InterfaceOverrideAction
See Also
CompositionAspectConfiguration Class
CompositionAspectConfiguration Members
PostSharp.Aspects.Configuration Namespace
CompositionAspectConfiguration AncestorOverrideAction
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


CompositionAspectConfiguration.ProtectedInterfaces Property

CompositionAspectConfiguration ProtectedInterfaces Property PostSharp Documentation
Gets or sets the array of interfaces to be introduced indirectly into the target type of the aspect. These interfaces will become accessible through the IProtectedInterface T interface.

Namespace: PostSharp.Aspects.Configuration
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
public TypeIdentity[] ProtectedInterfaces { get; set; }
public TypeIdentity[] ProtectedInterfaces { get; set; }
Property Value
Type:  TypeIdentity
See Also
CompositionAspectConfiguration Class
CompositionAspectConfiguration Members
PostSharp.Aspects.Configuration Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


CompositionAspectConfiguration.PublicInterfaces Property

CompositionAspectConfiguration PublicInterfaces Property PostSharp Documentation
Gets or sets the array of interfaces that should be introduced publicly into the target type of the aspect.

Namespace: PostSharp.Aspects.Configuration
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
public TypeIdentity[] PublicInterfaces { get; set; }
public TypeIdentity[] PublicInterfaces { get; set; }
Property Value
Type:  TypeIdentity
See Also
CompositionAspectConfiguration Class
CompositionAspectConfiguration Members
PostSharp.Aspects.Configuration Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


CompositionAspectConfigurationAttribute Class

CompositionAspectConfigurationAttribute Class PostSharp Documentation
Custom attribute that, when applied on a class implementing ICompositionAspect, defines the declarative configuration of that aspect.
Inheritance Hierarchy
Online System Object
Online System Attribute
PostSharp.Aspects.Configuration AspectConfigurationAttribute
PostSharp.Aspects.Configuration CompositionAspectConfigurationAttribute

Namespace: PostSharp.Aspects.Configuration
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
public sealed class CompositionAspectConfigurationAttribute : AspectConfigurationAttribute
public sealed class CompositionAspectConfigurationAttribute : AspectConfigurationAttribute
See Also
CompositionAspectConfigurationAttribute Members
PostSharp.Aspects.Configuration Namespace
PostSharp.Aspects.Configuration AspectConfigurationAttribute
PostSharp.Aspects CompositionAspect

      Conceptual Documentation: Configuring Aspects

  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


CompositionAspectConfigurationAttribute Members

CompositionAspectConfigurationAttribute Members PostSharp Documentation

The CompositionAspectConfigurationAttribute type exposes the following members.
Constructors
 | Name | Description
Public method | CompositionAspectConfigurationAttribute | Initializes a new instance of the CompositionAspectConfigurationAttribute class
Back to Top
Methods
 | Name | Description
Public method | GetAspectConfiguration | Gets the AspectConfiguration corresponding to the current custom attribute. (Inherited from AspectConfigurationAttribute.)
Back to Top
Properties
 | Name | Description
Public property | AncestorOverrideAction | Specifies the action (Fail or Ignore) to be overtaken when an ancestor of one of the interfaces specified by PublicInterfaces is already implemented by the type to which the current aspect is applied.
Public property | AspectPriority | Gets or sets the weaving priority of the aspect. (Inherited from AspectConfigurationAttribute.)
Public property | GenerateImplementationAccessor | Determines whether the interface IComposed T should be introduced into the type to which the aspect is applied for each interface specified by the PublicInterfaces property.
Public property | NonSerializedImplementation | Determines whether the field containing the interface implementation (and storing the object returned by CreateImplementationObject(AdviceArgs)) should be excluded from serialization by Online BinaryFormatter. The same effect is typically obtained by applying the Online NonSerializedAttribute custom attribute to the field.
Public property | OverrideAction | Specifies the action (Fail or Ignore) to be overtaken when one of the interfaces specified by PublicInterfaces or ProtectedInterfaces is already implemented by the type to which the aspect is applied.
Public property | ProtectedInterfaces | Gets or sets the array of type names of interfaces to be introduced indirectly into the target type of the aspect. These interfaces will become accessible through the IProtectedInterface T interface.
Public property | PublicInterfaces | Gets or sets the array of type names of interfaces that should be introduced publicly into the target type of the aspect.
Public property | SerializerType | Gets or sets the Online Type of the serializer that will be used to configure the current aspect. (Inherited from AspectConfigurationAttribute.)
Back to Top
See Also
CompositionAspectConfigurationAttribute Class
PostSharp.Aspects.Configuration Namespace

Online Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


CompositionAspectConfigurationAttribute Constructor

CompositionAspectConfigurationAttribute Constructor PostSharp Documentation
Initializes a new instance of the CompositionAspectConfigurationAttribute class

Namespace: PostSharp.Aspects.Configuration
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
public CompositionAspectConfigurationAttribute()
public CompositionAspectConfigurationAttribute()
See Also
CompositionAspectConfigurationAttribute Class
CompositionAspectConfigurationAttribute Members
PostSharp.Aspects.Configuration Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


CompositionAspectConfigurationAttribute Methods

CompositionAspectConfigurationAttribute Methods PostSharp Documentation
The CompositionAspectConfigurationAttribute type exposes the following members.
Methods
 | Name | Description
Public method | GetAspectConfiguration | Gets the AspectConfiguration corresponding to the current custom attribute. (Inherited from AspectConfigurationAttribute.)
Back to Top
See Also
CompositionAspectConfigurationAttribute Class
PostSharp.Aspects.Configuration Namespace

Online Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


CompositionAspectConfigurationAttribute Properties

CompositionAspectConfigurationAttribute Properties PostSharp Documentation
The CompositionAspectConfigurationAttribute type exposes the following members.
Properties
 | Name | Description
Public property | AncestorOverrideAction | Specifies the action (Fail or Ignore) to be overtaken when an ancestor of one of the interfaces specified by PublicInterfaces is already implemented by the type to which the current aspect is applied.
Public property | AspectPriority | Gets or sets the weaving priority of the aspect. (Inherited from AspectConfigurationAttribute.)
Public property | GenerateImplementationAccessor | Determines whether the interface IComposed T should be introduced into the type to which the aspect is applied for each interface specified by the PublicInterfaces property.
Public property | NonSerializedImplementation | Determines whether the field containing the interface implementation (and storing the object returned by CreateImplementationObject(AdviceArgs)) should be excluded from serialization by Online BinaryFormatter. The same effect is typically obtained by applying the Online NonSerializedAttribute custom attribute to the field.
Public property | OverrideAction | Specifies the action (Fail or Ignore) to be overtaken when one of the interfaces specified by PublicInterfaces or ProtectedInterfaces is already implemented by the type to which the aspect is applied.
Public property | ProtectedInterfaces | Gets or sets the array of type names of interfaces to be introduced indirectly into the target type of the aspect. These interfaces will become accessible through the IProtectedInterface T interface.
Public property | PublicInterfaces | Gets or sets the array of type names of interfaces that should be introduced publicly into the target type of the aspect.
Public property | SerializerType | Gets or sets the Online Type of the serializer that will be used to configure the current aspect. (Inherited from AspectConfigurationAttribute.)
Back to Top
See Also
CompositionAspectConfigurationAttribute Class
PostSharp.Aspects.Configuration Namespace

Online Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


CompositionAspectConfigurationAttribute.AncestorOverrideAction Property

CompositionAspectConfigurationAttribute AncestorOverrideAction Property PostSharp Documentation
Specifies the action (Fail or Ignore) to be overtaken when an ancestor of one of the interfaces specified by PublicInterfaces is already implemented by the type to which the current aspect is applied.

Namespace: PostSharp.Aspects.Configuration
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
public InterfaceOverrideAction AncestorOverrideAction { get; set; }
public InterfaceOverrideAction AncestorOverrideAction { get; set; }
Property Value
Type: InterfaceOverrideAction
See Also
CompositionAspectConfigurationAttribute Class
CompositionAspectConfigurationAttribute Members
PostSharp.Aspects.Configuration Namespace
CompositionAspectConfigurationAttribute OverrideAction
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


CompositionAspectConfigurationAttribute.GenerateImplementationAccessor Property

CompositionAspectConfigurationAttribute GenerateImplementationAccessor Property PostSharp Documentation
Determines whether the interface IComposed T should be introduced into the type to which the aspect is applied for each interface specified by the PublicInterfaces property.

Namespace: PostSharp.Aspects.Configuration
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
public bool GenerateImplementationAccessor { get; set; }
public bool GenerateImplementationAccessor { get; set; }
Property Value
Type:   Online Boolean
See Also
CompositionAspectConfigurationAttribute Class
CompositionAspectConfigurationAttribute Members
PostSharp.Aspects.Configuration Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


CompositionAspectConfigurationAttribute.NonSerializedImplementation Property

CompositionAspectConfigurationAttribute NonSerializedImplementation Property PostSharp Documentation
Determines whether the field containing the interface implementation (and storing the object returned by CreateImplementationObject(AdviceArgs)) should be excluded from serialization by Online BinaryFormatter. The same effect is typically obtained by applying the Online NonSerializedAttribute custom attribute to the field.

Namespace: PostSharp.Aspects.Configuration
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
public bool NonSerializedImplementation { get; set; }
public bool NonSerializedImplementation { get; set; }
Property Value
Type:   Online Boolean
See Also
CompositionAspectConfigurationAttribute Class
CompositionAspectConfigurationAttribute Members
PostSharp.Aspects.Configuration Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


CompositionAspectConfigurationAttribute.OverrideAction Property

CompositionAspectConfigurationAttribute OverrideAction Property PostSharp Documentation
Specifies the action (Fail or Ignore) to be overtaken when one of the interfaces specified by PublicInterfaces or ProtectedInterfaces is already implemented by the type to which the aspect is applied.

Namespace: PostSharp.Aspects.Configuration
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
public InterfaceOverrideAction OverrideAction { get; set; }
public InterfaceOverrideAction OverrideAction { get; set; }
Property Value
Type: InterfaceOverrideAction
See Also
CompositionAspectConfigurationAttribute Class
CompositionAspectConfigurationAttribute Members
PostSharp.Aspects.Configuration Namespace
CompositionAspectConfigurationAttribute AncestorOverrideAction
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


CompositionAspectConfigurationAttribute.ProtectedInterfaces Property

CompositionAspectConfigurationAttribute ProtectedInterfaces Property PostSharp Documentation
Gets or sets the array of type names of interfaces to be introduced indirectly into the target type of the aspect. These interfaces will become accessible through the IProtectedInterface T interface.

Namespace: PostSharp.Aspects.Configuration
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
public string[] ProtectedInterfaces { get; set; }
public string[] ProtectedInterfaces { get; set; }
Property Value
Type:    Online String
See Also
CompositionAspectConfigurationAttribute Class
CompositionAspectConfigurationAttribute Members
PostSharp.Aspects.Configuration Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


CompositionAspectConfigurationAttribute.PublicInterfaces Property

CompositionAspectConfigurationAttribute PublicInterfaces Property PostSharp Documentation
Gets or sets the array of type names of interfaces that should be introduced publicly into the target type of the aspect.

Namespace: PostSharp.Aspects.Configuration
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
public string[] PublicInterfaces { get; set; }
public string[] PublicInterfaces { get; set; }
Property Value
Type:    Online String
See Also
CompositionAspectConfigurationAttribute Class
CompositionAspectConfigurationAttribute Members
PostSharp.Aspects.Configuration Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


CustomAttributeIntroductionAspectConfiguration Class

CustomAttributeIntroductionAspectConfiguration Class PostSharp Documentation
Configuration of aspects of type CustomAttributeIntroductionAspect.
Inheritance Hierarchy
Online System Object
PostSharp.Aspects.Configuration AspectConfiguration
PostSharp.Aspects.Configuration CustomAttributeIntroductionAspectConfiguration

Namespace: PostSharp.Aspects.Configuration
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
public sealed class CustomAttributeIntroductionAspectConfiguration : AspectConfiguration
public sealed class CustomAttributeIntroductionAspectConfiguration : AspectConfiguration
See Also
CustomAttributeIntroductionAspectConfiguration Members
PostSharp.Aspects.Configuration Namespace

      Conceptual Documentation: Configuring Aspects

  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


CustomAttributeIntroductionAspectConfiguration Members

CustomAttributeIntroductionAspectConfiguration Members PostSharp Documentation

The CustomAttributeIntroductionAspectConfiguration type exposes the following members.
Constructors
 | Name | Description
Public method | CustomAttributeIntroductionAspectConfiguration | Initializes a new instance of the CustomAttributeIntroductionAspectConfiguration class
Back to Top
Properties
 | Name | Description
Public property | AspectPriority | Gets or sets the aspect priority. Aspects with smaller priority are processed first. The default priority is zero. (Inherited from AspectConfiguration.)
Public property | Dependencies | Gets or sets the collection of dependencies. (Inherited from AspectConfiguration.)
Public property | ObjectConstruction | Gets or sets the construction of the custom attribute that must be applied to the target of this aspect.
Public property | SerializerType | Gets or sets the type of the serializer that will be used to configure the current aspect. (Inherited from AspectConfiguration.)
Back to Top
See Also
CustomAttributeIntroductionAspectConfiguration Class
PostSharp.Aspects.Configuration Namespace

Online Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


CustomAttributeIntroductionAspectConfiguration Constructor

CustomAttributeIntroductionAspectConfiguration Constructor PostSharp Documentation
Initializes a new instance of the CustomAttributeIntroductionAspectConfiguration class

Namespace: PostSharp.Aspects.Configuration
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
public CustomAttributeIntroductionAspectConfiguration()
public CustomAttributeIntroductionAspectConfiguration()
See Also
CustomAttributeIntroductionAspectConfiguration Class
CustomAttributeIntroductionAspectConfiguration Members
PostSharp.Aspects.Configuration Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


CustomAttributeIntroductionAspectConfiguration Properties

CustomAttributeIntroductionAspectConfiguration Properties PostSharp Documentation
The CustomAttributeIntroductionAspectConfiguration type exposes the following members.
Properties
 | Name | Description
Public property | AspectPriority | Gets or sets the aspect priority. Aspects with smaller priority are processed first. The default priority is zero. (Inherited from AspectConfiguration.)
Public property | Dependencies | Gets or sets the collection of dependencies. (Inherited from AspectConfiguration.)
Public property | ObjectConstruction | Gets or sets the construction of the custom attribute that must be applied to the target of this aspect.
Public property | SerializerType | Gets or sets the type of the serializer that will be used to configure the current aspect. (Inherited from AspectConfiguration.)
Back to Top
See Also
CustomAttributeIntroductionAspectConfiguration Class
PostSharp.Aspects.Configuration Namespace

Online Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


CustomAttributeIntroductionAspectConfiguration.ObjectConstruction Property

CustomAttributeIntroductionAspectConfiguration ObjectConstruction Property PostSharp Documentation
Gets or sets the construction of the custom attribute that must be applied to the target of this aspect.

Namespace: PostSharp.Aspects.Configuration
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
public ObjectConstruction ObjectConstruction { get; set; }
public ObjectConstruction ObjectConstruction { get; set; }
Property Value
Type: ObjectConstruction
See Also
CustomAttributeIntroductionAspectConfiguration Class
CustomAttributeIntroductionAspectConfiguration Members
PostSharp.Aspects.Configuration Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


EventInterceptionAspectConfiguration Class

EventInterceptionAspectConfiguration Class PostSharp Documentation
Configuration of aspects of type IEventInterceptionAspect.
Inheritance Hierarchy
Online System Object
PostSharp.Aspects.Configuration AspectConfiguration
PostSharp.Aspects.Configuration EventInterceptionAspectConfiguration

Namespace: PostSharp.Aspects.Configuration
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
public sealed class EventInterceptionAspectConfiguration : AspectConfiguration
public sealed class EventInterceptionAspectConfiguration : AspectConfiguration
See Also
EventInterceptionAspectConfiguration Members
PostSharp.Aspects.Configuration Namespace
PostSharp.Aspects.Configuration EventInterceptionAspectConfigurationAttribute

      Conceptual Documentation: Configuring Aspects

  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


EventInterceptionAspectConfiguration Members

EventInterceptionAspectConfiguration Members PostSharp Documentation

The EventInterceptionAspectConfiguration type exposes the following members.
Constructors
 | Name | Description
Public method | EventInterceptionAspectConfiguration | Initializes a new instance of the EventInterceptionAspectConfiguration class
Back to Top
Properties
 | Name | Description
Public property | AspectPriority | Gets or sets the aspect priority. Aspects with smaller priority are processed first. The default priority is zero. (Inherited from AspectConfiguration.)
Public property | Dependencies | Gets or sets the collection of dependencies. (Inherited from AspectConfiguration.)
Public property | SerializerType | Gets or sets the type of the serializer that will be used to configure the current aspect. (Inherited from AspectConfiguration.)
Back to Top
See Also
EventInterceptionAspectConfiguration Class
PostSharp.Aspects.Configuration Namespace

Online Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


EventInterceptionAspectConfiguration Constructor

EventInterceptionAspectConfiguration Constructor PostSharp Documentation
Initializes a new instance of the EventInterceptionAspectConfiguration class

Namespace: PostSharp.Aspects.Configuration
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
public EventInterceptionAspectConfiguration()
public EventInterceptionAspectConfiguration()
See Also
EventInterceptionAspectConfiguration Class
EventInterceptionAspectConfiguration Members
PostSharp.Aspects.Configuration Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


EventInterceptionAspectConfiguration Properties

EventInterceptionAspectConfiguration Properties PostSharp Documentation
The EventInterceptionAspectConfiguration type exposes the following members.
Properties
 | Name | Description
Public property | AspectPriority | Gets or sets the aspect priority. Aspects with smaller priority are processed first. The default priority is zero. (Inherited from AspectConfiguration.)
Public property | Dependencies | Gets or sets the collection of dependencies. (Inherited from AspectConfiguration.)
Public property | SerializerType | Gets or sets the type of the serializer that will be used to configure the current aspect. (Inherited from AspectConfiguration.)
Back to Top
See Also
EventInterceptionAspectConfiguration Class
PostSharp.Aspects.Configuration Namespace

Online Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


EventInterceptionAspectConfigurationAttribute Class

EventInterceptionAspectConfigurationAttribute Class PostSharp Documentation
Custom attribute that, when applied on a class implementing IEventInterceptionAspect, defines the declarative configuration of that aspect.
Inheritance Hierarchy
Online System Object
Online System Attribute
PostSharp.Aspects.Configuration AspectConfigurationAttribute
PostSharp.Aspects.Configuration EventInterceptionAspectConfigurationAttribute

Namespace: PostSharp.Aspects.Configuration
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
public sealed class EventInterceptionAspectConfigurationAttribute : AspectConfigurationAttribute
public sealed class EventInterceptionAspectConfigurationAttribute : AspectConfigurationAttribute
See Also
EventInterceptionAspectConfigurationAttribute Members
PostSharp.Aspects.Configuration Namespace
PostSharp.Aspects.Configuration EventInterceptionAspectConfiguration
PostSharp.Aspects EventInterceptionAspect

      Conceptual Documentation: Configuring Aspects

  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


EventInterceptionAspectConfigurationAttribute Members

EventInterceptionAspectConfigurationAttribute Members PostSharp Documentation

The EventInterceptionAspectConfigurationAttribute type exposes the following members.
Constructors
 | Name | Description
Public method | EventInterceptionAspectConfigurationAttribute | Initializes a new instance of the EventInterceptionAspectConfigurationAttribute class
Back to Top
Methods
 | Name | Description
Public method | GetAspectConfiguration | Gets the AspectConfiguration corresponding to the current custom attribute. (Inherited from AspectConfigurationAttribute.)
Back to Top
Properties
 | Name | Description
Public property | AspectPriority | Gets or sets the weaving priority of the aspect. (Inherited from AspectConfigurationAttribute.)
Public property | SerializerType | Gets or sets the Online Type of the serializer that will be used to configure the current aspect. (Inherited from AspectConfigurationAttribute.)
Back to Top
See Also
EventInterceptionAspectConfigurationAttribute Class
PostSharp.Aspects.Configuration Namespace

Online Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


EventInterceptionAspectConfigurationAttribute Constructor

EventInterceptionAspectConfigurationAttribute Constructor PostSharp Documentation
Initializes a new instance of the EventInterceptionAspectConfigurationAttribute class

Namespace: PostSharp.Aspects.Configuration
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
public EventInterceptionAspectConfigurationAttribute()
public EventInterceptionAspectConfigurationAttribute()
See Also
EventInterceptionAspectConfigurationAttribute Class
EventInterceptionAspectConfigurationAttribute Members
PostSharp.Aspects.Configuration Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


EventInterceptionAspectConfigurationAttribute Methods

EventInterceptionAspectConfigurationAttribute Methods PostSharp Documentation
The EventInterceptionAspectConfigurationAttribute type exposes the following members.
Methods
 | Name | Description
Public method | GetAspectConfiguration | Gets the AspectConfiguration corresponding to the current custom attribute. (Inherited from AspectConfigurationAttribute.)
Back to Top
See Also
EventInterceptionAspectConfigurationAttribute Class
PostSharp.Aspects.Configuration Namespace

Online Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


EventInterceptionAspectConfigurationAttribute Properties

EventInterceptionAspectConfigurationAttribute Properties PostSharp Documentation
The EventInterceptionAspectConfigurationAttribute type exposes the following members.
Properties
 | Name | Description
Public property | AspectPriority | Gets or sets the weaving priority of the aspect. (Inherited from AspectConfigurationAttribute.)
Public property | SerializerType | Gets or sets the Online Type of the serializer that will be used to configure the current aspect. (Inherited from AspectConfigurationAttribute.)
Back to Top
See Also
EventInterceptionAspectConfigurationAttribute Class
PostSharp.Aspects.Configuration Namespace

Online Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


ExternalAspectConfiguration Class

ExternalAspectConfiguration Class PostSharp Documentation
Configuration of aspects of type IExternalAspect.
Inheritance Hierarchy
Online System Object
PostSharp.Aspects.Configuration AspectConfiguration
PostSharp.Aspects.Configuration ExternalAspectConfiguration

Namespace: PostSharp.Aspects.Configuration
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
public sealed class ExternalAspectConfiguration : AspectConfiguration
public sealed class ExternalAspectConfiguration : AspectConfiguration
See Also
ExternalAspectConfiguration Members
PostSharp.Aspects.Configuration Namespace

      Conceptual Documentation: Configuring Aspects

      Conceptual Documentation: Using PostSharp with Silverlight, Windows Phone, and the Compact .NET Framework

  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


ExternalAspectConfiguration Members

ExternalAspectConfiguration Members PostSharp Documentation

The ExternalAspectConfiguration type exposes the following members.
Constructors
 | Name | Description
Public method | ExternalAspectConfiguration | Initializes a new instance of the ExternalAspectConfiguration class
Back to Top
Properties
 | Name | Description
Public property | AspectPriority | Gets or sets the aspect priority. Aspects with smaller priority are processed first. The default priority is zero. (Inherited from AspectConfiguration.)
Public property | Dependencies | Gets or sets the collection of dependencies. (Inherited from AspectConfiguration.)
Public property | ImplementationTypeName | Gets or sets the type implementing the aspect. This type must implement the interface IExternalAspectImplementation.
Public property | SerializerType | Gets or sets the type of the serializer that will be used to configure the current aspect. (Inherited from AspectConfiguration.)
Back to Top
See Also
ExternalAspectConfiguration Class
PostSharp.Aspects.Configuration Namespace

Online Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


ExternalAspectConfiguration Constructor

ExternalAspectConfiguration Constructor PostSharp Documentation
Initializes a new instance of the ExternalAspectConfiguration class

Namespace: PostSharp.Aspects.Configuration
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
public ExternalAspectConfiguration()
public ExternalAspectConfiguration()
See Also
ExternalAspectConfiguration Class
ExternalAspectConfiguration Members
PostSharp.Aspects.Configuration Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


ExternalAspectConfiguration Properties

ExternalAspectConfiguration Properties PostSharp Documentation
The ExternalAspectConfiguration type exposes the following members.
Properties
 | Name | Description
Public property | AspectPriority | Gets or sets the aspect priority. Aspects with smaller priority are processed first. The default priority is zero. (Inherited from AspectConfiguration.)
Public property | Dependencies | Gets or sets the collection of dependencies. (Inherited from AspectConfiguration.)
Public property | ImplementationTypeName | Gets or sets the type implementing the aspect. This type must implement the interface IExternalAspectImplementation.
Public property | SerializerType | Gets or sets the type of the serializer that will be used to configure the current aspect. (Inherited from AspectConfiguration.)
Back to Top
See Also
ExternalAspectConfiguration Class
PostSharp.Aspects.Configuration Namespace

Online Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


ExternalAspectConfiguration.ImplementationTypeName Property

ExternalAspectConfiguration ImplementationTypeName Property PostSharp Documentation
Gets or sets the type implementing the aspect. This type must implement the interface IExternalAspectImplementation.

Namespace: PostSharp.Aspects.Configuration
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
public TypeIdentity ImplementationTypeName { get; set; }
public TypeIdentity ImplementationTypeName { get; set; }
Property Value
Type: TypeIdentity
See Also
ExternalAspectConfiguration Class
ExternalAspectConfiguration Members
PostSharp.Aspects.Configuration Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


ExternalAspectConfigurationAttribute Class

ExternalAspectConfigurationAttribute Class PostSharp Documentation
Specifies the type name of the implementation of external aspects (IExternalAspect).
Inheritance Hierarchy
Online System Object
Online System Attribute
PostSharp.Aspects.Configuration AspectConfigurationAttribute
PostSharp.Aspects.Configuration ExternalAspectConfigurationAttribute

Namespace: PostSharp.Aspects.Configuration
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
[ObsoleteAttribute]
public sealed class ExternalAspectConfigurationAttribute : AspectConfigurationAttribute
[ObsoleteAttribute]
public sealed class ExternalAspectConfigurationAttribute : AspectConfigurationAttribute
See Also
ExternalAspectConfigurationAttribute Members
PostSharp.Aspects.Configuration Namespace

      Conceptual Documentation: Configuring Aspects

      Conceptual Documentation: Using PostSharp with Silverlight, Windows Phone, and the Compact .NET Framework

  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


ExternalAspectConfigurationAttribute Members

ExternalAspectConfigurationAttribute Members PostSharp Documentation

The ExternalAspectConfigurationAttribute type exposes the following members.
Constructors
 | Name | Description
Public method | ExternalAspectConfigurationAttribute | Initializes a new ExternalAspectConfigurationAttribute. In user code, use the ExternalAspectConfigurationAttribute(String) constructor instead of this one.
Public method | ExternalAspectConfigurationAttribute(String) | Initializes a new ExternalAspectConfigurationAttribute.
Back to Top
Methods
 | Name | Description
Public method | GetAspectConfiguration | Gets the AspectConfiguration corresponding to the current custom attribute. (Inherited from AspectConfigurationAttribute.)
Back to Top
Properties
 | Name | Description
Public property | AspectPriority | Gets or sets the weaving priority of the aspect. (Inherited from AspectConfigurationAttribute.)
Public property | ImplementationTypeName | Gets the assembly-qualified name of the implementation type. This type must implement the IExternalAspectImplementation interface.
Public property | SerializerType | Gets or sets the Online Type of the serializer that will be used to configure the current aspect. (Inherited from AspectConfigurationAttribute.)
Back to Top
See Also
ExternalAspectConfigurationAttribute Class
PostSharp.Aspects.Configuration Namespace

Online Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


ExternalAspectConfigurationAttribute Constructor

ExternalAspectConfigurationAttribute Constructor PostSharp Documentation
Overload List
 | Name | Description
Public method | ExternalAspectConfigurationAttribute | Initializes a new ExternalAspectConfigurationAttribute. In user code, use the ExternalAspectConfigurationAttribute(String) constructor instead of this one.
Public method | ExternalAspectConfigurationAttribute(String) | Initializes a new ExternalAspectConfigurationAttribute.
Back to Top
See Also
ExternalAspectConfigurationAttribute Class
ExternalAspectConfigurationAttribute Members
PostSharp.Aspects.Configuration Namespace

Online Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


ExternalAspectConfigurationAttribute Constructor

ExternalAspectConfigurationAttribute Constructor PostSharp Documentation
Initializes a new ExternalAspectConfigurationAttribute. In user code, use the ExternalAspectConfigurationAttribute(String) constructor instead of this one.

Namespace: PostSharp.Aspects.Configuration
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
public ExternalAspectConfigurationAttribute()
public ExternalAspectConfigurationAttribute()
See Also
ExternalAspectConfigurationAttribute Class
ExternalAspectConfigurationAttribute Members
ExternalAspectConfigurationAttribute Overload
PostSharp.Aspects.Configuration Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


ExternalAspectConfigurationAttribute Constructor (String)

ExternalAspectConfigurationAttribute Constructor (String) PostSharp Documentation
Initializes a new ExternalAspectConfigurationAttribute.

Namespace: PostSharp.Aspects.Configuration
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
public ExternalAspectConfigurationAttribute(
    string implementationTypeName
)
public ExternalAspectConfigurationAttribute(
    string implementationTypeName
)
Parameters
implementationTypeName
Type:   Online System String
Assembly-qualified name of the implementation
              type. This type should implement the IExternalAspectImplementation
              interface.
See Also
ExternalAspectConfigurationAttribute Class
ExternalAspectConfigurationAttribute Members
ExternalAspectConfigurationAttribute Overload
PostSharp.Aspects.Configuration Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


ExternalAspectConfigurationAttribute Methods

ExternalAspectConfigurationAttribute Methods PostSharp Documentation
The ExternalAspectConfigurationAttribute type exposes the following members.
Methods
 | Name | Description
Public method | GetAspectConfiguration | Gets the AspectConfiguration corresponding to the current custom attribute. (Inherited from AspectConfigurationAttribute.)
Back to Top
See Also
ExternalAspectConfigurationAttribute Class
PostSharp.Aspects.Configuration Namespace

Online Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


ExternalAspectConfigurationAttribute Properties

ExternalAspectConfigurationAttribute Properties PostSharp Documentation
The ExternalAspectConfigurationAttribute type exposes the following members.
Properties
 | Name | Description
Public property | AspectPriority | Gets or sets the weaving priority of the aspect. (Inherited from AspectConfigurationAttribute.)
Public property | ImplementationTypeName | Gets the assembly-qualified name of the implementation type. This type must implement the IExternalAspectImplementation interface.
Public property | SerializerType | Gets or sets the Online Type of the serializer that will be used to configure the current aspect. (Inherited from AspectConfigurationAttribute.)
Back to Top
See Also
ExternalAspectConfigurationAttribute Class
PostSharp.Aspects.Configuration Namespace

Online Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


ExternalAspectConfigurationAttribute.ImplementationTypeName Property

ExternalAspectConfigurationAttribute ImplementationTypeName Property PostSharp Documentation
Gets the assembly-qualified name of the implementation type. This type must implement the IExternalAspectImplementation interface.

Namespace: PostSharp.Aspects.Configuration
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
public string ImplementationTypeName { get; set; }
public string ImplementationTypeName { get; set; }
Property Value
Type:   Online String
See Also
ExternalAspectConfigurationAttribute Class
ExternalAspectConfigurationAttribute Members
PostSharp.Aspects.Configuration Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


IProfileAwareConfiguration Interface

IProfileAwareConfiguration Interface PostSharp Documentation
Allows an AspectConfiguration to depend on a profile, i.e. an external piece of configuration stored as a resource in the project file. Classes derived from AspectConfiguration may implement this interface.

Namespace: PostSharp.Aspects.Configuration
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
public interface IProfileAwareConfiguration
public interface IProfileAwareConfiguration
See Also
IProfileAwareConfiguration Members
PostSharp.Aspects.Configuration Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


IProfileAwareConfiguration Members

IProfileAwareConfiguration Members PostSharp Documentation

The IProfileAwareConfiguration type exposes the following members.
Methods
 | Name | Description
Public method | ApplyProfile | Applies the profile to the current configuration object.
Back to Top
Properties
 | Name | Description
Public property | ProfileName | Gets the name of the profile, i.e. the name of the resource representing the profile.
Public property | ProfileSectionName | Gets the name of the project section in which the profile resource is stored.
Public property | ProfileSectionNamespace | Gets the namespace of the project section in which the profile resource is stored.
Back to Top
See Also
IProfileAwareConfiguration Interface
PostSharp.Aspects.Configuration Namespace

Online Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


IProfileAwareConfiguration Methods

IProfileAwareConfiguration Methods PostSharp Documentation
The IProfileAwareConfiguration type exposes the following members.
Methods
 | Name | Description
Public method | ApplyProfile | Applies the profile to the current configuration object.
Back to Top
See Also
IProfileAwareConfiguration Interface
PostSharp.Aspects.Configuration Namespace

Online Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


IProfileAwareConfiguration.ApplyProfile Method

IProfileAwareConfiguration ApplyProfile Method PostSharp Documentation
Applies the profile to the current configuration object.

Namespace: PostSharp.Aspects.Configuration
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
void ApplyProfile(
    Object profile
)
void ApplyProfile(
    Object profile
)
Parameters
profile
Type:   Online System Object
The profile object, represented by the resource named ProfileName
            in section named ProfileSectionName, with namespace ProfileSectionNamespace.

See Also
IProfileAwareConfiguration Interface
IProfileAwareConfiguration Members
PostSharp.Aspects.Configuration Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


IProfileAwareConfiguration Properties

IProfileAwareConfiguration Properties PostSharp Documentation
The IProfileAwareConfiguration type exposes the following members.
Properties
 | Name | Description
Public property | ProfileName | Gets the name of the profile, i.e. the name of the resource representing the profile.
Public property | ProfileSectionName | Gets the name of the project section in which the profile resource is stored.
Public property | ProfileSectionNamespace | Gets the namespace of the project section in which the profile resource is stored.
Back to Top
See Also
IProfileAwareConfiguration Interface
PostSharp.Aspects.Configuration Namespace

Online Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


IProfileAwareConfiguration.ProfileName Property

IProfileAwareConfiguration ProfileName Property PostSharp Documentation
Gets the name of the profile, i.e. the name of the resource representing the profile.

Namespace: PostSharp.Aspects.Configuration
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
string ProfileName { get; }
string ProfileName { get; }
Property Value
Type:   Online String
See Also
IProfileAwareConfiguration Interface
IProfileAwareConfiguration Members
PostSharp.Aspects.Configuration Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


IProfileAwareConfiguration.ProfileSectionName Property

IProfileAwareConfiguration ProfileSectionName Property PostSharp Documentation
Gets the name of the project section in which the profile resource is stored.

Namespace: PostSharp.Aspects.Configuration
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
string ProfileSectionName { get; }
string ProfileSectionName { get; }
Property Value
Type:   Online String
See Also
IProfileAwareConfiguration Interface
IProfileAwareConfiguration Members
PostSharp.Aspects.Configuration Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


IProfileAwareConfiguration.ProfileSectionNamespace Property

IProfileAwareConfiguration ProfileSectionNamespace Property PostSharp Documentation
Gets the namespace of the project section in which the profile resource is stored.

Namespace: PostSharp.Aspects.Configuration
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
string ProfileSectionNamespace { get; }
string ProfileSectionNamespace { get; }
Property Value
Type:   Online String
See Also
IProfileAwareConfiguration Interface
IProfileAwareConfiguration Members
PostSharp.Aspects.Configuration Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


LocationInterceptionAspectConfiguration Class

LocationInterceptionAspectConfiguration Class PostSharp Documentation
Configuration of aspects of type ILocationLevelAspect.
Inheritance Hierarchy
Online System Object
PostSharp.Aspects.Configuration AspectConfiguration
PostSharp.Aspects.Configuration LocationInterceptionAspectConfiguration

Namespace: PostSharp.Aspects.Configuration
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
public sealed class LocationInterceptionAspectConfiguration : AspectConfiguration
public sealed class LocationInterceptionAspectConfiguration : AspectConfiguration
See Also
LocationInterceptionAspectConfiguration Members
PostSharp.Aspects.Configuration Namespace

      Conceptual Documentation: Configuring Aspects

  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


LocationInterceptionAspectConfiguration Members

LocationInterceptionAspectConfiguration Members PostSharp Documentation

The LocationInterceptionAspectConfiguration type exposes the following members.
Constructors
 | Name | Description
Public method | LocationInterceptionAspectConfiguration | Initializes a new instance of the LocationInterceptionAspectConfiguration class
Back to Top
Properties
 | Name | Description
Public property | AspectPriority | Gets or sets the aspect priority. Aspects with smaller priority are processed first. The default priority is zero. (Inherited from AspectConfiguration.)
Public property | Dependencies | Gets or sets the collection of dependencies. (Inherited from AspectConfiguration.)
Public property | SerializerType | Gets or sets the type of the serializer that will be used to configure the current aspect. (Inherited from AspectConfiguration.)
Back to Top
See Also
LocationInterceptionAspectConfiguration Class
PostSharp.Aspects.Configuration Namespace

Online Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


LocationInterceptionAspectConfiguration Constructor

LocationInterceptionAspectConfiguration Constructor PostSharp Documentation
Initializes a new instance of the LocationInterceptionAspectConfiguration class

Namespace: PostSharp.Aspects.Configuration
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
public LocationInterceptionAspectConfiguration()
public LocationInterceptionAspectConfiguration()
See Also
LocationInterceptionAspectConfiguration Class
LocationInterceptionAspectConfiguration Members
PostSharp.Aspects.Configuration Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


LocationInterceptionAspectConfiguration Properties

LocationInterceptionAspectConfiguration Properties PostSharp Documentation
The LocationInterceptionAspectConfiguration type exposes the following members.
Properties
 | Name | Description
Public property | AspectPriority | Gets or sets the aspect priority. Aspects with smaller priority are processed first. The default priority is zero. (Inherited from AspectConfiguration.)
Public property | Dependencies | Gets or sets the collection of dependencies. (Inherited from AspectConfiguration.)
Public property | SerializerType | Gets or sets the type of the serializer that will be used to configure the current aspect. (Inherited from AspectConfiguration.)
Back to Top
See Also
LocationInterceptionAspectConfiguration Class
PostSharp.Aspects.Configuration Namespace

Online Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


LocationInterceptionAspectConfigurationAttribute Class

LocationInterceptionAspectConfigurationAttribute Class PostSharp Documentation
Custom attribute that, when applied on a class implementing ILocationInterceptionAspect, defines the declarative configuration of that aspect.
Inheritance Hierarchy
Online System Object
Online System Attribute
PostSharp.Aspects.Configuration AspectConfigurationAttribute
PostSharp.Aspects.Configuration LocationInterceptionAspectConfigurationAttribute

Namespace: PostSharp.Aspects.Configuration
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
public sealed class LocationInterceptionAspectConfigurationAttribute : AspectConfigurationAttribute
public sealed class LocationInterceptionAspectConfigurationAttribute : AspectConfigurationAttribute
See Also
LocationInterceptionAspectConfigurationAttribute Members
PostSharp.Aspects.Configuration Namespace
PostSharp.Aspects.Configuration LocationInterceptionAspectConfiguration
PostSharp.Aspects LocationLevelAspect

      Conceptual Documentation: Configuring Aspects

  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


LocationInterceptionAspectConfigurationAttribute Members

LocationInterceptionAspectConfigurationAttribute Members PostSharp Documentation

The LocationInterceptionAspectConfigurationAttribute type exposes the following members.
Constructors
 | Name | Description
Public method | LocationInterceptionAspectConfigurationAttribute | Initializes a new instance of the LocationInterceptionAspectConfigurationAttribute class
Back to Top
Methods
 | Name | Description
Public method | GetAspectConfiguration | Gets the AspectConfiguration corresponding to the current custom attribute. (Inherited from AspectConfigurationAttribute.)
Back to Top
Properties
 | Name | Description
Public property | AspectPriority | Gets or sets the weaving priority of the aspect. (Inherited from AspectConfigurationAttribute.)
Public property | SerializerType | Gets or sets the Online Type of the serializer that will be used to configure the current aspect. (Inherited from AspectConfigurationAttribute.)
Back to Top
See Also
LocationInterceptionAspectConfigurationAttribute Class
PostSharp.Aspects.Configuration Namespace

Online Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


LocationInterceptionAspectConfigurationAttribute Constructor

LocationInterceptionAspectConfigurationAttribute Constructor PostSharp Documentation
Initializes a new instance of the LocationInterceptionAspectConfigurationAttribute class

Namespace: PostSharp.Aspects.Configuration
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
public LocationInterceptionAspectConfigurationAttribute()
public LocationInterceptionAspectConfigurationAttribute()
See Also
LocationInterceptionAspectConfigurationAttribute Class
LocationInterceptionAspectConfigurationAttribute Members
PostSharp.Aspects.Configuration Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


LocationInterceptionAspectConfigurationAttribute Methods

LocationInterceptionAspectConfigurationAttribute Methods PostSharp Documentation
The LocationInterceptionAspectConfigurationAttribute type exposes the following members.
Methods
 | Name | Description
Public method | GetAspectConfiguration | Gets the AspectConfiguration corresponding to the current custom attribute. (Inherited from AspectConfigurationAttribute.)
Back to Top
See Also
LocationInterceptionAspectConfigurationAttribute Class
PostSharp.Aspects.Configuration Namespace

Online Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


LocationInterceptionAspectConfigurationAttribute Properties

LocationInterceptionAspectConfigurationAttribute Properties PostSharp Documentation
The LocationInterceptionAspectConfigurationAttribute type exposes the following members.
Properties
 | Name | Description
Public property | AspectPriority | Gets or sets the weaving priority of the aspect. (Inherited from AspectConfigurationAttribute.)
Public property | SerializerType | Gets or sets the Online Type of the serializer that will be used to configure the current aspect. (Inherited from AspectConfigurationAttribute.)
Back to Top
See Also
LocationInterceptionAspectConfigurationAttribute Class
PostSharp.Aspects.Configuration Namespace

Online Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


ManagedResourceIntroductionAspectConfiguration Class

ManagedResourceIntroductionAspectConfiguration Class PostSharp Documentation
Configuration of aspects of type ManagedResourceIntroductionAspect.
Inheritance Hierarchy
Online System Object
PostSharp.Aspects.Configuration AspectConfiguration
PostSharp.Aspects.Configuration ManagedResourceIntroductionAspectConfiguration

Namespace: PostSharp.Aspects.Configuration
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
public sealed class ManagedResourceIntroductionAspectConfiguration : AspectConfiguration
public sealed class ManagedResourceIntroductionAspectConfiguration : AspectConfiguration
See Also
ManagedResourceIntroductionAspectConfiguration Members
PostSharp.Aspects.Configuration Namespace

      Conceptual Documentation: Configuring Aspects

  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


ManagedResourceIntroductionAspectConfiguration Members

ManagedResourceIntroductionAspectConfiguration Members PostSharp Documentation

The ManagedResourceIntroductionAspectConfiguration type exposes the following members.
Constructors
 | Name | Description
Public method | ManagedResourceIntroductionAspectConfiguration | Initializes a new ManagedResourceIntroductionAspectConfiguration.
Back to Top
Properties
 | Name | Description
Public property | AspectPriority | Gets or sets the aspect priority. Aspects with smaller priority are processed first. The default priority is zero. (Inherited from AspectConfiguration.)
Public property | Data | Gets the content of the managed resource.
Public property | Dependencies | Gets or sets the collection of dependencies. (Inherited from AspectConfiguration.)
Public property | Name | Gets the name of the managed resource.
Public property | SerializerType | Gets or sets the type of the serializer that will be used to configure the current aspect. (Inherited from AspectConfiguration.)
Back to Top
See Also
ManagedResourceIntroductionAspectConfiguration Class
PostSharp.Aspects.Configuration Namespace

Online Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


ManagedResourceIntroductionAspectConfiguration Constructor

ManagedResourceIntroductionAspectConfiguration Constructor PostSharp Documentation
Initializes a new ManagedResourceIntroductionAspectConfiguration.

Namespace: PostSharp.Aspects.Configuration
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
public ManagedResourceIntroductionAspectConfiguration(
    string name,
    byte[] data
)
public ManagedResourceIntroductionAspectConfiguration(
    string name,
    byte[] data
)
Parameters
name
Type:   Online System String
Name of the managed resource.
data
Type:    Online System Byte
Content of the managed resource.
See Also
ManagedResourceIntroductionAspectConfiguration Class
ManagedResourceIntroductionAspectConfiguration Members
PostSharp.Aspects.Configuration Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


ManagedResourceIntroductionAspectConfiguration Properties

ManagedResourceIntroductionAspectConfiguration Properties PostSharp Documentation
The ManagedResourceIntroductionAspectConfiguration type exposes the following members.
Properties
 | Name | Description
Public property | AspectPriority | Gets or sets the aspect priority. Aspects with smaller priority are processed first. The default priority is zero. (Inherited from AspectConfiguration.)
Public property | Data | Gets the content of the managed resource.
Public property | Dependencies | Gets or sets the collection of dependencies. (Inherited from AspectConfiguration.)
Public property | Name | Gets the name of the managed resource.
Public property | SerializerType | Gets or sets the type of the serializer that will be used to configure the current aspect. (Inherited from AspectConfiguration.)
Back to Top
See Also
ManagedResourceIntroductionAspectConfiguration Class
PostSharp.Aspects.Configuration Namespace

Online Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


ManagedResourceIntroductionAspectConfiguration.Data Property

ManagedResourceIntroductionAspectConfiguration Data Property PostSharp Documentation
Gets the content of the managed resource.

Namespace: PostSharp.Aspects.Configuration
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
public byte[] Data { get; private set; }
public byte[] Data { get; private set; }
Property Value
Type:    Online Byte
See Also
ManagedResourceIntroductionAspectConfiguration Class
ManagedResourceIntroductionAspectConfiguration Members
PostSharp.Aspects.Configuration Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


ManagedResourceIntroductionAspectConfiguration.Name Property

ManagedResourceIntroductionAspectConfiguration Name Property PostSharp Documentation
Gets the name of the managed resource.

Namespace: PostSharp.Aspects.Configuration
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
public string Name { get; private set; }
public string Name { get; private set; }
Property Value
Type:   Online String
See Also
ManagedResourceIntroductionAspectConfiguration Class
ManagedResourceIntroductionAspectConfiguration Members
PostSharp.Aspects.Configuration Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


MethodInterceptionAspectConfiguration Class

MethodInterceptionAspectConfiguration Class PostSharp Documentation
Configuration of aspects of type IMethodInterceptionAspect.
Inheritance Hierarchy
Online System Object
PostSharp.Aspects.Configuration AspectConfiguration
PostSharp.Aspects.Configuration MethodInterceptionAspectConfiguration

Namespace: PostSharp.Aspects.Configuration
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
public sealed class MethodInterceptionAspectConfiguration : AspectConfiguration
public sealed class MethodInterceptionAspectConfiguration : AspectConfiguration
See Also
MethodInterceptionAspectConfiguration Members
PostSharp.Aspects.Configuration Namespace
PostSharp.Aspects.Configuration MethodInterceptionAspectConfigurationAttribute
PostSharp.Aspects MethodInterceptionAspect

      Conceptual Documentation: Configuring Aspects

  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


MethodInterceptionAspectConfiguration Members

MethodInterceptionAspectConfiguration Members PostSharp Documentation

The MethodInterceptionAspectConfiguration type exposes the following members.
Constructors
 | Name | Description
Public method | MethodInterceptionAspectConfiguration | Initializes a new instance of the MethodInterceptionAspectConfiguration class
Back to Top
Properties
 | Name | Description
Public property | AspectPriority | Gets or sets the aspect priority. Aspects with smaller priority are processed first. The default priority is zero. (Inherited from AspectConfiguration.)
Public property | Dependencies | Gets or sets the collection of dependencies. (Inherited from AspectConfiguration.)
Public property | SerializerType | Gets or sets the type of the serializer that will be used to configure the current aspect. (Inherited from AspectConfiguration.)
Back to Top
See Also
MethodInterceptionAspectConfiguration Class
PostSharp.Aspects.Configuration Namespace

Online Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


MethodInterceptionAspectConfiguration Constructor

MethodInterceptionAspectConfiguration Constructor PostSharp Documentation
Initializes a new instance of the MethodInterceptionAspectConfiguration class

Namespace: PostSharp.Aspects.Configuration
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
public MethodInterceptionAspectConfiguration()
public MethodInterceptionAspectConfiguration()
See Also
MethodInterceptionAspectConfiguration Class
MethodInterceptionAspectConfiguration Members
PostSharp.Aspects.Configuration Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


MethodInterceptionAspectConfiguration Properties

MethodInterceptionAspectConfiguration Properties PostSharp Documentation
The MethodInterceptionAspectConfiguration type exposes the following members.
Properties
 | Name | Description
Public property | AspectPriority | Gets or sets the aspect priority. Aspects with smaller priority are processed first. The default priority is zero. (Inherited from AspectConfiguration.)
Public property | Dependencies | Gets or sets the collection of dependencies. (Inherited from AspectConfiguration.)
Public property | SerializerType | Gets or sets the type of the serializer that will be used to configure the current aspect. (Inherited from AspectConfiguration.)
Back to Top
See Also
MethodInterceptionAspectConfiguration Class
PostSharp.Aspects.Configuration Namespace

Online Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


MethodInterceptionAspectConfigurationAttribute Class

MethodInterceptionAspectConfigurationAttribute Class PostSharp Documentation
Custom attribute that, when applied on a class implementing IMethodInterceptionAspect, defines the declarative configuration of that aspect.
Inheritance Hierarchy
Online System Object
Online System Attribute
PostSharp.Aspects.Configuration AspectConfigurationAttribute
PostSharp.Aspects.Configuration MethodInterceptionAspectConfigurationAttribute

Namespace: PostSharp.Aspects.Configuration
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
public sealed class MethodInterceptionAspectConfigurationAttribute : AspectConfigurationAttribute
public sealed class MethodInterceptionAspectConfigurationAttribute : AspectConfigurationAttribute
See Also
MethodInterceptionAspectConfigurationAttribute Members
PostSharp.Aspects.Configuration Namespace
PostSharp.Aspects MethodInterceptionAspect
PostSharp.Aspects.Configuration MethodInterceptionAspectConfiguration

      Conceptual Documentation: Configuring Aspects

  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


MethodInterceptionAspectConfigurationAttribute Members

MethodInterceptionAspectConfigurationAttribute Members PostSharp Documentation

The MethodInterceptionAspectConfigurationAttribute type exposes the following members.
Constructors
 | Name | Description
Public method | MethodInterceptionAspectConfigurationAttribute | Initializes a new instance of the MethodInterceptionAspectConfigurationAttribute class
Back to Top
Methods
 | Name | Description
Public method | GetAspectConfiguration | Gets the AspectConfiguration corresponding to the current custom attribute. (Inherited from AspectConfigurationAttribute.)
Back to Top
Properties
 | Name | Description
Public property | AspectPriority | Gets or sets the weaving priority of the aspect. (Inherited from AspectConfigurationAttribute.)
Public property | SerializerType | Gets or sets the Online Type of the serializer that will be used to configure the current aspect. (Inherited from AspectConfigurationAttribute.)
Back to Top
See Also
MethodInterceptionAspectConfigurationAttribute Class
PostSharp.Aspects.Configuration Namespace

Online Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


MethodInterceptionAspectConfigurationAttribute Constructor

MethodInterceptionAspectConfigurationAttribute Constructor PostSharp Documentation
Initializes a new instance of the MethodInterceptionAspectConfigurationAttribute class

Namespace: PostSharp.Aspects.Configuration
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
public MethodInterceptionAspectConfigurationAttribute()
public MethodInterceptionAspectConfigurationAttribute()
See Also
MethodInterceptionAspectConfigurationAttribute Class
MethodInterceptionAspectConfigurationAttribute Members
PostSharp.Aspects.Configuration Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


MethodInterceptionAspectConfigurationAttribute Methods

MethodInterceptionAspectConfigurationAttribute Methods PostSharp Documentation
The MethodInterceptionAspectConfigurationAttribute type exposes the following members.
Methods
 | Name | Description
Public method | GetAspectConfiguration | Gets the AspectConfiguration corresponding to the current custom attribute. (Inherited from AspectConfigurationAttribute.)
Back to Top
See Also
MethodInterceptionAspectConfigurationAttribute Class
PostSharp.Aspects.Configuration Namespace

Online Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


MethodInterceptionAspectConfigurationAttribute Properties

MethodInterceptionAspectConfigurationAttribute Properties PostSharp Documentation
The MethodInterceptionAspectConfigurationAttribute type exposes the following members.
Properties
 | Name | Description
Public property | AspectPriority | Gets or sets the weaving priority of the aspect. (Inherited from AspectConfigurationAttribute.)
Public property | SerializerType | Gets or sets the Online Type of the serializer that will be used to configure the current aspect. (Inherited from AspectConfigurationAttribute.)
Back to Top
See Also
MethodInterceptionAspectConfigurationAttribute Class
PostSharp.Aspects.Configuration Namespace

Online Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


OnExceptionAspectConfiguration Class

OnExceptionAspectConfiguration Class PostSharp Documentation
Configuration of the IOnExceptionAspect aspect.
Inheritance Hierarchy
Online System Object
PostSharp.Aspects.Configuration AspectConfiguration
PostSharp.Aspects.Configuration OnExceptionAspectConfiguration

Namespace: PostSharp.Aspects.Configuration
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
public sealed class OnExceptionAspectConfiguration : AspectConfiguration
public sealed class OnExceptionAspectConfiguration : AspectConfiguration
See Also
OnExceptionAspectConfiguration Members
PostSharp.Aspects.Configuration Namespace
PostSharp.Aspects OnExceptionAspect
PostSharp.Aspects.Configuration OnExceptionAspectConfigurationAttribute

      Conceptual Documentation: Configuring Aspects

  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


OnExceptionAspectConfiguration Members

OnExceptionAspectConfiguration Members PostSharp Documentation

The OnExceptionAspectConfiguration type exposes the following members.
Constructors
 | Name | Description
Public method | OnExceptionAspectConfiguration | Initializes a new instance of the OnExceptionAspectConfiguration class
Back to Top
Properties
 | Name | Description
Public property | AspectPriority | Gets or sets the aspect priority. Aspects with smaller priority are processed first. The default priority is zero. (Inherited from AspectConfiguration.)
Public property | Dependencies | Gets or sets the collection of dependencies. (Inherited from AspectConfiguration.)
Public property | ExceptionType | Gets or sets the type of exceptions that are caught by this aspect.
Public property | SerializerType | Gets or sets the type of the serializer that will be used to configure the current aspect. (Inherited from AspectConfiguration.)
Back to Top
See Also
OnExceptionAspectConfiguration Class
PostSharp.Aspects.Configuration Namespace

Online Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


OnExceptionAspectConfiguration Constructor

OnExceptionAspectConfiguration Constructor PostSharp Documentation
Initializes a new instance of the OnExceptionAspectConfiguration class

Namespace: PostSharp.Aspects.Configuration
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
public OnExceptionAspectConfiguration()
public OnExceptionAspectConfiguration()
See Also
OnExceptionAspectConfiguration Class
OnExceptionAspectConfiguration Members
PostSharp.Aspects.Configuration Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


OnExceptionAspectConfiguration Properties

OnExceptionAspectConfiguration Properties PostSharp Documentation
The OnExceptionAspectConfiguration type exposes the following members.
Properties
 | Name | Description
Public property | AspectPriority | Gets or sets the aspect priority. Aspects with smaller priority are processed first. The default priority is zero. (Inherited from AspectConfiguration.)
Public property | Dependencies | Gets or sets the collection of dependencies. (Inherited from AspectConfiguration.)
Public property | ExceptionType | Gets or sets the type of exceptions that are caught by this aspect.
Public property | SerializerType | Gets or sets the type of the serializer that will be used to configure the current aspect. (Inherited from AspectConfiguration.)
Back to Top
See Also
OnExceptionAspectConfiguration Class
PostSharp.Aspects.Configuration Namespace

Online Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


OnExceptionAspectConfiguration.ExceptionType Property

OnExceptionAspectConfiguration ExceptionType Property PostSharp Documentation
Gets or sets the type of exceptions that are caught by this aspect.

Namespace: PostSharp.Aspects.Configuration
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
public TypeIdentity ExceptionType { get; set; }
public TypeIdentity ExceptionType { get; set; }
Property Value
Type: TypeIdentity
Remarks

              If this property is null, any   Online Exception shall be caught.

See Also
OnExceptionAspectConfiguration Class
OnExceptionAspectConfiguration Members
PostSharp.Aspects.Configuration Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


OnExceptionAspectConfigurationAttribute Class

OnExceptionAspectConfigurationAttribute Class PostSharp Documentation
Custom attribute that, when applied on a class implementing IOnExceptionAspect, defines the configuration of that aspect.
Inheritance Hierarchy
Online System Object
Online System Attribute
PostSharp.Aspects.Configuration AspectConfigurationAttribute
PostSharp.Aspects.Configuration OnExceptionAspectConfigurationAttribute

Namespace: PostSharp.Aspects.Configuration
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
public sealed class OnExceptionAspectConfigurationAttribute : AspectConfigurationAttribute
public sealed class OnExceptionAspectConfigurationAttribute : AspectConfigurationAttribute
See Also
OnExceptionAspectConfigurationAttribute Members
PostSharp.Aspects.Configuration Namespace
PostSharp.Aspects OnExceptionAspect

      Conceptual Documentation: Configuring Aspects

  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


OnExceptionAspectConfigurationAttribute Members

OnExceptionAspectConfigurationAttribute Members PostSharp Documentation

The OnExceptionAspectConfigurationAttribute type exposes the following members.
Constructors
 | Name | Description
Public method | OnExceptionAspectConfigurationAttribute | Initializes a new instance of the OnExceptionAspectConfigurationAttribute class
Back to Top
Methods
 | Name | Description
Public method | GetAspectConfiguration | Gets the AspectConfiguration corresponding to the current custom attribute. (Inherited from AspectConfigurationAttribute.)
Back to Top
Properties
 | Name | Description
Public property | AspectPriority | Gets or sets the weaving priority of the aspect. (Inherited from AspectConfigurationAttribute.)
Public property | ExceptionType | Gets or sets the type of exceptions that are caught by this aspect.
Public property | SerializerType | Gets or sets the Online Type of the serializer that will be used to configure the current aspect. (Inherited from AspectConfigurationAttribute.)
Back to Top
See Also
OnExceptionAspectConfigurationAttribute Class
PostSharp.Aspects.Configuration Namespace

Online Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


OnExceptionAspectConfigurationAttribute Constructor

OnExceptionAspectConfigurationAttribute Constructor PostSharp Documentation
Initializes a new instance of the OnExceptionAspectConfigurationAttribute class

Namespace: PostSharp.Aspects.Configuration
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
public OnExceptionAspectConfigurationAttribute()
public OnExceptionAspectConfigurationAttribute()
See Also
OnExceptionAspectConfigurationAttribute Class
OnExceptionAspectConfigurationAttribute Members
PostSharp.Aspects.Configuration Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


OnExceptionAspectConfigurationAttribute Methods

OnExceptionAspectConfigurationAttribute Methods PostSharp Documentation
The OnExceptionAspectConfigurationAttribute type exposes the following members.
Methods
 | Name | Description
Public method | GetAspectConfiguration | Gets the AspectConfiguration corresponding to the current custom attribute. (Inherited from AspectConfigurationAttribute.)
Back to Top
See Also
OnExceptionAspectConfigurationAttribute Class
PostSharp.Aspects.Configuration Namespace

Online Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


OnExceptionAspectConfigurationAttribute Properties

OnExceptionAspectConfigurationAttribute Properties PostSharp Documentation
The OnExceptionAspectConfigurationAttribute type exposes the following members.
Properties
 | Name | Description
Public property | AspectPriority | Gets or sets the weaving priority of the aspect. (Inherited from AspectConfigurationAttribute.)
Public property | ExceptionType | Gets or sets the type of exceptions that are caught by this aspect.
Public property | SerializerType | Gets or sets the Online Type of the serializer that will be used to configure the current aspect. (Inherited from AspectConfigurationAttribute.)
Back to Top
See Also
OnExceptionAspectConfigurationAttribute Class
PostSharp.Aspects.Configuration Namespace

Online Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


OnExceptionAspectConfigurationAttribute.ExceptionType Property

OnExceptionAspectConfigurationAttribute ExceptionType Property PostSharp Documentation
Gets or sets the type of exceptions that are caught by this aspect.

Namespace: PostSharp.Aspects.Configuration
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
public Type ExceptionType { get; set; }
public Type ExceptionType { get; set; }
Property Value
Type:   Online Type
Remarks

              If this property is null, any   Online Exception shall be caught.

See Also
OnExceptionAspectConfigurationAttribute Class
OnExceptionAspectConfigurationAttribute Members
PostSharp.Aspects.Configuration Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


OnMethodBoundaryAspectConfiguration Class

OnMethodBoundaryAspectConfiguration Class PostSharp Documentation
Configuration of the IOnMethodBoundaryAspect aspect.
Inheritance Hierarchy
Online System Object
PostSharp.Aspects.Configuration AspectConfiguration
PostSharp.Aspects.Configuration OnMethodBoundaryAspectConfiguration

Namespace: PostSharp.Aspects.Configuration
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
public sealed class OnMethodBoundaryAspectConfiguration : AspectConfiguration
public sealed class OnMethodBoundaryAspectConfiguration : AspectConfiguration
See Also
OnMethodBoundaryAspectConfiguration Members
PostSharp.Aspects.Configuration Namespace
PostSharp.Aspects.Configuration OnMethodBoundaryAspectConfigurationAttribute
PostSharp.Aspects OnMethodBoundaryAspect

      Conceptual Documentation: Configuring Aspects

  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


OnMethodBoundaryAspectConfiguration Members

OnMethodBoundaryAspectConfiguration Members PostSharp Documentation

The OnMethodBoundaryAspectConfiguration type exposes the following members.
Constructors
 | Name | Description
Public method | OnMethodBoundaryAspectConfiguration | Initializes a new instance of the OnMethodBoundaryAspectConfiguration class
Back to Top
Properties
 | Name | Description
Public property | AspectPriority | Gets or sets the aspect priority. Aspects with smaller priority are processed first. The default priority is zero. (Inherited from AspectConfiguration.)
Public property | Dependencies | Gets or sets the collection of dependencies. (Inherited from AspectConfiguration.)
Public property | SerializerType | Gets or sets the type of the serializer that will be used to configure the current aspect. (Inherited from AspectConfiguration.)
Back to Top
See Also
OnMethodBoundaryAspectConfiguration Class
PostSharp.Aspects.Configuration Namespace

Online Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


OnMethodBoundaryAspectConfiguration Constructor

OnMethodBoundaryAspectConfiguration Constructor PostSharp Documentation
Initializes a new instance of the OnMethodBoundaryAspectConfiguration class

Namespace: PostSharp.Aspects.Configuration
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
public OnMethodBoundaryAspectConfiguration()
public OnMethodBoundaryAspectConfiguration()
See Also
OnMethodBoundaryAspectConfiguration Class
OnMethodBoundaryAspectConfiguration Members
PostSharp.Aspects.Configuration Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


OnMethodBoundaryAspectConfiguration Properties

OnMethodBoundaryAspectConfiguration Properties PostSharp Documentation
The OnMethodBoundaryAspectConfiguration type exposes the following members.
Properties
 | Name | Description
Public property | AspectPriority | Gets or sets the aspect priority. Aspects with smaller priority are processed first. The default priority is zero. (Inherited from AspectConfiguration.)
Public property | Dependencies | Gets or sets the collection of dependencies. (Inherited from AspectConfiguration.)
Public property | SerializerType | Gets or sets the type of the serializer that will be used to configure the current aspect. (Inherited from AspectConfiguration.)
Back to Top
See Also
OnMethodBoundaryAspectConfiguration Class
PostSharp.Aspects.Configuration Namespace

Online Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


OnMethodBoundaryAspectConfigurationAttribute Class

OnMethodBoundaryAspectConfigurationAttribute Class PostSharp Documentation
Custom attribute that, when applied on a class implementing IOnMethodBoundaryAspect, defines the configuration of that aspect.
Inheritance Hierarchy
Online System Object
Online System Attribute
PostSharp.Aspects.Configuration AspectConfigurationAttribute
PostSharp.Aspects.Configuration OnMethodBoundaryAspectConfigurationAttribute

Namespace: PostSharp.Aspects.Configuration
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
public sealed class OnMethodBoundaryAspectConfigurationAttribute : AspectConfigurationAttribute
public sealed class OnMethodBoundaryAspectConfigurationAttribute : AspectConfigurationAttribute
See Also
OnMethodBoundaryAspectConfigurationAttribute Members
PostSharp.Aspects.Configuration Namespace
PostSharp.Aspects.Configuration OnMethodBoundaryAspectConfiguration
PostSharp.Aspects OnMethodBoundaryAspect

      Conceptual Documentation: Configuring Aspects

  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


OnMethodBoundaryAspectConfigurationAttribute Members

OnMethodBoundaryAspectConfigurationAttribute Members PostSharp Documentation

The OnMethodBoundaryAspectConfigurationAttribute type exposes the following members.
Constructors
 | Name | Description
Public method | OnMethodBoundaryAspectConfigurationAttribute | Initializes a new instance of the OnMethodBoundaryAspectConfigurationAttribute class
Back to Top
Methods
 | Name | Description
Public method | GetAspectConfiguration | Gets the AspectConfiguration corresponding to the current custom attribute. (Inherited from AspectConfigurationAttribute.)
Back to Top
Properties
 | Name | Description
Public property | AspectPriority | Gets or sets the weaving priority of the aspect. (Inherited from AspectConfigurationAttribute.)
Public property | SerializerType | Gets or sets the Online Type of the serializer that will be used to configure the current aspect. (Inherited from AspectConfigurationAttribute.)
Back to Top
See Also
OnMethodBoundaryAspectConfigurationAttribute Class
PostSharp.Aspects.Configuration Namespace

Online Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


OnMethodBoundaryAspectConfigurationAttribute Constructor

OnMethodBoundaryAspectConfigurationAttribute Constructor PostSharp Documentation
Initializes a new instance of the OnMethodBoundaryAspectConfigurationAttribute class

Namespace: PostSharp.Aspects.Configuration
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
public OnMethodBoundaryAspectConfigurationAttribute()
public OnMethodBoundaryAspectConfigurationAttribute()
See Also
OnMethodBoundaryAspectConfigurationAttribute Class
OnMethodBoundaryAspectConfigurationAttribute Members
PostSharp.Aspects.Configuration Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


OnMethodBoundaryAspectConfigurationAttribute Methods

OnMethodBoundaryAspectConfigurationAttribute Methods PostSharp Documentation
The OnMethodBoundaryAspectConfigurationAttribute type exposes the following members.
Methods
 | Name | Description
Public method | GetAspectConfiguration | Gets the AspectConfiguration corresponding to the current custom attribute. (Inherited from AspectConfigurationAttribute.)
Back to Top
See Also
OnMethodBoundaryAspectConfigurationAttribute Class
PostSharp.Aspects.Configuration Namespace

Online Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


OnMethodBoundaryAspectConfigurationAttribute Properties

OnMethodBoundaryAspectConfigurationAttribute Properties PostSharp Documentation
The OnMethodBoundaryAspectConfigurationAttribute type exposes the following members.
Properties
 | Name | Description
Public property | AspectPriority | Gets or sets the weaving priority of the aspect. (Inherited from AspectConfigurationAttribute.)
Public property | SerializerType | Gets or sets the Online Type of the serializer that will be used to configure the current aspect. (Inherited from AspectConfigurationAttribute.)
Back to Top
See Also
OnMethodBoundaryAspectConfigurationAttribute Class
PostSharp.Aspects.Configuration Namespace

Online Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


PostSharp.Aspects.Dependencies Namespace

PostSharp.Aspects.Dependencies Namespace PostSharp Documentation
The PostSharp.Aspects.Dependencies namespace contains types and custom attributes that allow to define dependencies between aspects and advices, so that the aspect weaver behaves determistically even if the same element of code is the target of several aspects provided by multiple vendors.
Classes
 | Class | Description
Public class | AdviceDependencyAttribute | Specifies an aspect dependency matching an advice of the same aspect instance.
Public class | AspectDependencyAttribute | Base class for all custom attributes defining aspect dependencies. An aspect dependency determines the behavior of aspects or advices when used in conjunction with other aspects and advices. Aspect dependencies determine ordering, requirements, conflicts, and commutativity of aspects and advices.
Public class | AspectDependencyAttributeCollection | Collection of AspectDependencyAttribute.
Public class | AspectEffectDependencyAttribute | Specifies an aspect dependency matching aspects or advices having a given effect.
Public class | AspectRoleDependencyAttribute | Specifies an aspect dependency matching aspects or advices that are a part of a given role.
Public class | AspectTypeDependencyAttribute | Specifies an aspect dependency matching aspects of a specified type, and all its advices.
Public class | ProvideAspectRoleAttribute | Specifies that the aspect or aspect advice to which this custom attribute is applied is a part of a given role. This aspect or advice can then be matched by AspectRoleDependencyAttribute/
Public class | StandardEffects | List of standard effects.
Public class | StandardRoles | List of standard roles.
Public class | WaiveAspectEffectAttribute | Declares that the aspect class or advice to which this custom attribute is applied is exempt of a given effect.
Enumerations
 | Enumeration | Description
Public enumeration | AspectDependencyAction | Enumeration of the different kinds of relationships of specified by aspect dependencies.
Public enumeration | AspectDependencyPosition | Enumeration of the direction of the relationship specified by an aspect dependency.
Public enumeration | AspectDependencyTarget | Enumeration of targets (Default or Type) to which the aspect dependency apply.

Online Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


AdviceDependencyAttribute Class

AdviceDependencyAttribute Class PostSharp Documentation
Specifies an aspect dependency matching an advice of the same aspect instance.
Inheritance Hierarchy
Online System Object
Online System Attribute
PostSharp.Aspects.Dependencies AspectDependencyAttribute
PostSharp.Aspects.Dependencies AdviceDependencyAttribute

Namespace: PostSharp.Aspects.Dependencies
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
public sealed class AdviceDependencyAttribute : AspectDependencyAttribute
public sealed class AdviceDependencyAttribute : AspectDependencyAttribute
Remarks
  Note  Note

      PostSharp Professional Edition is required for this feature.

See Also
AdviceDependencyAttribute Members
PostSharp.Aspects.Dependencies Namespace

      Conceptual Documentation: Configuring Aspects

  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


AdviceDependencyAttribute Members

AdviceDependencyAttribute Members PostSharp Documentation

The AdviceDependencyAttribute type exposes the following members.
Constructors
 | Name | Description
Public method | AdviceDependencyAttribute(AspectDependencyAction, String) | Initializes a new AdviceDependencyAttribute without specifying the position, implicitly set to Any.
Public method | AdviceDependencyAttribute(AspectDependencyAction, AspectDependencyPosition, String) | Initializes a new AdviceDependencyAttribute and specifies a position.
Back to Top
Properties
 | Name | Description
Public property | Action | Gets the dependency action, i.e. the kind of relationship specified by the dependency (Order, Require, Conflict, or Commute). (Inherited from AspectDependencyAttribute.)
Public property | AdviceMethodName | Gets the name of the method implementing the advice.
Public property | IsWarning | If true, specifies that the constraint (of type Require or Conflict) should emit a warning instead of an error if not respected. (Inherited from AspectDependencyAttribute.)
Public property | Position | Gets the position of the current dependency, i.e. actually the position of the other aspect or advices with respect to the one related to this dependency. (Inherited from AspectDependencyAttribute.)
Public property | Target | Determines the target (Default or Type) to which the aspect dependency apply. (Inherited from AspectDependencyAttribute.)
Public property | TargetType | Aspect type to which this dependency applies. This property is required when the custom attribute is applied at assembly level. It is ignored when applied on class or method level. (Inherited from AspectDependencyAttribute.)
Back to Top
See Also
AdviceDependencyAttribute Class
PostSharp.Aspects.Dependencies Namespace

Online Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


AdviceDependencyAttribute Constructor

AdviceDependencyAttribute Constructor PostSharp Documentation
Overload List
 | Name | Description
Public method | AdviceDependencyAttribute(AspectDependencyAction, String) | Initializes a new AdviceDependencyAttribute without specifying the position, implicitly set to Any.
Public method | AdviceDependencyAttribute(AspectDependencyAction, AspectDependencyPosition, String) | Initializes a new AdviceDependencyAttribute and specifies a position.
Back to Top
See Also
AdviceDependencyAttribute Class
AdviceDependencyAttribute Members
PostSharp.Aspects.Dependencies Namespace

Online Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


AdviceDependencyAttribute Constructor (AspectDependencyAction, String)

AdviceDependencyAttribute Constructor (AspectDependencyAction, String) PostSharp Documentation
Initializes a new AdviceDependencyAttribute without specifying the position, implicitly set to Any.

Namespace: PostSharp.Aspects.Dependencies
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
public AdviceDependencyAttribute(
    AspectDependencyAction action,
    string adviceMethodName
)
public AdviceDependencyAttribute(
    AspectDependencyAction action,
    string adviceMethodName
)
Parameters
action
Type: PostSharp.Aspects.Dependencies AspectDependencyAction
Dependency action.
adviceMethodName
Type:   Online System String
Name of the advice method.
See Also
AdviceDependencyAttribute Class
AdviceDependencyAttribute Members
AdviceDependencyAttribute Overload
PostSharp.Aspects.Dependencies Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


AdviceDependencyAttribute Constructor (AspectDependencyAction, AspectDependencyPosition, String)

AdviceDependencyAttribute Constructor (AspectDependencyAction, AspectDependencyPosition, String) PostSharp Documentation
Initializes a new AdviceDependencyAttribute and specifies a position.

Namespace: PostSharp.Aspects.Dependencies
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
public AdviceDependencyAttribute(
    AspectDependencyAction action,
    AspectDependencyPosition position,
    string adviceMethodName
)
public AdviceDependencyAttribute(
    AspectDependencyAction action,
    AspectDependencyPosition position,
    string adviceMethodName
)
Parameters
action
Type: PostSharp.Aspects.Dependencies AspectDependencyAction
Dependency action.
position
Type: PostSharp.Aspects.Dependencies AspectDependencyPosition
Dependency position.
adviceMethodName
Type:   Online System String
Name of the advice method.
See Also
AdviceDependencyAttribute Class
AdviceDependencyAttribute Members
AdviceDependencyAttribute Overload
PostSharp.Aspects.Dependencies Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


AdviceDependencyAttribute Properties

AdviceDependencyAttribute Properties PostSharp Documentation
The AdviceDependencyAttribute type exposes the following members.
Properties
 | Name | Description
Public property | Action | Gets the dependency action, i.e. the kind of relationship specified by the dependency (Order, Require, Conflict, or Commute). (Inherited from AspectDependencyAttribute.)
Public property | AdviceMethodName | Gets the name of the method implementing the advice.
Public property | IsWarning | If true, specifies that the constraint (of type Require or Conflict) should emit a warning instead of an error if not respected. (Inherited from AspectDependencyAttribute.)
Public property | Position | Gets the position of the current dependency, i.e. actually the position of the other aspect or advices with respect to the one related to this dependency. (Inherited from AspectDependencyAttribute.)
Public property | Target | Determines the target (Default or Type) to which the aspect dependency apply. (Inherited from AspectDependencyAttribute.)
Public property | TargetType | Aspect type to which this dependency applies. This property is required when the custom attribute is applied at assembly level. It is ignored when applied on class or method level. (Inherited from AspectDependencyAttribute.)
Back to Top
See Also
AdviceDependencyAttribute Class
PostSharp.Aspects.Dependencies Namespace

Online Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


AdviceDependencyAttribute.AdviceMethodName Property

AdviceDependencyAttribute AdviceMethodName Property PostSharp Documentation
Gets the name of the method implementing the advice.

Namespace: PostSharp.Aspects.Dependencies
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
public string AdviceMethodName { get; private set; }
public string AdviceMethodName { get; private set; }
Property Value
Type:   Online String
See Also
AdviceDependencyAttribute Class
AdviceDependencyAttribute Members
PostSharp.Aspects.Dependencies Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


AspectDependencyAction Enumeration

AspectDependencyAction Enumeration PostSharp Documentation
Enumeration of the different kinds of relationships of specified by aspect dependencies.

Namespace: PostSharp.Aspects.Dependencies
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
public enum AspectDependencyAction
public enum AspectDependencyAction
Members
Member name | Value | Description
None | 0 | The dependency is ignored.
Order | 1 | The dependency specifies an order relationship.
Require | 2 | The depedency specifies that the current aspect or advice requires another aspect or advice.
Conflict | 3 | The dependency specifies that the current aspect or advice conflicts with another aspect or advice.
Commute | 4 | The dependency specifies that the current aspect or advice commutes with another aspect or advice.
Remarks
The combined values of AspectDependencyAction and AspectDependencyPosition is interpreted
                as follows:
Action | Position | Description
Order | After | The current aspect or advice should be positioned after the other aspect or advice matched by the custom attribute.
Order | Before | The current aspect or advice should be positioned before the other aspect or advice matched by the custom attribute.
Require | Any | The current aspect or advice requires another aspect or advice matched by the custom attribute, at any position.
Require | After | The current aspect or advice requires another aspect or advice matched by the custom attribute positioned after the current one.
Require | Before | The current aspect or advice requires another aspect or advice matched by the custom attribute positioned before the current one.
Conflict | Any | The current aspect or advice conflicts with any aspect or advice matched by the custom attribute, at any position.
Conflict | After | The current aspect or advice conflicts with any aspect or advice matched by the custom attribute, if positioned after the current one.
Conflict | Before | The current aspect or advice conflicts with any aspect or advice matched by the custom attribute, if positioned before the current one.
Commute |  | The current aspect or advice commute with any other aspect or advice matched by the custom attribute.
See Also
PostSharp.Aspects.Dependencies Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


AspectDependencyAttribute Class

AspectDependencyAttribute Class PostSharp Documentation
Base class for all custom attributes defining aspect dependencies. An aspect dependency determines the behavior of aspects or advices when used in conjunction with other aspects and advices. Aspect dependencies determine ordering, requirements, conflicts, and commutativity of aspects and advices.
Inheritance Hierarchy
Online System Object
Online System Attribute
PostSharp.Aspects.Dependencies AspectDependencyAttribute
PostSharp.Aspects.Dependencies AdviceDependencyAttribute
PostSharp.Aspects.Dependencies AspectEffectDependencyAttribute
PostSharp.Aspects.Dependencies AspectRoleDependencyAttribute
PostSharp.Aspects.Dependencies AspectTypeDependencyAttribute
PostSharp.Aspects.Dependencies ProvideAspectRoleAttribute

Namespace: PostSharp.Aspects.Dependencies
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
public abstract class AspectDependencyAttribute : Attribute
public abstract class AspectDependencyAttribute : Attribute
Remarks
  Note  Note

      PostSharp Professional Edition is required for this feature.

See Also
AspectDependencyAttribute Members
PostSharp.Aspects.Dependencies Namespace

      Conceptual Documentation: Configuring Aspects

  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


AspectDependencyAttribute Members

AspectDependencyAttribute Members PostSharp Documentation

The AspectDependencyAttribute type exposes the following members.
Constructors
 | Name | Description
Protected method | AspectDependencyAttribute(AspectDependencyAction) | Initializes a new AspectDependencyAttribute without specifying the position, implicitly set to Any.
Protected method | AspectDependencyAttribute(AspectDependencyAction, AspectDependencyPosition) | Initializes a new AspectDependencyAttribute and specifies a position.
Back to Top
Properties
 | Name | Description
Public property | Action | Gets the dependency action, i.e. the kind of relationship specified by the dependency (Order, Require, Conflict, or Commute).
Public property | IsWarning | If true, specifies that the constraint (of type Require or Conflict) should emit a warning instead of an error if not respected.
Public property | Position | Gets the position of the current dependency, i.e. actually the position of the other aspect or advices with respect to the one related to this dependency.
Public property | Target | Determines the target (Default or Type) to which the aspect dependency apply.
Public property | TargetType | Aspect type to which this dependency applies. This property is required when the custom attribute is applied at assembly level. It is ignored when applied on class or method level.
Back to Top
See Also
AspectDependencyAttribute Class
PostSharp.Aspects.Dependencies Namespace

Online Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


AspectDependencyAttribute Constructor

AspectDependencyAttribute Constructor PostSharp Documentation
Overload List
 | Name | Description
Protected method | AspectDependencyAttribute(AspectDependencyAction) | Initializes a new AspectDependencyAttribute without specifying the position, implicitly set to Any.
Protected method | AspectDependencyAttribute(AspectDependencyAction, AspectDependencyPosition) | Initializes a new AspectDependencyAttribute and specifies a position.
Back to Top
See Also
AspectDependencyAttribute Class
AspectDependencyAttribute Members
PostSharp.Aspects.Dependencies Namespace

Online Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


AspectDependencyAttribute Constructor (AspectDependencyAction)

AspectDependencyAttribute Constructor (AspectDependencyAction) PostSharp Documentation
Initializes a new AspectDependencyAttribute without specifying the position, implicitly set to Any.

Namespace: PostSharp.Aspects.Dependencies
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
protected AspectDependencyAttribute(
    AspectDependencyAction action
)
protected AspectDependencyAttribute(
    AspectDependencyAction action
)
Parameters
action
Type: PostSharp.Aspects.Dependencies AspectDependencyAction
Dependency action.
See Also
AspectDependencyAttribute Class
AspectDependencyAttribute Members
AspectDependencyAttribute Overload
PostSharp.Aspects.Dependencies Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


AspectDependencyAttribute Constructor (AspectDependencyAction, AspectDependencyPosition)

AspectDependencyAttribute Constructor (AspectDependencyAction, AspectDependencyPosition) PostSharp Documentation
Initializes a new AspectDependencyAttribute and specifies a position.

Namespace: PostSharp.Aspects.Dependencies
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
protected AspectDependencyAttribute(
    AspectDependencyAction action,
    AspectDependencyPosition position
)
protected AspectDependencyAttribute(
    AspectDependencyAction action,
    AspectDependencyPosition position
)
Parameters
action
Type: PostSharp.Aspects.Dependencies AspectDependencyAction
Dependency action.
position
Type: PostSharp.Aspects.Dependencies AspectDependencyPosition
Dependency position.
See Also
AspectDependencyAttribute Class
AspectDependencyAttribute Members
AspectDependencyAttribute Overload
PostSharp.Aspects.Dependencies Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


AspectDependencyAttribute Properties

AspectDependencyAttribute Properties PostSharp Documentation
The AspectDependencyAttribute type exposes the following members.
Properties
 | Name | Description
Public property | Action | Gets the dependency action, i.e. the kind of relationship specified by the dependency (Order, Require, Conflict, or Commute).
Public property | IsWarning | If true, specifies that the constraint (of type Require or Conflict) should emit a warning instead of an error if not respected.
Public property | Position | Gets the position of the current dependency, i.e. actually the position of the other aspect or advices with respect to the one related to this dependency.
Public property | Target | Determines the target (Default or Type) to which the aspect dependency apply.
Public property | TargetType | Aspect type to which this dependency applies. This property is required when the custom attribute is applied at assembly level. It is ignored when applied on class or method level.
Back to Top
See Also
AspectDependencyAttribute Class
PostSharp.Aspects.Dependencies Namespace

Online Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


AspectDependencyAttribute.Action Property

AspectDependencyAttribute Action Property PostSharp Documentation
Gets the dependency action, i.e. the kind of relationship specified by the dependency (Order, Require, Conflict, or Commute).

Namespace: PostSharp.Aspects.Dependencies
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
public AspectDependencyAction Action { get; private set; }
public AspectDependencyAction Action { get; private set; }
Property Value
Type: AspectDependencyAction
Remarks

              See documentation of AspectDependencyAction for a description of the meaning of combined Action
              and Position properties.

See Also
AspectDependencyAttribute Class
AspectDependencyAttribute Members
PostSharp.Aspects.Dependencies Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


AspectDependencyAttribute.IsWarning Property

AspectDependencyAttribute IsWarning Property PostSharp Documentation
If true, specifies that the constraint (of type Require or Conflict) should emit a warning instead of an error if not respected.

Namespace: PostSharp.Aspects.Dependencies
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
public bool IsWarning { get; set; }
public bool IsWarning { get; set; }
Property Value
Type:   Online Boolean
See Also
AspectDependencyAttribute Class
AspectDependencyAttribute Members
PostSharp.Aspects.Dependencies Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


AspectDependencyAttribute.Position Property

AspectDependencyAttribute Position Property PostSharp Documentation
Gets the position of the current dependency, i.e. actually the position of the other aspect or advices with respect to the one related to this dependency.

Namespace: PostSharp.Aspects.Dependencies
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
public AspectDependencyPosition Position { get; private set; }
public AspectDependencyPosition Position { get; private set; }
Property Value
Type: AspectDependencyPosition
Remarks

              See documentation of AspectDependencyAction for a description of the meaning of combined Action
              and Position properties.

See Also
AspectDependencyAttribute Class
AspectDependencyAttribute Members
PostSharp.Aspects.Dependencies Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


AspectDependencyAttribute.Target Property

AspectDependencyAttribute Target Property PostSharp Documentation
Determines the target (Default or Type) to which the aspect dependency apply.

Namespace: PostSharp.Aspects.Dependencies
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
public AspectDependencyTarget Target { get; set; }
public AspectDependencyTarget Target { get; set; }
Property Value
Type: AspectDependencyTarget
Remarks

              See the documentation of AspectDependencyTarget for details.

See Also
AspectDependencyAttribute Class
AspectDependencyAttribute Members
PostSharp.Aspects.Dependencies Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


AspectDependencyAttribute.TargetType Property

AspectDependencyAttribute TargetType Property PostSharp Documentation
Aspect type to which this dependency applies. This property is required when the custom attribute is applied at assembly level. It is ignored when applied on class or method level.

Namespace: PostSharp.Aspects.Dependencies
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
public Type TargetType { get; set; }
public Type TargetType { get; set; }
Property Value
Type:   Online Type
See Also
AspectDependencyAttribute Class
AspectDependencyAttribute Members
PostSharp.Aspects.Dependencies Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


AspectDependencyAttributeCollection Class

AspectDependencyAttributeCollection Class PostSharp Documentation
Collection of AspectDependencyAttribute.
Inheritance Hierarchy
Online System Object
Online System.Collections.ObjectModel Collection AspectDependencyAttribute
PostSharp.Aspects.Dependencies AspectDependencyAttributeCollection

Namespace: PostSharp.Aspects.Dependencies
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
public sealed class AspectDependencyAttributeCollection : Collection<AspectDependencyAttribute>
public sealed class AspectDependencyAttributeCollection : Collection<AspectDependencyAttribute>
See Also
AspectDependencyAttributeCollection Members
PostSharp.Aspects.Dependencies Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


AspectDependencyAttributeCollection Members

AspectDependencyAttributeCollection Members PostSharp Documentation

The AspectDependencyAttributeCollection type exposes the following members.
Constructors
 | Name | Description
Public method | AspectDependencyAttributeCollection | Initializes a new instance of the AspectDependencyAttributeCollection class
Back to Top
See Also
AspectDependencyAttributeCollection Class
PostSharp.Aspects.Dependencies Namespace

Online Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


AspectDependencyAttributeCollection Constructor

AspectDependencyAttributeCollection Constructor PostSharp Documentation
Initializes a new instance of the AspectDependencyAttributeCollection class

Namespace: PostSharp.Aspects.Dependencies
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
public AspectDependencyAttributeCollection()
public AspectDependencyAttributeCollection()
See Also
AspectDependencyAttributeCollection Class
AspectDependencyAttributeCollection Members
PostSharp.Aspects.Dependencies Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


AspectDependencyPosition Enumeration

AspectDependencyPosition Enumeration PostSharp Documentation
Enumeration of the direction of the relationship specified by an aspect dependency.

Namespace: PostSharp.Aspects.Dependencies
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
public enum AspectDependencyPosition
public enum AspectDependencyPosition
Members
Member name | Value | Description
Any | 0 | Any order possible (or order not relevant).
Before | -1 | The current aspect or advice is positioned before the other aspect or handler.
After | 1 | The current aspect or advice is positioned after the other aspect or handler.
See Also
PostSharp.Aspects.Dependencies Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


AspectDependencyTarget Enumeration

AspectDependencyTarget Enumeration PostSharp Documentation
Enumeration of targets (Default or Type) to which the aspect dependency apply.

Namespace: PostSharp.Aspects.Dependencies
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
public enum AspectDependencyTarget
public enum AspectDependencyTarget
Members
Member name | Value | Description
Default | 0 | Natural target of the aspect.
Type | 1 | Declaring type of the natural target of the aspect.
Remarks
This property is meaningful only for aspects that apply to type members. For aspects that
                apply to types, type-level and default-level dependencies are the same thing.
Member-level aspects may have semantics that actually apply at type level (for instance
                member introductions and imports). By setting the dependency target to
                Type, you can specify that the aspect dependency applies
                to type-level semantics. Otherwise, it will apply to member-level semantics.
See Also
PostSharp.Aspects.Dependencies Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


AspectEffectDependencyAttribute Class

AspectEffectDependencyAttribute Class PostSharp Documentation
Specifies an aspect dependency matching aspects or advices having a given effect.
Inheritance Hierarchy
Online System Object
Online System Attribute
PostSharp.Aspects.Dependencies AspectDependencyAttribute
PostSharp.Aspects.Dependencies AspectEffectDependencyAttribute

Namespace: PostSharp.Aspects.Dependencies
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
public sealed class AspectEffectDependencyAttribute : AspectDependencyAttribute
public sealed class AspectEffectDependencyAttribute : AspectDependencyAttribute
Remarks

                All aspects (except the ones that have an empty implementation) have an effect on the program execution.
                The current custom attribute allows to express dependencies to aspects according to their effect.

The list of standard effects is given in class StandardEffects. All advices have
                implicitly the effect Custom. Most advices also have the effect
                ChangeControlFlow, because they are able to modify the control flow (for instance,
                skip the execution of the intercepted method or throwing an exception). An aspect or advice can declare
                it does not have a given effect by using the WaiveAspectEffectAttribute custom attribute.

Remarks
  Note  Note

      PostSharp Professional Edition is required for this feature.

See Also
AspectEffectDependencyAttribute Members
PostSharp.Aspects.Dependencies Namespace
PostSharp.Aspects.Dependencies StandardEffects
PostSharp.Aspects.Dependencies WaiveAspectEffectAttribute

      Conceptual Documentation: Configuring Aspects

  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


AspectEffectDependencyAttribute Members

AspectEffectDependencyAttribute Members PostSharp Documentation

The AspectEffectDependencyAttribute type exposes the following members.
Constructors
 | Name | Description
Public method | AspectEffectDependencyAttribute(AspectDependencyAction, String) | Initializes a new AspectEffectDependencyAttribute without specifying the position, implicitly set to Any.
Public method | AspectEffectDependencyAttribute(AspectDependencyAction, AspectDependencyPosition, String) | Initializes a new AspectEffectDependencyAttribute and specifies a position.
Back to Top
Properties
 | Name | Description
Public property | Action | Gets the dependency action, i.e. the kind of relationship specified by the dependency (Order, Require, Conflict, or Commute). (Inherited from AspectDependencyAttribute.)
Public property | Effect | Gets the effect that the aspects or advices must have in order to match the current dependency.
Public property | IsWarning | If true, specifies that the constraint (of type Require or Conflict) should emit a warning instead of an error if not respected. (Inherited from AspectDependencyAttribute.)
Public property | Position | Gets the position of the current dependency, i.e. actually the position of the other aspect or advices with respect to the one related to this dependency. (Inherited from AspectDependencyAttribute.)
Public property | Target | Determines the target (Default or Type) to which the aspect dependency apply. (Inherited from AspectDependencyAttribute.)
Public property | TargetType | Aspect type to which this dependency applies. This property is required when the custom attribute is applied at assembly level. It is ignored when applied on class or method level. (Inherited from AspectDependencyAttribute.)
Back to Top
See Also
AspectEffectDependencyAttribute Class
PostSharp.Aspects.Dependencies Namespace

Online Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


AspectEffectDependencyAttribute Constructor

AspectEffectDependencyAttribute Constructor PostSharp Documentation
Overload List
 | Name | Description
Public method | AspectEffectDependencyAttribute(AspectDependencyAction, String) | Initializes a new AspectEffectDependencyAttribute without specifying the position, implicitly set to Any.
Public method | AspectEffectDependencyAttribute(AspectDependencyAction, AspectDependencyPosition, String) | Initializes a new AspectEffectDependencyAttribute and specifies a position.
Back to Top
See Also
AspectEffectDependencyAttribute Class
AspectEffectDependencyAttribute Members
PostSharp.Aspects.Dependencies Namespace

Online Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


AspectEffectDependencyAttribute Constructor (AspectDependencyAction, String)

AspectEffectDependencyAttribute Constructor (AspectDependencyAction, String) PostSharp Documentation
Initializes a new AspectEffectDependencyAttribute without specifying the position, implicitly set to Any.

Namespace: PostSharp.Aspects.Dependencies
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
public AspectEffectDependencyAttribute(
    AspectDependencyAction action,
    string effect
)
public AspectEffectDependencyAttribute(
    AspectDependencyAction action,
    string effect
)
Parameters
action
Type: PostSharp.Aspects.Dependencies AspectDependencyAction
Dependency action.
effect
Type:   Online System String
Effect (see StandardEffects).
See Also
AspectEffectDependencyAttribute Class
AspectEffectDependencyAttribute Members
AspectEffectDependencyAttribute Overload
PostSharp.Aspects.Dependencies Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


AspectEffectDependencyAttribute Constructor (AspectDependencyAction, AspectDependencyPosition, String)

AspectEffectDependencyAttribute Constructor (AspectDependencyAction, AspectDependencyPosition, String) PostSharp Documentation
Initializes a new AspectEffectDependencyAttribute and specifies a position.

Namespace: PostSharp.Aspects.Dependencies
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
public AspectEffectDependencyAttribute(
    AspectDependencyAction action,
    AspectDependencyPosition position,
    string effect
)
public AspectEffectDependencyAttribute(
    AspectDependencyAction action,
    AspectDependencyPosition position,
    string effect
)
Parameters
action
Type: PostSharp.Aspects.Dependencies AspectDependencyAction
Dependency action.
position
Type: PostSharp.Aspects.Dependencies AspectDependencyPosition
Dependency position.
effect
Type:   Online System String
Effect (see StandardEffects).
See Also
AspectEffectDependencyAttribute Class
AspectEffectDependencyAttribute Members
AspectEffectDependencyAttribute Overload
PostSharp.Aspects.Dependencies Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


AspectEffectDependencyAttribute Properties

AspectEffectDependencyAttribute Properties PostSharp Documentation
The AspectEffectDependencyAttribute type exposes the following members.
Properties
 | Name | Description
Public property | Action | Gets the dependency action, i.e. the kind of relationship specified by the dependency (Order, Require, Conflict, or Commute). (Inherited from AspectDependencyAttribute.)
Public property | Effect | Gets the effect that the aspects or advices must have in order to match the current dependency.
Public property | IsWarning | If true, specifies that the constraint (of type Require or Conflict) should emit a warning instead of an error if not respected. (Inherited from AspectDependencyAttribute.)
Public property | Position | Gets the position of the current dependency, i.e. actually the position of the other aspect or advices with respect to the one related to this dependency. (Inherited from AspectDependencyAttribute.)
Public property | Target | Determines the target (Default or Type) to which the aspect dependency apply. (Inherited from AspectDependencyAttribute.)
Public property | TargetType | Aspect type to which this dependency applies. This property is required when the custom attribute is applied at assembly level. It is ignored when applied on class or method level. (Inherited from AspectDependencyAttribute.)
Back to Top
See Also
AspectEffectDependencyAttribute Class
PostSharp.Aspects.Dependencies Namespace

Online Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


AspectEffectDependencyAttribute.Effect Property

AspectEffectDependencyAttribute Effect Property PostSharp Documentation
Gets the effect that the aspects or advices must have in order to match the current dependency.

Namespace: PostSharp.Aspects.Dependencies
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
public string Effect { get; private set; }
public string Effect { get; private set; }
Property Value
Type:   Online String
See Also
AspectEffectDependencyAttribute Class
AspectEffectDependencyAttribute Members
PostSharp.Aspects.Dependencies Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


AspectRoleDependencyAttribute Class

AspectRoleDependencyAttribute Class PostSharp Documentation
Specifies an aspect dependency matching aspects or advices that are a part of a given role.
Inheritance Hierarchy
Online System Object
Online System Attribute
PostSharp.Aspects.Dependencies AspectDependencyAttribute
PostSharp.Aspects.Dependencies AspectRoleDependencyAttribute

Namespace: PostSharp.Aspects.Dependencies
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
public sealed class AspectRoleDependencyAttribute : AspectDependencyAttribute
public sealed class AspectRoleDependencyAttribute : AspectDependencyAttribute
Remarks

                A role describes what the aspect actually does. A list of standard roles is available on the class
                StandardRoles. Aspect vendors are encouraged to enroll their aspects in one of these
                roles whenever it makes sense, and to document the other roles they have used.

An aspect or advice can be enrolled in a role by using the ProvideAspectRoleAttribute
                custom attribute.

  Note  Note

      PostSharp Professional Edition is required for this feature.

See Also
AspectRoleDependencyAttribute Members
PostSharp.Aspects.Dependencies Namespace
PostSharp.Aspects.Dependencies ProvideAspectRoleAttribute
PostSharp.Aspects.Dependencies StandardRoles

      Conceptual Documentation: Configuring Aspects

  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


AspectRoleDependencyAttribute Members

AspectRoleDependencyAttribute Members PostSharp Documentation

The AspectRoleDependencyAttribute type exposes the following members.
Constructors
 | Name | Description
Public method | AspectRoleDependencyAttribute(AspectDependencyAction, String) | Initializes a new AspectEffectDependencyAttribute without specifying the position, implicitly set to Any.
Public method | AspectRoleDependencyAttribute(AspectDependencyAction, AspectDependencyPosition, String) | Initializes a new AspectRoleDependencyAttribute and specifies a position.
Back to Top
Properties
 | Name | Description
Public property | Action | Gets the dependency action, i.e. the kind of relationship specified by the dependency (Order, Require, Conflict, or Commute). (Inherited from AspectDependencyAttribute.)
Public property | IsWarning | If true, specifies that the constraint (of type Require or Conflict) should emit a warning instead of an error if not respected. (Inherited from AspectDependencyAttribute.)
Public property | Position | Gets the position of the current dependency, i.e. actually the position of the other aspect or advices with respect to the one related to this dependency. (Inherited from AspectDependencyAttribute.)
Public property | Role | Gets the role that the aspects or advices must be a part of in order to match the current dependency.
Public property | Target | Determines the target (Default or Type) to which the aspect dependency apply. (Inherited from AspectDependencyAttribute.)
Public property | TargetType | Aspect type to which this dependency applies. This property is required when the custom attribute is applied at assembly level. It is ignored when applied on class or method level. (Inherited from AspectDependencyAttribute.)
Back to Top
See Also
AspectRoleDependencyAttribute Class
PostSharp.Aspects.Dependencies Namespace

Online Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


AspectRoleDependencyAttribute Constructor

AspectRoleDependencyAttribute Constructor PostSharp Documentation
Overload List
 | Name | Description
Public method | AspectRoleDependencyAttribute(AspectDependencyAction, String) | Initializes a new AspectEffectDependencyAttribute without specifying the position, implicitly set to Any.
Public method | AspectRoleDependencyAttribute(AspectDependencyAction, AspectDependencyPosition, String) | Initializes a new AspectRoleDependencyAttribute and specifies a position.
Back to Top
See Also
AspectRoleDependencyAttribute Class
AspectRoleDependencyAttribute Members
PostSharp.Aspects.Dependencies Namespace

Online Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


AspectRoleDependencyAttribute Constructor (AspectDependencyAction, String)

AspectRoleDependencyAttribute Constructor (AspectDependencyAction, String) PostSharp Documentation
Initializes a new AspectEffectDependencyAttribute without specifying the position, implicitly set to Any.

Namespace: PostSharp.Aspects.Dependencies
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
public AspectRoleDependencyAttribute(
    AspectDependencyAction action,
    string role
)
public AspectRoleDependencyAttribute(
    AspectDependencyAction action,
    string role
)
Parameters
action
Type: PostSharp.Aspects.Dependencies AspectDependencyAction
Dependency action.
role
Type:   Online System String
Role.
See Also
AspectRoleDependencyAttribute Class
AspectRoleDependencyAttribute Members
AspectRoleDependencyAttribute Overload
PostSharp.Aspects.Dependencies Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


AspectRoleDependencyAttribute Constructor (AspectDependencyAction, AspectDependencyPosition, String)

AspectRoleDependencyAttribute Constructor (AspectDependencyAction, AspectDependencyPosition, String) PostSharp Documentation
Initializes a new AspectRoleDependencyAttribute and specifies a position.

Namespace: PostSharp.Aspects.Dependencies
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
public AspectRoleDependencyAttribute(
    AspectDependencyAction action,
    AspectDependencyPosition position,
    string role
)
public AspectRoleDependencyAttribute(
    AspectDependencyAction action,
    AspectDependencyPosition position,
    string role
)
Parameters
action
Type: PostSharp.Aspects.Dependencies AspectDependencyAction
Dependency action.
position
Type: PostSharp.Aspects.Dependencies AspectDependencyPosition
Dependency position.
role
Type:   Online System String
Role.
See Also
AspectRoleDependencyAttribute Class
AspectRoleDependencyAttribute Members
AspectRoleDependencyAttribute Overload
PostSharp.Aspects.Dependencies Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


AspectRoleDependencyAttribute Properties

AspectRoleDependencyAttribute Properties PostSharp Documentation
The AspectRoleDependencyAttribute type exposes the following members.
Properties
 | Name | Description
Public property | Action | Gets the dependency action, i.e. the kind of relationship specified by the dependency (Order, Require, Conflict, or Commute). (Inherited from AspectDependencyAttribute.)
Public property | IsWarning | If true, specifies that the constraint (of type Require or Conflict) should emit a warning instead of an error if not respected. (Inherited from AspectDependencyAttribute.)
Public property | Position | Gets the position of the current dependency, i.e. actually the position of the other aspect or advices with respect to the one related to this dependency. (Inherited from AspectDependencyAttribute.)
Public property | Role | Gets the role that the aspects or advices must be a part of in order to match the current dependency.
Public property | Target | Determines the target (Default or Type) to which the aspect dependency apply. (Inherited from AspectDependencyAttribute.)
Public property | TargetType | Aspect type to which this dependency applies. This property is required when the custom attribute is applied at assembly level. It is ignored when applied on class or method level. (Inherited from AspectDependencyAttribute.)
Back to Top
See Also
AspectRoleDependencyAttribute Class
PostSharp.Aspects.Dependencies Namespace

Online Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


AspectRoleDependencyAttribute.Role Property

AspectRoleDependencyAttribute Role Property PostSharp Documentation
Gets the role that the aspects or advices must be a part of in order to match the current dependency.

Namespace: PostSharp.Aspects.Dependencies
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
public string Role { get; private set; }
public string Role { get; private set; }
Property Value
Type:   Online String
See Also
AspectRoleDependencyAttribute Class
AspectRoleDependencyAttribute Members
PostSharp.Aspects.Dependencies Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


AspectTypeDependencyAttribute Class

AspectTypeDependencyAttribute Class PostSharp Documentation
Specifies an aspect dependency matching aspects of a specified type, and all its advices.
Inheritance Hierarchy
Online System Object
Online System Attribute
PostSharp.Aspects.Dependencies AspectDependencyAttribute
PostSharp.Aspects.Dependencies AspectTypeDependencyAttribute

Namespace: PostSharp.Aspects.Dependencies
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
public sealed class AspectTypeDependencyAttribute : AspectDependencyAttribute
public sealed class AspectTypeDependencyAttribute : AspectDependencyAttribute
See Also
AspectTypeDependencyAttribute Members
PostSharp.Aspects.Dependencies Namespace

      Conceptual Documentation: Configuring Aspects

  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


AspectTypeDependencyAttribute Members

AspectTypeDependencyAttribute Members PostSharp Documentation

The AspectTypeDependencyAttribute type exposes the following members.
Constructors
 | Name | Description
Public method | AspectTypeDependencyAttribute(AspectDependencyAction, Type) | Initializes a new AspectTypeDependencyAttribute without specifying the position, implicitly set to Any.
Public method | AspectTypeDependencyAttribute(AspectDependencyAction, AspectDependencyPosition, Type) | Initializes a new AspectTypeDependencyAttribute and specifies a position.
Back to Top
Properties
 | Name | Description
Public property | Action | Gets the dependency action, i.e. the kind of relationship specified by the dependency (Order, Require, Conflict, or Commute). (Inherited from AspectDependencyAttribute.)
Public property | AspectType | Gets the type from which the aspects should be derived in order to match the current dependency.
Public property | IsWarning | If true, specifies that the constraint (of type Require or Conflict) should emit a warning instead of an error if not respected. (Inherited from AspectDependencyAttribute.)
Public property | Position | Gets the position of the current dependency, i.e. actually the position of the other aspect or advices with respect to the one related to this dependency. (Inherited from AspectDependencyAttribute.)
Public property | Target | Determines the target (Default or Type) to which the aspect dependency apply. (Inherited from AspectDependencyAttribute.)
Public property | TargetType | Aspect type to which this dependency applies. This property is required when the custom attribute is applied at assembly level. It is ignored when applied on class or method level. (Inherited from AspectDependencyAttribute.)
Back to Top
See Also
AspectTypeDependencyAttribute Class
PostSharp.Aspects.Dependencies Namespace

Online Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


AspectTypeDependencyAttribute Constructor

AspectTypeDependencyAttribute Constructor PostSharp Documentation
Overload List
 | Name | Description
Public method | AspectTypeDependencyAttribute(AspectDependencyAction, Type) | Initializes a new AspectTypeDependencyAttribute without specifying the position, implicitly set to Any.
Public method | AspectTypeDependencyAttribute(AspectDependencyAction, AspectDependencyPosition, Type) | Initializes a new AspectTypeDependencyAttribute and specifies a position.
Back to Top
See Also
AspectTypeDependencyAttribute Class
AspectTypeDependencyAttribute Members
PostSharp.Aspects.Dependencies Namespace

Online Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


AspectTypeDependencyAttribute Constructor (AspectDependencyAction, Type)

AspectTypeDependencyAttribute Constructor (AspectDependencyAction, Type) PostSharp Documentation
Initializes a new AspectTypeDependencyAttribute without specifying the position, implicitly set to Any.

Namespace: PostSharp.Aspects.Dependencies
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
public AspectTypeDependencyAttribute(
    AspectDependencyAction action,
    Type aspectType
)
public AspectTypeDependencyAttribute(
    AspectDependencyAction action,
    Type aspectType
)
Parameters
action
Type: PostSharp.Aspects.Dependencies AspectDependencyAction
Dependency action.
aspectType
Type:   Online System Type
Aspect type (derived from IAspect).
See Also
AspectTypeDependencyAttribute Class
AspectTypeDependencyAttribute Members
AspectTypeDependencyAttribute Overload
PostSharp.Aspects.Dependencies Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


AspectTypeDependencyAttribute Constructor (AspectDependencyAction, AspectDependencyPosition, Type)

AspectTypeDependencyAttribute Constructor (AspectDependencyAction, AspectDependencyPosition, Type) PostSharp Documentation
Initializes a new AspectTypeDependencyAttribute and specifies a position.

Namespace: PostSharp.Aspects.Dependencies
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
public AspectTypeDependencyAttribute(
    AspectDependencyAction action,
    AspectDependencyPosition position,
    Type aspectType
)
public AspectTypeDependencyAttribute(
    AspectDependencyAction action,
    AspectDependencyPosition position,
    Type aspectType
)
Parameters
action
Type: PostSharp.Aspects.Dependencies AspectDependencyAction
Dependency action.
position
Type: PostSharp.Aspects.Dependencies AspectDependencyPosition
Dependency position.
aspectType
Type:   Online System Type
Aspect type (derived from IAspect).
Remarks
  Note  Note

      PostSharp Professional Edition is required for this feature.

See Also
AspectTypeDependencyAttribute Class
AspectTypeDependencyAttribute Members
AspectTypeDependencyAttribute Overload
PostSharp.Aspects.Dependencies Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


AspectTypeDependencyAttribute Properties

AspectTypeDependencyAttribute Properties PostSharp Documentation
The AspectTypeDependencyAttribute type exposes the following members.
Properties
 | Name | Description
Public property | Action | Gets the dependency action, i.e. the kind of relationship specified by the dependency (Order, Require, Conflict, or Commute). (Inherited from AspectDependencyAttribute.)
Public property | AspectType | Gets the type from which the aspects should be derived in order to match the current dependency.
Public property | IsWarning | If true, specifies that the constraint (of type Require or Conflict) should emit a warning instead of an error if not respected. (Inherited from AspectDependencyAttribute.)
Public property | Position | Gets the position of the current dependency, i.e. actually the position of the other aspect or advices with respect to the one related to this dependency. (Inherited from AspectDependencyAttribute.)
Public property | Target | Determines the target (Default or Type) to which the aspect dependency apply. (Inherited from AspectDependencyAttribute.)
Public property | TargetType | Aspect type to which this dependency applies. This property is required when the custom attribute is applied at assembly level. It is ignored when applied on class or method level. (Inherited from AspectDependencyAttribute.)
Back to Top
See Also
AspectTypeDependencyAttribute Class
PostSharp.Aspects.Dependencies Namespace

Online Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


AspectTypeDependencyAttribute.AspectType Property

AspectTypeDependencyAttribute AspectType Property PostSharp Documentation
Gets the type from which the aspects should be derived in order to match the current dependency.

Namespace: PostSharp.Aspects.Dependencies
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
public Type AspectType { get; private set; }
public Type AspectType { get; private set; }
Property Value
Type:   Online Type
See Also
AspectTypeDependencyAttribute Class
AspectTypeDependencyAttribute Members
PostSharp.Aspects.Dependencies Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


ProvideAspectRoleAttribute Class

ProvideAspectRoleAttribute Class PostSharp Documentation
Specifies that the aspect or aspect advice to which this custom attribute is applied is a part of a given role. This aspect or advice can then be matched by AspectRoleDependencyAttribute/
Inheritance Hierarchy
Online System Object
Online System Attribute
PostSharp.Aspects.Dependencies AspectDependencyAttribute
PostSharp.Aspects.Dependencies ProvideAspectRoleAttribute

Namespace: PostSharp.Aspects.Dependencies
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
public sealed class ProvideAspectRoleAttribute : AspectDependencyAttribute
public sealed class ProvideAspectRoleAttribute : AspectDependencyAttribute
Remarks
  Note  Note

      PostSharp Professional Edition is required for this feature.

See Also
ProvideAspectRoleAttribute Members
PostSharp.Aspects.Dependencies Namespace
PostSharp.Aspects.Dependencies AspectRoleDependencyAttribute

      Conceptual Documentation: Configuring Aspects

  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


ProvideAspectRoleAttribute Members

ProvideAspectRoleAttribute Members PostSharp Documentation

The ProvideAspectRoleAttribute type exposes the following members.
Constructors
 | Name | Description
Public method | ProvideAspectRoleAttribute | Initializes a new ProvideAspectRoleAttribute.
Back to Top
Properties
 | Name | Description
Public property | Action | Gets the dependency action, i.e. the kind of relationship specified by the dependency (Order, Require, Conflict, or Commute). (Inherited from AspectDependencyAttribute.)
Public property | IsWarning | If true, specifies that the constraint (of type Require or Conflict) should emit a warning instead of an error if not respected. (Inherited from AspectDependencyAttribute.)
Public property | Position | Gets the position of the current dependency, i.e. actually the position of the other aspect or advices with respect to the one related to this dependency. (Inherited from AspectDependencyAttribute.)
Public property | Role | Gets the role into which the aspect or advice to which this custom attribute is applied will be enrolled.
Public property | Target | Determines the target (Default or Type) to which the aspect dependency apply. (Inherited from AspectDependencyAttribute.)
Public property | TargetType | Aspect type to which this dependency applies. This property is required when the custom attribute is applied at assembly level. It is ignored when applied on class or method level. (Inherited from AspectDependencyAttribute.)
Back to Top
See Also
ProvideAspectRoleAttribute Class
PostSharp.Aspects.Dependencies Namespace

Online Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


ProvideAspectRoleAttribute Constructor

ProvideAspectRoleAttribute Constructor PostSharp Documentation
Initializes a new ProvideAspectRoleAttribute.

Namespace: PostSharp.Aspects.Dependencies
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
public ProvideAspectRoleAttribute(
    string role
)
public ProvideAspectRoleAttribute(
    string role
)
Parameters
role
Type:   Online System String
Role.
See Also
ProvideAspectRoleAttribute Class
ProvideAspectRoleAttribute Members
PostSharp.Aspects.Dependencies Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


ProvideAspectRoleAttribute Properties

ProvideAspectRoleAttribute Properties PostSharp Documentation
The ProvideAspectRoleAttribute type exposes the following members.
Properties
 | Name | Description
Public property | Action | Gets the dependency action, i.e. the kind of relationship specified by the dependency (Order, Require, Conflict, or Commute). (Inherited from AspectDependencyAttribute.)
Public property | IsWarning | If true, specifies that the constraint (of type Require or Conflict) should emit a warning instead of an error if not respected. (Inherited from AspectDependencyAttribute.)
Public property | Position | Gets the position of the current dependency, i.e. actually the position of the other aspect or advices with respect to the one related to this dependency. (Inherited from AspectDependencyAttribute.)
Public property | Role | Gets the role into which the aspect or advice to which this custom attribute is applied will be enrolled.
Public property | Target | Determines the target (Default or Type) to which the aspect dependency apply. (Inherited from AspectDependencyAttribute.)
Public property | TargetType | Aspect type to which this dependency applies. This property is required when the custom attribute is applied at assembly level. It is ignored when applied on class or method level. (Inherited from AspectDependencyAttribute.)
Back to Top
See Also
ProvideAspectRoleAttribute Class
PostSharp.Aspects.Dependencies Namespace

Online Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


ProvideAspectRoleAttribute.Role Property

ProvideAspectRoleAttribute Role Property PostSharp Documentation
Gets the role into which the aspect or advice to which this custom attribute is applied will be enrolled.

Namespace: PostSharp.Aspects.Dependencies
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
public string Role { get; private set; }
public string Role { get; private set; }
Property Value
Type:   Online String
See Also
ProvideAspectRoleAttribute Class
ProvideAspectRoleAttribute Members
PostSharp.Aspects.Dependencies Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


StandardEffects Class

StandardEffects Class PostSharp Documentation
List of standard effects.
Inheritance Hierarchy
Online System Object
PostSharp.Aspects.Dependencies StandardEffects

Namespace: PostSharp.Aspects.Dependencies
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
public static class StandardEffects
public static class StandardEffects
Remarks
See AspectEffectDependencyAttribute for a discussion of effects.
This list is not meant to be extended by vendors providing concrete aspects (implementing some business
                functionality). Roles should be used to categorized the business effect of concrete aspects. However, if you
                implement a new kind of abstract aspect  (for instance member suppression), you may need to define new effects.

                In that case, we at PostSharp encourage you contact us to define a new role string. If you define a
                new role string, we recommend you clearly define it so that users of your aspect can express dependencies
                with their own aspects, or third-party aspects.
  Note  Note

      PostSharp Professional Edition is required for this feature.

See Also
StandardEffects Members
PostSharp.Aspects.Dependencies Namespace
PostSharp.Aspects.Dependencies AspectEffectDependencyAttribute
PostSharp.Aspects.Dependencies WaiveAspectEffectAttribute
PostSharp.Aspects.Dependencies StandardRoles

      Conceptual Documentation: Configuring Aspects

  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


StandardEffects Members

StandardEffects Members PostSharp Documentation

The StandardEffects type exposes the following members.
Methods
Name | Description
GetInterfaceIntroductionEffect | Gets a string representing the effect of introducing an interface into a type.
GetMemberImportEffect | Gets a string representing the effect of importing a member into from the target type into the aspect.
GetMemberIntroductionEffect | Gets a string representing the effect of introducing a member into a type.
Back to Top
Fields
Name | Description
ChangeControlFlow | Change the flow control (for instance by having the possibility to skip execution of an intercepted method).
Custom | Custom effect (implemented in an aspect advice). All advices have this effect by default, unless they are annotated by WaiveAspectEffectAttribute.
CustomAttributeIntroduction | Introduction of a custom attribute.
InterfaceIntroduction | Introduction of an interface.
MemberImport | Import of a type member.
MemberIntroduction | Introduction of a type member.
Back to Top
See Also
StandardEffects Class
PostSharp.Aspects.Dependencies Namespace

Online Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


StandardEffects Fields

StandardEffects Fields PostSharp Documentation
The StandardEffects type exposes the following members.
Fields
Name | Description
ChangeControlFlow | Change the flow control (for instance by having the possibility to skip execution of an intercepted method).
Custom | Custom effect (implemented in an aspect advice). All advices have this effect by default, unless they are annotated by WaiveAspectEffectAttribute.
CustomAttributeIntroduction | Introduction of a custom attribute.
InterfaceIntroduction | Introduction of an interface.
MemberImport | Import of a type member.
MemberIntroduction | Introduction of a type member.
Back to Top
See Also
StandardEffects Class
PostSharp.Aspects.Dependencies Namespace

Online Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


StandardEffects.ChangeControlFlow Field

StandardEffects ChangeControlFlow Field PostSharp Documentation
Change the flow control (for instance by having the possibility to skip execution of an intercepted method).

Namespace: PostSharp.Aspects.Dependencies
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
public const string ChangeControlFlow
public const string ChangeControlFlow
Field Value
Type:   Online String
See Also
StandardEffects Class
StandardEffects Members
PostSharp.Aspects.Dependencies Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


StandardEffects.Custom Field

StandardEffects Custom Field PostSharp Documentation
Custom effect (implemented in an aspect advice). All advices have this effect by default, unless they are annotated by WaiveAspectEffectAttribute.

Namespace: PostSharp.Aspects.Dependencies
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
public const string Custom
public const string Custom
Field Value
Type:   Online String
See Also
StandardEffects Class
StandardEffects Members
PostSharp.Aspects.Dependencies Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


StandardEffects.CustomAttributeIntroduction Field

StandardEffects CustomAttributeIntroduction Field PostSharp Documentation
Introduction of a custom attribute.

Namespace: PostSharp.Aspects.Dependencies
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
public const string CustomAttributeIntroduction
public const string CustomAttributeIntroduction
Field Value
Type:   Online String
See Also
StandardEffects Class
StandardEffects Members
PostSharp.Aspects.Dependencies Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


StandardEffects.InterfaceIntroduction Field

StandardEffects InterfaceIntroduction Field PostSharp Documentation
Introduction of an interface.

Namespace: PostSharp.Aspects.Dependencies
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
public const string InterfaceIntroduction
public const string InterfaceIntroduction
Field Value
Type:   Online String
See Also
StandardEffects Class
StandardEffects Members
PostSharp.Aspects.Dependencies Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


StandardEffects.MemberImport Field

StandardEffects MemberImport Field PostSharp Documentation
Import of a type member.

Namespace: PostSharp.Aspects.Dependencies
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
public const string MemberImport
public const string MemberImport
Field Value
Type:   Online String
See Also
StandardEffects Class
StandardEffects Members
PostSharp.Aspects.Dependencies Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


StandardEffects.MemberIntroduction Field

StandardEffects MemberIntroduction Field PostSharp Documentation
Introduction of a type member.

Namespace: PostSharp.Aspects.Dependencies
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
public const string MemberIntroduction
public const string MemberIntroduction
Field Value
Type:   Online String
See Also
StandardEffects Class
StandardEffects Members
PostSharp.Aspects.Dependencies Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


StandardEffects Methods

StandardEffects Methods PostSharp Documentation
The StandardEffects type exposes the following members.
Methods
Name | Description
GetInterfaceIntroductionEffect | Gets a string representing the effect of introducing an interface into a type.
GetMemberImportEffect | Gets a string representing the effect of importing a member into from the target type into the aspect.
GetMemberIntroductionEffect | Gets a string representing the effect of introducing a member into a type.
Back to Top
See Also
StandardEffects Class
PostSharp.Aspects.Dependencies Namespace

Online Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


StandardEffects.GetInterfaceIntroductionEffect Method

StandardEffects GetInterfaceIntroductionEffect Method PostSharp Documentation
Gets a string representing the effect of introducing an interface into a type.

Namespace: PostSharp.Aspects.Dependencies
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
public static string GetInterfaceIntroductionEffect(
    string typeName
)
public static string GetInterfaceIntroductionEffect(
    string typeName
)
Parameters
typeName
Type:   Online System String
Name of the introduced interface.
Return Value
Type:   Online String
A string that, by convention, represents the introduction of an interface named
              typeName into a type.
See Also
StandardEffects Class
StandardEffects Members
PostSharp.Aspects.Dependencies Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


StandardEffects.GetMemberImportEffect Method

StandardEffects GetMemberImportEffect Method PostSharp Documentation
Gets a string representing the effect of importing a member into from the target type into the aspect.

Namespace: PostSharp.Aspects.Dependencies
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
public static string GetMemberImportEffect(
    string memberName
)
public static string GetMemberImportEffect(
    string memberName
)
Parameters
memberName
Type:   Online System String
Name of the imported member.
Return Value
Type:   Online String
A string that, by convention, represents the import of a member named
              memberName from the target type into the aspect.
See Also
StandardEffects Class
StandardEffects Members
PostSharp.Aspects.Dependencies Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


StandardEffects.GetMemberIntroductionEffect Method

StandardEffects GetMemberIntroductionEffect Method PostSharp Documentation
Gets a string representing the effect of introducing a member into a type.

Namespace: PostSharp.Aspects.Dependencies
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
public static string GetMemberIntroductionEffect(
    string memberName
)
public static string GetMemberIntroductionEffect(
    string memberName
)
Parameters
memberName
Type:   Online System String
Name of the introduced member.
Return Value
Type:   Online String
A string that, by convention, represents the introduction of a member named
              memberName into a type.
See Also
StandardEffects Class
StandardEffects Members
PostSharp.Aspects.Dependencies Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


StandardRoles Class

StandardRoles Class PostSharp Documentation
List of standard roles.
Inheritance Hierarchy
Online System Object
PostSharp.Aspects.Dependencies StandardRoles

Namespace: PostSharp.Aspects.Dependencies
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
public static class StandardRoles
public static class StandardRoles
Remarks
See AspectRoleDependencyAttribute for a discussion of aspect roles.
Roles are used to categorize aspects according to their function. This class
                defines standard names for the most commonly used aspect roles. If you are an aspect vendor,
                you are encouraged to enroll your aspects (using ProvideAspectRoleAttribute) into
                one of these roles.

                If this list is not sufficient, we at PostSharp encourage you
                contact us to define a new role string. In any case, if you define a new role string, we recommend you
                clearly define it so that users of your aspect can express dependencies with their own aspects,
                or third-party aspects.
  Note  Note

      PostSharp Professional Edition is required for this feature.

See Also
StandardRoles Members
PostSharp.Aspects.Dependencies Namespace

      Conceptual Documentation: Configuring Aspects

  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


StandardRoles Members

StandardRoles Members PostSharp Documentation

The StandardRoles type exposes the following members.
Fields
Name | Description
Caching | Caching.
DataBinding | Data binding (for instance implementation of Online INotifyPropertyChanged).
EventBroker | Event broker (a system role used internally by PostSharp to realize the OnInvokeHandler(EventInterceptionArgs) handler).
ExceptionHandling | Exception handling.
PerformanceInstrumentation | Performance instrumentation (for instance performance counters).
Persistence | Object persistence (for instance Object-Relational Mapper).
Security | Security enforcing (typically authorization).
Threading | Threading (locking).
Tracing | Tracing and logging.
TransactionHandling | Transaction handling.
Validation | Validation of field, property, or parameter value.
Back to Top
See Also
StandardRoles Class
PostSharp.Aspects.Dependencies Namespace

Online Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


StandardRoles Fields

StandardRoles Fields PostSharp Documentation
The StandardRoles type exposes the following members.
Fields
Name | Description
Caching | Caching.
DataBinding | Data binding (for instance implementation of Online INotifyPropertyChanged).
EventBroker | Event broker (a system role used internally by PostSharp to realize the OnInvokeHandler(EventInterceptionArgs) handler).
ExceptionHandling | Exception handling.
PerformanceInstrumentation | Performance instrumentation (for instance performance counters).
Persistence | Object persistence (for instance Object-Relational Mapper).
Security | Security enforcing (typically authorization).
Threading | Threading (locking).
Tracing | Tracing and logging.
TransactionHandling | Transaction handling.
Validation | Validation of field, property, or parameter value.
Back to Top
See Also
StandardRoles Class
PostSharp.Aspects.Dependencies Namespace

Online Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


StandardRoles.Caching Field

StandardRoles Caching Field PostSharp Documentation
Caching.

Namespace: PostSharp.Aspects.Dependencies
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
public const string Caching
public const string Caching
Field Value
Type:   Online String
See Also
StandardRoles Class
StandardRoles Members
PostSharp.Aspects.Dependencies Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


StandardRoles.DataBinding Field

StandardRoles DataBinding Field PostSharp Documentation
Data binding (for instance implementation of Online INotifyPropertyChanged).

Namespace: PostSharp.Aspects.Dependencies
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
public const string DataBinding
public const string DataBinding
Field Value
Type:   Online String
See Also
StandardRoles Class
StandardRoles Members
PostSharp.Aspects.Dependencies Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


StandardRoles.EventBroker Field

StandardRoles EventBroker Field PostSharp Documentation
Event broker (a system role used internally by PostSharp to realize the OnInvokeHandler(EventInterceptionArgs) handler).

Namespace: PostSharp.Aspects.Dependencies
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
public const string EventBroker
public const string EventBroker
Field Value
Type:   Online String
See Also
StandardRoles Class
StandardRoles Members
PostSharp.Aspects.Dependencies Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


StandardRoles.ExceptionHandling Field

StandardRoles ExceptionHandling Field PostSharp Documentation
Exception handling.

Namespace: PostSharp.Aspects.Dependencies
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
public const string ExceptionHandling
public const string ExceptionHandling
Field Value
Type:   Online String
See Also
StandardRoles Class
StandardRoles Members
PostSharp.Aspects.Dependencies Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


StandardRoles.PerformanceInstrumentation Field

StandardRoles PerformanceInstrumentation Field PostSharp Documentation
Performance instrumentation (for instance performance counters).

Namespace: PostSharp.Aspects.Dependencies
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
public const string PerformanceInstrumentation
public const string PerformanceInstrumentation
Field Value
Type:   Online String
See Also
StandardRoles Class
StandardRoles Members
PostSharp.Aspects.Dependencies Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


StandardRoles.Persistence Field

StandardRoles Persistence Field PostSharp Documentation
Object persistence (for instance Object-Relational Mapper).

Namespace: PostSharp.Aspects.Dependencies
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
public const string Persistence
public const string Persistence
Field Value
Type:   Online String
See Also
StandardRoles Class
StandardRoles Members
PostSharp.Aspects.Dependencies Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


StandardRoles.Security Field

StandardRoles Security Field PostSharp Documentation
Security enforcing (typically authorization).

Namespace: PostSharp.Aspects.Dependencies
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
public const string Security
public const string Security
Field Value
Type:   Online String
See Also
StandardRoles Class
StandardRoles Members
PostSharp.Aspects.Dependencies Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


StandardRoles.Threading Field

StandardRoles Threading Field PostSharp Documentation
Threading (locking).

Namespace: PostSharp.Aspects.Dependencies
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
public const string Threading
public const string Threading
Field Value
Type:   Online String
See Also
StandardRoles Class
StandardRoles Members
PostSharp.Aspects.Dependencies Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


StandardRoles.Tracing Field

StandardRoles Tracing Field PostSharp Documentation
Tracing and logging.

Namespace: PostSharp.Aspects.Dependencies
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
public const string Tracing
public const string Tracing
Field Value
Type:   Online String
See Also
StandardRoles Class
StandardRoles Members
PostSharp.Aspects.Dependencies Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


StandardRoles.TransactionHandling Field

StandardRoles TransactionHandling Field PostSharp Documentation
Transaction handling.

Namespace: PostSharp.Aspects.Dependencies
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
public const string TransactionHandling
public const string TransactionHandling
Field Value
Type:   Online String
See Also
StandardRoles Class
StandardRoles Members
PostSharp.Aspects.Dependencies Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


StandardRoles.Validation Field

StandardRoles Validation Field PostSharp Documentation
Validation of field, property, or parameter value.

Namespace: PostSharp.Aspects.Dependencies
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
public const string Validation
public const string Validation
Field Value
Type:   Online String
See Also
StandardRoles Class
StandardRoles Members
PostSharp.Aspects.Dependencies Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


WaiveAspectEffectAttribute Class

WaiveAspectEffectAttribute Class PostSharp Documentation
Declares that the aspect class or advice to which this custom attribute is applied is exempt of a given effect.
Inheritance Hierarchy
Online System Object
Online System Attribute
PostSharp.Aspects.Dependencies WaiveAspectEffectAttribute

Namespace: PostSharp.Aspects.Dependencies
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
public sealed class WaiveAspectEffectAttribute : Attribute
public sealed class WaiveAspectEffectAttribute : Attribute
Remarks

              See AspectEffectDependencyAttribute for details about effects.

Remarks
  Note  Note

      PostSharp Professional Edition is required for this feature.

See Also
WaiveAspectEffectAttribute Members
PostSharp.Aspects.Dependencies Namespace

      Conceptual Documentation: Configuring Aspects

  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


WaiveAspectEffectAttribute Members

WaiveAspectEffectAttribute Members PostSharp Documentation

Constructors
 | Name | Description
Public method | WaiveAspectEffectAttribute | Initializes a new WaiveAspectEffectAttribute declaring that the aspect class or advice to which this custom attribute is applied has no effect at all.
Public method | WaiveAspectEffectAttribute( String ) | Initializes a new WaiveAspectEffectAttribute declaring that the aspect class or advice to which this custom attribute is applied is exempt of the specified effects.
Back to Top
See Also
WaiveAspectEffectAttribute Class
PostSharp.Aspects.Dependencies Namespace

Online Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


WaiveAspectEffectAttribute Constructor

WaiveAspectEffectAttribute Constructor PostSharp Documentation
Overload List
 | Name | Description
Public method | WaiveAspectEffectAttribute | Initializes a new WaiveAspectEffectAttribute declaring that the aspect class or advice to which this custom attribute is applied has no effect at all.
Public method | WaiveAspectEffectAttribute( String ) | Initializes a new WaiveAspectEffectAttribute declaring that the aspect class or advice to which this custom attribute is applied is exempt of the specified effects.
Back to Top
See Also
WaiveAspectEffectAttribute Class
WaiveAspectEffectAttribute Members
PostSharp.Aspects.Dependencies Namespace

Online Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


WaiveAspectEffectAttribute Constructor

WaiveAspectEffectAttribute Constructor PostSharp Documentation
Initializes a new WaiveAspectEffectAttribute declaring that the aspect class or advice to which this custom attribute is applied has no effect at all.

Namespace: PostSharp.Aspects.Dependencies
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
public WaiveAspectEffectAttribute()
public WaiveAspectEffectAttribute()
See Also
WaiveAspectEffectAttribute Class
WaiveAspectEffectAttribute Members
WaiveAspectEffectAttribute Overload
PostSharp.Aspects.Dependencies Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


WaiveAspectEffectAttribute Constructor (String[])

WaiveAspectEffectAttribute Constructor ( String ) PostSharp Documentation
Initializes a new WaiveAspectEffectAttribute declaring that the aspect class or advice to which this custom attribute is applied is exempt of the specified effects.

Namespace: PostSharp.Aspects.Dependencies
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
public WaiveAspectEffectAttribute(
    params string[] effects
)
public WaiveAspectEffectAttribute(
    params string[] effects
)
Parameters
effects
Type:    Online System String
List of effects of which the aspect class or advice
              to which this custom attribute is applied is guaranteed to be exempt.
See Also
WaiveAspectEffectAttribute Class
WaiveAspectEffectAttribute Members
WaiveAspectEffectAttribute Overload
PostSharp.Aspects.Dependencies Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


PostSharp.Aspects.Serialization Namespace

PostSharp.Aspects.Serialization Namespace PostSharp Documentation
The PostSharp.Aspects.Serialization namespace contains types taking care of the process of serializing aspects at build time and deserializing them at run time.
Classes
 | Class | Description
Public class | AspectSerializer | Base class for Laos serializers, whose role is to serialize aspect instances at compile-time and deserialize them at runtime.
Public class | BinaryAspectSerializationBinder | Implementation of Online SerializationBinder used at runtime when aspect instances are deserialized. By overriding the default binder, you can resolve assembly names differently. This can be useful if assemblies have been renamed or merged between PostSharp run and execution
Public class | BinaryAspectSerializer | Implementation of AspectSerializer based on the Online BinaryFormatter provided by the full version of the .NET Framework.
Public class | MsilAspectSerializer | When used as a value of AspectConfigurationAttribute.SerializerType property, specifies that the aspect should not be serialized but should instead be constructed at runtime using MSIL instructions.
Public class | PortableAspectSerializer | Implementation of AspectSerializer based on the PortableFormatter, for use on any other platform than the fully-trusted .NET Framework.
Public class | StateBag | Obsolete. Simple recursive structure of name-value collections used by the StateBagAspectSerializer to implement portable serialization.
Public class | StateBagAspectSerializer | Obsolete. Trivial serializer for use with light editions of the .NET Framework (Compact Framework, Silverlight). Aspects should implement the IStateBagSerializable interface and should have a parameterless constructor. This constructor is used during deserialization.
Public class | StateBagAspectSerializerException | Obsolete. Exception thrown by the StateBagAspectSerializer.
Public class | XmlAspectSerializer | Obsolete. Implementation of AspectSerializer based on the Online XmlSerializer provided by the .NET Framework.
Interfaces
 | Interface | Description
Public interface | IMetadataAwareSurrogateSelector | A Online SurrogateSelector that receives an IMetadataEmitter before serialization.
Public interface | IStateBagSerializable | Obsolete. Interface to be implemented by classes that should be serializable using a StateBagAspectSerializer. These classes should also implement a default (parameterless) constructor.

Online Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


AspectSerializer Class

AspectSerializer Class PostSharp Documentation
Base class for Laos serializers, whose role is to serialize aspect instances at compile-time and deserialize them at runtime.
Inheritance Hierarchy
Online System Object
PostSharp.Aspects.Serialization AspectSerializer
PostSharp.Aspects.Serialization BinaryAspectSerializer
PostSharp.Aspects.Serialization MsilAspectSerializer
PostSharp.Aspects.Serialization PortableAspectSerializer
PostSharp.Aspects.Serialization StateBagAspectSerializer
PostSharp.Aspects.Serialization XmlAspectSerializer

Namespace: PostSharp.Aspects.Serialization
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
public abstract class AspectSerializer
public abstract class AspectSerializer
See Also
AspectSerializer Members
PostSharp.Aspects.Serialization Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


AspectSerializer Members

AspectSerializer Members PostSharp Documentation

The AspectSerializer type exposes the following members.
Constructors
 | Name | Description
Protected method | AspectSerializer | Initializes a new instance of the AspectSerializer class
Back to Top
Methods
 | Name | Description
Protected method | Deserialize(Stream, IMetadataDispenser) | Deserializes a stream into an array if aspects.
Public method | Deserialize(Assembly, String, IMetadataDispenser) | Deserializes aspects contained in a managed resource of an assembly.
Public method | Serialize | Serializes an array of aspects into a stream.
Back to Top
See Also
AspectSerializer Class
PostSharp.Aspects.Serialization Namespace

Online Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


AspectSerializer Constructor

AspectSerializer Constructor PostSharp Documentation
Initializes a new instance of the AspectSerializer class

Namespace: PostSharp.Aspects.Serialization
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
protected AspectSerializer()
protected AspectSerializer()
See Also
AspectSerializer Class
AspectSerializer Members
PostSharp.Aspects.Serialization Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


AspectSerializer Methods

AspectSerializer Methods PostSharp Documentation
The AspectSerializer type exposes the following members.
Methods
 | Name | Description
Protected method | Deserialize(Stream, IMetadataDispenser) | Deserializes a stream into an array if aspects.
Public method | Deserialize(Assembly, String, IMetadataDispenser) | Deserializes aspects contained in a managed resource of an assembly.
Public method | Serialize | Serializes an array of aspects into a stream.
Back to Top
See Also
AspectSerializer Class
PostSharp.Aspects.Serialization Namespace

Online Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


AspectSerializer.Deserialize Method

AspectSerializer Deserialize Method PostSharp Documentation
Overload List
 | Name | Description
Protected method | Deserialize(Stream, IMetadataDispenser) | Deserializes a stream into an array if aspects.
Public method | Deserialize(Assembly, String, IMetadataDispenser) | Deserializes aspects contained in a managed resource of an assembly.
Back to Top
See Also
AspectSerializer Class
AspectSerializer Members
PostSharp.Aspects.Serialization Namespace

Online Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


AspectSerializer.Deserialize Method (Stream, IMetadataDispenser)

AspectSerializer Deserialize Method (Stream, IMetadataDispenser) PostSharp Documentation
Deserializes a stream into an array if aspects.

Namespace: PostSharp.Aspects.Serialization
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
protected abstract IAspect[] Deserialize(
    Stream stream,
    IMetadataDispenser metadataDispenser
)
protected abstract IAspect[] Deserialize(
    Stream stream,
    IMetadataDispenser metadataDispenser
)
Parameters
stream
Type:   Online System.IO Stream
Stream containing serialized aspects.
metadataDispenser
Type: PostSharp.Reflection IMetadataDispenser
Metadata dispenser to be used to resolve serialized metadata references in stream.
Return Value
Type:  IAspect
An array of aspects.
Remarks

              The implementation is not allowed to change the order or array elements.

See Also
AspectSerializer Class
AspectSerializer Members
Deserialize Overload
PostSharp.Aspects.Serialization Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


AspectSerializer.Deserialize Method (Assembly, String, IMetadataDispenser)

AspectSerializer Deserialize Method (Assembly, String, IMetadataDispenser) PostSharp Documentation
Deserializes aspects contained in a managed resource of an assembly.

Namespace: PostSharp.Aspects.Serialization
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
public IAspect[] Deserialize(
    Assembly assembly,
    string resourceName,
    IMetadataDispenser metadataDispenser
)
public IAspect[] Deserialize(
    Assembly assembly,
    string resourceName,
    IMetadataDispenser metadataDispenser
)
Parameters
assembly
Type:   Online System.Reflection Assembly
Assembly containing the serialized aspects.
resourceName
Type:   Online System String
Name of the managed resources into which aspects have been serialized.
metadataDispenser
Type: PostSharp.Reflection IMetadataDispenser
Metadata dispenser to be used to resolve serialized metadata references in this resource.
Return Value
Type:  IAspect
An array of aspects.
See Also
AspectSerializer Class
AspectSerializer Members
Deserialize Overload
PostSharp.Aspects.Serialization Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


AspectSerializer.Serialize Method

AspectSerializer Serialize Method PostSharp Documentation
Serializes an array of aspects into a stream.

Namespace: PostSharp.Aspects.Serialization
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
public abstract void Serialize(
    IAspect[] aspects,
    Stream stream,
    IMetadataEmitter metadataEmitter
)
public abstract void Serialize(
    IAspect[] aspects,
    Stream stream,
    IMetadataEmitter metadataEmitter
)
Parameters
aspects
Type:  PostSharp.Aspects IAspect
Array of aspects to be serialized.
stream
Type:   Online System.IO Stream
Stream into which aspects have to be serialized.
metadataEmitter
Type: PostSharp.Reflection IMetadataEmitter
A metadata emitter for the current module.
See Also
AspectSerializer Class
AspectSerializer Members
PostSharp.Aspects.Serialization Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


BinaryAspectSerializationBinder Class

BinaryAspectSerializationBinder Class PostSharp Documentation
Implementation of Online SerializationBinder used at runtime when aspect instances are deserialized. By overriding the default binder, you can resolve assembly names differently. This can be useful if assemblies have been renamed or merged between PostSharp run and execution
Inheritance Hierarchy
Online System Object
Online System.Runtime.Serialization SerializationBinder
PostSharp.Aspects.Serialization BinaryAspectSerializationBinder

Namespace: PostSharp.Aspects.Serialization
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
public class BinaryAspectSerializationBinder : SerializationBinder
public class BinaryAspectSerializationBinder : SerializationBinder
See Also
BinaryAspectSerializationBinder Members
PostSharp.Aspects.Serialization Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


BinaryAspectSerializationBinder Members

BinaryAspectSerializationBinder Members PostSharp Documentation

The BinaryAspectSerializationBinder type exposes the following members.
Constructors
 | Name | Description
Public method | BinaryAspectSerializationBinder | Initializes a new instance of the BinaryAspectSerializationBinder class
Back to Top
Methods
 | Name | Description
Public method | BindToType | When overridden in a derived class, controls the binding of a serialized object to a type. (Overrides Online SerializationBinder BindToType(String, String).)
Public method | Retarget | Retarget an assembly name to a new one.
Back to Top
See Also
BinaryAspectSerializationBinder Class
PostSharp.Aspects.Serialization Namespace

Online Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


BinaryAspectSerializationBinder Constructor

BinaryAspectSerializationBinder Constructor PostSharp Documentation
Initializes a new instance of the BinaryAspectSerializationBinder class

Namespace: PostSharp.Aspects.Serialization
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
public BinaryAspectSerializationBinder()
public BinaryAspectSerializationBinder()
See Also
BinaryAspectSerializationBinder Class
BinaryAspectSerializationBinder Members
PostSharp.Aspects.Serialization Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


BinaryAspectSerializationBinder Methods

BinaryAspectSerializationBinder Methods PostSharp Documentation
The BinaryAspectSerializationBinder type exposes the following members.
Methods
 | Name | Description
Public method | BindToType | When overridden in a derived class, controls the binding of a serialized object to a type. (Overrides Online SerializationBinder BindToType(String, String).)
Public method | Retarget | Retarget an assembly name to a new one.
Back to Top
See Also
BinaryAspectSerializationBinder Class
PostSharp.Aspects.Serialization Namespace

Online Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


BinaryAspectSerializationBinder.BindToType Method

BinaryAspectSerializationBinder BindToType Method PostSharp Documentation
When overridden in a derived class, controls the binding of a serialized object to a type.

Namespace: PostSharp.Aspects.Serialization
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
public override Type BindToType(
    string assemblyName,
    string typeName
)
public override Type BindToType(
    string assemblyName,
    string typeName
)
Parameters
assemblyName
Type:   Online System String
Specifies the   Online Assembly name of the serialized object.
typeName
Type:   Online System String
Specifies the   Online Type name of the serialized object.
Return Value
Type:   Online Type
The type of the object the formatter creates a new instance of.
See Also
BinaryAspectSerializationBinder Class
BinaryAspectSerializationBinder Members
PostSharp.Aspects.Serialization Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


BinaryAspectSerializationBinder.Retarget Method

BinaryAspectSerializationBinder Retarget Method PostSharp Documentation
Retarget an assembly name to a new one.

Namespace: PostSharp.Aspects.Serialization
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
public void Retarget(
    string oldAssemblyName,
    string newAssemblyName
)
public void Retarget(
    string oldAssemblyName,
    string newAssemblyName
)
Parameters
oldAssemblyName
Type:   Online System String
Old assembly name (in short form only).
newAssemblyName
Type:   Online System String
New assembly name (in short or full form).
See Also
BinaryAspectSerializationBinder Class
BinaryAspectSerializationBinder Members
PostSharp.Aspects.Serialization Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


BinaryAspectSerializer Class

BinaryAspectSerializer Class PostSharp Documentation
Implementation of AspectSerializer based on the Online BinaryFormatter provided by the full version of the .NET Framework.
Inheritance Hierarchy
Online System Object
PostSharp.Aspects.Serialization AspectSerializer
PostSharp.Aspects.Serialization BinaryAspectSerializer

Namespace: PostSharp.Aspects.Serialization
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
public class BinaryAspectSerializer : AspectSerializer
public class BinaryAspectSerializer : AspectSerializer
See Also
BinaryAspectSerializer Members
PostSharp.Aspects.Serialization Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


BinaryAspectSerializer Members

BinaryAspectSerializer Members PostSharp Documentation

The BinaryAspectSerializer type exposes the following members.
Constructors
 | Name | Description
Public method | BinaryAspectSerializer | Initializes a new instance of the BinaryAspectSerializer class
Back to Top
Methods
 | Name | Description
 | ChainSurrogateSelector | Adds an item to the chain of surrogate selectors used during the process of serializing aspects.
Protected method | Deserialize(Stream, IMetadataDispenser) | Deserializes a stream into an array if aspects. (Overrides AspectSerializer Deserialize(Stream, IMetadataDispenser).)
Public method | Deserialize(Assembly, String, IMetadataDispenser) | Deserializes aspects contained in a managed resource of an assembly. (Inherited from AspectSerializer.)
Public method | Serialize | Serializes an array of aspects into a stream. (Overrides AspectSerializer Serialize( IAspect , Stream, IMetadataEmitter).)
Back to Top
Properties
Name | Description
Binder | Gets or sets the Online SerializationBinder used to deserialize aspects.
Back to Top
See Also
BinaryAspectSerializer Class
PostSharp.Aspects.Serialization Namespace

Online Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


BinaryAspectSerializer Constructor

BinaryAspectSerializer Constructor PostSharp Documentation
Initializes a new instance of the BinaryAspectSerializer class

Namespace: PostSharp.Aspects.Serialization
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
public BinaryAspectSerializer()
public BinaryAspectSerializer()
See Also
BinaryAspectSerializer Class
BinaryAspectSerializer Members
PostSharp.Aspects.Serialization Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


BinaryAspectSerializer Methods

BinaryAspectSerializer Methods PostSharp Documentation
The BinaryAspectSerializer type exposes the following members.
Methods
 | Name | Description
 | ChainSurrogateSelector | Adds an item to the chain of surrogate selectors used during the process of serializing aspects.
Protected method | Deserialize(Stream, IMetadataDispenser) | Deserializes a stream into an array if aspects. (Overrides AspectSerializer Deserialize(Stream, IMetadataDispenser).)
Public method | Deserialize(Assembly, String, IMetadataDispenser) | Deserializes aspects contained in a managed resource of an assembly. (Inherited from AspectSerializer.)
Public method | Serialize | Serializes an array of aspects into a stream. (Overrides AspectSerializer Serialize( IAspect , Stream, IMetadataEmitter).)
Back to Top
See Also
BinaryAspectSerializer Class
PostSharp.Aspects.Serialization Namespace

Online Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


BinaryAspectSerializer.ChainSurrogateSelector Method

BinaryAspectSerializer ChainSurrogateSelector Method PostSharp Documentation
Adds an item to the chain of surrogate selectors used during the process of serializing aspects.

Namespace: PostSharp.Aspects.Serialization
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
public static void ChainSurrogateSelector(
    ISurrogateSelector selector
)
public static void ChainSurrogateSelector(
    ISurrogateSelector selector
)
Parameters
selector
Type:   Online System.Runtime.Serialization ISurrogateSelector
A new surrogate selector.
See Also
BinaryAspectSerializer Class
BinaryAspectSerializer Members
PostSharp.Aspects.Serialization Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


BinaryAspectSerializer.Deserialize Method

BinaryAspectSerializer Deserialize Method PostSharp Documentation
Overload List
 | Name | Description
Protected method | Deserialize(Stream, IMetadataDispenser) | Deserializes a stream into an array if aspects. (Overrides AspectSerializer Deserialize(Stream, IMetadataDispenser).)
Public method | Deserialize(Assembly, String, IMetadataDispenser) | Deserializes aspects contained in a managed resource of an assembly. (Inherited from AspectSerializer.)
Back to Top
See Also
BinaryAspectSerializer Class
BinaryAspectSerializer Members
PostSharp.Aspects.Serialization Namespace

Online Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


BinaryAspectSerializer.Deserialize Method (Stream, IMetadataDispenser)

BinaryAspectSerializer Deserialize Method (Stream, IMetadataDispenser) PostSharp Documentation
Deserializes a stream into an array if aspects.

Namespace: PostSharp.Aspects.Serialization
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
protected override IAspect[] Deserialize(
    Stream stream,
    IMetadataDispenser metadataDispenser
)
protected override IAspect[] Deserialize(
    Stream stream,
    IMetadataDispenser metadataDispenser
)
Parameters
stream
Type:   Online System.IO Stream
Stream containing serialized aspects.
metadataDispenser
Type: PostSharp.Reflection IMetadataDispenser
Metadata dispenser to be used to resolve serialized metadata references in stream.
Return Value
Type:  IAspect
An array of aspects.
Remarks

              The implementation is not allowed to change the order or array elements.

See Also
BinaryAspectSerializer Class
BinaryAspectSerializer Members
Deserialize Overload
PostSharp.Aspects.Serialization Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


BinaryAspectSerializer.Serialize Method

BinaryAspectSerializer Serialize Method PostSharp Documentation
Serializes an array of aspects into a stream.

Namespace: PostSharp.Aspects.Serialization
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
public override void Serialize(
    IAspect[] aspects,
    Stream stream,
    IMetadataEmitter metadataEmitter
)
public override void Serialize(
    IAspect[] aspects,
    Stream stream,
    IMetadataEmitter metadataEmitter
)
Parameters
aspects
Type:  PostSharp.Aspects IAspect
Array of aspects to be serialized.
stream
Type:   Online System.IO Stream
Stream into which aspects have to be serialized.
metadataEmitter
Type: PostSharp.Reflection IMetadataEmitter
A metadata emitter for the current module.
See Also
BinaryAspectSerializer Class
BinaryAspectSerializer Members
PostSharp.Aspects.Serialization Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


BinaryAspectSerializer Properties

BinaryAspectSerializer Properties PostSharp Documentation
The BinaryAspectSerializer type exposes the following members.
Properties
Name | Description
Binder | Gets or sets the Online SerializationBinder used to deserialize aspects.
Back to Top
See Also
BinaryAspectSerializer Class
PostSharp.Aspects.Serialization Namespace

Online Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


BinaryAspectSerializer.Binder Property

BinaryAspectSerializer Binder Property PostSharp Documentation
Gets or sets the Online SerializationBinder used to deserialize aspects.

Namespace: PostSharp.Aspects.Serialization
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
public static SerializationBinder Binder { get; set; }
public static SerializationBinder Binder { get; set; }
Property Value
Type:   Online SerializationBinder
A   Online SerializationBinder, or null
              to use the default one. By default, BinaryAspectSerializationBinder
              is used.
Remarks

              You should set this property before the first aspect is deserialized;
              that is, before the static constructor of the first enhanced type is invoked.

See Also
BinaryAspectSerializer Class
BinaryAspectSerializer Members
PostSharp.Aspects.Serialization Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


IMetadataAwareSurrogateSelector Interface

IMetadataAwareSurrogateSelector Interface PostSharp Documentation
A Online SurrogateSelector that receives an IMetadataEmitter before serialization.

Namespace: PostSharp.Aspects.Serialization
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
public interface IMetadataAwareSurrogateSelector : ISurrogateSelector
public interface IMetadataAwareSurrogateSelector : ISurrogateSelector
See Also
IMetadataAwareSurrogateSelector Members
PostSharp.Aspects.Serialization Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


IMetadataAwareSurrogateSelector Members

IMetadataAwareSurrogateSelector Members PostSharp Documentation

The IMetadataAwareSurrogateSelector type exposes the following members.
Methods
 | Name | Description
Public method | SetMetadataEmitter | Sets the IMetadataEmitter.
Back to Top
See Also
IMetadataAwareSurrogateSelector Interface
PostSharp.Aspects.Serialization Namespace

Online Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


IMetadataAwareSurrogateSelector Methods

IMetadataAwareSurrogateSelector Methods PostSharp Documentation
The IMetadataAwareSurrogateSelector type exposes the following members.
Methods
 | Name | Description
Public method | SetMetadataEmitter | Sets the IMetadataEmitter.
Back to Top
See Also
IMetadataAwareSurrogateSelector Interface
PostSharp.Aspects.Serialization Namespace

Online Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


IMetadataAwareSurrogateSelector.SetMetadataEmitter Method

IMetadataAwareSurrogateSelector SetMetadataEmitter Method PostSharp Documentation
Sets the IMetadataEmitter.

Namespace: PostSharp.Aspects.Serialization
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
void SetMetadataEmitter(
    IMetadataEmitter metadataEmitter
)
void SetMetadataEmitter(
    IMetadataEmitter metadataEmitter
)
Parameters
metadataEmitter
Type: PostSharp.Reflection IMetadataEmitter
An IMetadataEmitter.
See Also
IMetadataAwareSurrogateSelector Interface
IMetadataAwareSurrogateSelector Members
PostSharp.Aspects.Serialization Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


IStateBagSerializable Interface

IStateBagSerializable Interface PostSharp Documentation
Interface to be implemented by classes that should be serializable using a StateBagAspectSerializer. These classes should also implement a default (parameterless) constructor.

Namespace: PostSharp.Aspects.Serialization
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
[ObsoleteAttribute]
public interface IStateBagSerializable
[ObsoleteAttribute]
public interface IStateBagSerializable
See Also
IStateBagSerializable Members
PostSharp.Aspects.Serialization Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


IStateBagSerializable Members

IStateBagSerializable Members PostSharp Documentation

The IStateBagSerializable type exposes the following members.
Methods
 | Name | Description
Public method | Deserialize | Deserialized the current object from a StateBag.
Public method | Serialize | Serializes the current object into a StateBag/
Back to Top
See Also
IStateBagSerializable Interface
PostSharp.Aspects.Serialization Namespace

Online Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


IStateBagSerializable Methods

IStateBagSerializable Methods PostSharp Documentation
The IStateBagSerializable type exposes the following members.
Methods
 | Name | Description
Public method | Deserialize | Deserialized the current object from a StateBag.
Public method | Serialize | Serializes the current object into a StateBag/
Back to Top
See Also
IStateBagSerializable Interface
PostSharp.Aspects.Serialization Namespace

Online Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


IStateBagSerializable.Deserialize Method

IStateBagSerializable Deserialize Method PostSharp Documentation
Deserialized the current object from a StateBag.

Namespace: PostSharp.Aspects.Serialization
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
void Deserialize(
    StateBag stateBag
)
void Deserialize(
    StateBag stateBag
)
Parameters
stateBag
Type: PostSharp.Aspects.Serialization StateBag
The StateBag into which the object was previously serialized,
              and from which it should be deserialized.
Remarks

              This method is called during deserialization just after the default (parameterless) constructor
              has been invoked.

See Also
IStateBagSerializable Interface
IStateBagSerializable Members
PostSharp.Aspects.Serialization Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


IStateBagSerializable.Serialize Method

IStateBagSerializable Serialize Method PostSharp Documentation
Serializes the current object into a StateBag/

Namespace: PostSharp.Aspects.Serialization
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
void Serialize(
    StateBag stateBag
)
void Serialize(
    StateBag stateBag
)
Parameters
stateBag
Type: PostSharp.Aspects.Serialization StateBag
StateBag into which the current object has to be saved.
See Also
IStateBagSerializable Interface
IStateBagSerializable Members
PostSharp.Aspects.Serialization Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


MsilAspectSerializer Class

MsilAspectSerializer Class PostSharp Documentation
When used as a value of AspectConfigurationAttribute.SerializerType property, specifies that the aspect should not be serialized but should instead be constructed at runtime using MSIL instructions.
Inheritance Hierarchy
Online System Object
PostSharp.Aspects.Serialization AspectSerializer
PostSharp.Aspects.Serialization MsilAspectSerializer

Namespace: PostSharp.Aspects.Serialization
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
public sealed class MsilAspectSerializer : AspectSerializer
public sealed class MsilAspectSerializer : AspectSerializer
Remarks

              This class is not a serializer. When you use MSIL aspect construction, the aspect is built at runtime
              just as normal custom attributes, and any change made at build time is lost.

See Also
MsilAspectSerializer Members
PostSharp.Aspects.Serialization Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


MsilAspectSerializer Members

MsilAspectSerializer Members PostSharp Documentation

The MsilAspectSerializer type exposes the following members.
Constructors
 | Name | Description
Public method | MsilAspectSerializer | Initializes a new instance of the MsilAspectSerializer class
Back to Top
Methods
 | Name | Description
Public method | Deserialize(Assembly, String, IMetadataDispenser) | Deserializes aspects contained in a managed resource of an assembly. (Inherited from AspectSerializer.)
Public method | Serialize | Serializes an array of aspects into a stream. (Overrides AspectSerializer Serialize( IAspect , Stream, IMetadataEmitter).)
Back to Top
See Also
MsilAspectSerializer Class
PostSharp.Aspects.Serialization Namespace

Online Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


MsilAspectSerializer Constructor

MsilAspectSerializer Constructor PostSharp Documentation
Initializes a new instance of the MsilAspectSerializer class

Namespace: PostSharp.Aspects.Serialization
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
public MsilAspectSerializer()
public MsilAspectSerializer()
See Also
MsilAspectSerializer Class
MsilAspectSerializer Members
PostSharp.Aspects.Serialization Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


MsilAspectSerializer Methods

MsilAspectSerializer Methods PostSharp Documentation
The MsilAspectSerializer type exposes the following members.
Methods
 | Name | Description
Public method | Deserialize(Assembly, String, IMetadataDispenser) | Deserializes aspects contained in a managed resource of an assembly. (Inherited from AspectSerializer.)
Public method | Serialize | Serializes an array of aspects into a stream. (Overrides AspectSerializer Serialize( IAspect , Stream, IMetadataEmitter).)
Back to Top
See Also
MsilAspectSerializer Class
PostSharp.Aspects.Serialization Namespace

Online Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


MsilAspectSerializer.Serialize Method

MsilAspectSerializer Serialize Method PostSharp Documentation
Serializes an array of aspects into a stream.

Namespace: PostSharp.Aspects.Serialization
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
public override void Serialize(
    IAspect[] aspects,
    Stream stream,
    IMetadataEmitter metadataEmitter
)
public override void Serialize(
    IAspect[] aspects,
    Stream stream,
    IMetadataEmitter metadataEmitter
)
Parameters
aspects
Type:  PostSharp.Aspects IAspect
Array of aspects to be serialized.
stream
Type:   Online System.IO Stream
Stream into which aspects have to be serialized.
metadataEmitter
Type: PostSharp.Reflection IMetadataEmitter
A metadata emitter for the current module.
See Also
MsilAspectSerializer Class
MsilAspectSerializer Members
PostSharp.Aspects.Serialization Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


PortableAspectSerializer Class

PortableAspectSerializer Class PostSharp Documentation
Implementation of AspectSerializer based on the PortableFormatter, for use on any other platform than the fully-trusted .NET Framework.
Inheritance Hierarchy
Online System Object
PostSharp.Aspects.Serialization AspectSerializer
PostSharp.Aspects.Serialization PortableAspectSerializer

Namespace: PostSharp.Aspects.Serialization
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
public sealed class PortableAspectSerializer : AspectSerializer
public sealed class PortableAspectSerializer : AspectSerializer
See Also
PortableAspectSerializer Members
PostSharp.Aspects.Serialization Namespace
PostSharp.Aspects.Serialization AspectSerializer
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


PortableAspectSerializer Members

PortableAspectSerializer Members PostSharp Documentation

The PortableAspectSerializer type exposes the following members.
Constructors
 | Name | Description
Public method | PortableAspectSerializer | Initializes a new instance of the PortableAspectSerializer class
Back to Top
Methods
 | Name | Description
Public method | Deserialize(Assembly, String, IMetadataDispenser) | Deserializes aspects contained in a managed resource of an assembly. (Inherited from AspectSerializer.)
Public method | Serialize | Serializes an array of aspects into a stream. (Overrides AspectSerializer Serialize( IAspect , Stream, IMetadataEmitter).)
Back to Top
Properties
Name | Description
Binder | Gets or sets the PortableSerializationBinder used to deserialize aspects.
Back to Top
See Also
PortableAspectSerializer Class
PostSharp.Aspects.Serialization Namespace

Online Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


PortableAspectSerializer Constructor

PortableAspectSerializer Constructor PostSharp Documentation
Initializes a new instance of the PortableAspectSerializer class

Namespace: PostSharp.Aspects.Serialization
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
public PortableAspectSerializer()
public PortableAspectSerializer()
See Also
PortableAspectSerializer Class
PortableAspectSerializer Members
PostSharp.Aspects.Serialization Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


PortableAspectSerializer Methods

PortableAspectSerializer Methods PostSharp Documentation
The PortableAspectSerializer type exposes the following members.
Methods
 | Name | Description
Public method | Deserialize(Assembly, String, IMetadataDispenser) | Deserializes aspects contained in a managed resource of an assembly. (Inherited from AspectSerializer.)
Public method | Serialize | Serializes an array of aspects into a stream. (Overrides AspectSerializer Serialize( IAspect , Stream, IMetadataEmitter).)
Back to Top
See Also
PortableAspectSerializer Class
PostSharp.Aspects.Serialization Namespace

Online Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


PortableAspectSerializer.Serialize Method

PortableAspectSerializer Serialize Method PostSharp Documentation
Serializes an array of aspects into a stream.

Namespace: PostSharp.Aspects.Serialization
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
public override void Serialize(
    IAspect[] aspects,
    Stream stream,
    IMetadataEmitter metadataEmitter
)
public override void Serialize(
    IAspect[] aspects,
    Stream stream,
    IMetadataEmitter metadataEmitter
)
Parameters
aspects
Type:  PostSharp.Aspects IAspect
Array of aspects to be serialized.
stream
Type:   Online System.IO Stream
Stream into which aspects have to be serialized.
metadataEmitter
Type: PostSharp.Reflection IMetadataEmitter
A metadata emitter for the current module.
See Also
PortableAspectSerializer Class
PortableAspectSerializer Members
PostSharp.Aspects.Serialization Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


PortableAspectSerializer Properties

PortableAspectSerializer Properties PostSharp Documentation
The PortableAspectSerializer type exposes the following members.
Properties
Name | Description
Binder | Gets or sets the PortableSerializationBinder used to deserialize aspects.
Back to Top
See Also
PortableAspectSerializer Class
PostSharp.Aspects.Serialization Namespace

Online Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


PortableAspectSerializer.Binder Property

PortableAspectSerializer Binder Property PostSharp Documentation
Gets or sets the PortableSerializationBinder used to deserialize aspects.

Namespace: PostSharp.Aspects.Serialization
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
public static PortableSerializationBinder Binder { get; set; }
public static PortableSerializationBinder Binder { get; set; }
Property Value
Type: PortableSerializationBinder
See Also
PortableAspectSerializer Class
PortableAspectSerializer Members
PostSharp.Aspects.Serialization Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


StateBag Class

StateBag Class PostSharp Documentation
Simple recursive structure of name-value collections used by the StateBagAspectSerializer to implement portable serialization.
Inheritance Hierarchy
Online System Object
PostSharp.Aspects.Serialization StateBag

Namespace: PostSharp.Aspects.Serialization
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
[ObsoleteAttribute]
public sealed class StateBag
[ObsoleteAttribute]
public sealed class StateBag
See Also
StateBag Members
PostSharp.Aspects.Serialization Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


StateBag Members

StateBag Members PostSharp Documentation

The StateBag type exposes the following members.
Constructors
 | Name | Description
Public method | StateBag | Initializes a new StateBag.
Back to Top
Methods
 | Name | Description
Public method | CreateBag | Create a child StateBag and assign it a name.
 | Deserialize | Deserializes a stream (given a Online BinaryReader) into a StateBag.
Public method | GetBag | Gets a child StateBag.
Public method | GetValue | Gets a value of the current StateBag.
Public method | Serialize | Serializes the current StateBag into a Online BinaryWriter.
Public method | SetBag | Sets a child StateBag to the StateBag obtained by deserializing an object.
Public method | SetValue | Sets a value in the current StateBag.
Back to Top
Properties
 | Name | Description
Public property | Item | Gets or sets a value in the current StateBag.
Back to Top
See Also
StateBag Class
PostSharp.Aspects.Serialization Namespace

Online Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


StateBag Constructor

StateBag Constructor PostSharp Documentation
Initializes a new StateBag.

Namespace: PostSharp.Aspects.Serialization
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
public StateBag()
public StateBag()
See Also
StateBag Class
StateBag Members
PostSharp.Aspects.Serialization Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


StateBag Methods

StateBag Methods PostSharp Documentation
The StateBag type exposes the following members.
Methods
 | Name | Description
Public method | CreateBag | Create a child StateBag and assign it a name.
 | Deserialize | Deserializes a stream (given a Online BinaryReader) into a StateBag.
Public method | GetBag | Gets a child StateBag.
Public method | GetValue | Gets a value of the current StateBag.
Public method | Serialize | Serializes the current StateBag into a Online BinaryWriter.
Public method | SetBag | Sets a child StateBag to the StateBag obtained by deserializing an object.
Public method | SetValue | Sets a value in the current StateBag.
Back to Top
See Also
StateBag Class
PostSharp.Aspects.Serialization Namespace

Online Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


StateBag.CreateBag Method

StateBag CreateBag Method PostSharp Documentation
Create a child StateBag and assign it a name.

Namespace: PostSharp.Aspects.Serialization
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
public StateBag CreateBag(
    string name
)
public StateBag CreateBag(
    string name
)
Parameters
name
Type:   Online System String
Name of the child bag.
Return Value
Type: StateBag
The new StateBag.
See Also
StateBag Class
StateBag Members
PostSharp.Aspects.Serialization Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


StateBag.Deserialize Method

StateBag Deserialize Method PostSharp Documentation
Deserializes a stream (given a Online BinaryReader) into a StateBag.

Namespace: PostSharp.Aspects.Serialization
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
public static StateBag Deserialize(
    BinaryReader reader
)
public static StateBag Deserialize(
    BinaryReader reader
)
Parameters
reader
Type:   Online System.IO BinaryReader
A   Online BinaryReader.
Return Value
Type: StateBag
The StateBag built from reader.
See Also
StateBag Class
StateBag Members
PostSharp.Aspects.Serialization Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


StateBag.GetBag Method

StateBag GetBag Method PostSharp Documentation
Gets a child StateBag.

Namespace: PostSharp.Aspects.Serialization
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
public StateBag GetBag(
    string name
)
public StateBag GetBag(
    string name
)
Parameters
name
Type:   Online System String
Name of the child StateBag.
Return Value
Type: StateBag
The child StateBag named name, or null
              if there is no child StateBag of this name.
See Also
StateBag Class
StateBag Members
PostSharp.Aspects.Serialization Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


StateBag.GetValue Method

StateBag GetValue Method PostSharp Documentation
Gets a value of the current StateBag.

Namespace: PostSharp.Aspects.Serialization
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
public string GetValue(
    string name
)
public string GetValue(
    string name
)
Parameters
name
Type:   Online System String
Name of the requested value.
Return Value
Type:   Online String
The value named name, or null
              if the StateBag does not contain this value.
See Also
StateBag Class
StateBag Members
PostSharp.Aspects.Serialization Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


StateBag.Serialize Method

StateBag Serialize Method PostSharp Documentation
Serializes the current StateBag into a Online BinaryWriter.

Namespace: PostSharp.Aspects.Serialization
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
public void Serialize(
    BinaryWriter writer
)
public void Serialize(
    BinaryWriter writer
)
Parameters
writer
Type:   Online System.IO BinaryWriter
A   Online BinaryWriter.
See Also
StateBag Class
StateBag Members
PostSharp.Aspects.Serialization Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


StateBag.SetBag Method

StateBag SetBag Method PostSharp Documentation
Sets a child StateBag to the StateBag obtained by deserializing an object.

Namespace: PostSharp.Aspects.Serialization
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
public void SetBag(
    string name,
    IStateBagSerializable obj
)
public void SetBag(
    string name,
    IStateBagSerializable obj
)
Parameters
name
Type:   Online System String
Name of the child StateBag in the current StateBag.
obj
Type: PostSharp.Aspects.Serialization IStateBagSerializable
Object to deserialize.
See Also
StateBag Class
StateBag Members
PostSharp.Aspects.Serialization Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


StateBag.SetValue Method

StateBag SetValue Method PostSharp Documentation
Sets a value in the current StateBag.

Namespace: PostSharp.Aspects.Serialization
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
public void SetValue(
    string name,
    string value
)
public void SetValue(
    string name,
    string value
)
Parameters
name
Type:   Online System String
Item name.
value
Type:   Online System String
Item value.
See Also
StateBag Class
StateBag Members
PostSharp.Aspects.Serialization Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


StateBag Properties

StateBag Properties PostSharp Documentation
The StateBag type exposes the following members.
Properties
 | Name | Description
Public property | Item | Gets or sets a value in the current StateBag.
Back to Top
See Also
StateBag Class
PostSharp.Aspects.Serialization Namespace

Online Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


StateBag.Item Property

StateBag Item Property PostSharp Documentation
Gets or sets a value in the current StateBag.

Namespace: PostSharp.Aspects.Serialization
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
public string this[
    string name
] { get; set; }
public string this[
    string name
] { get; set; }
Parameters
name
Type:   Online System String
Value name.
Return Value
Type:   Online String
The value named name, or null if the
              current StateBag does not contain any value named name.
See Also
StateBag Class
StateBag Members
PostSharp.Aspects.Serialization Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


StateBagAspectSerializer Class

StateBagAspectSerializer Class PostSharp Documentation
Trivial serializer for use with light editions of the .NET Framework (Compact Framework, Silverlight). Aspects should implement the IStateBagSerializable interface and should have a parameterless constructor. This constructor is used during deserialization.
Inheritance Hierarchy
Online System Object
PostSharp.Aspects.Serialization AspectSerializer
PostSharp.Aspects.Serialization StateBagAspectSerializer

Namespace: PostSharp.Aspects.Serialization
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
[ObsoleteAttribute]
public sealed class StateBagAspectSerializer : AspectSerializer
[ObsoleteAttribute]
public sealed class StateBagAspectSerializer : AspectSerializer
See Also
StateBagAspectSerializer Members
PostSharp.Aspects.Serialization Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


StateBagAspectSerializer Members

StateBagAspectSerializer Members PostSharp Documentation

The StateBagAspectSerializer type exposes the following members.
Constructors
 | Name | Description
Public method | StateBagAspectSerializer | Initializes a new instance of the StateBagAspectSerializer class
Back to Top
Methods
 | Name | Description
Public method | Deserialize(Assembly, String, IMetadataDispenser) | Deserializes aspects contained in a managed resource of an assembly. (Inherited from AspectSerializer.)
Public method | Serialize | Serializes an array of aspects into a stream. (Overrides AspectSerializer Serialize( IAspect , Stream, IMetadataEmitter).)
Back to Top
See Also
StateBagAspectSerializer Class
PostSharp.Aspects.Serialization Namespace

Online Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


StateBagAspectSerializer Constructor

StateBagAspectSerializer Constructor PostSharp Documentation
Initializes a new instance of the StateBagAspectSerializer class

Namespace: PostSharp.Aspects.Serialization
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
public StateBagAspectSerializer()
public StateBagAspectSerializer()
See Also
StateBagAspectSerializer Class
StateBagAspectSerializer Members
PostSharp.Aspects.Serialization Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


StateBagAspectSerializer Methods

StateBagAspectSerializer Methods PostSharp Documentation
The StateBagAspectSerializer type exposes the following members.
Methods
 | Name | Description
Public method | Deserialize(Assembly, String, IMetadataDispenser) | Deserializes aspects contained in a managed resource of an assembly. (Inherited from AspectSerializer.)
Public method | Serialize | Serializes an array of aspects into a stream. (Overrides AspectSerializer Serialize( IAspect , Stream, IMetadataEmitter).)
Back to Top
See Also
StateBagAspectSerializer Class
PostSharp.Aspects.Serialization Namespace

Online Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


StateBagAspectSerializer.Serialize Method

StateBagAspectSerializer Serialize Method PostSharp Documentation
Serializes an array of aspects into a stream.

Namespace: PostSharp.Aspects.Serialization
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
public override void Serialize(
    IAspect[] aspects,
    Stream stream,
    IMetadataEmitter metadataEmitter
)
public override void Serialize(
    IAspect[] aspects,
    Stream stream,
    IMetadataEmitter metadataEmitter
)
Parameters
aspects
Type:  PostSharp.Aspects IAspect
Array of aspects to be serialized.
stream
Type:   Online System.IO Stream
Stream into which aspects have to be serialized.
metadataEmitter
Type: PostSharp.Reflection IMetadataEmitter
A metadata emitter for the current module.
See Also
StateBagAspectSerializer Class
StateBagAspectSerializer Members
PostSharp.Aspects.Serialization Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


StateBagAspectSerializerException Class

StateBagAspectSerializerException Class PostSharp Documentation
Exception thrown by the StateBagAspectSerializer.
Inheritance Hierarchy
Online System Object
Online System Exception
PostSharp.Aspects.Serialization StateBagAspectSerializerException

Namespace: PostSharp.Aspects.Serialization
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
[SerializableAttribute]
[ObsoleteAttribute]
public class StateBagAspectSerializerException : Exception
[SerializableAttribute]
[ObsoleteAttribute]
public class StateBagAspectSerializerException : Exception
See Also
StateBagAspectSerializerException Members
PostSharp.Aspects.Serialization Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


StateBagAspectSerializerException Members

StateBagAspectSerializerException Members PostSharp Documentation

Constructors
 | Name | Description
Public method | StateBagAspectSerializerException | Initializes a new StateBagAspectSerializerException with the default message.
Public method | StateBagAspectSerializerException(String) | Initializes a new StateBagAspectSerializerException with a given message.
Protected method | StateBagAspectSerializerException(SerializationInfo, StreamingContext) | Deserializes a StateBagAspectSerializerException.
Public method | StateBagAspectSerializerException(String, Exception) | Initializes a new StateBagAspectSerializerException with a given message and an inner exception.
Back to Top
See Also
StateBagAspectSerializerException Class
PostSharp.Aspects.Serialization Namespace

Online Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


StateBagAspectSerializerException Constructor

StateBagAspectSerializerException Constructor PostSharp Documentation
Overload List
 | Name | Description
Public method | StateBagAspectSerializerException | Initializes a new StateBagAspectSerializerException with the default message.
Public method | StateBagAspectSerializerException(String) | Initializes a new StateBagAspectSerializerException with a given message.
Protected method | StateBagAspectSerializerException(SerializationInfo, StreamingContext) | Deserializes a StateBagAspectSerializerException.
Public method | StateBagAspectSerializerException(String, Exception) | Initializes a new StateBagAspectSerializerException with a given message and an inner exception.
Back to Top
See Also
StateBagAspectSerializerException Class
StateBagAspectSerializerException Members
PostSharp.Aspects.Serialization Namespace

Online Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


StateBagAspectSerializerException Constructor

StateBagAspectSerializerException Constructor PostSharp Documentation
Initializes a new StateBagAspectSerializerException with the default message.

Namespace: PostSharp.Aspects.Serialization
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
public StateBagAspectSerializerException()
public StateBagAspectSerializerException()
See Also
StateBagAspectSerializerException Class
StateBagAspectSerializerException Members
StateBagAspectSerializerException Overload
PostSharp.Aspects.Serialization Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


StateBagAspectSerializerException Constructor (String)

StateBagAspectSerializerException Constructor (String) PostSharp Documentation
Initializes a new StateBagAspectSerializerException with a given message.

Namespace: PostSharp.Aspects.Serialization
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
public StateBagAspectSerializerException(
    string message
)
public StateBagAspectSerializerException(
    string message
)
Parameters
message
Type:   Online System String
Error message.
See Also
StateBagAspectSerializerException Class
StateBagAspectSerializerException Members
StateBagAspectSerializerException Overload
PostSharp.Aspects.Serialization Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


StateBagAspectSerializerException Constructor (SerializationInfo, StreamingContext)

StateBagAspectSerializerException Constructor (SerializationInfo, StreamingContext) PostSharp Documentation
Deserializes a StateBagAspectSerializerException.

Namespace: PostSharp.Aspects.Serialization
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
protected StateBagAspectSerializerException(
    SerializationInfo info,
    StreamingContext context
)
protected StateBagAspectSerializerException(
    SerializationInfo info,
    StreamingContext context
)
Parameters
info
Type:   Online System.Runtime.Serialization SerializationInfo
Serialization information.
context
Type:   Online System.Runtime.Serialization StreamingContext
Streaming context.
See Also
StateBagAspectSerializerException Class
StateBagAspectSerializerException Members
StateBagAspectSerializerException Overload
PostSharp.Aspects.Serialization Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


StateBagAspectSerializerException Constructor (String, Exception)

StateBagAspectSerializerException Constructor (String, Exception) PostSharp Documentation
Initializes a new StateBagAspectSerializerException with a given message and an inner exception.

Namespace: PostSharp.Aspects.Serialization
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
public StateBagAspectSerializerException(
    string message,
    Exception inner
)
public StateBagAspectSerializerException(
    string message,
    Exception inner
)
Parameters
message
Type:   Online System String
Error message.
inner
Type:   Online System Exception
Inner exception.
See Also
StateBagAspectSerializerException Class
StateBagAspectSerializerException Members
StateBagAspectSerializerException Overload
PostSharp.Aspects.Serialization Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


XmlAspectSerializer Class

XmlAspectSerializer Class PostSharp Documentation
Implementation of AspectSerializer based on the Online XmlSerializer provided by the .NET Framework.
Inheritance Hierarchy
Online System Object
PostSharp.Aspects.Serialization AspectSerializer
PostSharp.Aspects.Serialization XmlAspectSerializer

Namespace: PostSharp.Aspects.Serialization
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
[ObsoleteAttribute]
public sealed class XmlAspectSerializer : AspectSerializer
[ObsoleteAttribute]
public sealed class XmlAspectSerializer : AspectSerializer
See Also
XmlAspectSerializer Members
PostSharp.Aspects.Serialization Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


XmlAspectSerializer Members

XmlAspectSerializer Members PostSharp Documentation

The XmlAspectSerializer type exposes the following members.
Constructors
 | Name | Description
Public method | XmlAspectSerializer | Initializes a new instance of the XmlAspectSerializer class
Back to Top
Methods
 | Name | Description
Public method | Deserialize(Assembly, String, IMetadataDispenser) | Deserializes aspects contained in a managed resource of an assembly. (Inherited from AspectSerializer.)
Public method | Serialize | Serializes an array of aspects into a stream. (Overrides AspectSerializer Serialize( IAspect , Stream, IMetadataEmitter).)
Back to Top
See Also
XmlAspectSerializer Class
PostSharp.Aspects.Serialization Namespace

Online Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


XmlAspectSerializer Constructor

XmlAspectSerializer Constructor PostSharp Documentation
Initializes a new instance of the XmlAspectSerializer class

Namespace: PostSharp.Aspects.Serialization
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
public XmlAspectSerializer()
public XmlAspectSerializer()
See Also
XmlAspectSerializer Class
XmlAspectSerializer Members
PostSharp.Aspects.Serialization Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


XmlAspectSerializer Methods

XmlAspectSerializer Methods PostSharp Documentation
The XmlAspectSerializer type exposes the following members.
Methods
 | Name | Description
Public method | Deserialize(Assembly, String, IMetadataDispenser) | Deserializes aspects contained in a managed resource of an assembly. (Inherited from AspectSerializer.)
Public method | Serialize | Serializes an array of aspects into a stream. (Overrides AspectSerializer Serialize( IAspect , Stream, IMetadataEmitter).)
Back to Top
See Also
XmlAspectSerializer Class
PostSharp.Aspects.Serialization Namespace

Online Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


XmlAspectSerializer.Serialize Method

XmlAspectSerializer Serialize Method PostSharp Documentation
Serializes an array of aspects into a stream.

Namespace: PostSharp.Aspects.Serialization
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
public override void Serialize(
    IAspect[] aspects,
    Stream stream,
    IMetadataEmitter metadataEmitter
)
public override void Serialize(
    IAspect[] aspects,
    Stream stream,
    IMetadataEmitter metadataEmitter
)
Parameters
aspects
Type:  PostSharp.Aspects IAspect
Array of aspects to be serialized.
stream
Type:   Online System.IO Stream
Stream into which aspects have to be serialized.
metadataEmitter
Type: PostSharp.Reflection IMetadataEmitter
A metadata emitter for the current module.
See Also
XmlAspectSerializer Class
XmlAspectSerializer Members
PostSharp.Aspects.Serialization Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


PostSharp.Collections Namespace

PostSharp.Collections Namespace PostSharp Documentation
The PostSharp.Collections namespace contains collection types used by the PostSharp library.
Classes
 | Class | Description
Public class | LinkedListExtensions | Extensions to the IReadOnlyLinkedList T interface.
Interfaces
 | Interface | Description
Public interface | ILinkedListNode T | Represents a node in a double-linked list.
Public interface | IReadOnlyLinkedList T | Represents a double linked list.

Online Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


ILinkedListNode(T) Interface

ILinkedListNode T Interface PostSharp Documentation
Represents a node in a double-linked list.

Namespace: PostSharp.Collections
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
public interface ILinkedListNode<out T>
public interface ILinkedListNode<out T>
Type Parameters
T
Type of values stored in the list.
See Also
ILinkedListNode T  Members
PostSharp.Collections Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


ILinkedListNode(T) Members

ILinkedListNode T Members PostSharp Documentation

The ILinkedListNode T type exposes the following members.
Properties
 | Name | Description
Public property | Next | Gets the next node in the list, or null if the current node is the last one in the list.
Public property | Previous | Gets the previous node in the list, or null if the current node is the first one in the list.
Public property | Value | Gets the value stored in the current node.
Back to Top
See Also
ILinkedListNode T Interface
PostSharp.Collections Namespace

Online Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


ILinkedListNode(T) Properties

ILinkedListNode T Properties PostSharp Documentation
The ILinkedListNode T type exposes the following members.
Properties
 | Name | Description
Public property | Next | Gets the next node in the list, or null if the current node is the last one in the list.
Public property | Previous | Gets the previous node in the list, or null if the current node is the first one in the list.
Public property | Value | Gets the value stored in the current node.
Back to Top
See Also
ILinkedListNode T Interface
PostSharp.Collections Namespace

Online Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


ILinkedListNode(T).Next Property

ILinkedListNode T Next Property PostSharp Documentation
Gets the next node in the list, or null if the current node is the last one in the list.

Namespace: PostSharp.Collections
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
ILinkedListNode<T> Next { get; }
ILinkedListNode<T> Next { get; }
Property Value
Type: ILinkedListNode  T
See Also
ILinkedListNode T  Interface
ILinkedListNode T  Members
PostSharp.Collections Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


ILinkedListNode(T).Previous Property

ILinkedListNode T Previous Property PostSharp Documentation
Gets the previous node in the list, or null if the current node is the first one in the list.

Namespace: PostSharp.Collections
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
ILinkedListNode<T> Previous { get; }
ILinkedListNode<T> Previous { get; }
Property Value
Type: ILinkedListNode  T
See Also
ILinkedListNode T  Interface
ILinkedListNode T  Members
PostSharp.Collections Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


ILinkedListNode(T).Value Property

ILinkedListNode T Value Property PostSharp Documentation
Gets the value stored in the current node.

Namespace: PostSharp.Collections
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
T Value { get; }
T Value { get; }
Property Value
Type: T
See Also
ILinkedListNode T  Interface
ILinkedListNode T  Members
PostSharp.Collections Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


IReadOnlyLinkedList(T) Interface

IReadOnlyLinkedList T Interface PostSharp Documentation
Represents a double linked list.

Namespace: PostSharp.Collections
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
public interface IReadOnlyLinkedList<out T>
public interface IReadOnlyLinkedList<out T>
Type Parameters
T
Type of values stored in the link list.
See Also
IReadOnlyLinkedList T  Members
PostSharp.Collections Namespace
PostSharp.Collections LinkedListExtensions
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


IReadOnlyLinkedList(T) Members

IReadOnlyLinkedList T Members PostSharp Documentation

The IReadOnlyLinkedList T type exposes the following members.
Properties
 | Name | Description
Public property | First | Gets the first node in the list, or null if the list is empty.
Public property | IsEmpty | Determines whether the list is empty.
Public property | Last | Gets the last node in the list, or null if the list is empty.
Back to Top
See Also
IReadOnlyLinkedList T Interface
PostSharp.Collections Namespace

Online Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


IReadOnlyLinkedList(T) Properties

IReadOnlyLinkedList T Properties PostSharp Documentation
The IReadOnlyLinkedList T type exposes the following members.
Properties
 | Name | Description
Public property | First | Gets the first node in the list, or null if the list is empty.
Public property | IsEmpty | Determines whether the list is empty.
Public property | Last | Gets the last node in the list, or null if the list is empty.
Back to Top
See Also
IReadOnlyLinkedList T Interface
PostSharp.Collections Namespace

Online Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


IReadOnlyLinkedList(T).First Property

IReadOnlyLinkedList T First Property PostSharp Documentation
Gets the first node in the list, or null if the list is empty.

Namespace: PostSharp.Collections
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
ILinkedListNode<T> First { get; }
ILinkedListNode<T> First { get; }
Property Value
Type: ILinkedListNode  T
See Also
IReadOnlyLinkedList T  Interface
IReadOnlyLinkedList T  Members
PostSharp.Collections Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


IReadOnlyLinkedList(T).IsEmpty Property

IReadOnlyLinkedList T IsEmpty Property PostSharp Documentation
Determines whether the list is empty.

Namespace: PostSharp.Collections
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
bool IsEmpty { get; }
bool IsEmpty { get; }
Property Value
Type:   Online Boolean
See Also
IReadOnlyLinkedList T  Interface
IReadOnlyLinkedList T  Members
PostSharp.Collections Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


IReadOnlyLinkedList(T).Last Property

IReadOnlyLinkedList T Last Property PostSharp Documentation
Gets the last node in the list, or null if the list is empty.

Namespace: PostSharp.Collections
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
ILinkedListNode<T> Last { get; }
ILinkedListNode<T> Last { get; }
Property Value
Type: ILinkedListNode  T
See Also
IReadOnlyLinkedList T  Interface
IReadOnlyLinkedList T  Members
PostSharp.Collections Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


LinkedListExtensions Class

LinkedListExtensions Class PostSharp Documentation
Extensions to the IReadOnlyLinkedList T interface.
Inheritance Hierarchy
Online System Object
PostSharp.Collections LinkedListExtensions

Namespace: PostSharp.Collections
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
public static class LinkedListExtensions
public static class LinkedListExtensions
See Also
LinkedListExtensions Members
PostSharp.Collections Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


LinkedListExtensions Members

LinkedListExtensions Members PostSharp Documentation

The LinkedListExtensions type exposes the following members.
Methods
Name | Description
ToEnumerable T | Transforms an IReadOnlyLinkedList T into an Online IEnumerable T .
Back to Top
See Also
LinkedListExtensions Class
PostSharp.Collections Namespace

Online Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


LinkedListExtensions Methods

LinkedListExtensions Methods PostSharp Documentation
The LinkedListExtensions type exposes the following members.
Methods
Name | Description
ToEnumerable T | Transforms an IReadOnlyLinkedList T into an Online IEnumerable T .
Back to Top
See Also
LinkedListExtensions Class
PostSharp.Collections Namespace

Online Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


LinkedListExtensions.ToEnumerable(T) Method

LinkedListExtensions ToEnumerable T Method PostSharp Documentation
Transforms an IReadOnlyLinkedList T into an Online IEnumerable T .

Namespace: PostSharp.Collections
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
public static IEnumerable<T> ToEnumerable<T>(
    IReadOnlyLinkedList<T> linkedList
)
public static IEnumerable<T> ToEnumerable<T>(
    IReadOnlyLinkedList<T> linkedList
)
Parameters
linkedList
Type: PostSharp.Collections IReadOnlyLinkedList  T
A IReadOnlyLinkedList T , or null.
Type Parameters
T
Type of values.
Return Value
Type:   Online IEnumerable  T
An   Online IEnumerable T  that can enumerate all elements in linkedList.
            If linkedList is null, an empty enumerable is returned.

See Also
LinkedListExtensions Class
LinkedListExtensions Members
PostSharp.Collections Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


PostSharp.Constraints Namespace

PostSharp.Constraints Namespace PostSharp Documentation
The PostSharp.Contraints namespace allows you to validate your code against predefined or custom design rules.
Classes
 | Class | Description
Public class | ComponentInternalAttribute | ReferentialConstraint that, when applied on a declaration, limits the scope (namespace or type) in which this declaration can be used. This constraint is useful to isolate several components from each other, even if they are implemented in the same assembly. The ComponentInternal constraint sets the visibility of a declaration between internal and private. The constraint cannot be applied to public or protected declarations.
Public class | Constraint | Root class for all constraints based on MulticastAttribute. A constraint is a piece validation logic executed at build time. Constraints are applied to elements of code (( Online Assembly, Online Type, Online MethodInfo, Online ConstructorInfo, Online PropertyInfo, Online EventInfo, Online FieldInfo, Online ParameterInfo) typically using multicast custom attributes, and verified at build time for every assembly using this element of code.
Public class | ExperimentalAttribute | Custom attribute that, when applied on a declaration, causes PostSharp to emit a warning if the declaration is being used.
Public class | InternalAttribute | ReferentialConstraint, when applied to a declaration, prevents it to be used from an different assembly. This constraint can be used when a declaration must be made public for technical reasons, but its author do not want it to be used in external code.
Public class | InternalImplementAttribute | ReferentialConstraint that, when applied on an interface, prevents it to be implemented in a different assembly. This constraint should be used when the author of an interface does not expect users to implement the interface and wants to reserve the possibility to add new methods to the interface.
Public class | ProtectedAttribute | Custom attribute that, when applied to a target declaration, causes PostSharp to emit a warning if the declaration is being referenced from classes that are not derived from the target class. This constraint is similar to the C# keyword protected and should be used only when the target declaration must be made public or internal for non-architectural reasons.
Public class | ReferentialConstraint | Implementation of IReferentialConstraint based on MulticastAttribute.
Public class | ScalarConstraint | Implementation of IScalarConstraint based on MulticastAttribute.
Interfaces
 | Interface | Description
Public interface | IConstraint | A constraint is a piece of validation logic executed at build time. Constraints are applied to elements of code ( Online Assembly, Online Type, Online MethodInfo, Online ConstructorInfo, Online PropertyInfo, Online EventInfo, Online FieldInfo, Online ParameterInfo), typically (but not necessarily) using custom attributes or MulticastAttribute.
Public interface | IReferentialConstraint | A constraint is a piece validation logic executed at build time. Constraints are applied to elements of code (( Online Assembly, Online Type, Online MethodInfo, Online ConstructorInfo, Online PropertyInfo, Online EventInfo, Online FieldInfo, Online ParameterInfo), typically using custom attributes or MulticastAttribute, and verified at build time for every assembly using this element of code.
Public interface | IScalarConstraint | A constraint that validates a specific element of code. Use an IReferentialConstraint to validate relationships between elements of code.

Online Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


ComponentInternalAttribute Class

ComponentInternalAttribute Class PostSharp Documentation
ReferentialConstraint that, when applied on a declaration, limits the scope (namespace or type) in which this declaration can be used. This constraint is useful to isolate several components from each other, even if they are implemented in the same assembly. The ComponentInternal constraint sets the visibility of a declaration between internal and private. The constraint cannot be applied to public or protected declarations.
Inheritance Hierarchy
Online System Object
Online System Attribute
PostSharp.Extensibility MulticastAttribute
PostSharp.Constraints Constraint
PostSharp.Constraints ReferentialConstraint
PostSharp.Constraints ComponentInternalAttribute

Namespace: PostSharp.Constraints
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
public sealed class ComponentInternalAttribute : ReferentialConstraint
public sealed class ComponentInternalAttribute : ReferentialConstraint
See Also
ComponentInternalAttribute Members
PostSharp.Constraints Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


ComponentInternalAttribute Members

ComponentInternalAttribute Members PostSharp Documentation

The ComponentInternalAttribute type exposes the following members.
Constructors
 | Name | Description
Public method | ComponentInternalAttribute | Initializes a ComponentInternalAttribute restricting the target declaration from being used from another namespace than the namespace of the declaration.
Public method | ComponentInternalAttribute( String ) | Initializes a ComponentInternalAttribute restricting the target declaration from being used outside of given types or namespaces, given by strings.
Public method | ComponentInternalAttribute( Type ) | Initializes a ComponentInternalAttribute restricting the target declaration from being used outside of given types or namespaces, given as Online Type.
Back to Top
Methods
 | Name | Description
Public method | ValidateCode | Validates the constraint. (Overrides ReferentialConstraint ValidateCode(Object, Assembly).)
Public method | ValidateConstraint | Validates the fact that the constraint has been applied on a valid element of code. When this method returns false, the constraint is silently ignored. (Overrides Constraint ValidateConstraint(Object).)
Back to Top
Properties
 | Name | Description
Public property | AttributeExclude | If true, indicates that this attribute removes all other instances of the same attribute type from the set of elements defined by the current instance. (Inherited from MulticastAttribute.)
Public property | AttributeId | Obsolete. (Inherited from MulticastAttribute.)
Public property | AttributeInheritance | Determines whether this attribute is inherited (Inherited from MulticastAttribute.)
Public property | AttributePriority | Gets or sets the priority of the current attribute in case that multiple instances are defined on the same element (lower values are processed before). (Inherited from MulticastAttribute.)
Public property | AttributeReplace | Determines whether this attribute replaces other attributes found on the target declarations. (Inherited from MulticastAttribute.)
Public property | AttributeTargetAssemblies | Gets or sets the assemblies to which the current attribute apply. (Inherited from MulticastAttribute.)
Public property | AttributeTargetElements | Gets or sets the kind of elements to which this custom attributes applies. (Inherited from MulticastAttribute.)
Public property | AttributeTargetExternalMemberAttributes | Gets or sets the visibilities, scopes, virtualities, and implementation of members to which this attribute applies, when the member is external to the current module. (Inherited from MulticastAttribute.)
Public property | AttributeTargetExternalTypeAttributes | Gets or sets the visibilities of types to which this attribute applies, when this type is external to the current module. (Inherited from MulticastAttribute.)
Public property | AttributeTargetMemberAttributes | Gets or sets the visibilities, scopes, virtualities, and implementation of members to which this attribute applies. (Inherited from MulticastAttribute.)
Public property | AttributeTargetMembers | Gets or sets the expression specifying to which members this instance applies. (Inherited from MulticastAttribute.)
Public property | AttributeTargetParameterAttributes | Gets or sets the passing style (by value, out or ref) of parameters to which this attribute applies. (Inherited from MulticastAttribute.)
Public property | AttributeTargetParameters | Gets or sets the expression specifying to which parameters this instance applies. (Inherited from MulticastAttribute.)
Public property | AttributeTargetTypeAttributes | Gets or sets the visibilities of types to which this attribute applies. (Inherited from MulticastAttribute.)
Public property | AttributeTargetTypes | Gets or sets the expression specifying to which types this instance applies. (Inherited from MulticastAttribute.)
Public property | Severity | Gets or sets the severity of messages emitted by this constraint.
Back to Top
See Also
ComponentInternalAttribute Class
PostSharp.Constraints Namespace

Online Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


ComponentInternalAttribute Constructor

ComponentInternalAttribute Constructor PostSharp Documentation
Overload List
 | Name | Description
Public method | ComponentInternalAttribute | Initializes a ComponentInternalAttribute restricting the target declaration from being used from another namespace than the namespace of the declaration.
Public method | ComponentInternalAttribute( String ) | Initializes a ComponentInternalAttribute restricting the target declaration from being used outside of given types or namespaces, given by strings.
Public method | ComponentInternalAttribute( Type ) | Initializes a ComponentInternalAttribute restricting the target declaration from being used outside of given types or namespaces, given as Online Type.
Back to Top
See Also
ComponentInternalAttribute Class
ComponentInternalAttribute Members
PostSharp.Constraints Namespace

Online Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


ComponentInternalAttribute Constructor

ComponentInternalAttribute Constructor PostSharp Documentation
Initializes a ComponentInternalAttribute restricting the target declaration from being used from another namespace than the namespace of the declaration.

Namespace: PostSharp.Constraints
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
public ComponentInternalAttribute()
public ComponentInternalAttribute()
See Also
ComponentInternalAttribute Class
ComponentInternalAttribute Members
ComponentInternalAttribute Overload
PostSharp.Constraints Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


ComponentInternalAttribute Constructor (String[])

ComponentInternalAttribute Constructor ( String ) PostSharp Documentation
Initializes a ComponentInternalAttribute restricting the target declaration from being used outside of given types or namespaces, given by strings.

Namespace: PostSharp.Constraints
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
public ComponentInternalAttribute(
    params string[] friendNamespaces
)
public ComponentInternalAttribute(
    params string[] friendNamespaces
)
Parameters
friendNamespaces
Type:    Online System String
List of types or namespaces from which the target declaration
            can be used.
See Also
ComponentInternalAttribute Class
ComponentInternalAttribute Members
ComponentInternalAttribute Overload
PostSharp.Constraints Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


ComponentInternalAttribute Constructor (Type[])

ComponentInternalAttribute Constructor ( Type ) PostSharp Documentation
Initializes a ComponentInternalAttribute restricting the target declaration from being used outside of given types or namespaces, given as Online Type.

Namespace: PostSharp.Constraints
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
public ComponentInternalAttribute(
    params Type[] friendTypes
)
public ComponentInternalAttribute(
    params Type[] friendTypes
)
Parameters
friendTypes
Type:    Online System Type
List of types from which the target declaration can be used. If the name of a
            type is NamespaceType, the whole namespace of this type is allowed.
See Also
ComponentInternalAttribute Class
ComponentInternalAttribute Members
ComponentInternalAttribute Overload
PostSharp.Constraints Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


ComponentInternalAttribute Methods

ComponentInternalAttribute Methods PostSharp Documentation
The ComponentInternalAttribute type exposes the following members.
Methods
 | Name | Description
Public method | ValidateCode | Validates the constraint. (Overrides ReferentialConstraint ValidateCode(Object, Assembly).)
Public method | ValidateConstraint | Validates the fact that the constraint has been applied on a valid element of code. When this method returns false, the constraint is silently ignored. (Overrides Constraint ValidateConstraint(Object).)
Back to Top
See Also
ComponentInternalAttribute Class
PostSharp.Constraints Namespace

Online Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


ComponentInternalAttribute.ValidateCode Method

ComponentInternalAttribute ValidateCode Method PostSharp Documentation
Validates the constraint.

Namespace: PostSharp.Constraints
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
public override void ValidateCode(
    Object target,
    Assembly assembly
)
public override void ValidateCode(
    Object target,
    Assembly assembly
)
Parameters
target
Type:   Online System Object
Declaration (  Online Assembly,   Online Type,
              Online MethodInfo,   Online ConstructorInfo,   Online PropertyInfo,
              Online EventInfo,   Online FieldInfo,   Online ParameterInfo) to which
            the constraint has been applied.
assembly
Type:   Online System.Reflection Assembly
The assembly being currently processed.
Implements
IReferentialConstraint ValidateCode(Object, Assembly)
See Also
ComponentInternalAttribute Class
ComponentInternalAttribute Members
PostSharp.Constraints Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


ComponentInternalAttribute.ValidateConstraint Method

ComponentInternalAttribute ValidateConstraint Method PostSharp Documentation
Validates the fact that the constraint has been applied on a valid element of code. When this method returns false, the constraint is silently ignored.

Namespace: PostSharp.Constraints
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
public override bool ValidateConstraint(
    Object target
)
public override bool ValidateConstraint(
    Object target
)
Parameters
target
Type:   Online System Object
[Missing <param name="target"/> documentation for "M:PostSharp.Constraints.ComponentInternalAttribute.ValidateConstraint(System.Object)"]
Return Value
Type:   Online Boolean
true if the constraint has been applied on a valid element of code, otherwise false.
Implements
IConstraint ValidateConstraint(Object)
See Also
ComponentInternalAttribute Class
ComponentInternalAttribute Members
PostSharp.Constraints Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


ComponentInternalAttribute Properties

ComponentInternalAttribute Properties PostSharp Documentation
The ComponentInternalAttribute type exposes the following members.
Properties
 | Name | Description
Public property | AttributeExclude | If true, indicates that this attribute removes all other instances of the same attribute type from the set of elements defined by the current instance. (Inherited from MulticastAttribute.)
Public property | AttributeId | Obsolete. (Inherited from MulticastAttribute.)
Public property | AttributeInheritance | Determines whether this attribute is inherited (Inherited from MulticastAttribute.)
Public property | AttributePriority | Gets or sets the priority of the current attribute in case that multiple instances are defined on the same element (lower values are processed before). (Inherited from MulticastAttribute.)
Public property | AttributeReplace | Determines whether this attribute replaces other attributes found on the target declarations. (Inherited from MulticastAttribute.)
Public property | AttributeTargetAssemblies | Gets or sets the assemblies to which the current attribute apply. (Inherited from MulticastAttribute.)
Public property | AttributeTargetElements | Gets or sets the kind of elements to which this custom attributes applies. (Inherited from MulticastAttribute.)
Public property | AttributeTargetExternalMemberAttributes | Gets or sets the visibilities, scopes, virtualities, and implementation of members to which this attribute applies, when the member is external to the current module. (Inherited from MulticastAttribute.)
Public property | AttributeTargetExternalTypeAttributes | Gets or sets the visibilities of types to which this attribute applies, when this type is external to the current module. (Inherited from MulticastAttribute.)
Public property | AttributeTargetMemberAttributes | Gets or sets the visibilities, scopes, virtualities, and implementation of members to which this attribute applies. (Inherited from MulticastAttribute.)
Public property | AttributeTargetMembers | Gets or sets the expression specifying to which members this instance applies. (Inherited from MulticastAttribute.)
Public property | AttributeTargetParameterAttributes | Gets or sets the passing style (by value, out or ref) of parameters to which this attribute applies. (Inherited from MulticastAttribute.)
Public property | AttributeTargetParameters | Gets or sets the expression specifying to which parameters this instance applies. (Inherited from MulticastAttribute.)
Public property | AttributeTargetTypeAttributes | Gets or sets the visibilities of types to which this attribute applies. (Inherited from MulticastAttribute.)
Public property | AttributeTargetTypes | Gets or sets the expression specifying to which types this instance applies. (Inherited from MulticastAttribute.)
Public property | Severity | Gets or sets the severity of messages emitted by this constraint.
Back to Top
See Also
ComponentInternalAttribute Class
PostSharp.Constraints Namespace

Online Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


ComponentInternalAttribute.Severity Property

ComponentInternalAttribute Severity Property PostSharp Documentation
Gets or sets the severity of messages emitted by this constraint.

Namespace: PostSharp.Constraints
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
public SeverityType Severity { get; set; }
public SeverityType Severity { get; set; }
Property Value
Type: SeverityType
Remarks
The default value is Warning.
See Also
ComponentInternalAttribute Class
ComponentInternalAttribute Members
PostSharp.Constraints Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


Constraint Class

Constraint Class PostSharp Documentation
Root class for all constraints based on MulticastAttribute. A constraint is a piece validation logic executed at build time. Constraints are applied to elements of code (( Online Assembly, Online Type, Online MethodInfo, Online ConstructorInfo, Online PropertyInfo, Online EventInfo, Online FieldInfo, Online ParameterInfo) typically using multicast custom attributes, and verified at build time for every assembly using this element of code.
Inheritance Hierarchy
Online System Object
Online System Attribute
PostSharp.Extensibility MulticastAttribute
PostSharp.Constraints Constraint
PostSharp.Constraints ReferentialConstraint
PostSharp.Constraints ScalarConstraint

Namespace: PostSharp.Constraints
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
public abstract class Constraint : MulticastAttribute,
    IConstraint
public abstract class Constraint : MulticastAttribute,
    IConstraint
Remarks
  Note  Note

      PostSharp Professional Edition is required for this feature.

See Also
Constraint Members
PostSharp.Constraints Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


Constraint Members

Constraint Members PostSharp Documentation

The Constraint type exposes the following members.
Constructors
 | Name | Description
Protected method | Constraint | Initializes a new instance of the Constraint class
Back to Top
Methods
 | Name | Description
Public method | ValidateConstraint | Validates the fact that the constraint has been applied on a valid element of code. When this method returns false, the constraint is silently ignored.
Back to Top
Properties
 | Name | Description
Public property | AttributeExclude | If true, indicates that this attribute removes all other instances of the same attribute type from the set of elements defined by the current instance. (Inherited from MulticastAttribute.)
Public property | AttributeId | Obsolete. (Inherited from MulticastAttribute.)
Public property | AttributeInheritance | Determines whether this attribute is inherited (Inherited from MulticastAttribute.)
Public property | AttributePriority | Gets or sets the priority of the current attribute in case that multiple instances are defined on the same element (lower values are processed before). (Inherited from MulticastAttribute.)
Public property | AttributeReplace | Determines whether this attribute replaces other attributes found on the target declarations. (Inherited from MulticastAttribute.)
Public property | AttributeTargetAssemblies | Gets or sets the assemblies to which the current attribute apply. (Inherited from MulticastAttribute.)
Public property | AttributeTargetElements | Gets or sets the kind of elements to which this custom attributes applies. (Inherited from MulticastAttribute.)
Public property | AttributeTargetExternalMemberAttributes | Gets or sets the visibilities, scopes, virtualities, and implementation of members to which this attribute applies, when the member is external to the current module. (Inherited from MulticastAttribute.)
Public property | AttributeTargetExternalTypeAttributes | Gets or sets the visibilities of types to which this attribute applies, when this type is external to the current module. (Inherited from MulticastAttribute.)
Public property | AttributeTargetMemberAttributes | Gets or sets the visibilities, scopes, virtualities, and implementation of members to which this attribute applies. (Inherited from MulticastAttribute.)
Public property | AttributeTargetMembers | Gets or sets the expression specifying to which members this instance applies. (Inherited from MulticastAttribute.)
Public property | AttributeTargetParameterAttributes | Gets or sets the passing style (by value, out or ref) of parameters to which this attribute applies. (Inherited from MulticastAttribute.)
Public property | AttributeTargetParameters | Gets or sets the expression specifying to which parameters this instance applies. (Inherited from MulticastAttribute.)
Public property | AttributeTargetTypeAttributes | Gets or sets the visibilities of types to which this attribute applies. (Inherited from MulticastAttribute.)
Public property | AttributeTargetTypes | Gets or sets the expression specifying to which types this instance applies. (Inherited from MulticastAttribute.)
Back to Top
See Also
Constraint Class
PostSharp.Constraints Namespace

Online Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


Constraint Constructor

Constraint Constructor PostSharp Documentation
Initializes a new instance of the Constraint class

Namespace: PostSharp.Constraints
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
protected Constraint()
protected Constraint()
See Also
Constraint Class
Constraint Members
PostSharp.Constraints Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


Constraint Methods

Constraint Methods PostSharp Documentation
The Constraint type exposes the following members.
Methods
 | Name | Description
Public method | ValidateConstraint | Validates the fact that the constraint has been applied on a valid element of code. When this method returns false, the constraint is silently ignored.
Back to Top
See Also
Constraint Class
PostSharp.Constraints Namespace

Online Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


Constraint.ValidateConstraint Method

Constraint ValidateConstraint Method PostSharp Documentation
Validates the fact that the constraint has been applied on a valid element of code. When this method returns false, the constraint is silently ignored.

Namespace: PostSharp.Constraints
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
public virtual bool ValidateConstraint(
    Object target
)
public virtual bool ValidateConstraint(
    Object target
)
Parameters
target
Type:   Online System Object
[Missing <param name="target"/> documentation for "M:PostSharp.Constraints.Constraint.ValidateConstraint(System.Object)"]
Return Value
Type:   Online Boolean
true if the constraint has been applied on a valid element of code, otherwise false.
Implements
IConstraint ValidateConstraint(Object)
See Also
Constraint Class
Constraint Members
PostSharp.Constraints Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


Constraint Properties

Constraint Properties PostSharp Documentation
The Constraint type exposes the following members.
Properties
 | Name | Description
Public property | AttributeExclude | If true, indicates that this attribute removes all other instances of the same attribute type from the set of elements defined by the current instance. (Inherited from MulticastAttribute.)
Public property | AttributeId | Obsolete. (Inherited from MulticastAttribute.)
Public property | AttributeInheritance | Determines whether this attribute is inherited (Inherited from MulticastAttribute.)
Public property | AttributePriority | Gets or sets the priority of the current attribute in case that multiple instances are defined on the same element (lower values are processed before). (Inherited from MulticastAttribute.)
Public property | AttributeReplace | Determines whether this attribute replaces other attributes found on the target declarations. (Inherited from MulticastAttribute.)
Public property | AttributeTargetAssemblies | Gets or sets the assemblies to which the current attribute apply. (Inherited from MulticastAttribute.)
Public property | AttributeTargetElements | Gets or sets the kind of elements to which this custom attributes applies. (Inherited from MulticastAttribute.)
Public property | AttributeTargetExternalMemberAttributes | Gets or sets the visibilities, scopes, virtualities, and implementation of members to which this attribute applies, when the member is external to the current module. (Inherited from MulticastAttribute.)
Public property | AttributeTargetExternalTypeAttributes | Gets or sets the visibilities of types to which this attribute applies, when this type is external to the current module. (Inherited from MulticastAttribute.)
Public property | AttributeTargetMemberAttributes | Gets or sets the visibilities, scopes, virtualities, and implementation of members to which this attribute applies. (Inherited from MulticastAttribute.)
Public property | AttributeTargetMembers | Gets or sets the expression specifying to which members this instance applies. (Inherited from MulticastAttribute.)
Public property | AttributeTargetParameterAttributes | Gets or sets the passing style (by value, out or ref) of parameters to which this attribute applies. (Inherited from MulticastAttribute.)
Public property | AttributeTargetParameters | Gets or sets the expression specifying to which parameters this instance applies. (Inherited from MulticastAttribute.)
Public property | AttributeTargetTypeAttributes | Gets or sets the visibilities of types to which this attribute applies. (Inherited from MulticastAttribute.)
Public property | AttributeTargetTypes | Gets or sets the expression specifying to which types this instance applies. (Inherited from MulticastAttribute.)
Back to Top
See Also
Constraint Class
PostSharp.Constraints Namespace

Online Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


ExperimentalAttribute Class

ExperimentalAttribute Class PostSharp Documentation
Custom attribute that, when applied on a declaration, causes PostSharp to emit a warning if the declaration is being used.
Inheritance Hierarchy
Online System Object
Online System Attribute
PostSharp.Extensibility MulticastAttribute
PostSharp.Constraints Constraint
PostSharp.Constraints ReferentialConstraint
PostSharp.Constraints ExperimentalAttribute

Namespace: PostSharp.Constraints
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
public sealed class ExperimentalAttribute : ReferentialConstraint
public sealed class ExperimentalAttribute : ReferentialConstraint
See Also
ExperimentalAttribute Members
PostSharp.Constraints Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


ExperimentalAttribute Members

ExperimentalAttribute Members PostSharp Documentation

The ExperimentalAttribute type exposes the following members.
Constructors
 | Name | Description
Public method | ExperimentalAttribute | Initializes a new instance of the ExperimentalAttribute class
Back to Top
Methods
 | Name | Description
Public method | ValidateCode | Validates the constraint. (Overrides ReferentialConstraint ValidateCode(Object, Assembly).)
Public method | ValidateConstraint | Validates the fact that the constraint has been applied on a valid element of code. When this method returns false, the constraint is silently ignored. (Inherited from Constraint.)
Back to Top
Properties
 | Name | Description
Public property | AttributeExclude | If true, indicates that this attribute removes all other instances of the same attribute type from the set of elements defined by the current instance. (Inherited from MulticastAttribute.)
Public property | AttributeId | Obsolete. (Inherited from MulticastAttribute.)
Public property | AttributeInheritance | Determines whether this attribute is inherited (Inherited from MulticastAttribute.)
Public property | AttributePriority | Gets or sets the priority of the current attribute in case that multiple instances are defined on the same element (lower values are processed before). (Inherited from MulticastAttribute.)
Public property | AttributeReplace | Determines whether this attribute replaces other attributes found on the target declarations. (Inherited from MulticastAttribute.)
Public property | AttributeTargetAssemblies | Gets or sets the assemblies to which the current attribute apply. (Inherited from MulticastAttribute.)
Public property | AttributeTargetElements | Gets or sets the kind of elements to which this custom attributes applies. (Inherited from MulticastAttribute.)
Public property | AttributeTargetExternalMemberAttributes | Gets or sets the visibilities, scopes, virtualities, and implementation of members to which this attribute applies, when the member is external to the current module. (Inherited from MulticastAttribute.)
Public property | AttributeTargetExternalTypeAttributes | Gets or sets the visibilities of types to which this attribute applies, when this type is external to the current module. (Inherited from MulticastAttribute.)
Public property | AttributeTargetMemberAttributes | Gets or sets the visibilities, scopes, virtualities, and implementation of members to which this attribute applies. (Inherited from MulticastAttribute.)
Public property | AttributeTargetMembers | Gets or sets the expression specifying to which members this instance applies. (Inherited from MulticastAttribute.)
Public property | AttributeTargetParameterAttributes | Gets or sets the passing style (by value, out or ref) of parameters to which this attribute applies. (Inherited from MulticastAttribute.)
Public property | AttributeTargetParameters | Gets or sets the expression specifying to which parameters this instance applies. (Inherited from MulticastAttribute.)
Public property | AttributeTargetTypeAttributes | Gets or sets the visibilities of types to which this attribute applies. (Inherited from MulticastAttribute.)
Public property | AttributeTargetTypes | Gets or sets the expression specifying to which types this instance applies. (Inherited from MulticastAttribute.)
Back to Top
See Also
ExperimentalAttribute Class
PostSharp.Constraints Namespace

Online Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


ExperimentalAttribute Constructor

ExperimentalAttribute Constructor PostSharp Documentation
Initializes a new instance of the ExperimentalAttribute class

Namespace: PostSharp.Constraints
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
public ExperimentalAttribute()
public ExperimentalAttribute()
See Also
ExperimentalAttribute Class
ExperimentalAttribute Members
PostSharp.Constraints Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


ExperimentalAttribute Methods

ExperimentalAttribute Methods PostSharp Documentation
The ExperimentalAttribute type exposes the following members.
Methods
 | Name | Description
Public method | ValidateCode | Validates the constraint. (Overrides ReferentialConstraint ValidateCode(Object, Assembly).)
Public method | ValidateConstraint | Validates the fact that the constraint has been applied on a valid element of code. When this method returns false, the constraint is silently ignored. (Inherited from Constraint.)
Back to Top
See Also
ExperimentalAttribute Class
PostSharp.Constraints Namespace

Online Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


ExperimentalAttribute.ValidateCode Method

ExperimentalAttribute ValidateCode Method PostSharp Documentation
Validates the constraint.

Namespace: PostSharp.Constraints
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
public override void ValidateCode(
    Object target,
    Assembly assembly
)
public override void ValidateCode(
    Object target,
    Assembly assembly
)
Parameters
target
Type:   Online System Object
Declaration (  Online Assembly,   Online Type,
              Online MethodInfo,   Online ConstructorInfo,   Online PropertyInfo,
              Online EventInfo,   Online FieldInfo,   Online ParameterInfo) to which
            the constraint has been applied.
assembly
Type:   Online System.Reflection Assembly
The assembly being currently processed.
Implements
IReferentialConstraint ValidateCode(Object, Assembly)
See Also
ExperimentalAttribute Class
ExperimentalAttribute Members
PostSharp.Constraints Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


ExperimentalAttribute Properties

ExperimentalAttribute Properties PostSharp Documentation
The ExperimentalAttribute type exposes the following members.
Properties
 | Name | Description
Public property | AttributeExclude | If true, indicates that this attribute removes all other instances of the same attribute type from the set of elements defined by the current instance. (Inherited from MulticastAttribute.)
Public property | AttributeId | Obsolete. (Inherited from MulticastAttribute.)
Public property | AttributeInheritance | Determines whether this attribute is inherited (Inherited from MulticastAttribute.)
Public property | AttributePriority | Gets or sets the priority of the current attribute in case that multiple instances are defined on the same element (lower values are processed before). (Inherited from MulticastAttribute.)
Public property | AttributeReplace | Determines whether this attribute replaces other attributes found on the target declarations. (Inherited from MulticastAttribute.)
Public property | AttributeTargetAssemblies | Gets or sets the assemblies to which the current attribute apply. (Inherited from MulticastAttribute.)
Public property | AttributeTargetElements | Gets or sets the kind of elements to which this custom attributes applies. (Inherited from MulticastAttribute.)
Public property | AttributeTargetExternalMemberAttributes | Gets or sets the visibilities, scopes, virtualities, and implementation of members to which this attribute applies, when the member is external to the current module. (Inherited from MulticastAttribute.)
Public property | AttributeTargetExternalTypeAttributes | Gets or sets the visibilities of types to which this attribute applies, when this type is external to the current module. (Inherited from MulticastAttribute.)
Public property | AttributeTargetMemberAttributes | Gets or sets the visibilities, scopes, virtualities, and implementation of members to which this attribute applies. (Inherited from MulticastAttribute.)
Public property | AttributeTargetMembers | Gets or sets the expression specifying to which members this instance applies. (Inherited from MulticastAttribute.)
Public property | AttributeTargetParameterAttributes | Gets or sets the passing style (by value, out or ref) of parameters to which this attribute applies. (Inherited from MulticastAttribute.)
Public property | AttributeTargetParameters | Gets or sets the expression specifying to which parameters this instance applies. (Inherited from MulticastAttribute.)
Public property | AttributeTargetTypeAttributes | Gets or sets the visibilities of types to which this attribute applies. (Inherited from MulticastAttribute.)
Public property | AttributeTargetTypes | Gets or sets the expression specifying to which types this instance applies. (Inherited from MulticastAttribute.)
Back to Top
See Also
ExperimentalAttribute Class
PostSharp.Constraints Namespace

Online Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


IConstraint Interface

IConstraint Interface PostSharp Documentation
A constraint is a piece of validation logic executed at build time. Constraints are applied to elements of code ( Online Assembly, Online Type, Online MethodInfo, Online ConstructorInfo, Online PropertyInfo, Online EventInfo, Online FieldInfo, Online ParameterInfo), typically (but not necessarily) using custom attributes or MulticastAttribute.

Namespace: PostSharp.Constraints
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
public interface IConstraint
public interface IConstraint
Remarks
  Note  Note

      PostSharp Professional Edition is required for this feature.

See Also
IConstraint Members
PostSharp.Constraints Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


IConstraint Members

IConstraint Members PostSharp Documentation

The IConstraint type exposes the following members.
Methods
 | Name | Description
Public method | ValidateConstraint | Validates the fact that the constraint has been applied on a valid element of code. When this method returns false, the constraint is silently ignored.
Back to Top
See Also
IConstraint Interface
PostSharp.Constraints Namespace

Online Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


IConstraint Methods

IConstraint Methods PostSharp Documentation
The IConstraint type exposes the following members.
Methods
 | Name | Description
Public method | ValidateConstraint | Validates the fact that the constraint has been applied on a valid element of code. When this method returns false, the constraint is silently ignored.
Back to Top
See Also
IConstraint Interface
PostSharp.Constraints Namespace

Online Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


IConstraint.ValidateConstraint Method

IConstraint ValidateConstraint Method PostSharp Documentation
Validates the fact that the constraint has been applied on a valid element of code. When this method returns false, the constraint is silently ignored.

Namespace: PostSharp.Constraints
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
bool ValidateConstraint(
    Object target
)
bool ValidateConstraint(
    Object target
)
Parameters
target
Type:   Online System Object
[Missing <param name="target"/> documentation for "M:PostSharp.Constraints.IConstraint.ValidateConstraint(System.Object)"]
Return Value
Type:   Online Boolean
true if the constraint has been applied on a valid element of code, otherwise false.
See Also
IConstraint Interface
IConstraint Members
PostSharp.Constraints Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


InternalAttribute Class

InternalAttribute Class PostSharp Documentation
ReferentialConstraint, when applied to a declaration, prevents it to be used from an different assembly. This constraint can be used when a declaration must be made public for technical reasons, but its author do not want it to be used in external code.
Inheritance Hierarchy
Online System Object
Online System Attribute
PostSharp.Extensibility MulticastAttribute
PostSharp.Constraints Constraint
PostSharp.Constraints ReferentialConstraint
PostSharp.Constraints InternalAttribute

Namespace: PostSharp.Constraints
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
public sealed class InternalAttribute : ReferentialConstraint
public sealed class InternalAttribute : ReferentialConstraint
Remarks
  Note  Note

      PostSharp Professional Edition is required for this feature.

See Also
InternalAttribute Members
PostSharp.Constraints Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


InternalAttribute Members

InternalAttribute Members PostSharp Documentation

The InternalAttribute type exposes the following members.
Constructors
 | Name | Description
Public method | InternalAttribute | Initializes a new InternalAttribute.
Back to Top
Methods
 | Name | Description
Public method | ValidateCode | Validates the constraint. (Overrides ReferentialConstraint ValidateCode(Object, Assembly).)
Public method | ValidateConstraint | Validates the fact that the constraint has been applied on a valid element of code. When this method returns false, the constraint is silently ignored. (Overrides Constraint ValidateConstraint(Object).)
Back to Top
Properties
 | Name | Description
Public property | AttributeExclude | If true, indicates that this attribute removes all other instances of the same attribute type from the set of elements defined by the current instance. (Inherited from MulticastAttribute.)
Public property | AttributeId | Obsolete. (Inherited from MulticastAttribute.)
Public property | AttributeInheritance | Determines whether this attribute is inherited (Inherited from MulticastAttribute.)
Public property | AttributePriority | Gets or sets the priority of the current attribute in case that multiple instances are defined on the same element (lower values are processed before). (Inherited from MulticastAttribute.)
Public property | AttributeReplace | Determines whether this attribute replaces other attributes found on the target declarations. (Inherited from MulticastAttribute.)
Public property | AttributeTargetAssemblies | Gets or sets the assemblies to which the current attribute apply. (Inherited from MulticastAttribute.)
Public property | AttributeTargetElements | Gets or sets the kind of elements to which this custom attributes applies. (Inherited from MulticastAttribute.)
Public property | AttributeTargetExternalMemberAttributes | Gets or sets the visibilities, scopes, virtualities, and implementation of members to which this attribute applies, when the member is external to the current module. (Inherited from MulticastAttribute.)
Public property | AttributeTargetExternalTypeAttributes | Gets or sets the visibilities of types to which this attribute applies, when this type is external to the current module. (Inherited from MulticastAttribute.)
Public property | AttributeTargetMemberAttributes | Gets or sets the visibilities, scopes, virtualities, and implementation of members to which this attribute applies. (Inherited from MulticastAttribute.)
Public property | AttributeTargetMembers | Gets or sets the expression specifying to which members this instance applies. (Inherited from MulticastAttribute.)
Public property | AttributeTargetParameterAttributes | Gets or sets the passing style (by value, out or ref) of parameters to which this attribute applies. (Inherited from MulticastAttribute.)
Public property | AttributeTargetParameters | Gets or sets the expression specifying to which parameters this instance applies. (Inherited from MulticastAttribute.)
Public property | AttributeTargetTypeAttributes | Gets or sets the visibilities of types to which this attribute applies. (Inherited from MulticastAttribute.)
Public property | AttributeTargetTypes | Gets or sets the expression specifying to which types this instance applies. (Inherited from MulticastAttribute.)
Public property | Severity | Gets or sets the severity of messages emitted by this constraint.
Back to Top
See Also
InternalAttribute Class
PostSharp.Constraints Namespace

Online Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


InternalAttribute Constructor

InternalAttribute Constructor PostSharp Documentation
Initializes a new InternalAttribute.

Namespace: PostSharp.Constraints
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
public InternalAttribute()
public InternalAttribute()
See Also
InternalAttribute Class
InternalAttribute Members
PostSharp.Constraints Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


InternalAttribute Methods

InternalAttribute Methods PostSharp Documentation
The InternalAttribute type exposes the following members.
Methods
 | Name | Description
Public method | ValidateCode | Validates the constraint. (Overrides ReferentialConstraint ValidateCode(Object, Assembly).)
Public method | ValidateConstraint | Validates the fact that the constraint has been applied on a valid element of code. When this method returns false, the constraint is silently ignored. (Overrides Constraint ValidateConstraint(Object).)
Back to Top
See Also
InternalAttribute Class
PostSharp.Constraints Namespace

Online Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


InternalAttribute.ValidateCode Method

InternalAttribute ValidateCode Method PostSharp Documentation
Validates the constraint.

Namespace: PostSharp.Constraints
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
public override void ValidateCode(
    Object target,
    Assembly assembly
)
public override void ValidateCode(
    Object target,
    Assembly assembly
)
Parameters
target
Type:   Online System Object
Declaration (  Online Assembly,   Online Type,
              Online MethodInfo,   Online ConstructorInfo,   Online PropertyInfo,
              Online EventInfo,   Online FieldInfo,   Online ParameterInfo) to which
            the constraint has been applied.
assembly
Type:   Online System.Reflection Assembly
The assembly being currently processed.
Implements
IReferentialConstraint ValidateCode(Object, Assembly)
See Also
InternalAttribute Class
InternalAttribute Members
PostSharp.Constraints Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


InternalAttribute.ValidateConstraint Method

InternalAttribute ValidateConstraint Method PostSharp Documentation
Validates the fact that the constraint has been applied on a valid element of code. When this method returns false, the constraint is silently ignored.

Namespace: PostSharp.Constraints
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
public override bool ValidateConstraint(
    Object target
)
public override bool ValidateConstraint(
    Object target
)
Parameters
target
Type:   Online System Object
[Missing <param name="target"/> documentation for "M:PostSharp.Constraints.InternalAttribute.ValidateConstraint(System.Object)"]
Return Value
Type:   Online Boolean
true if the constraint has been applied on a valid element of code, otherwise false.
Implements
IConstraint ValidateConstraint(Object)
See Also
InternalAttribute Class
InternalAttribute Members
PostSharp.Constraints Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


InternalAttribute Properties

InternalAttribute Properties PostSharp Documentation
The InternalAttribute type exposes the following members.
Properties
 | Name | Description
Public property | AttributeExclude | If true, indicates that this attribute removes all other instances of the same attribute type from the set of elements defined by the current instance. (Inherited from MulticastAttribute.)
Public property | AttributeId | Obsolete. (Inherited from MulticastAttribute.)
Public property | AttributeInheritance | Determines whether this attribute is inherited (Inherited from MulticastAttribute.)
Public property | AttributePriority | Gets or sets the priority of the current attribute in case that multiple instances are defined on the same element (lower values are processed before). (Inherited from MulticastAttribute.)
Public property | AttributeReplace | Determines whether this attribute replaces other attributes found on the target declarations. (Inherited from MulticastAttribute.)
Public property | AttributeTargetAssemblies | Gets or sets the assemblies to which the current attribute apply. (Inherited from MulticastAttribute.)
Public property | AttributeTargetElements | Gets or sets the kind of elements to which this custom attributes applies. (Inherited from MulticastAttribute.)
Public property | AttributeTargetExternalMemberAttributes | Gets or sets the visibilities, scopes, virtualities, and implementation of members to which this attribute applies, when the member is external to the current module. (Inherited from MulticastAttribute.)
Public property | AttributeTargetExternalTypeAttributes | Gets or sets the visibilities of types to which this attribute applies, when this type is external to the current module. (Inherited from MulticastAttribute.)
Public property | AttributeTargetMemberAttributes | Gets or sets the visibilities, scopes, virtualities, and implementation of members to which this attribute applies. (Inherited from MulticastAttribute.)
Public property | AttributeTargetMembers | Gets or sets the expression specifying to which members this instance applies. (Inherited from MulticastAttribute.)
Public property | AttributeTargetParameterAttributes | Gets or sets the passing style (by value, out or ref) of parameters to which this attribute applies. (Inherited from MulticastAttribute.)
Public property | AttributeTargetParameters | Gets or sets the expression specifying to which parameters this instance applies. (Inherited from MulticastAttribute.)
Public property | AttributeTargetTypeAttributes | Gets or sets the visibilities of types to which this attribute applies. (Inherited from MulticastAttribute.)
Public property | AttributeTargetTypes | Gets or sets the expression specifying to which types this instance applies. (Inherited from MulticastAttribute.)
Public property | Severity | Gets or sets the severity of messages emitted by this constraint.
Back to Top
See Also
InternalAttribute Class
PostSharp.Constraints Namespace

Online Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


InternalAttribute.Severity Property

InternalAttribute Severity Property PostSharp Documentation
Gets or sets the severity of messages emitted by this constraint.

Namespace: PostSharp.Constraints
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
public SeverityType Severity { get; set; }
public SeverityType Severity { get; set; }
Property Value
Type: SeverityType
Remarks
The default value is Warning.
See Also
InternalAttribute Class
InternalAttribute Members
PostSharp.Constraints Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


InternalImplementAttribute Class

InternalImplementAttribute Class PostSharp Documentation
ReferentialConstraint that, when applied on an interface, prevents it to be implemented in a different assembly. This constraint should be used when the author of an interface does not expect users to implement the interface and wants to reserve the possibility to add new methods to the interface.
Inheritance Hierarchy
Online System Object
Online System Attribute
PostSharp.Extensibility MulticastAttribute
PostSharp.Constraints Constraint
PostSharp.Constraints ReferentialConstraint
PostSharp.Constraints InternalImplementAttribute

Namespace: PostSharp.Constraints
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
public sealed class InternalImplementAttribute : ReferentialConstraint
public sealed class InternalImplementAttribute : ReferentialConstraint
Remarks
  Note  Note

      PostSharp Professional Edition is required for this feature.

See Also
InternalImplementAttribute Members
PostSharp.Constraints Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


InternalImplementAttribute Members

InternalImplementAttribute Members PostSharp Documentation

The InternalImplementAttribute type exposes the following members.
Constructors
 | Name | Description
Public method | InternalImplementAttribute | Initializes a new InternalImplementAttribute.
Back to Top
Methods
 | Name | Description
Public method | ValidateCode | Validates the constraint. (Overrides ReferentialConstraint ValidateCode(Object, Assembly).)
Public method | ValidateConstraint | Validates the fact that the constraint has been applied on a valid element of code. When this method returns false, the constraint is silently ignored. (Inherited from Constraint.)
Back to Top
Properties
 | Name | Description
Public property | AttributeExclude | If true, indicates that this attribute removes all other instances of the same attribute type from the set of elements defined by the current instance. (Inherited from MulticastAttribute.)
Public property | AttributeId | Obsolete. (Inherited from MulticastAttribute.)
Public property | AttributeInheritance | Determines whether this attribute is inherited (Inherited from MulticastAttribute.)
Public property | AttributePriority | Gets or sets the priority of the current attribute in case that multiple instances are defined on the same element (lower values are processed before). (Inherited from MulticastAttribute.)
Public property | AttributeReplace | Determines whether this attribute replaces other attributes found on the target declarations. (Inherited from MulticastAttribute.)
Public property | AttributeTargetAssemblies | Gets or sets the assemblies to which the current attribute apply. (Inherited from MulticastAttribute.)
Public property | AttributeTargetElements | Gets or sets the kind of elements to which this custom attributes applies. (Inherited from MulticastAttribute.)
Public property | AttributeTargetExternalMemberAttributes | Gets or sets the visibilities, scopes, virtualities, and implementation of members to which this attribute applies, when the member is external to the current module. (Inherited from MulticastAttribute.)
Public property | AttributeTargetExternalTypeAttributes | Gets or sets the visibilities of types to which this attribute applies, when this type is external to the current module. (Inherited from MulticastAttribute.)
Public property | AttributeTargetMemberAttributes | Gets or sets the visibilities, scopes, virtualities, and implementation of members to which this attribute applies. (Inherited from MulticastAttribute.)
Public property | AttributeTargetMembers | Gets or sets the expression specifying to which members this instance applies. (Inherited from MulticastAttribute.)
Public property | AttributeTargetParameterAttributes | Gets or sets the passing style (by value, out or ref) of parameters to which this attribute applies. (Inherited from MulticastAttribute.)
Public property | AttributeTargetParameters | Gets or sets the expression specifying to which parameters this instance applies. (Inherited from MulticastAttribute.)
Public property | AttributeTargetTypeAttributes | Gets or sets the visibilities of types to which this attribute applies. (Inherited from MulticastAttribute.)
Public property | AttributeTargetTypes | Gets or sets the expression specifying to which types this instance applies. (Inherited from MulticastAttribute.)
Public property | Severity | Gets or sets the severity of messages emitted by this constraint.
Back to Top
See Also
InternalImplementAttribute Class
PostSharp.Constraints Namespace

Online Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


InternalImplementAttribute Constructor

InternalImplementAttribute Constructor PostSharp Documentation
Initializes a new InternalImplementAttribute.

Namespace: PostSharp.Constraints
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
public InternalImplementAttribute()
public InternalImplementAttribute()
See Also
InternalImplementAttribute Class
InternalImplementAttribute Members
PostSharp.Constraints Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


InternalImplementAttribute Methods

InternalImplementAttribute Methods PostSharp Documentation
The InternalImplementAttribute type exposes the following members.
Methods
 | Name | Description
Public method | ValidateCode | Validates the constraint. (Overrides ReferentialConstraint ValidateCode(Object, Assembly).)
Public method | ValidateConstraint | Validates the fact that the constraint has been applied on a valid element of code. When this method returns false, the constraint is silently ignored. (Inherited from Constraint.)
Back to Top
See Also
InternalImplementAttribute Class
PostSharp.Constraints Namespace

Online Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


InternalImplementAttribute.ValidateCode Method

InternalImplementAttribute ValidateCode Method PostSharp Documentation
Validates the constraint.

Namespace: PostSharp.Constraints
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
public override void ValidateCode(
    Object target,
    Assembly assembly
)
public override void ValidateCode(
    Object target,
    Assembly assembly
)
Parameters
target
Type:   Online System Object
Declaration (  Online Assembly,   Online Type,
              Online MethodInfo,   Online ConstructorInfo,   Online PropertyInfo,
              Online EventInfo,   Online FieldInfo,   Online ParameterInfo) to which
            the constraint has been applied.
assembly
Type:   Online System.Reflection Assembly
The assembly being currently processed.
Implements
IReferentialConstraint ValidateCode(Object, Assembly)
See Also
InternalImplementAttribute Class
InternalImplementAttribute Members
PostSharp.Constraints Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


InternalImplementAttribute Properties

InternalImplementAttribute Properties PostSharp Documentation
The InternalImplementAttribute type exposes the following members.
Properties
 | Name | Description
Public property | AttributeExclude | If true, indicates that this attribute removes all other instances of the same attribute type from the set of elements defined by the current instance. (Inherited from MulticastAttribute.)
Public property | AttributeId | Obsolete. (Inherited from MulticastAttribute.)
Public property | AttributeInheritance | Determines whether this attribute is inherited (Inherited from MulticastAttribute.)
Public property | AttributePriority | Gets or sets the priority of the current attribute in case that multiple instances are defined on the same element (lower values are processed before). (Inherited from MulticastAttribute.)
Public property | AttributeReplace | Determines whether this attribute replaces other attributes found on the target declarations. (Inherited from MulticastAttribute.)
Public property | AttributeTargetAssemblies | Gets or sets the assemblies to which the current attribute apply. (Inherited from MulticastAttribute.)
Public property | AttributeTargetElements | Gets or sets the kind of elements to which this custom attributes applies. (Inherited from MulticastAttribute.)
Public property | AttributeTargetExternalMemberAttributes | Gets or sets the visibilities, scopes, virtualities, and implementation of members to which this attribute applies, when the member is external to the current module. (Inherited from MulticastAttribute.)
Public property | AttributeTargetExternalTypeAttributes | Gets or sets the visibilities of types to which this attribute applies, when this type is external to the current module. (Inherited from MulticastAttribute.)
Public property | AttributeTargetMemberAttributes | Gets or sets the visibilities, scopes, virtualities, and implementation of members to which this attribute applies. (Inherited from MulticastAttribute.)
Public property | AttributeTargetMembers | Gets or sets the expression specifying to which members this instance applies. (Inherited from MulticastAttribute.)
Public property | AttributeTargetParameterAttributes | Gets or sets the passing style (by value, out or ref) of parameters to which this attribute applies. (Inherited from MulticastAttribute.)
Public property | AttributeTargetParameters | Gets or sets the expression specifying to which parameters this instance applies. (Inherited from MulticastAttribute.)
Public property | AttributeTargetTypeAttributes | Gets or sets the visibilities of types to which this attribute applies. (Inherited from MulticastAttribute.)
Public property | AttributeTargetTypes | Gets or sets the expression specifying to which types this instance applies. (Inherited from MulticastAttribute.)
Public property | Severity | Gets or sets the severity of messages emitted by this constraint.
Back to Top
See Also
InternalImplementAttribute Class
PostSharp.Constraints Namespace

Online Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


InternalImplementAttribute.Severity Property

InternalImplementAttribute Severity Property PostSharp Documentation
Gets or sets the severity of messages emitted by this constraint.

Namespace: PostSharp.Constraints
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
public SeverityType Severity { get; set; }
public SeverityType Severity { get; set; }
Property Value
Type: SeverityType
Remarks
The default value is Warning.
See Also
InternalImplementAttribute Class
InternalImplementAttribute Members
PostSharp.Constraints Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


IReferentialConstraint Interface

IReferentialConstraint Interface PostSharp Documentation
A constraint is a piece validation logic executed at build time. Constraints are applied to elements of code (( Online Assembly, Online Type, Online MethodInfo, Online ConstructorInfo, Online PropertyInfo, Online EventInfo, Online FieldInfo, Online ParameterInfo), typically using custom attributes or MulticastAttribute, and verified at build time for every assembly using this element of code.

Namespace: PostSharp.Constraints
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
public interface IReferentialConstraint : IConstraint
public interface IReferentialConstraint : IConstraint
Remarks
  Note  Note

      PostSharp Professional Edition is required for this feature.

See Also
IReferentialConstraint Members
PostSharp.Constraints Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


IReferentialConstraint Members

IReferentialConstraint Members PostSharp Documentation

The IReferentialConstraint type exposes the following members.
Methods
 | Name | Description
Public method | ValidateCode | Validates the constraint.
Public method | ValidateConstraint | Validates the fact that the constraint has been applied on a valid element of code. When this method returns false, the constraint is silently ignored. (Inherited from IConstraint.)
Back to Top
See Also
IReferentialConstraint Interface
PostSharp.Constraints Namespace

Online Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


IReferentialConstraint Methods

IReferentialConstraint Methods PostSharp Documentation
The IReferentialConstraint type exposes the following members.
Methods
 | Name | Description
Public method | ValidateCode | Validates the constraint.
Public method | ValidateConstraint | Validates the fact that the constraint has been applied on a valid element of code. When this method returns false, the constraint is silently ignored. (Inherited from IConstraint.)
Back to Top
See Also
IReferentialConstraint Interface
PostSharp.Constraints Namespace

Online Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


IReferentialConstraint.ValidateCode Method

IReferentialConstraint ValidateCode Method PostSharp Documentation
Validates the constraint.

Namespace: PostSharp.Constraints
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
void ValidateCode(
    Object target,
    Assembly assembly
)
void ValidateCode(
    Object target,
    Assembly assembly
)
Parameters
target
Type:   Online System Object
Declaration (  Online Assembly,   Online Type,
              Online MethodInfo,   Online ConstructorInfo,   Online PropertyInfo,
              Online EventInfo,   Online FieldInfo,   Online ParameterInfo) to which
            the constraint has been applied.
assembly
Type:   Online System.Reflection Assembly
The assembly being currently processed.
See Also
IReferentialConstraint Interface
IReferentialConstraint Members
PostSharp.Constraints Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


IScalarConstraint Interface

IScalarConstraint Interface PostSharp Documentation
A constraint that validates a specific element of code. Use an IReferentialConstraint to validate relationships between elements of code.

Namespace: PostSharp.Constraints
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
public interface IScalarConstraint : IConstraint
public interface IScalarConstraint : IConstraint
See Also
IScalarConstraint Members
PostSharp.Constraints Namespace
PostSharp.Constraints ScalarConstraint
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


IScalarConstraint Members

IScalarConstraint Members PostSharp Documentation

The IScalarConstraint type exposes the following members.
Methods
 | Name | Description
Public method | ValidateCode | Validates the element of code to which the constraint is applied.
Public method | ValidateConstraint | Validates the fact that the constraint has been applied on a valid element of code. When this method returns false, the constraint is silently ignored. (Inherited from IConstraint.)
Back to Top
See Also
IScalarConstraint Interface
PostSharp.Constraints Namespace

Online Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


IScalarConstraint Methods

IScalarConstraint Methods PostSharp Documentation
The IScalarConstraint type exposes the following members.
Methods
 | Name | Description
Public method | ValidateCode | Validates the element of code to which the constraint is applied.
Public method | ValidateConstraint | Validates the fact that the constraint has been applied on a valid element of code. When this method returns false, the constraint is silently ignored. (Inherited from IConstraint.)
Back to Top
See Also
IScalarConstraint Interface
PostSharp.Constraints Namespace

Online Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


IScalarConstraint.ValidateCode Method

IScalarConstraint ValidateCode Method PostSharp Documentation
Validates the element of code to which the constraint is applied.

Namespace: PostSharp.Constraints
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
void ValidateCode(
    Object target
)
void ValidateCode(
    Object target
)
Parameters
target
Type:   Online System Object
Element of code to which the constraint is applied (  Online Assembly,   Online Type,
              Online MethodInfo,   Online ConstructorInfo,   Online PropertyInfo,
              Online EventInfo,   Online FieldInfo,   Online ParameterInfo).
See Also
IScalarConstraint Interface
IScalarConstraint Members
PostSharp.Constraints Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


ProtectedAttribute Class

ProtectedAttribute Class PostSharp Documentation
Custom attribute that, when applied to a target declaration, causes PostSharp to emit a warning if the declaration is being referenced from classes that are not derived from the target class. This constraint is similar to the C# keyword protected and should be used only when the target declaration must be made public or internal for non-architectural reasons.

[Missing <include> target documentation in 'T:PostSharp.Constraints.ProtectedAttribute'. File: '../Documentation.xml' Path: '/documentation/section[@name='ultimateEdition']/*']

Inheritance Hierarchy
Online System Object
Online System Attribute
PostSharp.Extensibility MulticastAttribute
PostSharp.Constraints Constraint
PostSharp.Constraints ReferentialConstraint
PostSharp.Constraints ProtectedAttribute

Namespace: PostSharp.Constraints
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
public sealed class ProtectedAttribute : ReferentialConstraint
public sealed class ProtectedAttribute : ReferentialConstraint
See Also
ProtectedAttribute Members
PostSharp.Constraints Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


ProtectedAttribute Members

ProtectedAttribute Members PostSharp Documentation

The ProtectedAttribute type exposes the following members.
Constructors
 | Name | Description
Public method | ProtectedAttribute | Initializes a new ProtectedAttribute.
Back to Top
Methods
 | Name | Description
Public method | ValidateCode | Validates the constraint. (Overrides ReferentialConstraint ValidateCode(Object, Assembly).)
Public method | ValidateConstraint | Validates the fact that the constraint has been applied on a valid element of code. When this method returns false, the constraint is silently ignored. (Overrides Constraint ValidateConstraint(Object).)
Back to Top
Properties
 | Name | Description
Public property | AttributeExclude | If true, indicates that this attribute removes all other instances of the same attribute type from the set of elements defined by the current instance. (Inherited from MulticastAttribute.)
Public property | AttributeId | Obsolete. (Inherited from MulticastAttribute.)
Public property | AttributeInheritance | Determines whether this attribute is inherited (Inherited from MulticastAttribute.)
Public property | AttributePriority | Gets or sets the priority of the current attribute in case that multiple instances are defined on the same element (lower values are processed before). (Inherited from MulticastAttribute.)
Public property | AttributeReplace | Determines whether this attribute replaces other attributes found on the target declarations. (Inherited from MulticastAttribute.)
Public property | AttributeTargetAssemblies | Gets or sets the assemblies to which the current attribute apply. (Inherited from MulticastAttribute.)
Public property | AttributeTargetElements | Gets or sets the kind of elements to which this custom attributes applies. (Inherited from MulticastAttribute.)
Public property | AttributeTargetExternalMemberAttributes | Gets or sets the visibilities, scopes, virtualities, and implementation of members to which this attribute applies, when the member is external to the current module. (Inherited from MulticastAttribute.)
Public property | AttributeTargetExternalTypeAttributes | Gets or sets the visibilities of types to which this attribute applies, when this type is external to the current module. (Inherited from MulticastAttribute.)
Public property | AttributeTargetMemberAttributes | Gets or sets the visibilities, scopes, virtualities, and implementation of members to which this attribute applies. (Inherited from MulticastAttribute.)
Public property | AttributeTargetMembers | Gets or sets the expression specifying to which members this instance applies. (Inherited from MulticastAttribute.)
Public property | AttributeTargetParameterAttributes | Gets or sets the passing style (by value, out or ref) of parameters to which this attribute applies. (Inherited from MulticastAttribute.)
Public property | AttributeTargetParameters | Gets or sets the expression specifying to which parameters this instance applies. (Inherited from MulticastAttribute.)
Public property | AttributeTargetTypeAttributes | Gets or sets the visibilities of types to which this attribute applies. (Inherited from MulticastAttribute.)
Public property | AttributeTargetTypes | Gets or sets the expression specifying to which types this instance applies. (Inherited from MulticastAttribute.)
Public property | Severity | Gets or sets the severity of messages emitted by this constraint.
Back to Top
See Also
ProtectedAttribute Class
PostSharp.Constraints Namespace

Online Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


ProtectedAttribute Constructor

ProtectedAttribute Constructor PostSharp Documentation
Initializes a new ProtectedAttribute.

Namespace: PostSharp.Constraints
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
public ProtectedAttribute()
public ProtectedAttribute()
See Also
ProtectedAttribute Class
ProtectedAttribute Members
PostSharp.Constraints Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


ProtectedAttribute Methods

ProtectedAttribute Methods PostSharp Documentation
The ProtectedAttribute type exposes the following members.
Methods
 | Name | Description
Public method | ValidateCode | Validates the constraint. (Overrides ReferentialConstraint ValidateCode(Object, Assembly).)
Public method | ValidateConstraint | Validates the fact that the constraint has been applied on a valid element of code. When this method returns false, the constraint is silently ignored. (Overrides Constraint ValidateConstraint(Object).)
Back to Top
See Also
ProtectedAttribute Class
PostSharp.Constraints Namespace

Online Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


ProtectedAttribute.ValidateCode Method

ProtectedAttribute ValidateCode Method PostSharp Documentation
Validates the constraint.

Namespace: PostSharp.Constraints
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
public override void ValidateCode(
    Object target,
    Assembly assembly
)
public override void ValidateCode(
    Object target,
    Assembly assembly
)
Parameters
target
Type:   Online System Object
Declaration (  Online Assembly,   Online Type,
              Online MethodInfo,   Online ConstructorInfo,   Online PropertyInfo,
              Online EventInfo,   Online FieldInfo,   Online ParameterInfo) to which
            the constraint has been applied.
assembly
Type:   Online System.Reflection Assembly
The assembly being currently processed.
Implements
IReferentialConstraint ValidateCode(Object, Assembly)
See Also
ProtectedAttribute Class
ProtectedAttribute Members
PostSharp.Constraints Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


ProtectedAttribute.ValidateConstraint Method

ProtectedAttribute ValidateConstraint Method PostSharp Documentation
Validates the fact that the constraint has been applied on a valid element of code. When this method returns false, the constraint is silently ignored.

Namespace: PostSharp.Constraints
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
public override bool ValidateConstraint(
    Object target
)
public override bool ValidateConstraint(
    Object target
)
Parameters
target
Type:   Online System Object
[Missing <param name="target"/> documentation for "M:PostSharp.Constraints.ProtectedAttribute.ValidateConstraint(System.Object)"]
Return Value
Type:   Online Boolean
true if the constraint has been applied on a valid element of code, otherwise false.
Implements
IConstraint ValidateConstraint(Object)
See Also
ProtectedAttribute Class
ProtectedAttribute Members
PostSharp.Constraints Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


ProtectedAttribute Properties

ProtectedAttribute Properties PostSharp Documentation
The ProtectedAttribute type exposes the following members.
Properties
 | Name | Description
Public property | AttributeExclude | If true, indicates that this attribute removes all other instances of the same attribute type from the set of elements defined by the current instance. (Inherited from MulticastAttribute.)
Public property | AttributeId | Obsolete. (Inherited from MulticastAttribute.)
Public property | AttributeInheritance | Determines whether this attribute is inherited (Inherited from MulticastAttribute.)
Public property | AttributePriority | Gets or sets the priority of the current attribute in case that multiple instances are defined on the same element (lower values are processed before). (Inherited from MulticastAttribute.)
Public property | AttributeReplace | Determines whether this attribute replaces other attributes found on the target declarations. (Inherited from MulticastAttribute.)
Public property | AttributeTargetAssemblies | Gets or sets the assemblies to which the current attribute apply. (Inherited from MulticastAttribute.)
Public property | AttributeTargetElements | Gets or sets the kind of elements to which this custom attributes applies. (Inherited from MulticastAttribute.)
Public property | AttributeTargetExternalMemberAttributes | Gets or sets the visibilities, scopes, virtualities, and implementation of members to which this attribute applies, when the member is external to the current module. (Inherited from MulticastAttribute.)
Public property | AttributeTargetExternalTypeAttributes | Gets or sets the visibilities of types to which this attribute applies, when this type is external to the current module. (Inherited from MulticastAttribute.)
Public property | AttributeTargetMemberAttributes | Gets or sets the visibilities, scopes, virtualities, and implementation of members to which this attribute applies. (Inherited from MulticastAttribute.)
Public property | AttributeTargetMembers | Gets or sets the expression specifying to which members this instance applies. (Inherited from MulticastAttribute.)
Public property | AttributeTargetParameterAttributes | Gets or sets the passing style (by value, out or ref) of parameters to which this attribute applies. (Inherited from MulticastAttribute.)
Public property | AttributeTargetParameters | Gets or sets the expression specifying to which parameters this instance applies. (Inherited from MulticastAttribute.)
Public property | AttributeTargetTypeAttributes | Gets or sets the visibilities of types to which this attribute applies. (Inherited from MulticastAttribute.)
Public property | AttributeTargetTypes | Gets or sets the expression specifying to which types this instance applies. (Inherited from MulticastAttribute.)
Public property | Severity | Gets or sets the severity of messages emitted by this constraint.
Back to Top
See Also
ProtectedAttribute Class
PostSharp.Constraints Namespace

Online Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


ProtectedAttribute.Severity Property

ProtectedAttribute Severity Property PostSharp Documentation
Gets or sets the severity of messages emitted by this constraint.

Namespace: PostSharp.Constraints
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
public SeverityType Severity { get; set; }
public SeverityType Severity { get; set; }
Property Value
Type: SeverityType
Remarks
The default value is Warning.
See Also
ProtectedAttribute Class
ProtectedAttribute Members
PostSharp.Constraints Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


ReferentialConstraint Class

ReferentialConstraint Class PostSharp Documentation
Implementation of IReferentialConstraint based on MulticastAttribute.
Inheritance Hierarchy
Online System Object
Online System Attribute
PostSharp.Extensibility MulticastAttribute
PostSharp.Constraints Constraint
PostSharp.Constraints ReferentialConstraint
PostSharp.Constraints ComponentInternalAttribute
PostSharp.Constraints ExperimentalAttribute
PostSharp.Constraints InternalAttribute
PostSharp.Constraints InternalImplementAttribute
PostSharp.Constraints ProtectedAttribute

Namespace: PostSharp.Constraints
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
public abstract class ReferentialConstraint : Constraint,
    IReferentialConstraint, IConstraint
public abstract class ReferentialConstraint : Constraint,
    IReferentialConstraint, IConstraint
Remarks
  Note  Note

      PostSharp Professional Edition is required for this feature.

See Also
ReferentialConstraint Members
PostSharp.Constraints Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


ReferentialConstraint Members

ReferentialConstraint Members PostSharp Documentation

The ReferentialConstraint type exposes the following members.
Constructors
 | Name | Description
Protected method | ReferentialConstraint | Initializes a new instance of the ReferentialConstraint class
Back to Top
Methods
 | Name | Description
Public method | ValidateCode | Validates the constraint.
Public method | ValidateConstraint | Validates the fact that the constraint has been applied on a valid element of code. When this method returns false, the constraint is silently ignored. (Inherited from Constraint.)
Back to Top
Properties
 | Name | Description
Public property | AttributeExclude | If true, indicates that this attribute removes all other instances of the same attribute type from the set of elements defined by the current instance. (Inherited from MulticastAttribute.)
Public property | AttributeId | Obsolete. (Inherited from MulticastAttribute.)
Public property | AttributeInheritance | Determines whether this attribute is inherited (Inherited from MulticastAttribute.)
Public property | AttributePriority | Gets or sets the priority of the current attribute in case that multiple instances are defined on the same element (lower values are processed before). (Inherited from MulticastAttribute.)
Public property | AttributeReplace | Determines whether this attribute replaces other attributes found on the target declarations. (Inherited from MulticastAttribute.)
Public property | AttributeTargetAssemblies | Gets or sets the assemblies to which the current attribute apply. (Inherited from MulticastAttribute.)
Public property | AttributeTargetElements | Gets or sets the kind of elements to which this custom attributes applies. (Inherited from MulticastAttribute.)
Public property | AttributeTargetExternalMemberAttributes | Gets or sets the visibilities, scopes, virtualities, and implementation of members to which this attribute applies, when the member is external to the current module. (Inherited from MulticastAttribute.)
Public property | AttributeTargetExternalTypeAttributes | Gets or sets the visibilities of types to which this attribute applies, when this type is external to the current module. (Inherited from MulticastAttribute.)
Public property | AttributeTargetMemberAttributes | Gets or sets the visibilities, scopes, virtualities, and implementation of members to which this attribute applies. (Inherited from MulticastAttribute.)
Public property | AttributeTargetMembers | Gets or sets the expression specifying to which members this instance applies. (Inherited from MulticastAttribute.)
Public property | AttributeTargetParameterAttributes | Gets or sets the passing style (by value, out or ref) of parameters to which this attribute applies. (Inherited from MulticastAttribute.)
Public property | AttributeTargetParameters | Gets or sets the expression specifying to which parameters this instance applies. (Inherited from MulticastAttribute.)
Public property | AttributeTargetTypeAttributes | Gets or sets the visibilities of types to which this attribute applies. (Inherited from MulticastAttribute.)
Public property | AttributeTargetTypes | Gets or sets the expression specifying to which types this instance applies. (Inherited from MulticastAttribute.)
Back to Top
See Also
ReferentialConstraint Class
PostSharp.Constraints Namespace

Online Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


ReferentialConstraint Constructor

ReferentialConstraint Constructor PostSharp Documentation
Initializes a new instance of the ReferentialConstraint class

Namespace: PostSharp.Constraints
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
protected ReferentialConstraint()
protected ReferentialConstraint()
See Also
ReferentialConstraint Class
ReferentialConstraint Members
PostSharp.Constraints Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


ReferentialConstraint Methods

ReferentialConstraint Methods PostSharp Documentation
The ReferentialConstraint type exposes the following members.
Methods
 | Name | Description
Public method | ValidateCode | Validates the constraint.
Public method | ValidateConstraint | Validates the fact that the constraint has been applied on a valid element of code. When this method returns false, the constraint is silently ignored. (Inherited from Constraint.)
Back to Top
See Also
ReferentialConstraint Class
PostSharp.Constraints Namespace

Online Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


ReferentialConstraint.ValidateCode Method

ReferentialConstraint ValidateCode Method PostSharp Documentation
Validates the constraint.

Namespace: PostSharp.Constraints
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
public virtual void ValidateCode(
    Object target,
    Assembly assembly
)
public virtual void ValidateCode(
    Object target,
    Assembly assembly
)
Parameters
target
Type:   Online System Object
Declaration (  Online Assembly,   Online Type,
              Online MethodInfo,   Online ConstructorInfo,   Online PropertyInfo,
              Online EventInfo,   Online FieldInfo,   Online ParameterInfo) to which
            the constraint has been applied.
assembly
Type:   Online System.Reflection Assembly
The assembly being currently processed.
Implements
IReferentialConstraint ValidateCode(Object, Assembly)
See Also
ReferentialConstraint Class
ReferentialConstraint Members
PostSharp.Constraints Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


ReferentialConstraint Properties

ReferentialConstraint Properties PostSharp Documentation
The ReferentialConstraint type exposes the following members.
Properties
 | Name | Description
Public property | AttributeExclude | If true, indicates that this attribute removes all other instances of the same attribute type from the set of elements defined by the current instance. (Inherited from MulticastAttribute.)
Public property | AttributeId | Obsolete. (Inherited from MulticastAttribute.)
Public property | AttributeInheritance | Determines whether this attribute is inherited (Inherited from MulticastAttribute.)
Public property | AttributePriority | Gets or sets the priority of the current attribute in case that multiple instances are defined on the same element (lower values are processed before). (Inherited from MulticastAttribute.)
Public property | AttributeReplace | Determines whether this attribute replaces other attributes found on the target declarations. (Inherited from MulticastAttribute.)
Public property | AttributeTargetAssemblies | Gets or sets the assemblies to which the current attribute apply. (Inherited from MulticastAttribute.)
Public property | AttributeTargetElements | Gets or sets the kind of elements to which this custom attributes applies. (Inherited from MulticastAttribute.)
Public property | AttributeTargetExternalMemberAttributes | Gets or sets the visibilities, scopes, virtualities, and implementation of members to which this attribute applies, when the member is external to the current module. (Inherited from MulticastAttribute.)
Public property | AttributeTargetExternalTypeAttributes | Gets or sets the visibilities of types to which this attribute applies, when this type is external to the current module. (Inherited from MulticastAttribute.)
Public property | AttributeTargetMemberAttributes | Gets or sets the visibilities, scopes, virtualities, and implementation of members to which this attribute applies. (Inherited from MulticastAttribute.)
Public property | AttributeTargetMembers | Gets or sets the expression specifying to which members this instance applies. (Inherited from MulticastAttribute.)
Public property | AttributeTargetParameterAttributes | Gets or sets the passing style (by value, out or ref) of parameters to which this attribute applies. (Inherited from MulticastAttribute.)
Public property | AttributeTargetParameters | Gets or sets the expression specifying to which parameters this instance applies. (Inherited from MulticastAttribute.)
Public property | AttributeTargetTypeAttributes | Gets or sets the visibilities of types to which this attribute applies. (Inherited from MulticastAttribute.)
Public property | AttributeTargetTypes | Gets or sets the expression specifying to which types this instance applies. (Inherited from MulticastAttribute.)
Back to Top
See Also
ReferentialConstraint Class
PostSharp.Constraints Namespace

Online Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


ScalarConstraint Class

ScalarConstraint Class PostSharp Documentation
Implementation of IScalarConstraint based on MulticastAttribute.
Inheritance Hierarchy
Online System Object
Online System Attribute
PostSharp.Extensibility MulticastAttribute
PostSharp.Constraints Constraint
PostSharp.Constraints ScalarConstraint

Namespace: PostSharp.Constraints
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
public class ScalarConstraint : Constraint,
    IScalarConstraint, IConstraint
public class ScalarConstraint : Constraint,
    IScalarConstraint, IConstraint
Remarks
  Note  Note

      PostSharp Professional Edition is required for this feature.

See Also
ScalarConstraint Members
PostSharp.Constraints Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


ScalarConstraint Members

ScalarConstraint Members PostSharp Documentation

The ScalarConstraint type exposes the following members.
Constructors
 | Name | Description
Public method | ScalarConstraint | Initializes a new instance of the ScalarConstraint class
Back to Top
Methods
 | Name | Description
Public method | ValidateCode | Validates the element of code to which the constraint is applied.
Public method | ValidateConstraint | Validates the fact that the constraint has been applied on a valid element of code. When this method returns false, the constraint is silently ignored. (Inherited from Constraint.)
Back to Top
Properties
 | Name | Description
Public property | AttributeExclude | If true, indicates that this attribute removes all other instances of the same attribute type from the set of elements defined by the current instance. (Inherited from MulticastAttribute.)
Public property | AttributeId | Obsolete. (Inherited from MulticastAttribute.)
Public property | AttributeInheritance | Determines whether this attribute is inherited (Inherited from MulticastAttribute.)
Public property | AttributePriority | Gets or sets the priority of the current attribute in case that multiple instances are defined on the same element (lower values are processed before). (Inherited from MulticastAttribute.)
Public property | AttributeReplace | Determines whether this attribute replaces other attributes found on the target declarations. (Inherited from MulticastAttribute.)
Public property | AttributeTargetAssemblies | Gets or sets the assemblies to which the current attribute apply. (Inherited from MulticastAttribute.)
Public property | AttributeTargetElements | Gets or sets the kind of elements to which this custom attributes applies. (Inherited from MulticastAttribute.)
Public property | AttributeTargetExternalMemberAttributes | Gets or sets the visibilities, scopes, virtualities, and implementation of members to which this attribute applies, when the member is external to the current module. (Inherited from MulticastAttribute.)
Public property | AttributeTargetExternalTypeAttributes | Gets or sets the visibilities of types to which this attribute applies, when this type is external to the current module. (Inherited from MulticastAttribute.)
Public property | AttributeTargetMemberAttributes | Gets or sets the visibilities, scopes, virtualities, and implementation of members to which this attribute applies. (Inherited from MulticastAttribute.)
Public property | AttributeTargetMembers | Gets or sets the expression specifying to which members this instance applies. (Inherited from MulticastAttribute.)
Public property | AttributeTargetParameterAttributes | Gets or sets the passing style (by value, out or ref) of parameters to which this attribute applies. (Inherited from MulticastAttribute.)
Public property | AttributeTargetParameters | Gets or sets the expression specifying to which parameters this instance applies. (Inherited from MulticastAttribute.)
Public property | AttributeTargetTypeAttributes | Gets or sets the visibilities of types to which this attribute applies. (Inherited from MulticastAttribute.)
Public property | AttributeTargetTypes | Gets or sets the expression specifying to which types this instance applies. (Inherited from MulticastAttribute.)
Back to Top
See Also
ScalarConstraint Class
PostSharp.Constraints Namespace

Online Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


ScalarConstraint Constructor

ScalarConstraint Constructor PostSharp Documentation
Initializes a new instance of the ScalarConstraint class

Namespace: PostSharp.Constraints
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
public ScalarConstraint()
public ScalarConstraint()
See Also
ScalarConstraint Class
ScalarConstraint Members
PostSharp.Constraints Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


ScalarConstraint Methods

ScalarConstraint Methods PostSharp Documentation
The ScalarConstraint type exposes the following members.
Methods
 | Name | Description
Public method | ValidateCode | Validates the element of code to which the constraint is applied.
Public method | ValidateConstraint | Validates the fact that the constraint has been applied on a valid element of code. When this method returns false, the constraint is silently ignored. (Inherited from Constraint.)
Back to Top
See Also
ScalarConstraint Class
PostSharp.Constraints Namespace

Online Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


ScalarConstraint.ValidateCode Method

ScalarConstraint ValidateCode Method PostSharp Documentation
Validates the element of code to which the constraint is applied.

Namespace: PostSharp.Constraints
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
public virtual void ValidateCode(
    Object target
)
public virtual void ValidateCode(
    Object target
)
Parameters
target
Type:   Online System Object
Element of code to which the constraint is applied (  Online Assembly,   Online Type,
              Online MethodInfo,   Online ConstructorInfo,   Online PropertyInfo,
              Online EventInfo,   Online FieldInfo,   Online ParameterInfo).
Implements
IScalarConstraint ValidateCode(Object)
See Also
ScalarConstraint Class
ScalarConstraint Members
PostSharp.Constraints Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


ScalarConstraint Properties

ScalarConstraint Properties PostSharp Documentation
The ScalarConstraint type exposes the following members.
Properties
 | Name | Description
Public property | AttributeExclude | If true, indicates that this attribute removes all other instances of the same attribute type from the set of elements defined by the current instance. (Inherited from MulticastAttribute.)
Public property | AttributeId | Obsolete. (Inherited from MulticastAttribute.)
Public property | AttributeInheritance | Determines whether this attribute is inherited (Inherited from MulticastAttribute.)
Public property | AttributePriority | Gets or sets the priority of the current attribute in case that multiple instances are defined on the same element (lower values are processed before). (Inherited from MulticastAttribute.)
Public property | AttributeReplace | Determines whether this attribute replaces other attributes found on the target declarations. (Inherited from MulticastAttribute.)
Public property | AttributeTargetAssemblies | Gets or sets the assemblies to which the current attribute apply. (Inherited from MulticastAttribute.)
Public property | AttributeTargetElements | Gets or sets the kind of elements to which this custom attributes applies. (Inherited from MulticastAttribute.)
Public property | AttributeTargetExternalMemberAttributes | Gets or sets the visibilities, scopes, virtualities, and implementation of members to which this attribute applies, when the member is external to the current module. (Inherited from MulticastAttribute.)
Public property | AttributeTargetExternalTypeAttributes | Gets or sets the visibilities of types to which this attribute applies, when this type is external to the current module. (Inherited from MulticastAttribute.)
Public property | AttributeTargetMemberAttributes | Gets or sets the visibilities, scopes, virtualities, and implementation of members to which this attribute applies. (Inherited from MulticastAttribute.)
Public property | AttributeTargetMembers | Gets or sets the expression specifying to which members this instance applies. (Inherited from MulticastAttribute.)
Public property | AttributeTargetParameterAttributes | Gets or sets the passing style (by value, out or ref) of parameters to which this attribute applies. (Inherited from MulticastAttribute.)
Public property | AttributeTargetParameters | Gets or sets the expression specifying to which parameters this instance applies. (Inherited from MulticastAttribute.)
Public property | AttributeTargetTypeAttributes | Gets or sets the visibilities of types to which this attribute applies. (Inherited from MulticastAttribute.)
Public property | AttributeTargetTypes | Gets or sets the expression specifying to which types this instance applies. (Inherited from MulticastAttribute.)
Back to Top
See Also
ScalarConstraint Class
PostSharp.Constraints Namespace

Online Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


PostSharp.Extensibility Namespace

PostSharp.Extensibility Namespace PostSharp Documentation
The PostSharp.Extensibility namespace defines the semantics of the attribute multicasting mechanism and exposes other types that allow user code to interact with the PostSharp,platform.
Classes
 | Class | Description
Public class | AssemblyIdAttribute | Assigns a unique identifier to an assembly. This assembly identifier is used to generate unique attribute identifiers.
Public class | CompatibilityLevelAttribute | Sets the level of backward compatibility required by aspects in the current assembly.
Public class | EnhancedByPostSharpAttribute | Obsolete. Custom attribute added to the assembly manifest of modules processed by PostSharp.
Public class | EscalatePostSharpMessageAttribute | Custom attribute that, when applied on an assembly, means that a given message should be escalated to an error during the current PostSharp session.
Public class | FrameworkVariants | Obsolete. Defines constants identifying the different variants of the .NET Framework (Full, Compact, Silverlight).
Public class | HasInheritedAttributeAttribute | Internal Only. Custom attribute used internally by PostSharp to mark elements having inherited custom attributes. This custom attribute should not be used in custom code, otherwise PostSharp may not work properly.
Public class | ImplementationBoundAttributeAttribute | Custom attribute meaning that custom attributes of a given type are bound to the implementation, not to the semantics.
Public class | InvalidAnnotationException | Exception thrown at build time by implementation of CompileTimeValidate(Object) when an annotation is invalid.
Public class | Message | Encapsulates a message (error, warning, info, ...).
Public class | MessageDispenser | Provides a base implementation of IMessageDispenser where the message key is supposed to be in format PRE0000, where PRE is a prefix and 0000 is an integer. Keys for help URLs have the format PRE0000?.
Public class | MessageException | Exception embedding a Message.
Public class | MessageSource | Provides commodity methods to work with an IMessageSink.
Public class | MetricAttribute | Custom attribute that, when applied on an aspect, causes the aspect to increment some metric at build time.
Public class | MulticastAttribute | Custom attribute that can be applied to multiple elements using wildcards.
Public class | MulticastAttributeUsageAttribute | Custom attribute that determines the usage of a MulticastAttribute.
Public class | MulticastImplementationDetailsTypeAttribute |
Public class | PostSharpEnvironment | Provides access to the current PostSharp environment (IPostSharpEnvironment).
Public class | PostSharpTrace | Provides tracing functionality. An instance of the PostSharpTrace type implements a trace sink.
Public class | ProjectExtensionElement | Represents a custom element (or section) in the XML project type.
Public class | ProjectResource | Represents an element of a resource section, i.e. a named object deserialized from XML.
Public class | RequireLicenseAttribute | Custom attribute that, when applied to an aspect, causes PostSharp to require some license in order to weave the aspect.
Public class | RequirePostSharpAttribute | Custom attribute that, when applied on another custom attribute (a class derived from Online Attribute), means that assemblies with elements annotated with that custom attribute should be processed by PostSharp.
Public class | RequireReflectionWrapperAttribute | Obsolete. Custom attribute that, when applied on a type, specifies that all build-time semantics of this type require reflection wrappers to be passed instead of real reflection objects.
Public class | SuppressAnnotationValidationAttribute | Instructs PostSharp that the validation of IValidableAnnotation is done by another component, and should not be processed by the default component.
Structures
 | Structure | Description
Public structure | TargetFrameworkFamily | Represents a variant of family (variant) of the .NET Framework, e.g. NetCore, NetFramework, Silverlight or NetPortable.
Interfaces
 | Interface | Description
Public interface | IMessageDispenser | Gets a text given its key.
Public interface | IMessageSink | Receives messages.
Public interface | IPostSharpEnvironment | Provides information about the current PostSharp environment.
Public interface | IProject | Provides information about the currently executing project.
Public interface | IReflectionBindingManagerService | Exposes the ResolveAssembly(Type) method, which gets the reference identity of the assembly declaring a given type.
Public interface | IService | A service exposed by the build-time part of PostSharp.
Public interface | ITargetFramework | Represents a version and variant of the .NET framework (running on a device) on which the project being built is design to run.
Public interface | IValidableAnnotation | Interface that, when implemented by a custom attribute ( Online Attribute), causes PostSharp to invoke a validation method for every instance of that custom attribute.
Enumerations
 | Enumeration | Description
Public enumeration | AssemblyLoadContext | Enumeration of contexts in which assemblies can be loaded.
Public enumeration | CompatibilityLevel | Enumeration of standard levels of backward compatibility.
Public enumeration | MulticastAttributes | Attributes of elements to which multicast custom attributes (MulticastAttribute) apply.
Public enumeration | MulticastInheritance | Kind of inheritance of MulticastAttribute.
Public enumeration | MulticastTargets | Kinds of targets to which multicast custom attributes (MulticastAttribute) can apply.
Public enumeration | SeverityType | Types of message severities.

Online Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


AssemblyIdAttribute Class

AssemblyIdAttribute Class PostSharp Documentation
Assigns a unique identifier to an assembly. This assembly identifier is used to generate unique attribute identifiers.
Inheritance Hierarchy
Online System Object
Online System Attribute
PostSharp.Extensibility AssemblyIdAttribute

Namespace: PostSharp.Extensibility
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
public sealed class AssemblyIdAttribute : Attribute
public sealed class AssemblyIdAttribute : Attribute
Remarks

              By default, the assembly identifier is computed from the module name
              (by using the first 4 bytes of the MD5 sum of the module name).

See Also
AssemblyIdAttribute Members
PostSharp.Extensibility Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


AssemblyIdAttribute Members

AssemblyIdAttribute Members PostSharp Documentation

The AssemblyIdAttribute type exposes the following members.
Constructors
 | Name | Description
Public method | AssemblyIdAttribute | Initializes a new AssemblyIdAttribute.
Back to Top
See Also
AssemblyIdAttribute Class
PostSharp.Extensibility Namespace

Online Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


AssemblyIdAttribute Constructor

AssemblyIdAttribute Constructor PostSharp Documentation
Initializes a new AssemblyIdAttribute.

Namespace: PostSharp.Extensibility
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
public AssemblyIdAttribute(
    int id
)
public AssemblyIdAttribute(
    int id
)
Parameters
id
Type:   Online System Int32
Assembly identifier.
See Also
AssemblyIdAttribute Class
AssemblyIdAttribute Members
PostSharp.Extensibility Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


AssemblyLoadContext Enumeration

AssemblyLoadContext Enumeration PostSharp Documentation
Enumeration of contexts in which assemblies can be loaded.

Namespace: PostSharp.Extensibility
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
public enum AssemblyLoadContext
public enum AssemblyLoadContext
Members
Member name | Value | Description
Reference | 0 | Reference assemblies the ones the project is being linked against. They are typically located in directory C:\Program Files\Reference Assemblies for the proper target platform.
Runtime | 1 | Runtime assemblies are the ones loaded at build time in the CLR. They are typically located in GAC.
See Also
PostSharp.Extensibility Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


CompatibilityLevel Enumeration

CompatibilityLevel Enumeration PostSharp Documentation
Enumeration of standard levels of backward compatibility.

Namespace: PostSharp.Extensibility
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
public enum CompatibilityLevel
public enum CompatibilityLevel
Members
Member name | Value | Description
Undefined | 0 | No compatibility level defined (latest at execution time).
PostSharp30 | 844424930131968 | Compatibility level for PostSharp 3.0.
Latest | 844424930131968 | Latest at build time.
See Also
PostSharp.Extensibility Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


CompatibilityLevelAttribute Class

CompatibilityLevelAttribute Class PostSharp Documentation
Sets the level of backward compatibility required by aspects in the current assembly.
Inheritance Hierarchy
Online System Object
Online System Attribute
PostSharp.Extensibility CompatibilityLevelAttribute

Namespace: PostSharp.Extensibility
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
public sealed class CompatibilityLevelAttribute : Attribute
public sealed class CompatibilityLevelAttribute : Attribute
See Also
CompatibilityLevelAttribute Members
PostSharp.Extensibility Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


CompatibilityLevelAttribute Members

CompatibilityLevelAttribute Members PostSharp Documentation

The CompatibilityLevelAttribute type exposes the following members.
Constructors
 | Name | Description
Public method | CompatibilityLevelAttribute | Initializes a new CompatibilityLevelAttribute.
Back to Top
See Also
CompatibilityLevelAttribute Class
PostSharp.Extensibility Namespace

Online Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


CompatibilityLevelAttribute Constructor

CompatibilityLevelAttribute Constructor PostSharp Documentation
Initializes a new CompatibilityLevelAttribute.

Namespace: PostSharp.Extensibility
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
public CompatibilityLevelAttribute(
    CompatibilityLevel level
)
public CompatibilityLevelAttribute(
    CompatibilityLevel level
)
Parameters
level
Type: PostSharp.Extensibility CompatibilityLevel
Level of backward compatibility required by aspects in the current assembly.
See Also
CompatibilityLevelAttribute Class
CompatibilityLevelAttribute Members
PostSharp.Extensibility Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


EnhancedByPostSharpAttribute Class

EnhancedByPostSharpAttribute Class PostSharp Documentation
Custom attribute added to the assembly manifest of modules processed by PostSharp.
Inheritance Hierarchy
Online System Object
Online System Attribute
PostSharp.Extensibility EnhancedByPostSharpAttribute

Namespace: PostSharp.Extensibility
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
[ObsoleteAttribute]
public sealed class EnhancedByPostSharpAttribute : Attribute
[ObsoleteAttribute]
public sealed class EnhancedByPostSharpAttribute : Attribute
See Also
EnhancedByPostSharpAttribute Members
PostSharp.Extensibility Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


EnhancedByPostSharpAttribute Members

EnhancedByPostSharpAttribute Members PostSharp Documentation

Constructors
 | Name | Description
Public method | EnhancedByPostSharpAttribute(Int32) | Instantiates a new EnhancedByPostSharpAttribute and specifies the license number (not the full license key).
Public method | EnhancedByPostSharpAttribute(String) | Instantiate a new EnhancedByPostSharpAttribute with a text message, typically used when PostSharp runs in evaluation mode.
Back to Top
See Also
EnhancedByPostSharpAttribute Class
PostSharp.Extensibility Namespace

Online Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


EnhancedByPostSharpAttribute Constructor

EnhancedByPostSharpAttribute Constructor PostSharp Documentation
Overload List
 | Name | Description
Public method | EnhancedByPostSharpAttribute(Int32) | Instantiates a new EnhancedByPostSharpAttribute and specifies the license number (not the full license key).
Public method | EnhancedByPostSharpAttribute(String) | Instantiate a new EnhancedByPostSharpAttribute with a text message, typically used when PostSharp runs in evaluation mode.
Back to Top
See Also
EnhancedByPostSharpAttribute Class
EnhancedByPostSharpAttribute Members
PostSharp.Extensibility Namespace

Online Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


EnhancedByPostSharpAttribute Constructor (Int32)

EnhancedByPostSharpAttribute Constructor (Int32) PostSharp Documentation
Instantiates a new EnhancedByPostSharpAttribute and specifies the license number (not the full license key).

Namespace: PostSharp.Extensibility
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
public EnhancedByPostSharpAttribute(
    int licenseId
)
public EnhancedByPostSharpAttribute(
    int licenseId
)
Parameters
licenseId
Type:   Online System Int32
License number.
See Also
EnhancedByPostSharpAttribute Class
EnhancedByPostSharpAttribute Members
EnhancedByPostSharpAttribute Overload
PostSharp.Extensibility Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


EnhancedByPostSharpAttribute Constructor (String)

EnhancedByPostSharpAttribute Constructor (String) PostSharp Documentation
Instantiate a new EnhancedByPostSharpAttribute with a text message, typically used when PostSharp runs in evaluation mode.

Namespace: PostSharp.Extensibility
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
public EnhancedByPostSharpAttribute(
    string message
)
public EnhancedByPostSharpAttribute(
    string message
)
Parameters
message
Type:   Online System String
The watermark text.
See Also
EnhancedByPostSharpAttribute Class
EnhancedByPostSharpAttribute Members
EnhancedByPostSharpAttribute Overload
PostSharp.Extensibility Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


EscalatePostSharpMessageAttribute Class

EscalatePostSharpMessageAttribute Class PostSharp Documentation
Custom attribute that, when applied on an assembly, means that a given message should be escalated to an error during the current PostSharp session.
Inheritance Hierarchy
Online System Object
Online System Attribute
PostSharp.Extensibility EscalatePostSharpMessageAttribute

Namespace: PostSharp.Extensibility
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
public sealed class EscalatePostSharpMessageAttribute : Attribute
public sealed class EscalatePostSharpMessageAttribute : Attribute
Remarks

              Errors and fatal errors cannot be disabled.

See Also
EscalatePostSharpMessageAttribute Members
PostSharp.Extensibility Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


EscalatePostSharpMessageAttribute Members

EscalatePostSharpMessageAttribute Members PostSharp Documentation

The EscalatePostSharpMessageAttribute type exposes the following members.
Constructors
 | Name | Description
Public method | EscalatePostSharpMessageAttribute | Initializes a new EscalatePostSharpMessageAttribute.
Back to Top
Properties
 | Name | Description
Public property | MessageId | Gets the identifier of the message to be disabled.
Back to Top
See Also
EscalatePostSharpMessageAttribute Class
PostSharp.Extensibility Namespace

Online Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


EscalatePostSharpMessageAttribute Constructor

EscalatePostSharpMessageAttribute Constructor PostSharp Documentation
Initializes a new EscalatePostSharpMessageAttribute.

Namespace: PostSharp.Extensibility
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
public EscalatePostSharpMessageAttribute(
    string messageId
)
public EscalatePostSharpMessageAttribute(
    string messageId
)
Parameters
messageId
Type:   Online System String
Identifier of the message to be disabled.
See Also
EscalatePostSharpMessageAttribute Class
EscalatePostSharpMessageAttribute Members
PostSharp.Extensibility Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


EscalatePostSharpMessageAttribute Properties

EscalatePostSharpMessageAttribute Properties PostSharp Documentation
The EscalatePostSharpMessageAttribute type exposes the following members.
Properties
 | Name | Description
Public property | MessageId | Gets the identifier of the message to be disabled.
Back to Top
See Also
EscalatePostSharpMessageAttribute Class
PostSharp.Extensibility Namespace

Online Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


EscalatePostSharpMessageAttribute.MessageId Property

EscalatePostSharpMessageAttribute MessageId Property PostSharp Documentation
Gets the identifier of the message to be disabled.

Namespace: PostSharp.Extensibility
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
public string MessageId { get; }
public string MessageId { get; }
Property Value
Type:   Online String
See Also
EscalatePostSharpMessageAttribute Class
EscalatePostSharpMessageAttribute Members
PostSharp.Extensibility Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


FrameworkVariants Class

FrameworkVariants Class PostSharp Documentation
Defines constants identifying the different variants of the .NET Framework (Full, Compact, Silverlight).
Inheritance Hierarchy
Online System Object
PostSharp.Extensibility FrameworkVariants

Namespace: PostSharp.Extensibility
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
[ObsoleteAttribute("Use ITargetDevice")]
public static class FrameworkVariants
[ObsoleteAttribute("Use ITargetDevice")]
public static class FrameworkVariants
See Also
FrameworkVariants Members
PostSharp.Extensibility Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


FrameworkVariants Members

FrameworkVariants Members PostSharp Documentation

The FrameworkVariants type exposes the following members.
Methods
Name | Description
FromBytes | Convert a byte array (typically containing the public key token of mscorlib) into a string that can be compared to one of the constants defined in this class.
Back to Top
Fields
Name | Description
Compact | .NET Compact Framework.
Full | Normal, full .NET Framework.
Micro | Micro Framework.
Silverlight | Silverlight.
Back to Top
See Also
FrameworkVariants Class
PostSharp.Extensibility Namespace

Online Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


FrameworkVariants Fields

FrameworkVariants Fields PostSharp Documentation
The FrameworkVariants type exposes the following members.
Fields
Name | Description
Compact | .NET Compact Framework.
Full | Normal, full .NET Framework.
Micro | Micro Framework.
Silverlight | Silverlight.
Back to Top
See Also
FrameworkVariants Class
PostSharp.Extensibility Namespace

Online Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


FrameworkVariants.Compact Field

FrameworkVariants Compact Field PostSharp Documentation
.NET Compact Framework.

Namespace: PostSharp.Extensibility
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
public const string Compact
public const string Compact
Field Value
Type:   Online String
See Also
FrameworkVariants Class
FrameworkVariants Members
PostSharp.Extensibility Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


FrameworkVariants.Full Field

FrameworkVariants Full Field PostSharp Documentation
Normal, full .NET Framework.

Namespace: PostSharp.Extensibility
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
public const string Full
public const string Full
Field Value
Type:   Online String
See Also
FrameworkVariants Class
FrameworkVariants Members
PostSharp.Extensibility Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


FrameworkVariants.Micro Field

FrameworkVariants Micro Field PostSharp Documentation
Micro Framework.

Namespace: PostSharp.Extensibility
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
public const string Micro
public const string Micro
Field Value
Type:   Online String
Remarks

              There is strong name in the Micro Framework.

See Also
FrameworkVariants Class
FrameworkVariants Members
PostSharp.Extensibility Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


FrameworkVariants.Silverlight Field

FrameworkVariants Silverlight Field PostSharp Documentation
Silverlight.

Namespace: PostSharp.Extensibility
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
public const string Silverlight
public const string Silverlight
Field Value
Type:   Online String
See Also
FrameworkVariants Class
FrameworkVariants Members
PostSharp.Extensibility Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


FrameworkVariants Methods

FrameworkVariants Methods PostSharp Documentation
The FrameworkVariants type exposes the following members.
Methods
Name | Description
FromBytes | Convert a byte array (typically containing the public key token of mscorlib) into a string that can be compared to one of the constants defined in this class.
Back to Top
See Also
FrameworkVariants Class
PostSharp.Extensibility Namespace

Online Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


FrameworkVariants.FromBytes Method

FrameworkVariants FromBytes Method PostSharp Documentation
Convert a byte array (typically containing the public key token of mscorlib) into a string that can be compared to one of the constants defined in this class.

Namespace: PostSharp.Extensibility
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
public static string FromBytes(
    byte[] bytes
)
public static string FromBytes(
    byte[] bytes
)
Parameters
bytes
Type:    Online System Byte
A byte array (typically containing the public key token of mscorlib)
Return Value
Type:   Online String
A string that can be compared to one of the constants defined in this class
See Also
FrameworkVariants Class
FrameworkVariants Members
PostSharp.Extensibility Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


HasInheritedAttributeAttribute Class

HasInheritedAttributeAttribute Class PostSharp Documentation
Internal Only. Custom attribute used internally by PostSharp to mark elements having inherited custom attributes. This custom attribute should not be used in custom code, otherwise PostSharp may not work properly.
Inheritance Hierarchy
Online System Object
Online System Attribute
PostSharp.Extensibility HasInheritedAttributeAttribute

Namespace: PostSharp.Extensibility
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
public sealed class HasInheritedAttributeAttribute : Attribute
public sealed class HasInheritedAttributeAttribute : Attribute
See Also
PostSharp.Extensibility Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


IMessageDispenser Interface

IMessageDispenser Interface PostSharp Documentation
Gets a text given its key.

Namespace: PostSharp.Extensibility
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
public interface IMessageDispenser
public interface IMessageDispenser
See Also
IMessageDispenser Members
PostSharp.Extensibility Namespace
PostSharp.Extensibility MessageDispenser
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


IMessageDispenser Members

IMessageDispenser Members PostSharp Documentation

The IMessageDispenser type exposes the following members.
Methods
 | Name | Description
Public method | GetMessage | Gets a message text given a message key.
Back to Top
See Also
IMessageDispenser Interface
PostSharp.Extensibility Namespace

Online Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


IMessageDispenser Methods

IMessageDispenser Methods PostSharp Documentation
The IMessageDispenser type exposes the following members.
Methods
 | Name | Description
Public method | GetMessage | Gets a message text given a message key.
Back to Top
See Also
IMessageDispenser Interface
PostSharp.Extensibility Namespace

Online Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


IMessageDispenser.GetMessage Method

IMessageDispenser GetMessage Method PostSharp Documentation
Gets a message text given a message key.

Namespace: PostSharp.Extensibility
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
string GetMessage(
    string key
)
string GetMessage(
    string key
)
Parameters
key
Type:   Online System String
Message key.
Return Value
Type:   Online String
The rext corresponding to key.
See Also
IMessageDispenser Interface
IMessageDispenser Members
PostSharp.Extensibility Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


IMessageSink Interface

IMessageSink Interface PostSharp Documentation
Receives messages.

Namespace: PostSharp.Extensibility
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
public interface IMessageSink
public interface IMessageSink
Remarks

              Use this interface instead of events for cross-domain communication.

See Also
IMessageSink Members
PostSharp.Extensibility Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


IMessageSink Members

IMessageSink Members PostSharp Documentation

The IMessageSink type exposes the following members.
Methods
 | Name | Description
Public method | Write | Writes a message to the sink.
Back to Top
See Also
IMessageSink Interface
PostSharp.Extensibility Namespace

Online Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


IMessageSink Methods

IMessageSink Methods PostSharp Documentation
The IMessageSink type exposes the following members.
Methods
 | Name | Description
Public method | Write | Writes a message to the sink.
Back to Top
See Also
IMessageSink Interface
PostSharp.Extensibility Namespace

Online Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


IMessageSink.Write Method

IMessageSink Write Method PostSharp Documentation
Writes a message to the sink.

Namespace: PostSharp.Extensibility
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
void Write(
    Message message
)
void Write(
    Message message
)
Parameters
message
Type: PostSharp.Extensibility Message
A message.
See Also
IMessageSink Interface
IMessageSink Members
PostSharp.Extensibility Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


ImplementationBoundAttributeAttribute Class

ImplementationBoundAttributeAttribute Class PostSharp Documentation
Custom attribute meaning that custom attributes of a given type are bound to the implementation, not to the semantics.
Inheritance Hierarchy
Online System Object
Online System Attribute
PostSharp.Extensibility ImplementationBoundAttributeAttribute

Namespace: PostSharp.Extensibility
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
public sealed class ImplementationBoundAttributeAttribute : Attribute
public sealed class ImplementationBoundAttributeAttribute : Attribute
Remarks
This custom attribute influences whether instances of a given other
                custom attribute should be moved from the semantic to the implementation,
                when the semantic is detached from the implementation. This happens for instance
                when a property is generated from a field; the property become the semantic
                (and is made public) and the field the implementation (and is made private).
                Most custom attributes apply to semantics, so they are moved from the field
                to the property. If a custom attribute must not be moved, it should be
                marked with the ImplementationBoundAttributeAttribute
                custom attribute.

See Also
ImplementationBoundAttributeAttribute Members
PostSharp.Extensibility Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


ImplementationBoundAttributeAttribute Members

ImplementationBoundAttributeAttribute Members PostSharp Documentation

The ImplementationBoundAttributeAttribute type exposes the following members.
Constructors
 | Name | Description
Public method | ImplementationBoundAttributeAttribute | Initializes the new ImplementationBoundAttributeAttribute.
Back to Top
Properties
 | Name | Description
Public property | AttributeType | Gets the type of the custom attribute that should not be moved from implementation to semantic
Back to Top
See Also
ImplementationBoundAttributeAttribute Class
PostSharp.Extensibility Namespace

Online Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


ImplementationBoundAttributeAttribute Constructor

ImplementationBoundAttributeAttribute Constructor PostSharp Documentation
Initializes the new ImplementationBoundAttributeAttribute.

Namespace: PostSharp.Extensibility
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
public ImplementationBoundAttributeAttribute(
    Type attributeType
)
public ImplementationBoundAttributeAttribute(
    Type attributeType
)
Parameters
attributeType
Type:   Online System Type
Type of the custom attribute that
              should not be moved from implementation to semantic.
See Also
ImplementationBoundAttributeAttribute Class
ImplementationBoundAttributeAttribute Members
PostSharp.Extensibility Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


ImplementationBoundAttributeAttribute Properties

ImplementationBoundAttributeAttribute Properties PostSharp Documentation
The ImplementationBoundAttributeAttribute type exposes the following members.
Properties
 | Name | Description
Public property | AttributeType | Gets the type of the custom attribute that should not be moved from implementation to semantic
Back to Top
See Also
ImplementationBoundAttributeAttribute Class
PostSharp.Extensibility Namespace

Online Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


ImplementationBoundAttributeAttribute.AttributeType Property

ImplementationBoundAttributeAttribute AttributeType Property PostSharp Documentation
Gets the type of the custom attribute that should not be moved from implementation to semantic

Namespace: PostSharp.Extensibility
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
public Type AttributeType { get; }
public Type AttributeType { get; }
Property Value
Type:   Online Type
See Also
ImplementationBoundAttributeAttribute Class
ImplementationBoundAttributeAttribute Members
PostSharp.Extensibility Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


InvalidAnnotationException Class

InvalidAnnotationException Class PostSharp Documentation
Exception thrown at build time by implementation of CompileTimeValidate(Object) when an annotation is invalid.
Inheritance Hierarchy
Online System Object
Online System Exception
PostSharp.Extensibility InvalidAnnotationException

Namespace: PostSharp.Extensibility
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
[SerializableAttribute]
public class InvalidAnnotationException : Exception
[SerializableAttribute]
public class InvalidAnnotationException : Exception
See Also
InvalidAnnotationException Members
PostSharp.Extensibility Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


InvalidAnnotationException Members

InvalidAnnotationException Members PostSharp Documentation

Constructors
 | Name | Description
Public method | InvalidAnnotationException | Initializes a new InvalidAnnotationException with default message.
Public method | InvalidAnnotationException(String) | Initializes a new InvalidAnnotationException and with a specified exception message.
Protected method | InvalidAnnotationException(SerializationInfo, StreamingContext) | Deserialization constructor.
Public method | InvalidAnnotationException(String, Exception) | Initializes a new InvalidAnnotationException with a specified exception message and inner Online Exception.
Back to Top
See Also
InvalidAnnotationException Class
PostSharp.Extensibility Namespace

Online Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


InvalidAnnotationException Constructor

InvalidAnnotationException Constructor PostSharp Documentation
Overload List
 | Name | Description
Public method | InvalidAnnotationException | Initializes a new InvalidAnnotationException with default message.
Public method | InvalidAnnotationException(String) | Initializes a new InvalidAnnotationException and with a specified exception message.
Protected method | InvalidAnnotationException(SerializationInfo, StreamingContext) | Deserialization constructor.
Public method | InvalidAnnotationException(String, Exception) | Initializes a new InvalidAnnotationException with a specified exception message and inner Online Exception.
Back to Top
See Also
InvalidAnnotationException Class
InvalidAnnotationException Members
PostSharp.Extensibility Namespace

Online Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


InvalidAnnotationException Constructor

InvalidAnnotationException Constructor PostSharp Documentation
Initializes a new InvalidAnnotationException with default message.

Namespace: PostSharp.Extensibility
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
public InvalidAnnotationException()
public InvalidAnnotationException()
See Also
InvalidAnnotationException Class
InvalidAnnotationException Members
InvalidAnnotationException Overload
PostSharp.Extensibility Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


InvalidAnnotationException Constructor (String)

InvalidAnnotationException Constructor (String) PostSharp Documentation
Initializes a new InvalidAnnotationException and with a specified exception message.

Namespace: PostSharp.Extensibility
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
public InvalidAnnotationException(
    string message
)
public InvalidAnnotationException(
    string message
)
Parameters
message
Type:   Online System String
Exception message
See Also
InvalidAnnotationException Class
InvalidAnnotationException Members
InvalidAnnotationException Overload
PostSharp.Extensibility Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


InvalidAnnotationException Constructor (SerializationInfo, StreamingContext)

InvalidAnnotationException Constructor (SerializationInfo, StreamingContext) PostSharp Documentation
Deserialization constructor.

Namespace: PostSharp.Extensibility
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
protected InvalidAnnotationException(
    SerializationInfo info,
    StreamingContext context
)
protected InvalidAnnotationException(
    SerializationInfo info,
    StreamingContext context
)
Parameters
info
Type:   Online System.Runtime.Serialization SerializationInfo
Info.
context
Type:   Online System.Runtime.Serialization StreamingContext
Context.
See Also
InvalidAnnotationException Class
InvalidAnnotationException Members
InvalidAnnotationException Overload
PostSharp.Extensibility Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


InvalidAnnotationException Constructor (String, Exception)

InvalidAnnotationException Constructor (String, Exception) PostSharp Documentation
Initializes a new InvalidAnnotationException with a specified exception message and inner Online Exception.

Namespace: PostSharp.Extensibility
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
public InvalidAnnotationException(
    string message,
    Exception inner
)
public InvalidAnnotationException(
    string message,
    Exception inner
)
Parameters
message
Type:   Online System String
Exception message.
inner
Type:   Online System Exception
Inner exception.
See Also
InvalidAnnotationException Class
InvalidAnnotationException Members
InvalidAnnotationException Overload
PostSharp.Extensibility Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


IPostSharpEnvironment Interface

IPostSharpEnvironment Interface PostSharp Documentation
Provides information about the current PostSharp environment.

Namespace: PostSharp.Extensibility
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
public interface IPostSharpEnvironment
public interface IPostSharpEnvironment
See Also
IPostSharpEnvironment Members
PostSharp.Extensibility Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


IPostSharpEnvironment Members

IPostSharpEnvironment Members PostSharp Documentation

The IPostSharpEnvironment type exposes the following members.
Methods
 | Name | Description
Public method | FindAssembly(AssemblyName) | Obsolete.
Public method | FindAssembly(AssemblyName, AssemblyLoadContext) | Finds the location of an assembly given its name.
Public method | LoadAssemblyFromFile | Loads an Online Assembly given its file name.
Back to Top
Properties
 | Name | Description
Public property | CurrentProject | Gets the currently executing project.
Back to Top
See Also
IPostSharpEnvironment Interface
PostSharp.Extensibility Namespace

Online Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


IPostSharpEnvironment Methods

IPostSharpEnvironment Methods PostSharp Documentation
The IPostSharpEnvironment type exposes the following members.
Methods
 | Name | Description
Public method | FindAssembly(AssemblyName) | Obsolete.
Public method | FindAssembly(AssemblyName, AssemblyLoadContext) | Finds the location of an assembly given its name.
Public method | LoadAssemblyFromFile | Loads an Online Assembly given its file name.
Back to Top
See Also
IPostSharpEnvironment Interface
PostSharp.Extensibility Namespace

Online Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


IPostSharpEnvironment.FindAssembly Method

IPostSharpEnvironment FindAssembly Method PostSharp Documentation
Overload List
 | Name | Description
Public method | FindAssembly(AssemblyName) | Obsolete.
Public method | FindAssembly(AssemblyName, AssemblyLoadContext) | Finds the location of an assembly given its name.
Back to Top
See Also
IPostSharpEnvironment Interface
IPostSharpEnvironment Members
PostSharp.Extensibility Namespace

Online Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


IPostSharpEnvironment.FindAssembly Method (AssemblyName)

IPostSharpEnvironment FindAssembly Method (AssemblyName) PostSharp Documentation

[Missing <summary> documentation for "M:PostSharp.Extensibility.IPostSharpEnvironment.FindAssembly(System.Reflection.AssemblyName)"]

Namespace: PostSharp.Extensibility
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
[ObsoleteAttribute("Use the second overload.")]
string FindAssembly(
    AssemblyName name
)
[ObsoleteAttribute("Use the second overload.")]
string FindAssembly(
    AssemblyName name
)
Parameters
name
Type:   Online System.Reflection AssemblyName
[Missing <param name="name"/> documentation for "M:PostSharp.Extensibility.IPostSharpEnvironment.FindAssembly(System.Reflection.AssemblyName)"]
Return Value
Type:   Online String
[Missing <returns> documentation for "M:PostSharp.Extensibility.IPostSharpEnvironment.FindAssembly(System.Reflection.AssemblyName)"]
See Also
IPostSharpEnvironment Interface
IPostSharpEnvironment Members
FindAssembly Overload
PostSharp.Extensibility Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


IPostSharpEnvironment.FindAssembly Method (AssemblyName, AssemblyLoadContext)

IPostSharpEnvironment FindAssembly Method (AssemblyName, AssemblyLoadContext) PostSharp Documentation
Finds the location of an assembly given its name.

Namespace: PostSharp.Extensibility
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
string FindAssembly(
    AssemblyName name,
    AssemblyLoadContext loadContext
)
string FindAssembly(
    AssemblyName name,
    AssemblyLoadContext loadContext
)
Parameters
name
Type:   Online System.Reflection AssemblyName
Assembly name.
loadContext
Type: PostSharp.Extensibility AssemblyLoadContext
Reference or Runtime.
Return Value
Type:   Online String
The full path of the assembly, or null if the assembly could not be found.
See Also
IPostSharpEnvironment Interface
IPostSharpEnvironment Members
FindAssembly Overload
PostSharp.Extensibility Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


IPostSharpEnvironment.LoadAssemblyFromFile Method

IPostSharpEnvironment LoadAssemblyFromFile Method PostSharp Documentation
Loads an Online Assembly given its file name.

Namespace: PostSharp.Extensibility
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
Assembly LoadAssemblyFromFile(
    string fileName
)
Assembly LoadAssemblyFromFile(
    string fileName
)
Parameters
fileName
Type:   Online System String
Full assembly path.
Return Value
Type:   Online Assembly
The   Online Assembly.
Remarks

                Use this method instead of   Online LoadFile(String).

  Note  Note

                You cannot load two assemblies with a different path and the same identity (strong name) into PostSharp.

See Also
IPostSharpEnvironment Interface
IPostSharpEnvironment Members
PostSharp.Extensibility Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


IPostSharpEnvironment Properties

IPostSharpEnvironment Properties PostSharp Documentation
The IPostSharpEnvironment type exposes the following members.
Properties
 | Name | Description
Public property | CurrentProject | Gets the currently executing project.
Back to Top
See Also
IPostSharpEnvironment Interface
PostSharp.Extensibility Namespace

Online Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


IPostSharpEnvironment.CurrentProject Property

IPostSharpEnvironment CurrentProject Property PostSharp Documentation
Gets the currently executing project.

Namespace: PostSharp.Extensibility
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
IProject CurrentProject { get; }
IProject CurrentProject { get; }
Property Value
Type: IProject

              The current project, or null if there is no current project.

See Also
IPostSharpEnvironment Interface
IPostSharpEnvironment Members
PostSharp.Extensibility Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


IProject Interface

IProject Interface PostSharp Documentation
Provides information about the currently executing project.

Namespace: PostSharp.Extensibility
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
public interface IProject
public interface IProject
See Also
IProject Members
PostSharp.Extensibility Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


IProject Members

IProject Members PostSharp Documentation

The IProject type exposes the following members.
Methods
 | Name | Description
Public method | EvaluateExpression | Evaluates an expression (that is, replace parameters by their actual value).
Public method | GetExtensionElements | Gets the set of project extension elements (ProjectExtensionElement) given their name and XML namespace.
Public method | GetFrameworkVariant | Obsolete. Gets the variant of the .NET Framework against which the .NET assembly currently processed is linked.
Public method | GetService T | Gets a build-time service exposed by PostSharp.
Public method | GetTargetAssembly | Gets the assembly that is being transformed by PostSharp.
Back to Top
Properties
 | Name | Description
Public property | TargetFramework | Gets the variant and version of the .NET Framework that the assembly being built targets.
Back to Top
See Also
IProject Interface
PostSharp.Extensibility Namespace

Online Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


IProject Methods

IProject Methods PostSharp Documentation
The IProject type exposes the following members.
Methods
 | Name | Description
Public method | EvaluateExpression | Evaluates an expression (that is, replace parameters by their actual value).
Public method | GetExtensionElements | Gets the set of project extension elements (ProjectExtensionElement) given their name and XML namespace.
Public method | GetFrameworkVariant | Obsolete. Gets the variant of the .NET Framework against which the .NET assembly currently processed is linked.
Public method | GetService T | Gets a build-time service exposed by PostSharp.
Public method | GetTargetAssembly | Gets the assembly that is being transformed by PostSharp.
Back to Top
See Also
IProject Interface
PostSharp.Extensibility Namespace

Online Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


IProject.EvaluateExpression Method

IProject EvaluateExpression Method PostSharp Documentation
Evaluates an expression (that is, replace parameters by their actual value).

Namespace: PostSharp.Extensibility
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
string EvaluateExpression(
    string expression
)
string EvaluateExpression(
    string expression
)
Parameters
expression
Type:   Online System String
An expression.
Return Value
Type:   Online String
The evaluated expression, or null if one parameter could not be
              resolved.
See Also
IProject Interface
IProject Members
PostSharp.Extensibility Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


IProject.GetExtensionElements Method

IProject GetExtensionElements Method PostSharp Documentation
Gets the set of project extension elements (ProjectExtensionElement) given their name and XML namespace.

Namespace: PostSharp.Extensibility
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
IEnumerable<ProjectExtensionElement> GetExtensionElements(
    string name,
    string ns
)
IEnumerable<ProjectExtensionElement> GetExtensionElements(
    string name,
    string ns
)
Parameters
name
Type:   Online System String
Local name of the project extension element.
ns
Type:   Online System String
XML namespace of the project extension element.
Return Value
Type:   Online IEnumerable  ProjectExtensionElement
The set of project elements named name in all loaded projects.
See Also
IProject Interface
IProject Members
PostSharp.Extensibility Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


IProject.GetFrameworkVariant Method

IProject GetFrameworkVariant Method PostSharp Documentation
Gets the variant of the .NET Framework against which the .NET assembly currently processed is linked.

Namespace: PostSharp.Extensibility
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
[ObsoleteAttribute("Use TargetDevice property.")]
string GetFrameworkVariant()
[ObsoleteAttribute("Use TargetDevice property.")]
string GetFrameworkVariant()
Return Value
Type:   Online String
A string uniquely identifying the framework variant, to be compared
              to the constants defined in the FrameworkVariants class.
              Actually, the public key token of mscorlib is returned.
See Also
IProject Interface
IProject Members
PostSharp.Extensibility Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


IProject.GetService(T) Method

IProject GetService T Method PostSharp Documentation
Gets a build-time service exposed by PostSharp.

Namespace: PostSharp.Extensibility
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
T GetService<T>(
    bool throwing = true
)
where T : class, IService
T GetService<T>(
    bool throwing = true
)
where T : class, IService
Parameters
throwing (Optional)
Type:   Online System Boolean
true wether an exception should be thrown in case the service cannot be acquired, otherwise false.
            The default value is true.
Type Parameters
T
An interface derived from IService.
Return Value
Type: T
The service T, or null if the service could not be acquired and throwing
            was set to false.
See Also
IProject Interface
IProject Members
PostSharp.Extensibility Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


IProject.GetTargetAssembly Method

IProject GetTargetAssembly Method PostSharp Documentation
Gets the assembly that is being transformed by PostSharp.

Namespace: PostSharp.Extensibility
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
Assembly GetTargetAssembly(
    bool reflectionOnly = false
)
Assembly GetTargetAssembly(
    bool reflectionOnly = false
)
Parameters
reflectionOnly (Optional)
Type:   Online System Boolean
false if the system   Online Assembly has to be returned, true if a wrapper has to be returned.
Return Value
Type:   Online Assembly
The assembly being processed. If reflectionOnly is true, this method returns an instance of a PostSharp internal
              type implementing the   Online Assembly interface. Otherwise, the reflection   Online Assembly is returned.
See Also
IProject Interface
IProject Members
PostSharp.Extensibility Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


IProject Properties

IProject Properties PostSharp Documentation
The IProject type exposes the following members.
Properties
 | Name | Description
Public property | TargetFramework | Gets the variant and version of the .NET Framework that the assembly being built targets.
Back to Top
See Also
IProject Interface
PostSharp.Extensibility Namespace

Online Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


IProject.TargetFramework Property

IProject TargetFramework Property PostSharp Documentation
Gets the variant and version of the .NET Framework that the assembly being built targets.

Namespace: PostSharp.Extensibility
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
ITargetFramework TargetFramework { get; }
ITargetFramework TargetFramework { get; }
Property Value
Type: ITargetFramework
See Also
IProject Interface
IProject Members
PostSharp.Extensibility Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


IReflectionBindingManagerService Interface

IReflectionBindingManagerService Interface PostSharp Documentation
Exposes the ResolveAssembly(Type) method, which gets the reference identity of the assembly declaring a given type.

Namespace: PostSharp.Extensibility
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
public interface IReflectionBindingManagerService : IService
public interface IReflectionBindingManagerService : IService
See Also
IReflectionBindingManagerService Members
PostSharp.Extensibility Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


IReflectionBindingManagerService Members

IReflectionBindingManagerService Members PostSharp Documentation

The IReflectionBindingManagerService type exposes the following members.
Methods
 | Name | Description
Public method | ResolveAssembly | Returns the reference identity of the assembly declaring a type.
Back to Top
See Also
IReflectionBindingManagerService Interface
PostSharp.Extensibility Namespace

Online Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


IReflectionBindingManagerService Methods

IReflectionBindingManagerService Methods PostSharp Documentation
The IReflectionBindingManagerService type exposes the following members.
Methods
 | Name | Description
Public method | ResolveAssembly | Returns the reference identity of the assembly declaring a type.
Back to Top
See Also
IReflectionBindingManagerService Interface
PostSharp.Extensibility Namespace

Online Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


IReflectionBindingManagerService.ResolveAssembly Method

IReflectionBindingManagerService ResolveAssembly Method PostSharp Documentation
Returns the reference identity of the assembly declaring a type.

Namespace: PostSharp.Extensibility
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
string ResolveAssembly(
    Type type
)
string ResolveAssembly(
    Type type
)
Parameters
type
Type:   Online System Type
A   Online Type.
Return Value
Type:   Online String
The identity of the reference assembly defining   Online Type. This assembly is possibly
            different than the runtime assembly, which is available from the   Online Assembly property
            of the   Online Type class. This method may return null if type is
            an internal type of a system assembly.
See Also
IReflectionBindingManagerService Interface
IReflectionBindingManagerService Members
PostSharp.Extensibility Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


IService Interface

IService Interface PostSharp Documentation
A service exposed by the build-time part of PostSharp.

Namespace: PostSharp.Extensibility
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
public interface IService
public interface IService
See Also
PostSharp.Extensibility Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


ITargetFramework Interface

ITargetFramework Interface PostSharp Documentation
Represents a version and variant of the .NET framework (running on a device) on which the project being built is design to run.

Namespace: PostSharp.Extensibility
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
public interface ITargetFramework
public interface ITargetFramework
See Also
ITargetFramework Members
PostSharp.Extensibility Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


ITargetFramework Members

ITargetFramework Members PostSharp Documentation

The ITargetFramework type exposes the following members.
Properties
 | Name | Description
Public property | FrameworkMoniker | Unique string identifier of the target device.
Public property | FrameworkProfile | Gets the target profile of the framework (e.g. WindowsPhone).
Public property | TargetFrameworkFamily | Identifier of the framework family (NetFramework, NetCore, Silverlight, NetPortable).
Public property | Version | Gets the version of the target profile.
Back to Top
See Also
ITargetFramework Interface
PostSharp.Extensibility Namespace

Online Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


ITargetFramework Properties

ITargetFramework Properties PostSharp Documentation
The ITargetFramework type exposes the following members.
Properties
 | Name | Description
Public property | FrameworkMoniker | Unique string identifier of the target device.
Public property | FrameworkProfile | Gets the target profile of the framework (e.g. WindowsPhone).
Public property | TargetFrameworkFamily | Identifier of the framework family (NetFramework, NetCore, Silverlight, NetPortable).
Public property | Version | Gets the version of the target profile.
Back to Top
See Also
ITargetFramework Interface
PostSharp.Extensibility Namespace

Online Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


ITargetFramework.FrameworkMoniker Property

ITargetFramework FrameworkMoniker Property PostSharp Documentation
Unique string identifier of the target device.

Namespace: PostSharp.Extensibility
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
string FrameworkMoniker { get; }
string FrameworkMoniker { get; }
Property Value
Type:   Online String
See Also
ITargetFramework Interface
ITargetFramework Members
PostSharp.Extensibility Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


ITargetFramework.FrameworkProfile Property

ITargetFramework FrameworkProfile Property PostSharp Documentation
Gets the target profile of the framework (e.g. WindowsPhone).

Namespace: PostSharp.Extensibility
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
string FrameworkProfile { get; }
string FrameworkProfile { get; }
Property Value
Type:   Online String
See Also
ITargetFramework Interface
ITargetFramework Members
PostSharp.Extensibility Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


ITargetFramework.TargetFrameworkFamily Property

ITargetFramework TargetFrameworkFamily Property PostSharp Documentation
Identifier of the framework family (NetFramework, NetCore, Silverlight, NetPortable).

Namespace: PostSharp.Extensibility
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
TargetFrameworkFamily TargetFrameworkFamily { get; }
TargetFrameworkFamily TargetFrameworkFamily { get; }
Property Value
Type: TargetFrameworkFamily
See Also
ITargetFramework Interface
ITargetFramework Members
PostSharp.Extensibility Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


ITargetFramework.Version Property

ITargetFramework Version Property PostSharp Documentation
Gets the version of the target profile.

Namespace: PostSharp.Extensibility
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
Version Version { get; }
Version Version { get; }
Property Value
Type:   Online Version
See Also
ITargetFramework Interface
ITargetFramework Members
PostSharp.Extensibility Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


IValidableAnnotation Interface

IValidableAnnotation Interface PostSharp Documentation
Interface that, when implemented by a custom attribute ( Online Attribute), causes PostSharp to invoke a validation method for every instance of that custom attribute.

Namespace: PostSharp.Extensibility
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
public interface IValidableAnnotation
public interface IValidableAnnotation
See Also
IValidableAnnotation Members
PostSharp.Extensibility Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


IValidableAnnotation Members

IValidableAnnotation Members PostSharp Documentation

The IValidableAnnotation type exposes the following members.
Methods
 | Name | Description
Public method | CompileTimeValidate | Method invoked at build time to ensure that the aspect has been applied to the right target.
Back to Top
See Also
IValidableAnnotation Interface
PostSharp.Extensibility Namespace

Online Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


IValidableAnnotation Methods

IValidableAnnotation Methods PostSharp Documentation
The IValidableAnnotation type exposes the following members.
Methods
 | Name | Description
Public method | CompileTimeValidate | Method invoked at build time to ensure that the aspect has been applied to the right target.
Back to Top
See Also
IValidableAnnotation Interface
PostSharp.Extensibility Namespace

Online Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


IValidableAnnotation.CompileTimeValidate Method

IValidableAnnotation CompileTimeValidate Method PostSharp Documentation
Method invoked at build time to ensure that the aspect has been applied to the right target.

Namespace: PostSharp.Extensibility
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
bool CompileTimeValidate(
    Object target
)
bool CompileTimeValidate(
    Object target
)
Parameters
target
Type:   Online System Object
Target element.
Return Value
Type:   Online Boolean
true if the aspect was applied to an acceptable target, otherwise
              false.
Remarks

              The implementation of this method is expected to emit an error message
              or an exception of type InvalidAnnotationException in case of error. Only returning false causes the aspect
              to be silently ignored.

See Also
IValidableAnnotation Interface
IValidableAnnotation Members
PostSharp.Extensibility Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


Message Class

Message Class PostSharp Documentation
Encapsulates a message (error, warning, info, ...).
Inheritance Hierarchy
Online System Object
PostSharp.Extensibility Message

Namespace: PostSharp.Extensibility
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
[SerializableAttribute]
public sealed class Message
[SerializableAttribute]
public sealed class Message
See Also
Message Members
PostSharp.Extensibility Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


Message Members

Message Members PostSharp Documentation

The Message type exposes the following members.
Constructors
 | Name | Description
Public method | Message(SeverityType, String, String, String) | Obsolete. Initializes a new Message and specifies only required parameters.
Public method | Message(MessageLocation, SeverityType, String, String, String, String, Exception) | Initializes a new Message and specifies all its properties.
Public method | Message(SeverityType, String, String, String, String, String, Int32, Int32, Exception) | Initializes a new Message and specifies all its properties.
Back to Top
Methods
Name | Description
GetExceptionStackMessage | Returns a string composed of the messages of all inner exceptions.
Back to Top
Fields
Name | Description
NotAvailable | When set to the LocationLine or the LocationColumn property, means that the value of this property is unknown.
Back to Top
Properties
 | Name | Description
Public property | HelpLink | Gets the help link.
Public property | InnerException | Gets the
Public property | Location | Location of the source code artifact causing the message.
Public property | LocationColumn | Gets the column in the file that caused the message.
Public property | LocationFile | Gets the name of the file that caused the message.
Public property | LocationLine | Gets the line in the file that caused the message.
Public property | MessageId | Gets the message type identifier.
Public property | MessageText | Gets the message formatted text.
Public property | Severity | Gets the message severity.
Public property | Source | Gets or sets the name of the source component.
Back to Top
See Also
Message Class
PostSharp.Extensibility Namespace

Online Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


Message Constructor

Message Constructor PostSharp Documentation
Overload List
 | Name | Description
Public method | Message(SeverityType, String, String, String) | Obsolete. Initializes a new Message and specifies only required parameters.
Public method | Message(MessageLocation, SeverityType, String, String, String, String, Exception) | Initializes a new Message and specifies all its properties.
Public method | Message(SeverityType, String, String, String, String, String, Int32, Int32, Exception) | Initializes a new Message and specifies all its properties.
Back to Top
See Also
Message Class
Message Members
PostSharp.Extensibility Namespace

Online Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


Message Constructor (SeverityType, String, String, String)

Message Constructor (SeverityType, String, String, String) PostSharp Documentation
Initializes a new Message and specifies only required parameters.

Namespace: PostSharp.Extensibility
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
[ObsoleteAttribute("Use an overload that accepts the target code element.")]
public Message(
    SeverityType severity,
    string messageId,
    string messageText,
    string source
)
[ObsoleteAttribute("Use an overload that accepts the target code element.")]
public Message(
    SeverityType severity,
    string messageId,
    string messageText,
    string source
)
Parameters
severity
Type: PostSharp.Extensibility SeverityType
Message severify (fatal error, error, info, debug).
messageId
Type:   Online System String
Identifier of the message type.
messageText
Type:   Online System String
Fully formatted message text.
source
Type:   Online System String
Name of the component emitting the message.
See Also
Message Class
Message Members
Message Overload
PostSharp.Extensibility Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


Message Constructor (MessageLocation, SeverityType, String, String, String, String, Exception)

Message Constructor (MessageLocation, SeverityType, String, String, String, String, Exception) PostSharp Documentation
Initializes a new Message and specifies all its properties.

Namespace: PostSharp.Extensibility
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
public Message(
    MessageLocation location,
    SeverityType severity,
    string messageId,
    string messageText,
    string helpLink,
    string source,
    Exception innerException
)
public Message(
    MessageLocation location,
    SeverityType severity,
    string messageId,
    string messageText,
    string helpLink,
    string source,
    Exception innerException
)
Parameters
location
Type: PostSharp MessageLocation
Element of code (  Online Assembly,   Online Type,   Online MethodInfo,
              Online ConstructorInfo,   Online PropertyInfo,   Online EventInfo or   Online ParameterInfo)
            to which the message applies. When called from PostSharp.Sdk, the parameter can also contain a MetadataDeclaration.
severity
Type: PostSharp.Extensibility SeverityType
Message severify (fatal error, error, info, debug).
messageId
Type:   Online System String
Identifier of the message type.
messageText
Type:   Online System String
Fully formatted message text.
helpLink
Type:   Online System String
Link to the help file page associated to this message.
source
Type:   Online System String
Name of the component emitting the message.
innerException
Type:   Online System Exception
The   Online Exception that caused this message,
              or null if this message was not caused by an
              exception.
See Also
Message Class
Message Members
Message Overload
PostSharp.Extensibility Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


Message Constructor (SeverityType, String, String, String, String, String, Int32, Int32, Exception)

Message Constructor (SeverityType, String, String, String, String, String, Int32, Int32, Exception) PostSharp Documentation
Initializes a new Message and specifies all its properties.

Namespace: PostSharp.Extensibility
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
public Message(
    SeverityType severity,
    string messageId,
    string messageText,
    string helpLink,
    string source,
    string locationFile,
    int locationLine,
    int locationColumn,
    Exception innerException
)
public Message(
    SeverityType severity,
    string messageId,
    string messageText,
    string helpLink,
    string source,
    string locationFile,
    int locationLine,
    int locationColumn,
    Exception innerException
)
Parameters
severity
Type: PostSharp.Extensibility SeverityType
Message severify (fatal error, error, info, debug).
messageId
Type:   Online System String
Identifier of the message type.
messageText
Type:   Online System String
Fully formatted message text.
helpLink
Type:   Online System String
Link to the help file page associated to this message.
source
Type:   Online System String
Name of the component emitting the message.
locationFile
Type:   Online System String
File that caused the error, or null if
              the file is unknown or does not apply.
locationLine
Type:   Online System Int32
 Position (line) in the file that caused the error,
              or NotAvailable if the line is
              unknown or does not apply.
locationColumn
Type:   Online System Int32
Position (column) in the file that caused the error,
              or NotAvailable if the line is
              unknown or does not apply.
innerException
Type:   Online System Exception
The   Online Exception that caused this message,
              or null if this message was not caused by an
              exception.
See Also
Message Class
Message Members
Message Overload
PostSharp.Extensibility Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


Message Fields

Message Fields PostSharp Documentation
The Message type exposes the following members.
Fields
Name | Description
NotAvailable | When set to the LocationLine or the LocationColumn property, means that the value of this property is unknown.
Back to Top
See Also
Message Class
PostSharp.Extensibility Namespace

Online Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


Message.NotAvailable Field

Message NotAvailable Field PostSharp Documentation
When set to the LocationLine or the LocationColumn property, means that the value of this property is unknown.

Namespace: PostSharp.Extensibility
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
public const int NotAvailable
public const int NotAvailable
Field Value
Type:   Online Int32
See Also
Message Class
Message Members
PostSharp.Extensibility Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


Message Methods

Message Methods PostSharp Documentation
The Message type exposes the following members.
Methods
Name | Description
GetExceptionStackMessage | Returns a string composed of the messages of all inner exceptions.
Back to Top
See Also
Message Class
PostSharp.Extensibility Namespace

Online Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


Message.GetExceptionStackMessage Method

Message GetExceptionStackMessage Method PostSharp Documentation
Returns a string composed of the messages of all inner exceptions.

Namespace: PostSharp.Extensibility
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
public static string GetExceptionStackMessage(
    Exception outerException
)
public static string GetExceptionStackMessage(
    Exception outerException
)
Parameters
outerException
Type:   Online System Exception
The outer exception.
Return Value
Type:   Online String
A string composed of the mesages of all
              outerException and all inner exceptions,
              concatenated by the string -->.
See Also
Message Class
Message Members
PostSharp.Extensibility Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


Message Properties

Message Properties PostSharp Documentation
The Message type exposes the following members.
Properties
 | Name | Description
Public property | HelpLink | Gets the help link.
Public property | InnerException | Gets the
Public property | Location | Location of the source code artifact causing the message.
Public property | LocationColumn | Gets the column in the file that caused the message.
Public property | LocationFile | Gets the name of the file that caused the message.
Public property | LocationLine | Gets the line in the file that caused the message.
Public property | MessageId | Gets the message type identifier.
Public property | MessageText | Gets the message formatted text.
Public property | Severity | Gets the message severity.
Public property | Source | Gets or sets the name of the source component.
Back to Top
See Also
Message Class
PostSharp.Extensibility Namespace

Online Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


Message.HelpLink Property

Message HelpLink Property PostSharp Documentation
Gets the help link.

Namespace: PostSharp.Extensibility
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
public string HelpLink { get; private set; }
public string HelpLink { get; private set; }
Property Value
Type:   Online String
See Also
Message Class
Message Members
PostSharp.Extensibility Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


Message.InnerException Property

Message InnerException Property PostSharp Documentation
Gets the

Namespace: PostSharp.Extensibility
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
public Exception InnerException { get; private set; }
public Exception InnerException { get; private set; }
Property Value
Type:   Online Exception
See Also
Message Class
Message Members
PostSharp.Extensibility Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


Message.Location Property

Message Location Property PostSharp Documentation
Location of the source code artifact causing the message.

Namespace: PostSharp.Extensibility
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
public MessageLocation Location { get; }
public MessageLocation Location { get; }
Property Value
Type: MessageLocation
See Also
Message Class
Message Members
PostSharp.Extensibility Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


Message.LocationColumn Property

Message LocationColumn Property PostSharp Documentation
Gets the column in the file that caused the message.
An integer greater or equal to 1, or NotAvailable if the column is unknown or does not apply.

Namespace: PostSharp.Extensibility
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
public int LocationColumn { get; }
public int LocationColumn { get; }
Property Value
Type:   Online Int32
See Also
Message Class
Message Members
PostSharp.Extensibility Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


Message.LocationFile Property

Message LocationFile Property PostSharp Documentation
Gets the name of the file that caused the message.

Namespace: PostSharp.Extensibility
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
public string LocationFile { get; }
public string LocationFile { get; }
Property Value
Type:   Online String

              A full file name, or null if the file name
              is unknown or not applicable.

See Also
Message Class
Message Members
PostSharp.Extensibility Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


Message.LocationLine Property

Message LocationLine Property PostSharp Documentation
Gets the line in the file that caused the message.
An integer greater or equal to 1, or NotAvailable if the line is unknown or does not apply.

Namespace: PostSharp.Extensibility
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
public int LocationLine { get; }
public int LocationLine { get; }
Property Value
Type:   Online Int32
See Also
Message Class
Message Members
PostSharp.Extensibility Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


Message.MessageId Property

Message MessageId Property PostSharp Documentation
Gets the message type identifier.

Namespace: PostSharp.Extensibility
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
public string MessageId { get; private set; }
public string MessageId { get; private set; }
Property Value
Type:   Online String
See Also
Message Class
Message Members
PostSharp.Extensibility Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


Message.MessageText Property

Message MessageText Property PostSharp Documentation
Gets the message formatted text.

Namespace: PostSharp.Extensibility
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
public string MessageText { get; private set; }
public string MessageText { get; private set; }
Property Value
Type:   Online String
See Also
Message Class
Message Members
PostSharp.Extensibility Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


Message.Severity Property

Message Severity Property PostSharp Documentation
Gets the message severity.

Namespace: PostSharp.Extensibility
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
public SeverityType Severity { get; internal set; }
public SeverityType Severity { get; internal set; }
Property Value
Type: SeverityType
See Also
Message Class
Message Members
PostSharp.Extensibility Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


Message.Source Property

Message Source Property PostSharp Documentation
Gets or sets the name of the source component.

Namespace: PostSharp.Extensibility
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
public string Source { get; private set; }
public string Source { get; private set; }
Property Value
Type:   Online String
See Also
Message Class
Message Members
PostSharp.Extensibility Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


MessageDispenser Class

MessageDispenser Class PostSharp Documentation
Provides a base implementation of IMessageDispenser where the message key is supposed to be in format PRE0000, where PRE is a prefix and 0000 is an integer. Keys for help URLs have the format PRE0000?.
Inheritance Hierarchy
Online System Object
PostSharp.Extensibility MessageDispenser

Namespace: PostSharp.Extensibility
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
public abstract class MessageDispenser : IMessageDispenser
public abstract class MessageDispenser : IMessageDispenser
See Also
MessageDispenser Members
PostSharp.Extensibility Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


MessageDispenser Members

MessageDispenser Members PostSharp Documentation

The MessageDispenser type exposes the following members.
Constructors
 | Name | Description
Protected method | MessageDispenser | Initializes a new MessageDispenser.
Back to Top
Methods
 | Name | Description
Protected method | GetHelpUrl | Gets the message help URL of a given number.
Protected method | GetMessage(Int32) | Gets the message text of a given number.
Public method | GetMessage(String) | Gets a message text given a message key.
Back to Top
Properties
 | Name | Description
Public property | Prefix | Gets the message prefix.
Back to Top
See Also
MessageDispenser Class
PostSharp.Extensibility Namespace

Online Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


MessageDispenser Constructor

MessageDispenser Constructor PostSharp Documentation
Initializes a new MessageDispenser.

Namespace: PostSharp.Extensibility
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
protected MessageDispenser(
    string prefix
)
protected MessageDispenser(
    string prefix
)
Parameters
prefix
Type:   Online System String
Prefix of all messages provided by the new dispenser.
See Also
MessageDispenser Class
MessageDispenser Members
PostSharp.Extensibility Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


MessageDispenser Methods

MessageDispenser Methods PostSharp Documentation
The MessageDispenser type exposes the following members.
Methods
 | Name | Description
Protected method | GetHelpUrl | Gets the message help URL of a given number.
Protected method | GetMessage(Int32) | Gets the message text of a given number.
Public method | GetMessage(String) | Gets a message text given a message key.
Back to Top
See Also
MessageDispenser Class
PostSharp.Extensibility Namespace

Online Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


MessageDispenser.GetHelpUrl Method

MessageDispenser GetHelpUrl Method PostSharp Documentation
Gets the message help URL of a given number.

Namespace: PostSharp.Extensibility
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
protected virtual string GetHelpUrl(
    int number
)
protected virtual string GetHelpUrl(
    int number
)
Parameters
number
Type:   Online System Int32
Message number.
Return Value
Type:   Online String
The message help URL corresponding to number.
See Also
MessageDispenser Class
MessageDispenser Members
PostSharp.Extensibility Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


MessageDispenser.GetMessage Method

MessageDispenser GetMessage Method PostSharp Documentation
Overload List
 | Name | Description
Protected method | GetMessage(Int32) | Gets the message text of a given number.
Public method | GetMessage(String) | Gets a message text given a message key.
Back to Top
See Also
MessageDispenser Class
MessageDispenser Members
PostSharp.Extensibility Namespace

Online Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


MessageDispenser.GetMessage Method (Int32)

MessageDispenser GetMessage Method (Int32) PostSharp Documentation
Gets the message text of a given number.

Namespace: PostSharp.Extensibility
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
protected abstract string GetMessage(
    int number
)
protected abstract string GetMessage(
    int number
)
Parameters
number
Type:   Online System Int32
Message number.
Return Value
Type:   Online String
The message text corresponding to number.
See Also
MessageDispenser Class
MessageDispenser Members
GetMessage Overload
PostSharp.Extensibility Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


MessageDispenser.GetMessage Method (String)

MessageDispenser GetMessage Method (String) PostSharp Documentation
Gets a message text given a message key.

Namespace: PostSharp.Extensibility
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
public string GetMessage(
    string key
)
public string GetMessage(
    string key
)
Parameters
key
Type:   Online System String
Message key.
Return Value
Type:   Online String
The rext corresponding to key.
Implements
IMessageDispenser GetMessage(String)
See Also
MessageDispenser Class
MessageDispenser Members
GetMessage Overload
PostSharp.Extensibility Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


MessageDispenser Properties

MessageDispenser Properties PostSharp Documentation
The MessageDispenser type exposes the following members.
Properties
 | Name | Description
Public property | Prefix | Gets the message prefix.
Back to Top
See Also
MessageDispenser Class
PostSharp.Extensibility Namespace

Online Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


MessageDispenser.Prefix Property

MessageDispenser Prefix Property PostSharp Documentation
Gets the message prefix.

Namespace: PostSharp.Extensibility
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
public string Prefix { get; private set; }
public string Prefix { get; private set; }
Property Value
Type:   Online String
See Also
MessageDispenser Class
MessageDispenser Members
PostSharp.Extensibility Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


MessageException Class

MessageException Class PostSharp Documentation
Exception embedding a Message.
Inheritance Hierarchy
Online System Object
Online System Exception
PostSharp.Extensibility MessageException

Namespace: PostSharp.Extensibility
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
[SerializableAttribute]
public sealed class MessageException : Exception
[SerializableAttribute]
public sealed class MessageException : Exception
See Also
MessageException Members
PostSharp.Extensibility Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


MessageException Members

MessageException Members PostSharp Documentation

The MessageException type exposes the following members.
Constructors
 | Name | Description
Public method | MessageException | Initializes a new MessageException from an existing Message.
Back to Top
Methods
 | Name | Description
Public method | GetObjectData | Serializes the current object. (Overrides Online Exception GetObjectData(SerializationInfo, StreamingContext).)
Back to Top
Properties
 | Name | Description
Public property | MessageObject | Gets the Message em
Back to Top
See Also
MessageException Class
PostSharp.Extensibility Namespace

Online Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


MessageException Constructor

MessageException Constructor PostSharp Documentation
Initializes a new MessageException from an existing Message.

Namespace: PostSharp.Extensibility
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
public MessageException(
    Message message
)
public MessageException(
    Message message
)
Parameters
message
Type: PostSharp.Extensibility Message
A Message.
See Also
MessageException Class
MessageException Members
PostSharp.Extensibility Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


MessageException Methods

MessageException Methods PostSharp Documentation
The MessageException type exposes the following members.
Methods
 | Name | Description
Public method | GetObjectData | Serializes the current object. (Overrides Online Exception GetObjectData(SerializationInfo, StreamingContext).)
Back to Top
See Also
MessageException Class
PostSharp.Extensibility Namespace

Online Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


MessageException.GetObjectData Method

MessageException GetObjectData Method PostSharp Documentation
Serializes the current object.

Namespace: PostSharp.Extensibility
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
public override void GetObjectData(
    SerializationInfo info,
    StreamingContext context
)
public override void GetObjectData(
    SerializationInfo info,
    StreamingContext context
)
Parameters
info
Type:   Online System.Runtime.Serialization SerializationInfo
Serialization information.
context
Type:   Online System.Runtime.Serialization StreamingContext
Serialization context.
Implements
  Online ISerializable GetObjectData(SerializationInfo, StreamingContext)
  Online _Exception GetObjectData(SerializationInfo, StreamingContext)
See Also
MessageException Class
MessageException Members
PostSharp.Extensibility Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


MessageException Properties

MessageException Properties PostSharp Documentation
The MessageException type exposes the following members.
Properties
 | Name | Description
Public property | MessageObject | Gets the Message em
Back to Top
See Also
MessageException Class
PostSharp.Extensibility Namespace

Online Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


MessageException.MessageObject Property

MessageException MessageObject Property PostSharp Documentation
Gets the Message em

Namespace: PostSharp.Extensibility
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
public Message MessageObject { get; }
public Message MessageObject { get; }
Property Value
Type: Message
See Also
MessageException Class
MessageException Members
PostSharp.Extensibility Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


MessageSource Class

MessageSource Class PostSharp Documentation
Provides commodity methods to work with an IMessageSink.
Inheritance Hierarchy
Online System Object
Online System MarshalByRefObject
PostSharp.Extensibility MessageSource

Namespace: PostSharp.Extensibility
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
public class MessageSource : MarshalByRefObject,
    IMessageSink
public class MessageSource : MarshalByRefObject,
    IMessageSink
See Also
MessageSource Members
PostSharp.Extensibility Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


MessageSource Members

MessageSource Members PostSharp Documentation

The MessageSource type exposes the following members.
Constructors
 | Name | Description
Public method | MessageSource(String, IMessageDispenser) | Initializes a new MessageSource backed by a IMessageDispenser.
Public method | MessageSource(String, ResourceManager) | Obsolete. Initializes a new instance of the MessageSource class
Back to Top
Methods
 | Name | Description
Public method | Write(Message) | Writes a message to the sink.
Public method | Write(SeverityType, String, Object ) | Obsolete.
Public method | Write(Assembly, SeverityType, String, Object ) | Emits a Message.
Public method | Write(MemberInfo, SeverityType, String, Object ) | Emits a Message.
Public method | Write(ParameterInfo, SeverityType, String, Object ) | Emits a Message.
Public method | Write(MessageLocation, SeverityType, String, Object ) | Emits a Message.
Public method | Write(SeverityType, String, Object , SymbolSequencePoint) | Obsolete.
Public method | Write(SeverityType, String, Object , String) | Obsolete.
Public method | Write(MessageLocation, SeverityType, String, Exception, Object ) | Emits a Message and specifies an inner Online Exception.
Public method | Write(SeverityType, String, Object , String, Int32) | Obsolete.
Public method | Write(SeverityType, String, Object , String, Int32, Int32) | Obsolete.
Public method | Write(SeverityType, String, Object , String, Int32, Int32, Exception) | Obsolete.
Back to Top
Properties
Name | Description
MessageSink | Gets the current message sink.
Back to Top
See Also
MessageSource Class
PostSharp.Extensibility Namespace

Online Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


MessageSource Constructor

MessageSource Constructor PostSharp Documentation
Overload List
 | Name | Description
Public method | MessageSource(String, IMessageDispenser) | Initializes a new MessageSource backed by a IMessageDispenser.
Public method | MessageSource(String, ResourceManager) | Obsolete. Initializes a new instance of the MessageSource class
Back to Top
See Also
MessageSource Class
MessageSource Members
PostSharp.Extensibility Namespace

Online Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


MessageSource Constructor (String, IMessageDispenser)

MessageSource Constructor (String, IMessageDispenser) PostSharp Documentation
Initializes a new MessageSource backed by a IMessageDispenser.

Namespace: PostSharp.Extensibility
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
public MessageSource(
    string source,
    IMessageDispenser messageDispenser
)
public MessageSource(
    string source,
    IMessageDispenser messageDispenser
)
Parameters
source
Type:   Online System String
Name of the component emitting. the messages.
messageDispenser
Type: PostSharp.Extensibility IMessageDispenser
The IMessageDispenser that will be used to
              retrieve message texts.
See Also
MessageSource Class
MessageSource Members
MessageSource Overload
PostSharp.Extensibility Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


MessageSource Constructor (String, ResourceManager)

MessageSource Constructor (String, ResourceManager) PostSharp Documentation
Initializes a new instance of the MessageSource class

Namespace: PostSharp.Extensibility
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
[ObsoleteAttribute("For optimal performance, use a MessageSource backed by an IMessageDispenser.")]
public MessageSource(
    string source,
    ResourceManager resourceManager
)
[ObsoleteAttribute("For optimal performance, use a MessageSource backed by an IMessageDispenser.")]
public MessageSource(
    string source,
    ResourceManager resourceManager
)
Parameters
source
Type:   Online System String
[Missing <param name="source"/> documentation for "M:PostSharp.Extensibility.MessageSource.#ctor(System.String,System.Resources.ResourceManager)"]
resourceManager
Type:   Online System.Resources ResourceManager
[Missing <param name="resourceManager"/> documentation for "M:PostSharp.Extensibility.MessageSource.#ctor(System.String,System.Resources.ResourceManager)"]
See Also
MessageSource Class
MessageSource Members
MessageSource Overload
PostSharp.Extensibility Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


MessageSource Methods

MessageSource Methods PostSharp Documentation
Methods
 | Name | Description
Public method | Write(Message) | Writes a message to the sink.
Public method | Write(SeverityType, String, Object ) | Obsolete.
Public method | Write(Assembly, SeverityType, String, Object ) | Emits a Message.
Public method | Write(MemberInfo, SeverityType, String, Object ) | Emits a Message.
Public method | Write(ParameterInfo, SeverityType, String, Object ) | Emits a Message.
Public method | Write(MessageLocation, SeverityType, String, Object ) | Emits a Message.
Public method | Write(SeverityType, String, Object , SymbolSequencePoint) | Obsolete.
Public method | Write(SeverityType, String, Object , String) | Obsolete.
Public method | Write(MessageLocation, SeverityType, String, Exception, Object ) | Emits a Message and specifies an inner Online Exception.
Public method | Write(SeverityType, String, Object , String, Int32) | Obsolete.
Public method | Write(SeverityType, String, Object , String, Int32, Int32) | Obsolete.
Public method | Write(SeverityType, String, Object , String, Int32, Int32, Exception) | Obsolete.
Back to Top
See Also
MessageSource Class
PostSharp.Extensibility Namespace

Online Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


MessageSource.Write Method

MessageSource Write Method PostSharp Documentation
Overload List
 | Name | Description
Public method | Write(Message) | Writes a message to the sink.
Public method | Write(SeverityType, String, Object ) | Obsolete.
Public method | Write(Assembly, SeverityType, String, Object ) | Emits a Message.
Public method | Write(MemberInfo, SeverityType, String, Object ) | Emits a Message.
Public method | Write(ParameterInfo, SeverityType, String, Object ) | Emits a Message.
Public method | Write(MessageLocation, SeverityType, String, Object ) | Emits a Message.
Public method | Write(SeverityType, String, Object , SymbolSequencePoint) | Obsolete.
Public method | Write(SeverityType, String, Object , String) | Obsolete.
Public method | Write(MessageLocation, SeverityType, String, Exception, Object ) | Emits a Message and specifies an inner Online Exception.
Public method | Write(SeverityType, String, Object , String, Int32) | Obsolete.
Public method | Write(SeverityType, String, Object , String, Int32, Int32) | Obsolete.
Public method | Write(SeverityType, String, Object , String, Int32, Int32, Exception) | Obsolete.
Back to Top
See Also
MessageSource Class
MessageSource Members
PostSharp.Extensibility Namespace

Online Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


MessageSource.Write Method (Message)

MessageSource Write Method (Message) PostSharp Documentation
Writes a message to the sink.

Namespace: PostSharp.Extensibility
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
public void Write(
    Message message
)
public void Write(
    Message message
)
Parameters
message
Type: PostSharp.Extensibility Message
A message.
Implements
IMessageSink Write(Message)
See Also
MessageSource Class
MessageSource Members
Write Overload
PostSharp.Extensibility Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


MessageSource.Write Method (SeverityType, String, Object[])

MessageSource Write Method (SeverityType, String, Object ) PostSharp Documentation

[Missing <summary> documentation for "M:PostSharp.Extensibility.MessageSource.Write(PostSharp.Extensibility.SeverityType,System.String,System.Object[])"]

Namespace: PostSharp.Extensibility
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
[ObsoleteAttribute("Use an overload that specifies the error location.")]
public void Write(
    SeverityType severity,
    string messageId,
    Object[] arguments
)
[ObsoleteAttribute("Use an overload that specifies the error location.")]
public void Write(
    SeverityType severity,
    string messageId,
    Object[] arguments
)
Parameters
severity
Type: PostSharp.Extensibility SeverityType
[Missing <param name="severity"/> documentation for "M:PostSharp.Extensibility.MessageSource.Write(PostSharp.Extensibility.SeverityType,System.String,System.Object[])"]
messageId
Type:   Online System String
[Missing <param name="messageId"/> documentation for "M:PostSharp.Extensibility.MessageSource.Write(PostSharp.Extensibility.SeverityType,System.String,System.Object[])"]
arguments
Type:    Online System Object
[Missing <param name="arguments"/> documentation for "M:PostSharp.Extensibility.MessageSource.Write(PostSharp.Extensibility.SeverityType,System.String,System.Object[])"]
See Also
MessageSource Class
MessageSource Members
Write Overload
PostSharp.Extensibility Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


MessageSource.Write Method (Assembly, SeverityType, String, Object[])

MessageSource Write Method (Assembly, SeverityType, String, Object ) PostSharp Documentation
Emits a Message.

Namespace: PostSharp.Extensibility
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
public void Write(
    Assembly codeElement,
    SeverityType severity,
    string messageId,
    params Object[] arguments
)
public void Write(
    Assembly codeElement,
    SeverityType severity,
    string messageId,
    params Object[] arguments
)
Parameters
codeElement
Type:   Online System.Reflection Assembly
Source code artifact that caused the message.
severity
Type: PostSharp.Extensibility SeverityType
Message severity (fatal error, error, info, debug).
messageId
Type:   Online System String
Identifier of the message type.
arguments
Type:    Online System Object
Array of arguments used to format the message text,
              or null if this message has no argument.
See Also
MessageSource Class
MessageSource Members
Write Overload
PostSharp.Extensibility Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


MessageSource.Write Method (MemberInfo, SeverityType, String, Object[])

MessageSource Write Method (MemberInfo, SeverityType, String, Object ) PostSharp Documentation
Emits a Message.

Namespace: PostSharp.Extensibility
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
public void Write(
    MemberInfo codeElement,
    SeverityType severity,
    string messageId,
    params Object[] arguments
)
public void Write(
    MemberInfo codeElement,
    SeverityType severity,
    string messageId,
    params Object[] arguments
)
Parameters
codeElement
Type:   Online System.Reflection MemberInfo
Source code artifact (  Online Type,   Online MethodInfo,   Online ConstructorInfo,
              Online FieldInfo,   Online EventInfo,   Online PropertyInfo) that caused the message.
severity
Type: PostSharp.Extensibility SeverityType
Message severity (fatal error, error, info, debug).
messageId
Type:   Online System String
Identifier of the message type.
arguments
Type:    Online System Object
Array of arguments used to format the message text,
              or null if this message has no argument.
See Also
MessageSource Class
MessageSource Members
Write Overload
PostSharp.Extensibility Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


MessageSource.Write Method (ParameterInfo, SeverityType, String, Object[])

MessageSource Write Method (ParameterInfo, SeverityType, String, Object ) PostSharp Documentation
Emits a Message.

Namespace: PostSharp.Extensibility
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
public void Write(
    ParameterInfo codeElement,
    SeverityType severity,
    string messageId,
    params Object[] arguments
)
public void Write(
    ParameterInfo codeElement,
    SeverityType severity,
    string messageId,
    params Object[] arguments
)
Parameters
codeElement
Type:   Online System.Reflection ParameterInfo
Source code artifact that caused the message.
severity
Type: PostSharp.Extensibility SeverityType
Message severity (fatal error, error, info, debug).
messageId
Type:   Online System String
Identifier of the message type.
arguments
Type:    Online System Object
Array of arguments used to format the message text,
              or null if this message has no argument.
See Also
MessageSource Class
MessageSource Members
Write Overload
PostSharp.Extensibility Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


MessageSource.Write Method (MessageLocation, SeverityType, String, Object[])

MessageSource Write Method (MessageLocation, SeverityType, String, Object ) PostSharp Documentation
Emits a Message.

Namespace: PostSharp.Extensibility
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
public void Write(
    MessageLocation location,
    SeverityType severity,
    string messageId,
    params Object[] arguments
)
public void Write(
    MessageLocation location,
    SeverityType severity,
    string messageId,
    params Object[] arguments
)
Parameters
location
Type: PostSharp MessageLocation
Location of the source code artifact that caused the message.
severity
Type: PostSharp.Extensibility SeverityType
Message severity (fatal error, error, info, debug).
messageId
Type:   Online System String
Identifier of the message type.
arguments
Type:    Online System Object
Array of arguments used to format the message text,
              or null if this message has no argument.
See Also
MessageSource Class
MessageSource Members
Write Overload
PostSharp.Extensibility Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


MessageSource.Write Method (SeverityType, String, Object[], SymbolSequencePoint)

MessageSource Write Method (SeverityType, String, Object , SymbolSequencePoint) PostSharp Documentation

[Missing <summary> documentation for "M:PostSharp.Extensibility.MessageSource.Write(PostSharp.Extensibility.SeverityType,System.String,System.Object[],PostSharp.Reflection.SymbolSequencePoint)"]

Namespace: PostSharp.Extensibility
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
[ObsoleteAttribute("Use an overload accepting a MessageLocation object.")]
public void Write(
    SeverityType severity,
    string messageId,
    Object[] arguments,
    SymbolSequencePoint symbolSequencePoint
)
[ObsoleteAttribute("Use an overload accepting a MessageLocation object.")]
public void Write(
    SeverityType severity,
    string messageId,
    Object[] arguments,
    SymbolSequencePoint symbolSequencePoint
)
Parameters
severity
Type: PostSharp.Extensibility SeverityType
[Missing <param name="severity"/> documentation for "M:PostSharp.Extensibility.MessageSource.Write(PostSharp.Extensibility.SeverityType,System.String,System.Object[],PostSharp.Reflection.SymbolSequencePoint)"]
messageId
Type:   Online System String
[Missing <param name="messageId"/> documentation for "M:PostSharp.Extensibility.MessageSource.Write(PostSharp.Extensibility.SeverityType,System.String,System.Object[],PostSharp.Reflection.SymbolSequencePoint)"]
arguments
Type:    Online System Object
[Missing <param name="arguments"/> documentation for "M:PostSharp.Extensibility.MessageSource.Write(PostSharp.Extensibility.SeverityType,System.String,System.Object[],PostSharp.Reflection.SymbolSequencePoint)"]
symbolSequencePoint
Type: PostSharp.Reflection SymbolSequencePoint
[Missing <param name="symbolSequencePoint"/> documentation for "M:PostSharp.Extensibility.MessageSource.Write(PostSharp.Extensibility.SeverityType,System.String,System.Object[],PostSharp.Reflection.SymbolSequencePoint)"]
See Also
MessageSource Class
MessageSource Members
Write Overload
PostSharp.Extensibility Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


MessageSource.Write Method (SeverityType, String, Object[], String)

MessageSource Write Method (SeverityType, String, Object , String) PostSharp Documentation

[Missing <summary> documentation for "M:PostSharp.Extensibility.MessageSource.Write(PostSharp.Extensibility.SeverityType,System.String,System.Object[],System.String)"]

Namespace: PostSharp.Extensibility
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
[ObsoleteAttribute("Use an overload accepting a MessageLocation object.")]
public void Write(
    SeverityType severity,
    string messageId,
    Object[] arguments,
    string locationFile
)
[ObsoleteAttribute("Use an overload accepting a MessageLocation object.")]
public void Write(
    SeverityType severity,
    string messageId,
    Object[] arguments,
    string locationFile
)
Parameters
severity
Type: PostSharp.Extensibility SeverityType
[Missing <param name="severity"/> documentation for "M:PostSharp.Extensibility.MessageSource.Write(PostSharp.Extensibility.SeverityType,System.String,System.Object[],System.String)"]
messageId
Type:   Online System String
[Missing <param name="messageId"/> documentation for "M:PostSharp.Extensibility.MessageSource.Write(PostSharp.Extensibility.SeverityType,System.String,System.Object[],System.String)"]
arguments
Type:    Online System Object
[Missing <param name="arguments"/> documentation for "M:PostSharp.Extensibility.MessageSource.Write(PostSharp.Extensibility.SeverityType,System.String,System.Object[],System.String)"]
locationFile
Type:   Online System String
[Missing <param name="locationFile"/> documentation for "M:PostSharp.Extensibility.MessageSource.Write(PostSharp.Extensibility.SeverityType,System.String,System.Object[],System.String)"]
See Also
MessageSource Class
MessageSource Members
Write Overload
PostSharp.Extensibility Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


MessageSource.Write Method (MessageLocation, SeverityType, String, Exception, Object[])

MessageSource Write Method (MessageLocation, SeverityType, String, Exception, Object ) PostSharp Documentation
Emits a Message and specifies an inner Online Exception.

Namespace: PostSharp.Extensibility
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
public void Write(
    MessageLocation location,
    SeverityType severity,
    string messageId,
    Exception innerException,
    params Object[] arguments
)
public void Write(
    MessageLocation location,
    SeverityType severity,
    string messageId,
    Exception innerException,
    params Object[] arguments
)
Parameters
location
Type: PostSharp MessageLocation
Location of the source code artifact that caused the message.
severity
Type: PostSharp.Extensibility SeverityType
Message severity (fatal error, error, info, debug).
messageId
Type:   Online System String
Identifier of the message type.
innerException
Type:   Online System Exception
The   Online Exception that caused this message,
              or null if this message was not caused by an
              exception.
arguments
Type:    Online System Object
Array of arguments used to format the message text,
              or null if this message has no argument.
See Also
MessageSource Class
MessageSource Members
Write Overload
PostSharp.Extensibility Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


MessageSource.Write Method (SeverityType, String, Object[], String, Int32)

MessageSource Write Method (SeverityType, String, Object , String, Int32) PostSharp Documentation

[Missing <summary> documentation for "M:PostSharp.Extensibility.MessageSource.Write(PostSharp.Extensibility.SeverityType,System.String,System.Object[],System.String,System.Int32)"]

Namespace: PostSharp.Extensibility
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
[ObsoleteAttribute("Use an overload accepting a MessageLocation object.")]
public void Write(
    SeverityType severity,
    string messageId,
    Object[] arguments,
    string locationFile,
    int locationLine
)
[ObsoleteAttribute("Use an overload accepting a MessageLocation object.")]
public void Write(
    SeverityType severity,
    string messageId,
    Object[] arguments,
    string locationFile,
    int locationLine
)
Parameters
severity
Type: PostSharp.Extensibility SeverityType
[Missing <param name="severity"/> documentation for "M:PostSharp.Extensibility.MessageSource.Write(PostSharp.Extensibility.SeverityType,System.String,System.Object[],System.String,System.Int32)"]
messageId
Type:   Online System String
[Missing <param name="messageId"/> documentation for "M:PostSharp.Extensibility.MessageSource.Write(PostSharp.Extensibility.SeverityType,System.String,System.Object[],System.String,System.Int32)"]
arguments
Type:    Online System Object
[Missing <param name="arguments"/> documentation for "M:PostSharp.Extensibility.MessageSource.Write(PostSharp.Extensibility.SeverityType,System.String,System.Object[],System.String,System.Int32)"]
locationFile
Type:   Online System String
[Missing <param name="locationFile"/> documentation for "M:PostSharp.Extensibility.MessageSource.Write(PostSharp.Extensibility.SeverityType,System.String,System.Object[],System.String,System.Int32)"]
locationLine
Type:   Online System Int32
[Missing <param name="locationLine"/> documentation for "M:PostSharp.Extensibility.MessageSource.Write(PostSharp.Extensibility.SeverityType,System.String,System.Object[],System.String,System.Int32)"]
See Also
MessageSource Class
MessageSource Members
Write Overload
PostSharp.Extensibility Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


MessageSource.Write Method (SeverityType, String, Object[], String, Int32, Int32)

MessageSource Write Method (SeverityType, String, Object , String, Int32, Int32) PostSharp Documentation

[Missing <summary> documentation for "M:PostSharp.Extensibility.MessageSource.Write(PostSharp.Extensibility.SeverityType,System.String,System.Object[],System.String,System.Int32,System.Int32)"]

Namespace: PostSharp.Extensibility
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
[ObsoleteAttribute("Use an overload accepting a MessageLocation object.")]
public void Write(
    SeverityType severity,
    string messageId,
    Object[] arguments,
    string locationFile,
    int locationLine,
    int locationColumn
)
[ObsoleteAttribute("Use an overload accepting a MessageLocation object.")]
public void Write(
    SeverityType severity,
    string messageId,
    Object[] arguments,
    string locationFile,
    int locationLine,
    int locationColumn
)
Parameters
severity
Type: PostSharp.Extensibility SeverityType
[Missing <param name="severity"/> documentation for "M:PostSharp.Extensibility.MessageSource.Write(PostSharp.Extensibility.SeverityType,System.String,System.Object[],System.String,System.Int32,System.Int32)"]
messageId
Type:   Online System String
[Missing <param name="messageId"/> documentation for "M:PostSharp.Extensibility.MessageSource.Write(PostSharp.Extensibility.SeverityType,System.String,System.Object[],System.String,System.Int32,System.Int32)"]
arguments
Type:    Online System Object
[Missing <param name="arguments"/> documentation for "M:PostSharp.Extensibility.MessageSource.Write(PostSharp.Extensibility.SeverityType,System.String,System.Object[],System.String,System.Int32,System.Int32)"]
locationFile
Type:   Online System String
[Missing <param name="locationFile"/> documentation for "M:PostSharp.Extensibility.MessageSource.Write(PostSharp.Extensibility.SeverityType,System.String,System.Object[],System.String,System.Int32,System.Int32)"]
locationLine
Type:   Online System Int32
[Missing <param name="locationLine"/> documentation for "M:PostSharp.Extensibility.MessageSource.Write(PostSharp.Extensibility.SeverityType,System.String,System.Object[],System.String,System.Int32,System.Int32)"]
locationColumn
Type:   Online System Int32
[Missing <param name="locationColumn"/> documentation for "M:PostSharp.Extensibility.MessageSource.Write(PostSharp.Extensibility.SeverityType,System.String,System.Object[],System.String,System.Int32,System.Int32)"]
See Also
MessageSource Class
MessageSource Members
Write Overload
PostSharp.Extensibility Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


MessageSource.Write Method (SeverityType, String, Object[], String, Int32, Int32, Exception)

MessageSource Write Method (SeverityType, String, Object , String, Int32, Int32, Exception) PostSharp Documentation

[Missing <summary> documentation for "M:PostSharp.Extensibility.MessageSource.Write(PostSharp.Extensibility.SeverityType,System.String,System.Object[],System.String,System.Int32,System.Int32,System.Exception)"]

Namespace: PostSharp.Extensibility
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
[ObsoleteAttribute("Use an overload accepting a MessageLocation object.")]
public void Write(
    SeverityType severity,
    string messageId,
    Object[] arguments,
    string locationFile,
    int locationLine,
    int locationColumn,
    Exception innerException
)
[ObsoleteAttribute("Use an overload accepting a MessageLocation object.")]
public void Write(
    SeverityType severity,
    string messageId,
    Object[] arguments,
    string locationFile,
    int locationLine,
    int locationColumn,
    Exception innerException
)
Parameters
severity
Type: PostSharp.Extensibility SeverityType
[Missing <param name="severity"/> documentation for "M:PostSharp.Extensibility.MessageSource.Write(PostSharp.Extensibility.SeverityType,System.String,System.Object[],System.String,System.Int32,System.Int32,System.Exception)"]
messageId
Type:   Online System String
[Missing <param name="messageId"/> documentation for "M:PostSharp.Extensibility.MessageSource.Write(PostSharp.Extensibility.SeverityType,System.String,System.Object[],System.String,System.Int32,System.Int32,System.Exception)"]
arguments
Type:    Online System Object
[Missing <param name="arguments"/> documentation for "M:PostSharp.Extensibility.MessageSource.Write(PostSharp.Extensibility.SeverityType,System.String,System.Object[],System.String,System.Int32,System.Int32,System.Exception)"]
locationFile
Type:   Online System String
[Missing <param name="locationFile"/> documentation for "M:PostSharp.Extensibility.MessageSource.Write(PostSharp.Extensibility.SeverityType,System.String,System.Object[],System.String,System.Int32,System.Int32,System.Exception)"]
locationLine
Type:   Online System Int32
[Missing <param name="locationLine"/> documentation for "M:PostSharp.Extensibility.MessageSource.Write(PostSharp.Extensibility.SeverityType,System.String,System.Object[],System.String,System.Int32,System.Int32,System.Exception)"]
locationColumn
Type:   Online System Int32
[Missing <param name="locationColumn"/> documentation for "M:PostSharp.Extensibility.MessageSource.Write(PostSharp.Extensibility.SeverityType,System.String,System.Object[],System.String,System.Int32,System.Int32,System.Exception)"]
innerException
Type:   Online System Exception
[Missing <param name="innerException"/> documentation for "M:PostSharp.Extensibility.MessageSource.Write(PostSharp.Extensibility.SeverityType,System.String,System.Object[],System.String,System.Int32,System.Int32,System.Exception)"]
See Also
MessageSource Class
MessageSource Members
Write Overload
PostSharp.Extensibility Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


MessageSource Properties

MessageSource Properties PostSharp Documentation
The MessageSource type exposes the following members.
Properties
Name | Description
MessageSink | Gets the current message sink.
Back to Top
See Also
MessageSource Class
PostSharp.Extensibility Namespace

Online Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


MessageSource.MessageSink Property

MessageSource MessageSink Property PostSharp Documentation
Gets the current message sink.

Namespace: PostSharp.Extensibility
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
public static IMessageSink MessageSink { get; internal set; }
public static IMessageSink MessageSink { get; internal set; }
Property Value
Type: IMessageSink
See Also
MessageSource Class
MessageSource Members
PostSharp.Extensibility Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


MetricAttribute Class

MetricAttribute Class PostSharp Documentation
Custom attribute that, when applied on an aspect, causes the aspect to increment some metric at build time.
Inheritance Hierarchy
Online System Object
Online System Attribute
PostSharp.Extensibility MetricAttribute

Namespace: PostSharp.Extensibility
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
public class MetricAttribute : Attribute
public class MetricAttribute : Attribute
Remarks

             These metrics are used by PostSharp to collect usage information and are transferred to the makers
            of PostSharp only if you opted in for the Customer Experience Improvement Program.

See Also
MetricAttribute Members
PostSharp.Extensibility Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


MetricAttribute Members

MetricAttribute Members PostSharp Documentation

The MetricAttribute type exposes the following members.
Constructors
 | Name | Description
Public method | MetricAttribute | Initializes a new MetricAttribute.
Back to Top
Properties
 | Name | Description
Public property | MetricName | Gets the name of the metric.
Public property | Operand | Gets the operand of the metric.
Back to Top
See Also
MetricAttribute Class
PostSharp.Extensibility Namespace

Online Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


MetricAttribute Constructor

MetricAttribute Constructor PostSharp Documentation
Initializes a new MetricAttribute.

Namespace: PostSharp.Extensibility
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
public MetricAttribute(
    string metricName,
    Object operand
)
public MetricAttribute(
    string metricName,
    Object operand
)
Parameters
metricName
Type:   Online System String
Metric name.
operand
Type:   Online System Object
Metric operand.
See Also
MetricAttribute Class
MetricAttribute Members
PostSharp.Extensibility Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


MetricAttribute Properties

MetricAttribute Properties PostSharp Documentation
The MetricAttribute type exposes the following members.
Properties
 | Name | Description
Public property | MetricName | Gets the name of the metric.
Public property | Operand | Gets the operand of the metric.
Back to Top
See Also
MetricAttribute Class
PostSharp.Extensibility Namespace

Online Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


MetricAttribute.MetricName Property

MetricAttribute MetricName Property PostSharp Documentation
Gets the name of the metric.

Namespace: PostSharp.Extensibility
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
public string MetricName { get; private set; }
public string MetricName { get; private set; }
Property Value
Type:   Online String
See Also
MetricAttribute Class
MetricAttribute Members
PostSharp.Extensibility Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


MetricAttribute.Operand Property

MetricAttribute Operand Property PostSharp Documentation
Gets the operand of the metric.

Namespace: PostSharp.Extensibility
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
public Object Operand { get; private set; }
public Object Operand { get; private set; }
Property Value
Type:   Online Object
See Also
MetricAttribute Class
MetricAttribute Members
PostSharp.Extensibility Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


MulticastAttribute Class

MulticastAttribute Class PostSharp Documentation
Custom attribute that can be applied to multiple elements using wildcards.
Inheritance Hierarchy
Online System Object
Online System Attribute
PostSharp.Extensibility MulticastAttribute
PostSharp.Aspects Aspect
PostSharp.Constraints Constraint
PostSharp.Patterns.Contracts LocationContractAttribute
PostSharp.Patterns.Model PureAttribute
PostSharp.Serialization PSerializableAttribute

Namespace: PostSharp.Extensibility
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
[SerializableAttribute]
public abstract class MulticastAttribute : Attribute
[SerializableAttribute]
public abstract class MulticastAttribute : Attribute
Remarks
Each class derived from MulticastAttribute
            should be decorated with an instance of MulticastAttributeUsageAttribute.

            Multicasting is performed by the MulticastAttributeTask, which should be
            included in the project. After multicasting, custom attribute instances are
            available on the CustomAttributeDictionaryTask class.

See Also
MulticastAttribute Members
PostSharp.Extensibility Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


MulticastAttribute Members

MulticastAttribute Members PostSharp Documentation

The MulticastAttribute type exposes the following members.
Constructors
 | Name | Description
Protected method | MulticastAttribute | Initializes a new instance of the MulticastAttribute class
Back to Top
Properties
 | Name | Description
Public property | AttributeExclude | If true, indicates that this attribute removes all other instances of the same attribute type from the set of elements defined by the current instance.
Public property | AttributeId | Obsolete.
Public property | AttributeInheritance | Determines whether this attribute is inherited
Public property | AttributePriority | Gets or sets the priority of the current attribute in case that multiple instances are defined on the same element (lower values are processed before).
Public property | AttributeReplace | Determines whether this attribute replaces other attributes found on the target declarations.
Public property | AttributeTargetAssemblies | Gets or sets the assemblies to which the current attribute apply.
Public property | AttributeTargetElements | Gets or sets the kind of elements to which this custom attributes applies.
Public property | AttributeTargetExternalMemberAttributes | Gets or sets the visibilities, scopes, virtualities, and implementation of members to which this attribute applies, when the member is external to the current module.
Public property | AttributeTargetExternalTypeAttributes | Gets or sets the visibilities of types to which this attribute applies, when this type is external to the current module.
Public property | AttributeTargetMemberAttributes | Gets or sets the visibilities, scopes, virtualities, and implementation of members to which this attribute applies.
Public property | AttributeTargetMembers | Gets or sets the expression specifying to which members this instance applies.
Public property | AttributeTargetParameterAttributes | Gets or sets the passing style (by value, out or ref) of parameters to which this attribute applies.
Public property | AttributeTargetParameters | Gets or sets the expression specifying to which parameters this instance applies.
Public property | AttributeTargetTypeAttributes | Gets or sets the visibilities of types to which this attribute applies.
Public property | AttributeTargetTypes | Gets or sets the expression specifying to which types this instance applies.
Back to Top
See Also
MulticastAttribute Class
PostSharp.Extensibility Namespace

Online Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


MulticastAttribute Constructor

MulticastAttribute Constructor PostSharp Documentation
Initializes a new instance of the MulticastAttribute class

Namespace: PostSharp.Extensibility
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
protected MulticastAttribute()
protected MulticastAttribute()
See Also
MulticastAttribute Class
MulticastAttribute Members
PostSharp.Extensibility Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


MulticastAttribute Properties

MulticastAttribute Properties PostSharp Documentation
The MulticastAttribute type exposes the following members.
Properties
 | Name | Description
Public property | AttributeExclude | If true, indicates that this attribute removes all other instances of the same attribute type from the set of elements defined by the current instance.
Public property | AttributeId | Obsolete.
Public property | AttributeInheritance | Determines whether this attribute is inherited
Public property | AttributePriority | Gets or sets the priority of the current attribute in case that multiple instances are defined on the same element (lower values are processed before).
Public property | AttributeReplace | Determines whether this attribute replaces other attributes found on the target declarations.
Public property | AttributeTargetAssemblies | Gets or sets the assemblies to which the current attribute apply.
Public property | AttributeTargetElements | Gets or sets the kind of elements to which this custom attributes applies.
Public property | AttributeTargetExternalMemberAttributes | Gets or sets the visibilities, scopes, virtualities, and implementation of members to which this attribute applies, when the member is external to the current module.
Public property | AttributeTargetExternalTypeAttributes | Gets or sets the visibilities of types to which this attribute applies, when this type is external to the current module.
Public property | AttributeTargetMemberAttributes | Gets or sets the visibilities, scopes, virtualities, and implementation of members to which this attribute applies.
Public property | AttributeTargetMembers | Gets or sets the expression specifying to which members this instance applies.
Public property | AttributeTargetParameterAttributes | Gets or sets the passing style (by value, out or ref) of parameters to which this attribute applies.
Public property | AttributeTargetParameters | Gets or sets the expression specifying to which parameters this instance applies.
Public property | AttributeTargetTypeAttributes | Gets or sets the visibilities of types to which this attribute applies.
Public property | AttributeTargetTypes | Gets or sets the expression specifying to which types this instance applies.
Back to Top
See Also
MulticastAttribute Class
PostSharp.Extensibility Namespace

Online Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


MulticastAttribute.AttributeExclude Property

MulticastAttribute AttributeExclude Property PostSharp Documentation
If true, indicates that this attribute removes all other instances of the same attribute type from the set of elements defined by the current instance.

Namespace: PostSharp.Extensibility
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
public bool AttributeExclude { get; set; }
public bool AttributeExclude { get; set; }
Property Value
Type:   Online Boolean
See Also
MulticastAttribute Class
MulticastAttribute Members
PostSharp.Extensibility Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


MulticastAttribute.AttributeId Property

MulticastAttribute AttributeId Property PostSharp Documentation

[Missing <summary> documentation for "P:PostSharp.Extensibility.MulticastAttribute.AttributeId"]

Namespace: PostSharp.Extensibility
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
[ObsoleteAttribute("Do not use this property in customer code.", true)]
public long AttributeId { get; set; }
[ObsoleteAttribute("Do not use this property in customer code.", true)]
public long AttributeId { get; set; }
Property Value
Type:   Online Int64
See Also
MulticastAttribute Class
MulticastAttribute Members
PostSharp.Extensibility Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


MulticastAttribute.AttributeInheritance Property

MulticastAttribute AttributeInheritance Property PostSharp Documentation
Determines whether this attribute is inherited

Namespace: PostSharp.Extensibility
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
public MulticastInheritance AttributeInheritance { get; set; }
public MulticastInheritance AttributeInheritance { get; set; }
Property Value
Type: MulticastInheritance
Remarks
If this property is true, a copy of this attribute will be propagated along
            the lines of inheritance of the target element:
  • On classes: all classed derived from that class.
  • On interfaces: all classes implementing this interface.
  • On virtual, abstract or interface methods: all methods overriding
            or implementing this method.
  • On parameters or return value of virtual, abstract or interface methods:
            corresponding parameter or return value on all methods or overriding or implementing the
            parent method of the target parameter or return value.
See Also
MulticastAttribute Class
MulticastAttribute Members
PostSharp.Extensibility Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


MulticastAttribute.AttributePriority Property

MulticastAttribute AttributePriority Property PostSharp Documentation
Gets or sets the priority of the current attribute in case that multiple instances are defined on the same element (lower values are processed before).

Namespace: PostSharp.Extensibility
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
public int AttributePriority { get; set; }
public int AttributePriority { get; set; }
Property Value
Type:   Online Int32
Remarks

            You should use only 16-bit values in user code. Top 16 bits are reserved for the system.

See Also
MulticastAttribute Class
MulticastAttribute Members
PostSharp.Extensibility Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


MulticastAttribute.AttributeReplace Property

MulticastAttribute AttributeReplace Property PostSharp Documentation
Determines whether this attribute replaces other attributes found on the target declarations.

Namespace: PostSharp.Extensibility
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
public bool AttributeReplace { get; set; }
public bool AttributeReplace { get; set; }
Property Value
Type:   Online Boolean
true if the current instance will replace previous ones, or false
            if it will be added to previous instances.

See Also
MulticastAttribute Class
MulticastAttribute Members
PostSharp.Extensibility Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


MulticastAttribute.AttributeTargetAssemblies Property

MulticastAttribute AttributeTargetAssemblies Property PostSharp Documentation
Gets or sets the assemblies to which the current attribute apply.

Namespace: PostSharp.Extensibility
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
public string AttributeTargetAssemblies { get; set; }
public string AttributeTargetAssemblies { get; set; }
Property Value
Type:   Online String

            Wildcard or regular expression specifying to which assemblies
            this instance applies, or null if this instance applies
            only to elements of the current assembly. Wildcard expressions should
            start with the regex: prefix.

Remarks

            When this property is not specified or is null, the current
            attribute is multicasted only in the current assembly. Otherwise, it
            is multicasted also to external assemblies, i.e. to declarations that
            are referenced by the current assembly.

See Also
MulticastAttribute Class
MulticastAttribute Members
PostSharp.Extensibility Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


MulticastAttribute.AttributeTargetElements Property

MulticastAttribute AttributeTargetElements Property PostSharp Documentation
Gets or sets the kind of elements to which this custom attributes applies.

Namespace: PostSharp.Extensibility
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
public MulticastTargets AttributeTargetElements { get; set; }
public MulticastTargets AttributeTargetElements { get; set; }
Property Value
Type: MulticastTargets
See Also
MulticastAttribute Class
MulticastAttribute Members
PostSharp.Extensibility Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


MulticastAttribute.AttributeTargetExternalMemberAttributes Property

MulticastAttribute AttributeTargetExternalMemberAttributes Property PostSharp Documentation
Gets or sets the visibilities, scopes, virtualities, and implementation of members to which this attribute applies, when the member is external to the current module.

Namespace: PostSharp.Extensibility
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
public MulticastAttributes AttributeTargetExternalMemberAttributes { get; set; }
public MulticastAttributes AttributeTargetExternalMemberAttributes { get; set; }
Property Value
Type: MulticastAttributes
Remarks
Ignored if the AttributeTargetElements are only the module, the assembly,
            and/or types.

            The MulticastAttributes enumeration is a multi-part flag: there is one
            part for visibility, one for scope, one for virtuality, and one for implementation.
            If you specify one part, it will override the values defined on the custom attribute definition.
            If you do not specify it, the values defined on the custom attribute definition will be inherited.
            Note that custom attributes may apply restrictions on these attributes. For instance,
            a custom attribute may not be valid on abstract methods. You are obviously not allowed
            to 'enlarge' the set of possible targets.

See Also
MulticastAttribute Class
MulticastAttribute Members
PostSharp.Extensibility Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


MulticastAttribute.AttributeTargetExternalTypeAttributes Property

MulticastAttribute AttributeTargetExternalTypeAttributes Property PostSharp Documentation
Gets or sets the visibilities of types to which this attribute applies, when this type is external to the current module.

Namespace: PostSharp.Extensibility
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
public MulticastAttributes AttributeTargetExternalTypeAttributes { get; set; }
public MulticastAttributes AttributeTargetExternalTypeAttributes { get; set; }
Property Value
Type: MulticastAttributes
Remarks

            On type-level, the only meaningfull enumeration values are related to visibility.

See Also
MulticastAttribute Class
MulticastAttribute Members
PostSharp.Extensibility Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


MulticastAttribute.AttributeTargetMemberAttributes Property

MulticastAttribute AttributeTargetMemberAttributes Property PostSharp Documentation
Gets or sets the visibilities, scopes, virtualities, and implementation of members to which this attribute applies.

Namespace: PostSharp.Extensibility
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
public MulticastAttributes AttributeTargetMemberAttributes { get; set; }
public MulticastAttributes AttributeTargetMemberAttributes { get; set; }
Property Value
Type: MulticastAttributes
Remarks
Ignored if the AttributeTargetElements are only the module, the assembly,
            and/or types.

            The MulticastAttributes enumeration is a multi-part flag: there is one
            part for visibility, one for scope, one for virtuality, and one for implementation.
            If you specify one part, it will override the values defined on the custom attribute definition.
            If you do not specify it, the values defined on the custom attribute definition will be inherited.
            Note that custom attributes may apply restrictions on these attributes. For instance,
            a custom attribute may not be valid on abstract methods. You are obviously not allowed
            to 'enlarge' the set of possible targets.

See Also
MulticastAttribute Class
MulticastAttribute Members
PostSharp.Extensibility Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


MulticastAttribute.AttributeTargetMembers Property

MulticastAttribute AttributeTargetMembers Property PostSharp Documentation
Gets or sets the expression specifying to which members this instance applies.

Namespace: PostSharp.Extensibility
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
public string AttributeTargetMembers { get; set; }
public string AttributeTargetMembers { get; set; }
Property Value
Type:   Online String

            A wildcard or regular expression specifying to which members
            this instance applies, or null this instance
            applies either to all members whose kind is given in AttributeTargetElements.
            Regular expressions should start with the regex: prefix.

Remarks
Ignored if the only AttributeTargetElements are only types.

See Also
MulticastAttribute Class
MulticastAttribute Members
PostSharp.Extensibility Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


MulticastAttribute.AttributeTargetParameterAttributes Property

MulticastAttribute AttributeTargetParameterAttributes Property PostSharp Documentation
Gets or sets the passing style (by value, out or ref) of parameters to which this attribute applies.

Namespace: PostSharp.Extensibility
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
public MulticastAttributes AttributeTargetParameterAttributes { get; set; }
public MulticastAttributes AttributeTargetParameterAttributes { get; set; }
Property Value
Type: MulticastAttributes
Remarks
Ignored if the AttributeTargetElements do not include parameters.

See Also
MulticastAttribute Class
MulticastAttribute Members
PostSharp.Extensibility Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


MulticastAttribute.AttributeTargetParameters Property

MulticastAttribute AttributeTargetParameters Property PostSharp Documentation
Gets or sets the expression specifying to which parameters this instance applies.

Namespace: PostSharp.Extensibility
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
public string AttributeTargetParameters { get; set; }
public string AttributeTargetParameters { get; set; }
Property Value
Type:   Online String

            A wildcard or regular expression specifying to which parameters
            this instance applies, or null this instance
            applies either to all members whose kind is given in AttributeTargetElements.
            Wildcard expressions should
            start with the regex: prefix.

Remarks
Ignored if the only AttributeTargetElements are only types.

See Also
MulticastAttribute Class
MulticastAttribute Members
PostSharp.Extensibility Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


MulticastAttribute.AttributeTargetTypeAttributes Property

MulticastAttribute AttributeTargetTypeAttributes Property PostSharp Documentation
Gets or sets the visibilities of types to which this attribute applies.

Namespace: PostSharp.Extensibility
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
public MulticastAttributes AttributeTargetTypeAttributes { get; set; }
public MulticastAttributes AttributeTargetTypeAttributes { get; set; }
Property Value
Type: MulticastAttributes
Remarks

            On type-level, the only meaningfull enumeration values are related to visibility.

See Also
MulticastAttribute Class
MulticastAttribute Members
PostSharp.Extensibility Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


MulticastAttribute.AttributeTargetTypes Property

MulticastAttribute AttributeTargetTypes Property PostSharp Documentation
Gets or sets the expression specifying to which types this instance applies.

Namespace: PostSharp.Extensibility
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
public string AttributeTargetTypes { get; set; }
public string AttributeTargetTypes { get; set; }
Property Value
Type:   Online String

            A wildcard or regular expression specifying to which types
            this instance applies, or null this instance
            applies either to all types. Regular expressions should
            start with the regex: prefix.

Remarks

            Ignored if the AttributeTargetElements are only the module and/or the assembly.

See Also
MulticastAttribute Class
MulticastAttribute Members
PostSharp.Extensibility Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


MulticastAttributes Enumeration

MulticastAttributes Enumeration PostSharp Documentation
Attributes of elements to which multicast custom attributes (MulticastAttribute) apply.

Namespace: PostSharp.Extensibility
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
[FlagsAttribute]
public enum MulticastAttributes
[FlagsAttribute]
public enum MulticastAttributes
Members
Member name | Value | Description
Default | 0 | Specifies that the set of target attributes is inherited from the parent custom attribute.
Private | 2 | Private (visible inside the current type).
Protected | 4 | Protected (visible inside derived types).
Internal | 8 | Internal (visible inside the current assembly).
InternalAndProtected | 16 | Internal and protected (visible inside derived types that are defined in the current assembly).
InternalOrProtected | 32 | Internal or protected (visible inside all derived types and in the current assembly).
Public | 64 | Public (visible everywhere).
AnyVisibility | 126 | Any visibility.
Static | 128 | Static scope.
Instance | 256 | Instance scope.
AnyScope | 384 | Any scope (Static | Instance).
Abstract | 512 | Abstract methods.
NonAbstract | 1024 | Concrete (non-abstract) methods.
AnyAbstraction | 1536 | Any abstraction (Abstract | NonAbstract).
Virtual | 2048 | Virtual methods.
NonVirtual | 4096 | Non-virtual methods.
AnyVirtuality | 6144 | Any virtuality (Virtual | NonVirtual).
Managed | 8192 | Managed code implemetation.
NonManaged | 16384 | Non-managed code implementation (external or system).
AnyImplementation | 24576 | Any implementation (Managed | NonManaged).
Literal | 32768 | Literal fields.
NonLiteral | 65536 | Non-literal fields.
AnyLiterality | 98304 | Any field literality (Literal | NonLiteral).
InParameter | 131072 | Input parameters.
CompilerGenerated | 262144 | Compiler-generated code (for instance closure types of anonymous method, iterator type, ...).
UserGenerated | 524288 | User-generated code (anything expected CompilerGenerated).
AnyGeneration | 786432 | Any code generation (CompilerGenerated | UserGenerated)l
OutParameter | 1048576 | Output (out in C#) parameters.
RefParameter | 2097152 | Input/Output (ref in C#) parameters.
AnyParameter | 3276800 | Any kind of parameter passing (InParameter | OutParameter | RefParameter).
All | 4194302 | All members.
Remarks

              When specifying attributes of target members or types, do not forget to provide
              all categories of flags, not only the category on which you want to put
              a restriction. If you want to limit, for instance, a custom attribute to be
              applied on public members, a good practice is to set
              TargetMemberAttributes = MulticastAttributes.Public | ~MulticastAttributes.AnyVisibility,
              unless the parent is more restrictive, in which case you should specify attributes
              explicitly.

See Also
PostSharp.Extensibility Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


MulticastAttributeUsageAttribute Class

MulticastAttributeUsageAttribute Class PostSharp Documentation
Custom attribute that determines the usage of a MulticastAttribute.
Inheritance Hierarchy
Online System Object
Online System Attribute
PostSharp.Extensibility MulticastAttributeUsageAttribute

Namespace: PostSharp.Extensibility
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
public sealed class MulticastAttributeUsageAttribute : Attribute
public sealed class MulticastAttributeUsageAttribute : Attribute
See Also
MulticastAttributeUsageAttribute Members
PostSharp.Extensibility Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


MulticastAttributeUsageAttribute Members

MulticastAttributeUsageAttribute Members PostSharp Documentation

The MulticastAttributeUsageAttribute type exposes the following members.
Constructors
 | Name | Description
Public method | MulticastAttributeUsageAttribute | Initializes a new MulticastAttributeUsageAttribute.
Public method | MulticastAttributeUsageAttribute(MulticastTargets) | Initializes a new MulticastAttributeUsageAttribute.
Back to Top
Properties
 | Name | Description
Public property | AllowExternalAssemblies | Determines whether this attribute can be applied to declaration of external assemblies (i.e. to other assemblies than the one in which the custom attribute is instantiated).
Public property | AllowMultiple | Determines whether many instances of the custom attribute are allowed on a single declaration.
Public property | HideFromAspectBrowser | Determines whether instances of the target MulticastAttribute should be hidden from the Aspect Browser, in the Visual Studio extension.
Public property | Inheritance | Determines whether the custom attribute in inherited along the lines of inheritance of the target element.
Public property | PersistMetaData | Determines whether the custom attribute should be persisted in metadata, so that it would be available for System.Reflection.
Public property | TargetExternalMemberAttributes | Gets or sets the attributes of the members (fields or methods) to which the custom attribute can be applied, when the members are external to the current module.
Public property | TargetExternalTypeAttributes | Gets or sets the attributes of the types to which the custom attribute can be applied, when the type is external to the current module. If the custom attribute relates to fields or methods, this property specifies which attributes of the declaring type are acceptable.
Public property | TargetMemberAttributes | Gets or sets the attributes of the members (fields or methods) to which the custom attribute can be applied.
Public property | TargetParameterAttributes | Gets or sets the attributes of the parameter to which the custom attribute can be applied.
Public property | TargetTypeAttributes | Gets or sets the attributes of the types to which the custom attribute can be applied. If the custom attribute relates to fields or methods, this property specifies which attributes of the declaring type are acceptable.
Public property | ValidOn | Gets the kinds of targets that instances of the related MulticastAttribute apply to.
Back to Top
See Also
MulticastAttributeUsageAttribute Class
PostSharp.Extensibility Namespace

Online Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


MulticastAttributeUsageAttribute Constructor

MulticastAttributeUsageAttribute Constructor PostSharp Documentation
Overload List
 | Name | Description
Public method | MulticastAttributeUsageAttribute | Initializes a new MulticastAttributeUsageAttribute.
Public method | MulticastAttributeUsageAttribute(MulticastTargets) | Initializes a new MulticastAttributeUsageAttribute.
Back to Top
See Also
MulticastAttributeUsageAttribute Class
MulticastAttributeUsageAttribute Members
PostSharp.Extensibility Namespace

Online Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


MulticastAttributeUsageAttribute Constructor

MulticastAttributeUsageAttribute Constructor PostSharp Documentation
Initializes a new MulticastAttributeUsageAttribute.

Namespace: PostSharp.Extensibility
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
public MulticastAttributeUsageAttribute()
public MulticastAttributeUsageAttribute()
See Also
MulticastAttributeUsageAttribute Class
MulticastAttributeUsageAttribute Members
MulticastAttributeUsageAttribute Overload
PostSharp.Extensibility Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


MulticastAttributeUsageAttribute Constructor (MulticastTargets)

MulticastAttributeUsageAttribute Constructor (MulticastTargets) PostSharp Documentation
Initializes a new MulticastAttributeUsageAttribute.

Namespace: PostSharp.Extensibility
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
public MulticastAttributeUsageAttribute(
    MulticastTargets validOn
)
public MulticastAttributeUsageAttribute(
    MulticastTargets validOn
)
Parameters
validOn
Type: PostSharp.Extensibility MulticastTargets
Kinds of targets that instances of the related MulticastAttribute
              apply to.
See Also
MulticastAttributeUsageAttribute Class
MulticastAttributeUsageAttribute Members
MulticastAttributeUsageAttribute Overload
PostSharp.Extensibility Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


MulticastAttributeUsageAttribute Properties

MulticastAttributeUsageAttribute Properties PostSharp Documentation
The MulticastAttributeUsageAttribute type exposes the following members.
Properties
 | Name | Description
Public property | AllowExternalAssemblies | Determines whether this attribute can be applied to declaration of external assemblies (i.e. to other assemblies than the one in which the custom attribute is instantiated).
Public property | AllowMultiple | Determines whether many instances of the custom attribute are allowed on a single declaration.
Public property | HideFromAspectBrowser | Determines whether instances of the target MulticastAttribute should be hidden from the Aspect Browser, in the Visual Studio extension.
Public property | Inheritance | Determines whether the custom attribute in inherited along the lines of inheritance of the target element.
Public property | PersistMetaData | Determines whether the custom attribute should be persisted in metadata, so that it would be available for System.Reflection.
Public property | TargetExternalMemberAttributes | Gets or sets the attributes of the members (fields or methods) to which the custom attribute can be applied, when the members are external to the current module.
Public property | TargetExternalTypeAttributes | Gets or sets the attributes of the types to which the custom attribute can be applied, when the type is external to the current module. If the custom attribute relates to fields or methods, this property specifies which attributes of the declaring type are acceptable.
Public property | TargetMemberAttributes | Gets or sets the attributes of the members (fields or methods) to which the custom attribute can be applied.
Public property | TargetParameterAttributes | Gets or sets the attributes of the parameter to which the custom attribute can be applied.
Public property | TargetTypeAttributes | Gets or sets the attributes of the types to which the custom attribute can be applied. If the custom attribute relates to fields or methods, this property specifies which attributes of the declaring type are acceptable.
Public property | ValidOn | Gets the kinds of targets that instances of the related MulticastAttribute apply to.
Back to Top
See Also
MulticastAttributeUsageAttribute Class
PostSharp.Extensibility Namespace

Online Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


MulticastAttributeUsageAttribute.AllowExternalAssemblies Property

MulticastAttributeUsageAttribute AllowExternalAssemblies Property PostSharp Documentation
Determines whether this attribute can be applied to declaration of external assemblies (i.e. to other assemblies than the one in which the custom attribute is instantiated).

Namespace: PostSharp.Extensibility
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
public bool AllowExternalAssemblies { get; set; }
public bool AllowExternalAssemblies { get; set; }
Property Value
Type:   Online Boolean
See Also
MulticastAttributeUsageAttribute Class
MulticastAttributeUsageAttribute Members
PostSharp.Extensibility Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


MulticastAttributeUsageAttribute.AllowMultiple Property

MulticastAttributeUsageAttribute AllowMultiple Property PostSharp Documentation
Determines whether many instances of the custom attribute are allowed on a single declaration.

Namespace: PostSharp.Extensibility
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
public bool AllowMultiple { get; set; }
public bool AllowMultiple { get; set; }
Property Value
Type:   Online Boolean
See Also
MulticastAttributeUsageAttribute Class
MulticastAttributeUsageAttribute Members
PostSharp.Extensibility Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


MulticastAttributeUsageAttribute.HideFromAspectBrowser Property

MulticastAttributeUsageAttribute HideFromAspectBrowser Property PostSharp Documentation
Determines whether instances of the target MulticastAttribute should be hidden from the Aspect Browser, in the Visual Studio extension.

Namespace: PostSharp.Extensibility
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
public bool HideFromAspectBrowser { get; set; }
public bool HideFromAspectBrowser { get; set; }
Property Value
Type:   Online Boolean
See Also
MulticastAttributeUsageAttribute Class
MulticastAttributeUsageAttribute Members
PostSharp.Extensibility Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


MulticastAttributeUsageAttribute.Inheritance Property

MulticastAttributeUsageAttribute Inheritance Property PostSharp Documentation
Determines whether the custom attribute in inherited along the lines of inheritance of the target element.

Namespace: PostSharp.Extensibility
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
public MulticastInheritance Inheritance { get; set; }
public MulticastInheritance Inheritance { get; set; }
Property Value
Type: MulticastInheritance
See Also
MulticastAttributeUsageAttribute Class
MulticastAttributeUsageAttribute Members
PostSharp.Extensibility Namespace
MulticastAttribute AttributeInheritance
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


MulticastAttributeUsageAttribute.PersistMetaData Property

MulticastAttributeUsageAttribute PersistMetaData Property PostSharp Documentation
Determines whether the custom attribute should be persisted in metadata, so that it would be available for System.Reflection.

Namespace: PostSharp.Extensibility
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
public bool PersistMetaData { get; set; }
public bool PersistMetaData { get; set; }
Property Value
Type:   Online Boolean
See Also
MulticastAttributeUsageAttribute Class
MulticastAttributeUsageAttribute Members
PostSharp.Extensibility Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


MulticastAttributeUsageAttribute.TargetExternalMemberAttributes Property

MulticastAttributeUsageAttribute TargetExternalMemberAttributes Property PostSharp Documentation
Gets or sets the attributes of the members (fields or methods) to which the custom attribute can be applied, when the members are external to the current module.

Namespace: PostSharp.Extensibility
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
public MulticastAttributes TargetExternalMemberAttributes { get; set; }
public MulticastAttributes TargetExternalMemberAttributes { get; set; }
Property Value
Type: MulticastAttributes
See Also
MulticastAttributeUsageAttribute Class
MulticastAttributeUsageAttribute Members
PostSharp.Extensibility Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


MulticastAttributeUsageAttribute.TargetExternalTypeAttributes Property

MulticastAttributeUsageAttribute TargetExternalTypeAttributes Property PostSharp Documentation
Gets or sets the attributes of the types to which the custom attribute can be applied, when the type is external to the current module. If the custom attribute relates to fields or methods, this property specifies which attributes of the declaring type are acceptable.

Namespace: PostSharp.Extensibility
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
public MulticastAttributes TargetExternalTypeAttributes { get; set; }
public MulticastAttributes TargetExternalTypeAttributes { get; set; }
Property Value
Type: MulticastAttributes
See Also
MulticastAttributeUsageAttribute Class
MulticastAttributeUsageAttribute Members
PostSharp.Extensibility Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


MulticastAttributeUsageAttribute.TargetMemberAttributes Property

MulticastAttributeUsageAttribute TargetMemberAttributes Property PostSharp Documentation
Gets or sets the attributes of the members (fields or methods) to which the custom attribute can be applied.

Namespace: PostSharp.Extensibility
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
public MulticastAttributes TargetMemberAttributes { get; set; }
public MulticastAttributes TargetMemberAttributes { get; set; }
Property Value
Type: MulticastAttributes
See Also
MulticastAttributeUsageAttribute Class
MulticastAttributeUsageAttribute Members
PostSharp.Extensibility Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


MulticastAttributeUsageAttribute.TargetParameterAttributes Property

MulticastAttributeUsageAttribute TargetParameterAttributes Property PostSharp Documentation
Gets or sets the attributes of the parameter to which the custom attribute can be applied.

Namespace: PostSharp.Extensibility
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
public MulticastAttributes TargetParameterAttributes { get; set; }
public MulticastAttributes TargetParameterAttributes { get; set; }
Property Value
Type: MulticastAttributes
See Also
MulticastAttributeUsageAttribute Class
MulticastAttributeUsageAttribute Members
PostSharp.Extensibility Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


MulticastAttributeUsageAttribute.TargetTypeAttributes Property

MulticastAttributeUsageAttribute TargetTypeAttributes Property PostSharp Documentation
Gets or sets the attributes of the types to which the custom attribute can be applied. If the custom attribute relates to fields or methods, this property specifies which attributes of the declaring type are acceptable.

Namespace: PostSharp.Extensibility
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
public MulticastAttributes TargetTypeAttributes { get; set; }
public MulticastAttributes TargetTypeAttributes { get; set; }
Property Value
Type: MulticastAttributes
See Also
MulticastAttributeUsageAttribute Class
MulticastAttributeUsageAttribute Members
PostSharp.Extensibility Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


MulticastAttributeUsageAttribute.ValidOn Property

MulticastAttributeUsageAttribute ValidOn Property PostSharp Documentation
Gets the kinds of targets that instances of the related MulticastAttribute apply to.

Namespace: PostSharp.Extensibility
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
public MulticastTargets ValidOn { get; internal set; }
public MulticastTargets ValidOn { get; internal set; }
Property Value
Type: MulticastTargets
See Also
MulticastAttributeUsageAttribute Class
MulticastAttributeUsageAttribute Members
PostSharp.Extensibility Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


MulticastImplementationDetailsTypeAttribute Class

MulticastImplementationDetailsTypeAttribute Class PostSharp Documentation

[Missing <summary> documentation for "T:PostSharp.Extensibility.MulticastImplementationDetailsTypeAttribute"]

Inheritance Hierarchy
Online System Object
Online System Attribute
PostSharp.Extensibility MulticastImplementationDetailsTypeAttribute

Namespace: PostSharp.Extensibility
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
public sealed class MulticastImplementationDetailsTypeAttribute : Attribute
public sealed class MulticastImplementationDetailsTypeAttribute : Attribute
See Also
MulticastImplementationDetailsTypeAttribute Members
PostSharp.Extensibility Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


MulticastImplementationDetailsTypeAttribute Members

MulticastImplementationDetailsTypeAttribute Members PostSharp Documentation

The MulticastImplementationDetailsTypeAttribute type exposes the following members.
Constructors
 | Name | Description
Public method | MulticastImplementationDetailsTypeAttribute | Initializes a new instance of the MulticastImplementationDetailsTypeAttribute class
Back to Top
See Also
MulticastImplementationDetailsTypeAttribute Class
PostSharp.Extensibility Namespace

Online Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


MulticastImplementationDetailsTypeAttribute Constructor

MulticastImplementationDetailsTypeAttribute Constructor PostSharp Documentation
Initializes a new instance of the MulticastImplementationDetailsTypeAttribute class

Namespace: PostSharp.Extensibility
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
public MulticastImplementationDetailsTypeAttribute(
    Type type
)
public MulticastImplementationDetailsTypeAttribute(
    Type type
)
Parameters
type
Type:   Online System Type
[Missing <param name="type"/> documentation for "M:PostSharp.Extensibility.MulticastImplementationDetailsTypeAttribute.#ctor(System.Type)"]
See Also
MulticastImplementationDetailsTypeAttribute Class
MulticastImplementationDetailsTypeAttribute Members
PostSharp.Extensibility Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


MulticastInheritance Enumeration

MulticastInheritance Enumeration PostSharp Documentation
Kind of inheritance of MulticastAttribute.

Namespace: PostSharp.Extensibility
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
public enum MulticastInheritance
public enum MulticastInheritance
Members
Member name | Value | Description
None | 0 | No inheritance.
Strict | 1 | The instance is inherited to children of the original element, but multicasting is not applied to members of children.
Multicast | 2 | The instance is inherited to children of the original element and multicasting is applied to members of children.
See Also
PostSharp.Extensibility Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


MulticastTargets Enumeration

MulticastTargets Enumeration PostSharp Documentation
Kinds of targets to which multicast custom attributes (MulticastAttribute) can apply.

Namespace: PostSharp.Extensibility
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
[FlagsAttribute]
public enum MulticastTargets
[FlagsAttribute]
public enum MulticastTargets
Members
Member name | Value | Description
Default | 0 | Specifies that the set of target elements is inherited from the parent custom attribute.
Class | 1 | Class.
Struct | 2 | Structure.
Enum | 4 | Enumeration.
Delegate | 8 | Delegate.
Interface | 16 | Interface.
AnyType | 31 | Any type (Class, Struct, Enum, Delegate or Interface).
Field | 32 | Field.
Method | 64 | Method (but not constructor).
InstanceConstructor | 128 | Instance constructor.
StaticConstructor | 256 | Static constructor.
Property | 512 | Property (but not methods inside the property).
Event | 1024 | Event (but not methods inside the event).
AnyMember | 2016 | Any member (Field, Method, InstanceConstructor, StaticConstructor, Property, Event).
Assembly | 2048 | Assembly.
Parameter | 4096 | Method or property parameter.
ReturnValue | 8192 | Method or property return value.
All | 16383 | All element kinds.
See Also
PostSharp.Extensibility Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


PostSharpEnvironment Class

PostSharpEnvironment Class PostSharp Documentation
Provides access to the current PostSharp environment (IPostSharpEnvironment).
Inheritance Hierarchy
Online System Object
PostSharp.Extensibility PostSharpEnvironment

Namespace: PostSharp.Extensibility
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
public static class PostSharpEnvironment
public static class PostSharpEnvironment
See Also
PostSharpEnvironment Members
PostSharp.Extensibility Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


PostSharpEnvironment Members

PostSharpEnvironment Members PostSharp Documentation

The PostSharpEnvironment type exposes the following members.
Properties
Name | Description
Current | Gets the current PostSharp environment, or null if the PostSharp Platform is not loaded in the current context.
CurrentProject | Gets the current PostSharp project.
IsPostSharpRunning | Determines whether the PostSharp Platform is currently loaded.
Back to Top
See Also
PostSharpEnvironment Class
PostSharp.Extensibility Namespace

Online Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


PostSharpEnvironment Properties

PostSharpEnvironment Properties PostSharp Documentation
The PostSharpEnvironment type exposes the following members.
Properties
Name | Description
Current | Gets the current PostSharp environment, or null if the PostSharp Platform is not loaded in the current context.
CurrentProject | Gets the current PostSharp project.
IsPostSharpRunning | Determines whether the PostSharp Platform is currently loaded.
Back to Top
See Also
PostSharpEnvironment Class
PostSharp.Extensibility Namespace

Online Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


PostSharpEnvironment.Current Property

PostSharpEnvironment Current Property PostSharp Documentation
Gets the current PostSharp environment, or null if the PostSharp Platform is not loaded in the current context.

Namespace: PostSharp.Extensibility
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
public static IPostSharpEnvironment Current { get; internal set; }
public static IPostSharpEnvironment Current { get; internal set; }
Property Value
Type: IPostSharpEnvironment
See Also
PostSharpEnvironment Class
PostSharpEnvironment Members
PostSharp.Extensibility Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


PostSharpEnvironment.CurrentProject Property

PostSharpEnvironment CurrentProject Property PostSharp Documentation
Gets the current PostSharp project.

Namespace: PostSharp.Extensibility
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
public static IProject CurrentProject { get; }
public static IProject CurrentProject { get; }
Property Value
Type: IProject
See Also
PostSharpEnvironment Class
PostSharpEnvironment Members
PostSharp.Extensibility Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


PostSharpEnvironment.IsPostSharpRunning Property

PostSharpEnvironment IsPostSharpRunning Property PostSharp Documentation
Determines whether the PostSharp Platform is currently loaded.

Namespace: PostSharp.Extensibility
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
public static bool IsPostSharpRunning { get; }
public static bool IsPostSharpRunning { get; }
Property Value
Type:   Online Boolean
See Also
PostSharpEnvironment Class
PostSharpEnvironment Members
PostSharp.Extensibility Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


PostSharpTrace Class

PostSharpTrace Class PostSharp Documentation
Provides tracing functionality. An instance of the PostSharpTrace type implements a trace sink.
Inheritance Hierarchy
Online System Object
PostSharp.Extensibility PostSharpTrace

Namespace: PostSharp.Extensibility
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
public sealed class PostSharpTrace
public sealed class PostSharpTrace
See Also
PostSharpTrace Members
PostSharp.Extensibility Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


PostSharpTrace Members

PostSharpTrace Members PostSharp Documentation

The PostSharpTrace type exposes the following members.
Constructors
 | Name | Description
Public method | PostSharpTrace | Initialize a new PostSharpTrace sink.
Back to Top
Methods
 | Name | Description
 | EnableCategory(String) | Enables a trace category known by its name.
 | EnableCategory(PostSharpTrace) | Enables a trace category known by its object.
Public method | Write(String) | Writes a message to the current sink without formatting parameter.
Public method | Write(String, Object) | Writes a message to the current sink with a single formatting parameter.
Public method | Write(String, Object ) | Writes a message to the current sink with many formatting parameters.
Public method | Write(String, Object, Object) | Writes a message to the current sink with two formatting parameters.
Public method | Write(String, Object, Object, Object) | Writes a message to the current sink with three formatting parameters.
Public method | WriteLine(String) | Writes a message to the current sink without parameter, and issues a line break.
Public method | WriteLine(String, Object) | Writes a message to the current sink with a single formatting parameter, and issues a line break.
Public method | WriteLine(String, Object ) | Writes a message to the current sink with many formatting parameters, and issues a line break.
Public method | WriteLine(String, Object, Object) | Writes a message to the current sink with two formatting parameters, and issues a line break.
Public method | WriteLine(String, Object, Object, Object) | Writes a message to the current sink with three formatting parameters, and issues a line break.
Back to Top
Properties
 | Name | Description
Public property | Enabled | Determines whether the current trace sink is enabled.
Back to Top
See Also
PostSharpTrace Class
PostSharp.Extensibility Namespace

Online Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


PostSharpTrace Constructor

PostSharpTrace Constructor PostSharp Documentation
Initialize a new PostSharpTrace sink.

Namespace: PostSharp.Extensibility
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
public PostSharpTrace(
    string category
)
public PostSharpTrace(
    string category
)
Parameters
category
Type:   Online System String
Category of messages.
See Also
PostSharpTrace Class
PostSharpTrace Members
PostSharp.Extensibility Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


PostSharpTrace Methods

PostSharpTrace Methods PostSharp Documentation
Methods
 | Name | Description
 | EnableCategory(String) | Enables a trace category known by its name.
 | EnableCategory(PostSharpTrace) | Enables a trace category known by its object.
Public method | Write(String) | Writes a message to the current sink without formatting parameter.
Public method | Write(String, Object) | Writes a message to the current sink with a single formatting parameter.
Public method | Write(String, Object ) | Writes a message to the current sink with many formatting parameters.
Public method | Write(String, Object, Object) | Writes a message to the current sink with two formatting parameters.
Public method | Write(String, Object, Object, Object) | Writes a message to the current sink with three formatting parameters.
Public method | WriteLine(String) | Writes a message to the current sink without parameter, and issues a line break.
Public method | WriteLine(String, Object) | Writes a message to the current sink with a single formatting parameter, and issues a line break.
Public method | WriteLine(String, Object ) | Writes a message to the current sink with many formatting parameters, and issues a line break.
Public method | WriteLine(String, Object, Object) | Writes a message to the current sink with two formatting parameters, and issues a line break.
Public method | WriteLine(String, Object, Object, Object) | Writes a message to the current sink with three formatting parameters, and issues a line break.
Back to Top
See Also
PostSharpTrace Class
PostSharp.Extensibility Namespace

Online Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


PostSharpTrace.EnableCategory Method

PostSharpTrace EnableCategory Method PostSharp Documentation
Overload List
Name | Description
EnableCategory(String) | Enables a trace category known by its name.
EnableCategory(PostSharpTrace) | Enables a trace category known by its object.
Back to Top
See Also
PostSharpTrace Class
PostSharpTrace Members
PostSharp.Extensibility Namespace

Online Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


PostSharpTrace.EnableCategory Method (String)

PostSharpTrace EnableCategory Method (String) PostSharp Documentation
Enables a trace category known by its name.

Namespace: PostSharp.Extensibility
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
public static void EnableCategory(
    string category
)
public static void EnableCategory(
    string category
)
Parameters
category
Type:   Online System String
The category name.
See Also
PostSharpTrace Class
PostSharpTrace Members
EnableCategory Overload
PostSharp.Extensibility Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


PostSharpTrace.EnableCategory Method (PostSharpTrace)

PostSharpTrace EnableCategory Method (PostSharpTrace) PostSharp Documentation
Enables a trace category known by its object.

Namespace: PostSharp.Extensibility
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
public static void EnableCategory(
    PostSharpTrace category
)
public static void EnableCategory(
    PostSharpTrace category
)
Parameters
category
Type: PostSharp.Extensibility PostSharpTrace
A PostSharpTrace object.
See Also
PostSharpTrace Class
PostSharpTrace Members
EnableCategory Overload
PostSharp.Extensibility Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


PostSharpTrace.Write Method

PostSharpTrace Write Method PostSharp Documentation
Overload List
 | Name | Description
Public method | Write(String) | Writes a message to the current sink without formatting parameter.
Public method | Write(String, Object) | Writes a message to the current sink with a single formatting parameter.
Public method | Write(String, Object ) | Writes a message to the current sink with many formatting parameters.
Public method | Write(String, Object, Object) | Writes a message to the current sink with two formatting parameters.
Public method | Write(String, Object, Object, Object) | Writes a message to the current sink with three formatting parameters.
Back to Top
See Also
PostSharpTrace Class
PostSharpTrace Members
PostSharp.Extensibility Namespace

Online Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


PostSharpTrace.Write Method (String)

PostSharpTrace Write Method (String) PostSharp Documentation
Writes a message to the current sink without formatting parameter.

Namespace: PostSharp.Extensibility
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
public void Write(
    string message
)
public void Write(
    string message
)
Parameters
message
Type:   Online System String
Message.
See Also
PostSharpTrace Class
PostSharpTrace Members
Write Overload
PostSharp.Extensibility Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


PostSharpTrace.Write Method (String, Object)

PostSharpTrace Write Method (String, Object) PostSharp Documentation
Writes a message to the current sink with a single formatting parameter.

Namespace: PostSharp.Extensibility
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
public void Write(
    string format,
    Object arg0
)
public void Write(
    string format,
    Object arg0
)
Parameters
format
Type:   Online System String
Message formatting string.
arg0
Type:   Online System Object
The first formatting parameter.
See Also
PostSharpTrace Class
PostSharpTrace Members
Write Overload
PostSharp.Extensibility Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


PostSharpTrace.Write Method (String, Object[])

PostSharpTrace Write Method (String, Object ) PostSharp Documentation
Writes a message to the current sink with many formatting parameters.

Namespace: PostSharp.Extensibility
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
public void Write(
    string format,
    params Object[] parameters
)
public void Write(
    string format,
    params Object[] parameters
)
Parameters
format
Type:   Online System String
Message formatting string.
parameters
Type:    Online System Object
Formatting parameters.
See Also
PostSharpTrace Class
PostSharpTrace Members
Write Overload
PostSharp.Extensibility Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


PostSharpTrace.Write Method (String, Object, Object)

PostSharpTrace Write Method (String, Object, Object) PostSharp Documentation
Writes a message to the current sink with two formatting parameters.

Namespace: PostSharp.Extensibility
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
public void Write(
    string format,
    Object arg0,
    Object arg1
)
public void Write(
    string format,
    Object arg0,
    Object arg1
)
Parameters
format
Type:   Online System String
Message formatting string.
arg0
Type:   Online System Object
The first formatting parameter.
arg1
Type:   Online System Object
The second formatting parameter.
See Also
PostSharpTrace Class
PostSharpTrace Members
Write Overload
PostSharp.Extensibility Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


PostSharpTrace.Write Method (String, Object, Object, Object)

PostSharpTrace Write Method (String, Object, Object, Object) PostSharp Documentation
Writes a message to the current sink with three formatting parameters.

Namespace: PostSharp.Extensibility
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
public void Write(
    string format,
    Object arg0,
    Object arg1,
    Object arg2
)
public void Write(
    string format,
    Object arg0,
    Object arg1,
    Object arg2
)
Parameters
format
Type:   Online System String
Message formatting string.
arg0
Type:   Online System Object
The first formatting parameter.
arg1
Type:   Online System Object
The second formatting parameter.
arg2
Type:   Online System Object
The thirs formatting parameter.
See Also
PostSharpTrace Class
PostSharpTrace Members
Write Overload
PostSharp.Extensibility Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


PostSharpTrace.WriteLine Method

PostSharpTrace WriteLine Method PostSharp Documentation
Overload List
 | Name | Description
Public method | WriteLine(String) | Writes a message to the current sink without parameter, and issues a line break.
Public method | WriteLine(String, Object) | Writes a message to the current sink with a single formatting parameter, and issues a line break.
Public method | WriteLine(String, Object ) | Writes a message to the current sink with many formatting parameters, and issues a line break.
Public method | WriteLine(String, Object, Object) | Writes a message to the current sink with two formatting parameters, and issues a line break.
Public method | WriteLine(String, Object, Object, Object) | Writes a message to the current sink with three formatting parameters, and issues a line break.
Back to Top
See Also
PostSharpTrace Class
PostSharpTrace Members
PostSharp.Extensibility Namespace

Online Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


PostSharpTrace.WriteLine Method (String)

PostSharpTrace WriteLine Method (String) PostSharp Documentation
Writes a message to the current sink without parameter, and issues a line break.

Namespace: PostSharp.Extensibility
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
public void WriteLine(
    string format
)
public void WriteLine(
    string format
)
Parameters
format
Type:   Online System String
Message formatting string.
See Also
PostSharpTrace Class
PostSharpTrace Members
WriteLine Overload
PostSharp.Extensibility Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


PostSharpTrace.WriteLine Method (String, Object)

PostSharpTrace WriteLine Method (String, Object) PostSharp Documentation
Writes a message to the current sink with a single formatting parameter, and issues a line break.

Namespace: PostSharp.Extensibility
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
public void WriteLine(
    string format,
    Object arg0
)
public void WriteLine(
    string format,
    Object arg0
)
Parameters
format
Type:   Online System String
Message formatting string.
arg0
Type:   Online System Object
The first formatting parameter.
See Also
PostSharpTrace Class
PostSharpTrace Members
WriteLine Overload
PostSharp.Extensibility Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


PostSharpTrace.WriteLine Method (String, Object[])

PostSharpTrace WriteLine Method (String, Object ) PostSharp Documentation
Writes a message to the current sink with many formatting parameters, and issues a line break.

Namespace: PostSharp.Extensibility
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
public void WriteLine(
    string format,
    params Object[] parameters
)
public void WriteLine(
    string format,
    params Object[] parameters
)
Parameters
format
Type:   Online System String
Message formatting string.
parameters
Type:    Online System Object
Formatting parameters.
See Also
PostSharpTrace Class
PostSharpTrace Members
WriteLine Overload
PostSharp.Extensibility Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


PostSharpTrace.WriteLine Method (String, Object, Object)

PostSharpTrace WriteLine Method (String, Object, Object) PostSharp Documentation
Writes a message to the current sink with two formatting parameters, and issues a line break.

Namespace: PostSharp.Extensibility
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
public void WriteLine(
    string format,
    Object arg0,
    Object arg1
)
public void WriteLine(
    string format,
    Object arg0,
    Object arg1
)
Parameters
format
Type:   Online System String
Message formatting string.
arg0
Type:   Online System Object
The first formatting parameter.
arg1
Type:   Online System Object
The second formatting parameter.
See Also
PostSharpTrace Class
PostSharpTrace Members
WriteLine Overload
PostSharp.Extensibility Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


PostSharpTrace.WriteLine Method (String, Object, Object, Object)

PostSharpTrace WriteLine Method (String, Object, Object, Object) PostSharp Documentation
Writes a message to the current sink with three formatting parameters, and issues a line break.

Namespace: PostSharp.Extensibility
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
public void WriteLine(
    string format,
    Object arg0,
    Object arg1,
    Object arg2
)
public void WriteLine(
    string format,
    Object arg0,
    Object arg1,
    Object arg2
)
Parameters
format
Type:   Online System String
Message formatting string.
arg0
Type:   Online System Object
The first formatting parameter.
arg1
Type:   Online System Object
The second formatting parameter.
arg2
Type:   Online System Object
The thirs formatting parameter.
See Also
PostSharpTrace Class
PostSharpTrace Members
WriteLine Overload
PostSharp.Extensibility Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


PostSharpTrace Properties

PostSharpTrace Properties PostSharp Documentation
The PostSharpTrace type exposes the following members.
Properties
 | Name | Description
Public property | Enabled | Determines whether the current trace sink is enabled.
Back to Top
See Also
PostSharpTrace Class
PostSharp.Extensibility Namespace

Online Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


PostSharpTrace.Enabled Property

PostSharpTrace Enabled Property PostSharp Documentation
Determines whether the current trace sink is enabled.

Namespace: PostSharp.Extensibility
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
public bool Enabled { get; }
public bool Enabled { get; }
Property Value
Type:   Online Boolean
See Also
PostSharpTrace Class
PostSharpTrace Members
PostSharp.Extensibility Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


ProjectExtensionElement Class

ProjectExtensionElement Class PostSharp Documentation
Represents a custom element (or section) in the XML project type.
Inheritance Hierarchy
Online System Object
PostSharp.Extensibility ProjectExtensionElement

Namespace: PostSharp.Extensibility
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
public sealed class ProjectExtensionElement
public sealed class ProjectExtensionElement
See Also
ProjectExtensionElement Members
PostSharp.Extensibility Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


ProjectExtensionElement Members

ProjectExtensionElement Members PostSharp Documentation

The ProjectExtensionElement type exposes the following members.
Properties
 | Name | Description
Public property | FileName | Gets the full path of the file in which the element is defined.
Public property | Xml | Gets the text representation of the XmlElement materializing the project extension.
Public property | XmlElement | Gets the XmlElement materializing the project extension.
Back to Top
See Also
ProjectExtensionElement Class
PostSharp.Extensibility Namespace

Online Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


ProjectExtensionElement Properties

ProjectExtensionElement Properties PostSharp Documentation
The ProjectExtensionElement type exposes the following members.
Properties
 | Name | Description
Public property | FileName | Gets the full path of the file in which the element is defined.
Public property | Xml | Gets the text representation of the XmlElement materializing the project extension.
Public property | XmlElement | Gets the XmlElement materializing the project extension.
Back to Top
See Also
ProjectExtensionElement Class
PostSharp.Extensibility Namespace

Online Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


ProjectExtensionElement.FileName Property

ProjectExtensionElement FileName Property PostSharp Documentation
Gets the full path of the file in which the element is defined.

Namespace: PostSharp.Extensibility
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
public string FileName { get; private set; }
public string FileName { get; private set; }
Property Value
Type:   Online String
See Also
ProjectExtensionElement Class
ProjectExtensionElement Members
PostSharp.Extensibility Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


ProjectExtensionElement.Xml Property

ProjectExtensionElement Xml Property PostSharp Documentation
Gets the text representation of the XmlElement materializing the project extension.

Namespace: PostSharp.Extensibility
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
public string Xml { get; }
public string Xml { get; }
Property Value
Type:   Online String
See Also
ProjectExtensionElement Class
ProjectExtensionElement Members
PostSharp.Extensibility Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


ProjectExtensionElement.XmlElement Property

ProjectExtensionElement XmlElement Property PostSharp Documentation
Gets the XmlElement materializing the project extension.

Namespace: PostSharp.Extensibility
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
public XmlElement XmlElement { get; private set; }
public XmlElement XmlElement { get; private set; }
Property Value
Type:   Online XmlElement
See Also
ProjectExtensionElement Class
ProjectExtensionElement Members
PostSharp.Extensibility Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


ProjectResource Class

ProjectResource Class PostSharp Documentation
Represents an element of a resource section, i.e. a named object deserialized from XML.
Inheritance Hierarchy
Online System Object
PostSharp.Extensibility ProjectResource

Namespace: PostSharp.Extensibility
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
public sealed class ProjectResource
public sealed class ProjectResource
See Also
ProjectResource Members
PostSharp.Extensibility Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


ProjectResource Members

ProjectResource Members PostSharp Documentation

The ProjectResource type exposes the following members.
Constructors
 | Name | Description
Public method | ProjectResource | Initializes a new ProjectResource.
Back to Top
Properties
 | Name | Description
Public property | Name | Gets the name of the resource section, i.e. the name of the XML element containing the resource.
Public property | Value | Gets the resource value, i.e. the object that has been constructed by deserializing the XML element.
Back to Top
See Also
ProjectResource Class
PostSharp.Extensibility Namespace

Online Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


ProjectResource Constructor

ProjectResource Constructor PostSharp Documentation
Initializes a new ProjectResource.

Namespace: PostSharp.Extensibility
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
public ProjectResource(
    string name,
    Object value
)
public ProjectResource(
    string name,
    Object value
)
Parameters
name
Type:   Online System String
Resource name.
value
Type:   Online System Object
Resource value.
See Also
ProjectResource Class
ProjectResource Members
PostSharp.Extensibility Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


ProjectResource Properties

ProjectResource Properties PostSharp Documentation
The ProjectResource type exposes the following members.
Properties
 | Name | Description
Public property | Name | Gets the name of the resource section, i.e. the name of the XML element containing the resource.
Public property | Value | Gets the resource value, i.e. the object that has been constructed by deserializing the XML element.
Back to Top
See Also
ProjectResource Class
PostSharp.Extensibility Namespace

Online Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


ProjectResource.Name Property

ProjectResource Name Property PostSharp Documentation
Gets the name of the resource section, i.e. the name of the XML element containing the resource.

Namespace: PostSharp.Extensibility
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
public string Name { get; private set; }
public string Name { get; private set; }
Property Value
Type:   Online String
See Also
ProjectResource Class
ProjectResource Members
PostSharp.Extensibility Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


ProjectResource.Value Property

ProjectResource Value Property PostSharp Documentation
Gets the resource value, i.e. the object that has been constructed by deserializing the XML element.

Namespace: PostSharp.Extensibility
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
public Object Value { get; private set; }
public Object Value { get; private set; }
Property Value
Type:   Online Object
See Also
ProjectResource Class
ProjectResource Members
PostSharp.Extensibility Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


RequireLicenseAttribute Class

RequireLicenseAttribute Class PostSharp Documentation
Custom attribute that, when applied to an aspect, causes PostSharp to require some license in order to weave the aspect.
Inheritance Hierarchy
Online System Object
Online System Attribute
PostSharp.Extensibility RequireLicenseAttribute

Namespace: PostSharp.Extensibility
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
public sealed class RequireLicenseAttribute : Attribute
public sealed class RequireLicenseAttribute : Attribute
Remarks
When several instances of this custom attributes are available, the license check will be satisfied with any of them.
See Also
RequireLicenseAttribute Members
PostSharp.Extensibility Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


RequireLicenseAttribute Members

RequireLicenseAttribute Members PostSharp Documentation

The RequireLicenseAttribute type exposes the following members.
Constructors
 | Name | Description
Public method | RequireLicenseAttribute | Initializes a new RequireLicenseAttribute.
Back to Top
Properties
 | Name | Description
Public property | Description | Gets or sets the human-readable description of the license requirement.
Public property | Features | Gets or sets the bitmask of required licensed features.
Public property | Product | Gets the identifier of the required licensed product.
Back to Top
See Also
RequireLicenseAttribute Class
PostSharp.Extensibility Namespace

Online Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


RequireLicenseAttribute Constructor

RequireLicenseAttribute Constructor PostSharp Documentation
Initializes a new RequireLicenseAttribute.

Namespace: PostSharp.Extensibility
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
public RequireLicenseAttribute(
    int product
)
public RequireLicenseAttribute(
    int product
)
Parameters
product
Type:   Online System Int32
Identifier of the licensed product.
See Also
RequireLicenseAttribute Class
RequireLicenseAttribute Members
PostSharp.Extensibility Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


RequireLicenseAttribute Properties

RequireLicenseAttribute Properties PostSharp Documentation
The RequireLicenseAttribute type exposes the following members.
Properties
 | Name | Description
Public property | Description | Gets or sets the human-readable description of the license requirement.
Public property | Features | Gets or sets the bitmask of required licensed features.
Public property | Product | Gets the identifier of the required licensed product.
Back to Top
See Also
RequireLicenseAttribute Class
PostSharp.Extensibility Namespace

Online Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


RequireLicenseAttribute.Description Property

RequireLicenseAttribute Description Property PostSharp Documentation
Gets or sets the human-readable description of the license requirement.

Namespace: PostSharp.Extensibility
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
public string Description { get; set; }
public string Description { get; set; }
Property Value
Type:   Online String
See Also
RequireLicenseAttribute Class
RequireLicenseAttribute Members
PostSharp.Extensibility Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


RequireLicenseAttribute.Features Property

RequireLicenseAttribute Features Property PostSharp Documentation
Gets or sets the bitmask of required licensed features.

Namespace: PostSharp.Extensibility
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
public long Features { get; set; }
public long Features { get; set; }
Property Value
Type:   Online Int64
See Also
RequireLicenseAttribute Class
RequireLicenseAttribute Members
PostSharp.Extensibility Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


RequireLicenseAttribute.Product Property

RequireLicenseAttribute Product Property PostSharp Documentation
Gets the identifier of the required licensed product.

Namespace: PostSharp.Extensibility
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
public int Product { get; private set; }
public int Product { get; private set; }
Property Value
Type:   Online Int32
See Also
RequireLicenseAttribute Class
RequireLicenseAttribute Members
PostSharp.Extensibility Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


RequirePostSharpAttribute Class

RequirePostSharpAttribute Class PostSharp Documentation
Custom attribute that, when applied on another custom attribute (a class derived from Online Attribute), means that assemblies with elements annotated with that custom attribute should be processed by PostSharp.
Inheritance Hierarchy
Online System Object
Online System Attribute
PostSharp.Extensibility RequirePostSharpAttribute

Namespace: PostSharp.Extensibility
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
public sealed class RequirePostSharpAttribute : Attribute
public sealed class RequirePostSharpAttribute : Attribute
See Also
RequirePostSharpAttribute Members
PostSharp.Extensibility Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


RequirePostSharpAttribute Members

RequirePostSharpAttribute Members PostSharp Documentation

The RequirePostSharpAttribute type exposes the following members.
Constructors
 | Name | Description
Public method | RequirePostSharpAttribute | Initializes a new RequirePostSharpAttribute.
Back to Top
Properties
 | Name | Description
Public property | AssemblyReferenceOnly | Determines whether the requirement should apply only to assemblies referencing the declaration to which the custom attribute is applied. If true, the requirement will not apply to the assembly where the custom attribute is used.
Public property | PlugIn | Gets the name of the required plug-in (file name without the extension).
Public property | Task | Gets the name of the required task (should be defined in PlugIn).
Back to Top
See Also
RequirePostSharpAttribute Class
PostSharp.Extensibility Namespace

Online Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


RequirePostSharpAttribute Constructor

RequirePostSharpAttribute Constructor PostSharp Documentation
Initializes a new RequirePostSharpAttribute.

Namespace: PostSharp.Extensibility
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
public RequirePostSharpAttribute(
    string plugIn,
    string task
)
public RequirePostSharpAttribute(
    string plugIn,
    string task
)
Parameters
plugIn
Type:   Online System String
Name of the required plug-in (file name without extension).
task
Type:   Online System String
Name of the required task (should be defined in plugIn).
See Also
RequirePostSharpAttribute Class
RequirePostSharpAttribute Members
PostSharp.Extensibility Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


RequirePostSharpAttribute Properties

RequirePostSharpAttribute Properties PostSharp Documentation
The RequirePostSharpAttribute type exposes the following members.
Properties
 | Name | Description
Public property | AssemblyReferenceOnly | Determines whether the requirement should apply only to assemblies referencing the declaration to which the custom attribute is applied. If true, the requirement will not apply to the assembly where the custom attribute is used.
Public property | PlugIn | Gets the name of the required plug-in (file name without the extension).
Public property | Task | Gets the name of the required task (should be defined in PlugIn).
Back to Top
See Also
RequirePostSharpAttribute Class
PostSharp.Extensibility Namespace

Online Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


RequirePostSharpAttribute.AssemblyReferenceOnly Property

RequirePostSharpAttribute AssemblyReferenceOnly Property PostSharp Documentation
Determines whether the requirement should apply only to assemblies referencing the declaration to which the custom attribute is applied. If true, the requirement will not apply to the assembly where the custom attribute is used.

Namespace: PostSharp.Extensibility
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
public bool AssemblyReferenceOnly { get; set; }
public bool AssemblyReferenceOnly { get; set; }
Property Value
Type:   Online Boolean
See Also
RequirePostSharpAttribute Class
RequirePostSharpAttribute Members
PostSharp.Extensibility Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


RequirePostSharpAttribute.PlugIn Property

RequirePostSharpAttribute PlugIn Property PostSharp Documentation
Gets the name of the required plug-in (file name without the extension).

Namespace: PostSharp.Extensibility
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
public string PlugIn { get; }
public string PlugIn { get; }
Property Value
Type:   Online String
See Also
RequirePostSharpAttribute Class
RequirePostSharpAttribute Members
PostSharp.Extensibility Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


RequirePostSharpAttribute.Task Property

RequirePostSharpAttribute Task Property PostSharp Documentation
Gets the name of the required task (should be defined in PlugIn).

Namespace: PostSharp.Extensibility
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
public string Task { get; }
public string Task { get; }
Property Value
Type:   Online String
See Also
RequirePostSharpAttribute Class
RequirePostSharpAttribute Members
PostSharp.Extensibility Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


RequireReflectionWrapperAttribute Class

RequireReflectionWrapperAttribute Class PostSharp Documentation
Custom attribute that, when applied on a type, specifies that all build-time semantics of this type require reflection wrappers to be passed instead of real reflection objects.
Inheritance Hierarchy
Online System Object
Online System Attribute
PostSharp.Extensibility RequireReflectionWrapperAttribute

Namespace: PostSharp.Extensibility
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
[ObsoleteAttribute("Reflection wrappers are now returned automatically when a real reflection type cannot be returned.",
    true)]
public sealed class RequireReflectionWrapperAttribute : Attribute
[ObsoleteAttribute("Reflection wrappers are now returned automatically when a real reflection type cannot be returned.",
    true)]
public sealed class RequireReflectionWrapperAttribute : Attribute
See Also
RequireReflectionWrapperAttribute Members
PostSharp.Extensibility Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


RequireReflectionWrapperAttribute Members

RequireReflectionWrapperAttribute Members PostSharp Documentation

The RequireReflectionWrapperAttribute type exposes the following members.
Constructors
 | Name | Description
Public method | RequireReflectionWrapperAttribute | Initializes a new instance of the RequireReflectionWrapperAttribute class
Back to Top
See Also
RequireReflectionWrapperAttribute Class
PostSharp.Extensibility Namespace

Online Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


RequireReflectionWrapperAttribute Constructor

RequireReflectionWrapperAttribute Constructor PostSharp Documentation
Initializes a new instance of the RequireReflectionWrapperAttribute class

Namespace: PostSharp.Extensibility
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
public RequireReflectionWrapperAttribute()
public RequireReflectionWrapperAttribute()
See Also
RequireReflectionWrapperAttribute Class
RequireReflectionWrapperAttribute Members
PostSharp.Extensibility Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


SeverityType Enumeration

SeverityType Enumeration PostSharp Documentation
Types of message severities.

Namespace: PostSharp.Extensibility
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
public enum SeverityType
public enum SeverityType
Members
Member name | Value | Description
Debug | 0 | Debugging information (typically trace).
Verbose | 1 | Verbose (lowly important information).
Info | 2 | Information.
ImportantInfo | 3 | Important information.
CommandLine | 4 | Command line.
Warning | 5 | Warning.
Error | 6 | Error.
Fatal | 7 | Fatal error.
None | -1 | No message.
See Also
PostSharp.Extensibility Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


SuppressAnnotationValidationAttribute Class

SuppressAnnotationValidationAttribute Class PostSharp Documentation
Instructs PostSharp that the validation of IValidableAnnotation is done by another component, and should not be processed by the default component.
Inheritance Hierarchy
Online System Object
Online System Attribute
PostSharp.Extensibility SuppressAnnotationValidationAttribute

Namespace: PostSharp.Extensibility
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
public class SuppressAnnotationValidationAttribute : Attribute
public class SuppressAnnotationValidationAttribute : Attribute
See Also
SuppressAnnotationValidationAttribute Members
PostSharp.Extensibility Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


SuppressAnnotationValidationAttribute Members

SuppressAnnotationValidationAttribute Members PostSharp Documentation

The SuppressAnnotationValidationAttribute type exposes the following members.
Constructors
 | Name | Description
Public method | SuppressAnnotationValidationAttribute | Initializes a new instance of the SuppressAnnotationValidationAttribute class
Back to Top
See Also
SuppressAnnotationValidationAttribute Class
PostSharp.Extensibility Namespace

Online Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


SuppressAnnotationValidationAttribute Constructor

SuppressAnnotationValidationAttribute Constructor PostSharp Documentation
Initializes a new instance of the SuppressAnnotationValidationAttribute class

Namespace: PostSharp.Extensibility
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
public SuppressAnnotationValidationAttribute()
public SuppressAnnotationValidationAttribute()
See Also
SuppressAnnotationValidationAttribute Class
SuppressAnnotationValidationAttribute Members
PostSharp.Extensibility Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


TargetFrameworkFamily Structure

TargetFrameworkFamily Structure PostSharp Documentation
Represents a variant of family (variant) of the .NET Framework, e.g. NetCore, NetFramework, Silverlight or NetPortable.

Namespace: PostSharp.Extensibility
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
public struct TargetFrameworkFamily : IEquatable<TargetFrameworkFamily>
public struct TargetFrameworkFamily : IEquatable<TargetFrameworkFamily>
See Also
TargetFrameworkFamily Members
PostSharp.Extensibility Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


TargetFrameworkFamily Members

TargetFrameworkFamily Members PostSharp Documentation

The TargetFrameworkFamily type exposes the following members.
Methods
 | Name | Description
Public method | Equals(Object) | Indicates whether this instance and a specified object are equal. (Overrides Online ValueType Equals(Object).)
Public method | Equals(TargetFrameworkFamily) | Indicates whether the current object is equal to another object of the same type.
Public method | GetHashCode | Returns the hash code for this instance. (Overrides Online ValueType GetHashCode .)
Back to Top
Operators
Name | Description
Equality | Determines whether two TargetFrameworkFamily instances are equal.
Inequality | Determines whether two TargetFrameworkFamily instances are different.
Back to Top
Fields
Name | Description
NetCore | Instance of TargetFrameworkFamily representing .NET Framework for Windows Store.
NetFramework | Instance of TargetFrameworkFamily representing the full .NET Framework.
NetPortable | Instance of TargetFrameworkFamily representing .NET Portable Class Library.
Silverlight | Instance of TargetFrameworkFamily representing Silverlight.
Back to Top
Properties
 | Name | Description
Public property | IsNull | Determines whether the current object represents a null instance.
Public property | Value | Gets the string identity of the current object.
Back to Top
See Also
TargetFrameworkFamily Structure
PostSharp.Extensibility Namespace

Online Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


TargetFrameworkFamily Fields

TargetFrameworkFamily Fields PostSharp Documentation
The TargetFrameworkFamily type exposes the following members.
Fields
Name | Description
NetCore | Instance of TargetFrameworkFamily representing .NET Framework for Windows Store.
NetFramework | Instance of TargetFrameworkFamily representing the full .NET Framework.
NetPortable | Instance of TargetFrameworkFamily representing .NET Portable Class Library.
Silverlight | Instance of TargetFrameworkFamily representing Silverlight.
Back to Top
See Also
TargetFrameworkFamily Structure
PostSharp.Extensibility Namespace

Online Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


TargetFrameworkFamily.NetCore Field

TargetFrameworkFamily NetCore Field PostSharp Documentation
Instance of TargetFrameworkFamily representing .NET Framework for Windows Store.

Namespace: PostSharp.Extensibility
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
public static readonly TargetFrameworkFamily NetCore
public static readonly TargetFrameworkFamily NetCore
Field Value
Type: TargetFrameworkFamily
See Also
TargetFrameworkFamily Structure
TargetFrameworkFamily Members
PostSharp.Extensibility Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


TargetFrameworkFamily.NetFramework Field

TargetFrameworkFamily NetFramework Field PostSharp Documentation
Instance of TargetFrameworkFamily representing the full .NET Framework.

Namespace: PostSharp.Extensibility
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
public static readonly TargetFrameworkFamily NetFramework
public static readonly TargetFrameworkFamily NetFramework
Field Value
Type: TargetFrameworkFamily
See Also
TargetFrameworkFamily Structure
TargetFrameworkFamily Members
PostSharp.Extensibility Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


TargetFrameworkFamily.NetPortable Field

TargetFrameworkFamily NetPortable Field PostSharp Documentation
Instance of TargetFrameworkFamily representing .NET Portable Class Library.

Namespace: PostSharp.Extensibility
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
public static readonly TargetFrameworkFamily NetPortable
public static readonly TargetFrameworkFamily NetPortable
Field Value
Type: TargetFrameworkFamily
See Also
TargetFrameworkFamily Structure
TargetFrameworkFamily Members
PostSharp.Extensibility Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


TargetFrameworkFamily.Silverlight Field

TargetFrameworkFamily Silverlight Field PostSharp Documentation
Instance of TargetFrameworkFamily representing Silverlight.

Namespace: PostSharp.Extensibility
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
public static readonly TargetFrameworkFamily Silverlight
public static readonly TargetFrameworkFamily Silverlight
Field Value
Type: TargetFrameworkFamily
See Also
TargetFrameworkFamily Structure
TargetFrameworkFamily Members
PostSharp.Extensibility Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


TargetFrameworkFamily Methods

TargetFrameworkFamily Methods PostSharp Documentation
The TargetFrameworkFamily type exposes the following members.
Methods
 | Name | Description
Public method | Equals(Object) | Indicates whether this instance and a specified object are equal. (Overrides Online ValueType Equals(Object).)
Public method | Equals(TargetFrameworkFamily) | Indicates whether the current object is equal to another object of the same type.
Public method | GetHashCode | Returns the hash code for this instance. (Overrides Online ValueType GetHashCode .)
Back to Top
See Also
TargetFrameworkFamily Structure
PostSharp.Extensibility Namespace

Online Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


TargetFrameworkFamily.Equals Method

TargetFrameworkFamily Equals Method PostSharp Documentation
Overload List
 | Name | Description
Public method | Equals(Object) | Indicates whether this instance and a specified object are equal. (Overrides Online ValueType Equals(Object).)
Public method | Equals(TargetFrameworkFamily) | Indicates whether the current object is equal to another object of the same type.
Back to Top
See Also
TargetFrameworkFamily Structure
TargetFrameworkFamily Members
PostSharp.Extensibility Namespace

Online Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


TargetFrameworkFamily.Equals Method (Object)

TargetFrameworkFamily Equals Method (Object) PostSharp Documentation
Indicates whether this instance and a specified object are equal.

Namespace: PostSharp.Extensibility
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
public override bool Equals(
    Object obj
)
public override bool Equals(
    Object obj
)
Parameters
obj
Type:   Online System Object
Another object to compare to.
Return Value
Type:   Online Boolean
true if obj and this instance are the same type and represent the same value; otherwise, false.
See Also
TargetFrameworkFamily Structure
TargetFrameworkFamily Members
Equals Overload
PostSharp.Extensibility Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


TargetFrameworkFamily.Equals Method (TargetFrameworkFamily)

TargetFrameworkFamily Equals Method (TargetFrameworkFamily) PostSharp Documentation
Indicates whether the current object is equal to another object of the same type.

Namespace: PostSharp.Extensibility
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
public bool Equals(
    TargetFrameworkFamily other
)
public bool Equals(
    TargetFrameworkFamily other
)
Parameters
other
Type: PostSharp.Extensibility TargetFrameworkFamily
An object to compare with this object.
Return Value
Type:   Online Boolean
true if the current object is equal to the other parameter; otherwise, false.
Implements
  Online IEquatable T  Equals(T)
See Also
TargetFrameworkFamily Structure
TargetFrameworkFamily Members
Equals Overload
PostSharp.Extensibility Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


TargetFrameworkFamily.GetHashCode Method

TargetFrameworkFamily GetHashCode Method PostSharp Documentation
Returns the hash code for this instance.

Namespace: PostSharp.Extensibility
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
public override int GetHashCode()
public override int GetHashCode()
Return Value
Type:   Online Int32
A 32-bit signed integer that is the hash code for this instance.
See Also
TargetFrameworkFamily Structure
TargetFrameworkFamily Members
PostSharp.Extensibility Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


TargetFrameworkFamily Operators

TargetFrameworkFamily Operators PostSharp Documentation
The TargetFrameworkFamily type exposes the following members.
Operators
Name | Description
Equality | Determines whether two TargetFrameworkFamily instances are equal.
Inequality | Determines whether two TargetFrameworkFamily instances are different.
Back to Top
See Also
TargetFrameworkFamily Structure
PostSharp.Extensibility Namespace

Online Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


TargetFrameworkFamily.Equality Operator

TargetFrameworkFamily Equality Operator PostSharp Documentation
Determines whether two TargetFrameworkFamily instances are equal.

Namespace: PostSharp.Extensibility
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
public static bool operator ==(
    TargetFrameworkFamily x,
    TargetFrameworkFamily y
)
public static bool operator ==(
    TargetFrameworkFamily x,
    TargetFrameworkFamily y
)
Parameters
x
Type: PostSharp.Extensibility TargetFrameworkFamily
A TargetFrameworkFamily.
y
Type: PostSharp.Extensibility TargetFrameworkFamily
A TargetFrameworkFamily.
Return Value
Type:   Online Boolean
true if x and y are equal, otherwise  false.
See Also
TargetFrameworkFamily Structure
TargetFrameworkFamily Members
PostSharp.Extensibility Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


TargetFrameworkFamily.Inequality Operator

TargetFrameworkFamily Inequality Operator PostSharp Documentation
Determines whether two TargetFrameworkFamily instances are different.

Namespace: PostSharp.Extensibility
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
public static bool operator !=(
    TargetFrameworkFamily x,
    TargetFrameworkFamily y
)
public static bool operator !=(
    TargetFrameworkFamily x,
    TargetFrameworkFamily y
)
Parameters
x
Type: PostSharp.Extensibility TargetFrameworkFamily
A TargetFrameworkFamily.
y
Type: PostSharp.Extensibility TargetFrameworkFamily
A TargetFrameworkFamily.
Return Value
Type:   Online Boolean
true if x and y are different, otherwise  false
See Also
TargetFrameworkFamily Structure
TargetFrameworkFamily Members
PostSharp.Extensibility Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


TargetFrameworkFamily Properties

TargetFrameworkFamily Properties PostSharp Documentation
The TargetFrameworkFamily type exposes the following members.
Properties
 | Name | Description
Public property | IsNull | Determines whether the current object represents a null instance.
Public property | Value | Gets the string identity of the current object.
Back to Top
See Also
TargetFrameworkFamily Structure
PostSharp.Extensibility Namespace

Online Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


TargetFrameworkFamily.IsNull Property

TargetFrameworkFamily IsNull Property PostSharp Documentation
Determines whether the current object represents a null instance.

Namespace: PostSharp.Extensibility
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
public bool IsNull { get; }
public bool IsNull { get; }
Property Value
Type:   Online Boolean
See Also
TargetFrameworkFamily Structure
TargetFrameworkFamily Members
PostSharp.Extensibility Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


TargetFrameworkFamily.Value Property

TargetFrameworkFamily Value Property PostSharp Documentation
Gets the string identity of the current object.

Namespace: PostSharp.Extensibility
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
public string Value { get; }
public string Value { get; }
Property Value
Type:   Online String
See Also
TargetFrameworkFamily Structure
TargetFrameworkFamily Members
PostSharp.Extensibility Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


PostSharp.Patterns.Contracts Namespace

PostSharp.Patterns.Contracts Namespace PostSharp Documentation
The PostSharp.Patterns.Contracts namespace contains ready-made contracts that validate fields, properties and parameters at runtime.
Classes
 | Class | Description
Public class | CreditCardAttribute | Custom attribute that, when added to a field, property or parameter, throws an Online ArgumentException if the target is assigned a value that is not a valid credit card number. Null strings are accepted and do not throw an exception.
Public class | EmailAddressAttribute | Custom attribute that, when added to a field, property or parameter, throws an Online ArgumentException if the target is assigned a value that is not a valid email address. Null strings are accepted and do not throw an exception.
Public class | EnumDataTypeAttribute | Custom attribute that, when added to a field, property or parameter, throws an Online ArgumentException if the target is assigned a value that is not a valid member of an enumeration.
Public class | GreaterThanAttribute | Custom attribute that, when added to a field, property or parameter, throws an Online ArgumentOutOfRangeException if the target is assigned a value that is smaller or equal to a given value.
Public class | LessThanAttribute | Custom attribute that, when added to a field, property or parameter, throws an Online ArgumentOutOfRangeException if the target is assigned a value that is greater or equal to a given value.
Public class | LocationContractAttribute | Base class for other custom attributes in this namespace.
Public class | NotEmptyAttribute | Custom attribute that, when added to a field, property or parameter, throws an Online ArgumentNullException if the target is assigned a null or empty value. The custom attributes can be added to locations of type Online String (where empty means zero character) or Online ICollection (where empty means zero item).
Public class | NotNullAttribute | Custom attribute that, when added to a field, property or parameter, throws an Online ArgumentNullException if the target is assigned a null value.
Public class | PhoneAttribute | Custom attribute that, when added to a field, property or parameter, throws an Online ArgumentException if the target is assigned a value that is not a valid phone number. Null strings are accepted and do not throw an exception.
Public class | PositiveAttribute | Custom attribute that, when added to a field, property or parameter, throws an Online ArgumentOutOfRangeException if the target is assigned a value that smaller than zero.
Public class | RangeAttribute | Custom attribute that, when added to a field, property or parameter, throws an Online ArgumentOutOfRangeException if the target is assigned a value that is outside a given range.
Public class | RegularExpressionAttribute | Custom attribute that, when added to a field, property or parameter, throws an Online ArgumentException if the target is assigned a value that does not match a given regular expression. Null strings are accepted and do not throw an exception.
Public class | RequiredAttribute | Custom attribute that, when added to a field, property or parameter, throws an Online ArgumentNullException if the target is assigned a null value or an empty or white-space string.
Public class | StrictlyGreaterThanAttribute | Custom attribute that, when added to a field, property or parameter, throws an Online ArgumentOutOfRangeException if the target is assigned a value that is strictly smaller than a given value.
Public class | StrictlyPositiveAttribute | Custom attribute that, when added to a field, property or parameter, throws an Online ArgumentOutOfRangeException if the target is assigned a value that smaller than zero.
Public class | StringLengthAttribute | Custom attribute that, when added to a field, property or parameter, throws an Online ArgumentException if the target is assigned a string of invalid lenght. Null strings are accepted and do not throw an exception.
Public class | UrlAttribute | Custom attribute that, when added to a field, property or parameter, throws an Online ArgumentException if the target is assigned a value that is not a valid URL starting with http://, https:// or ftp://. Null strings are accepted and do not throw an exception.

Online Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


CreditCardAttribute Class

CreditCardAttribute Class PostSharp Documentation
Custom attribute that, when added to a field, property or parameter, throws an Online ArgumentException if the target is assigned a value that is not a valid credit card number. Null strings are accepted and do not throw an exception.
Inheritance Hierarchy
Online System Object
Online System Attribute
PostSharp.Extensibility MulticastAttribute
PostSharp.Patterns.Contracts LocationContractAttribute
PostSharp.Patterns.Contracts CreditCardAttribute

Namespace: PostSharp.Patterns.Contracts
Assembly: PostSharp.Patterns.Model (in PostSharp.Patterns.Model.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
public sealed class CreditCardAttribute : LocationContractAttribute,
    ILocationValidationAspect<string>, ILocationValidationAspect, IAspect
public sealed class CreditCardAttribute : LocationContractAttribute,
    ILocationValidationAspect<string>, ILocationValidationAspect, IAspect
See Also
CreditCardAttribute Members
PostSharp.Patterns.Contracts Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


CreditCardAttribute Members

CreditCardAttribute Members PostSharp Documentation

The CreditCardAttribute type exposes the following members.
Constructors
 | Name | Description
Public method | CreditCardAttribute | Initializes a new CreditCardAttribute.
Back to Top
Methods
 | Name | Description
Public method | ValidateValue |
Back to Top
Properties
 | Name | Description
Public property | AttributeExclude | If true, indicates that this attribute removes all other instances of the same attribute type from the set of elements defined by the current instance. (Inherited from MulticastAttribute.)
Public property | AttributeId | Obsolete. (Inherited from MulticastAttribute.)
Public property | AttributeInheritance | Determines whether this attribute is inherited (Inherited from MulticastAttribute.)
Public property | AttributePriority | Gets or sets the priority of the current attribute in case that multiple instances are defined on the same element (lower values are processed before). (Inherited from MulticastAttribute.)
Public property | AttributeReplace | Determines whether this attribute replaces other attributes found on the target declarations. (Inherited from MulticastAttribute.)
Public property | AttributeTargetAssemblies | Gets or sets the assemblies to which the current attribute apply. (Inherited from MulticastAttribute.)
Public property | AttributeTargetElements | Gets or sets the kind of elements to which this custom attributes applies. (Inherited from MulticastAttribute.)
Public property | AttributeTargetExternalMemberAttributes | Gets or sets the visibilities, scopes, virtualities, and implementation of members to which this attribute applies, when the member is external to the current module. (Inherited from MulticastAttribute.)
Public property | AttributeTargetExternalTypeAttributes | Gets or sets the visibilities of types to which this attribute applies, when this type is external to the current module. (Inherited from MulticastAttribute.)
Public property | AttributeTargetMemberAttributes | Gets or sets the visibilities, scopes, virtualities, and implementation of members to which this attribute applies. (Inherited from MulticastAttribute.)
Public property | AttributeTargetMembers | Gets or sets the expression specifying to which members this instance applies. (Inherited from MulticastAttribute.)
Public property | AttributeTargetParameterAttributes | Gets or sets the passing style (by value, out or ref) of parameters to which this attribute applies. (Inherited from MulticastAttribute.)
Public property | AttributeTargetParameters | Gets or sets the expression specifying to which parameters this instance applies. (Inherited from MulticastAttribute.)
Public property | AttributeTargetTypeAttributes | Gets or sets the visibilities of types to which this attribute applies. (Inherited from MulticastAttribute.)
Public property | AttributeTargetTypes | Gets or sets the expression specifying to which types this instance applies. (Inherited from MulticastAttribute.)
Public property | ErrorMessage | Gets or sets the error message formatting string. (Inherited from LocationContractAttribute.)
Back to Top
See Also
CreditCardAttribute Class
PostSharp.Patterns.Contracts Namespace

Online Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


CreditCardAttribute Constructor

CreditCardAttribute Constructor PostSharp Documentation
Initializes a new CreditCardAttribute.

Namespace: PostSharp.Patterns.Contracts
Assembly: PostSharp.Patterns.Model (in PostSharp.Patterns.Model.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
public CreditCardAttribute()
public CreditCardAttribute()
See Also
CreditCardAttribute Class
CreditCardAttribute Members
PostSharp.Patterns.Contracts Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


CreditCardAttribute Methods

CreditCardAttribute Methods PostSharp Documentation
The CreditCardAttribute type exposes the following members.
Methods
 | Name | Description
Public method | ValidateValue |
Back to Top
See Also
CreditCardAttribute Class
PostSharp.Patterns.Contracts Namespace

Online Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


CreditCardAttribute.ValidateValue Method

CreditCardAttribute ValidateValue Method PostSharp Documentation

[Missing <summary> documentation for "M:PostSharp.Patterns.Contracts.CreditCardAttribute.ValidateValue(System.String,System.String,PostSharp.Reflection.LocationKind)"]

Namespace: PostSharp.Patterns.Contracts
Assembly: PostSharp.Patterns.Model (in PostSharp.Patterns.Model.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
public Exception ValidateValue(
    string value,
    string locationName,
    LocationKind locationKind
)
public Exception ValidateValue(
    string value,
    string locationName,
    LocationKind locationKind
)
Parameters
value
Type:   Online System String
[Missing <param name="value"/> documentation for "M:PostSharp.Patterns.Contracts.CreditCardAttribute.ValidateValue(System.String,System.String,PostSharp.Reflection.LocationKind)"]
locationName
Type:   Online System String
[Missing <param name="locationName"/> documentation for "M:PostSharp.Patterns.Contracts.CreditCardAttribute.ValidateValue(System.String,System.String,PostSharp.Reflection.LocationKind)"]
locationKind
Type: PostSharp.Reflection LocationKind
[Missing <param name="locationKind"/> documentation for "M:PostSharp.Patterns.Contracts.CreditCardAttribute.ValidateValue(System.String,System.String,PostSharp.Reflection.LocationKind)"]
Return Value
Type:   Online Exception
[Missing <returns> documentation for "M:PostSharp.Patterns.Contracts.CreditCardAttribute.ValidateValue(System.String,System.String,PostSharp.Reflection.LocationKind)"]
Implements
ILocationValidationAspect T  ValidateValue(T, String, LocationKind)
See Also
CreditCardAttribute Class
CreditCardAttribute Members
PostSharp.Patterns.Contracts Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


CreditCardAttribute Properties

CreditCardAttribute Properties PostSharp Documentation
The CreditCardAttribute type exposes the following members.
Properties
 | Name | Description
Public property | AttributeExclude | If true, indicates that this attribute removes all other instances of the same attribute type from the set of elements defined by the current instance. (Inherited from MulticastAttribute.)
Public property | AttributeId | Obsolete. (Inherited from MulticastAttribute.)
Public property | AttributeInheritance | Determines whether this attribute is inherited (Inherited from MulticastAttribute.)
Public property | AttributePriority | Gets or sets the priority of the current attribute in case that multiple instances are defined on the same element (lower values are processed before). (Inherited from MulticastAttribute.)
Public property | AttributeReplace | Determines whether this attribute replaces other attributes found on the target declarations. (Inherited from MulticastAttribute.)
Public property | AttributeTargetAssemblies | Gets or sets the assemblies to which the current attribute apply. (Inherited from MulticastAttribute.)
Public property | AttributeTargetElements | Gets or sets the kind of elements to which this custom attributes applies. (Inherited from MulticastAttribute.)
Public property | AttributeTargetExternalMemberAttributes | Gets or sets the visibilities, scopes, virtualities, and implementation of members to which this attribute applies, when the member is external to the current module. (Inherited from MulticastAttribute.)
Public property | AttributeTargetExternalTypeAttributes | Gets or sets the visibilities of types to which this attribute applies, when this type is external to the current module. (Inherited from MulticastAttribute.)
Public property | AttributeTargetMemberAttributes | Gets or sets the visibilities, scopes, virtualities, and implementation of members to which this attribute applies. (Inherited from MulticastAttribute.)
Public property | AttributeTargetMembers | Gets or sets the expression specifying to which members this instance applies. (Inherited from MulticastAttribute.)
Public property | AttributeTargetParameterAttributes | Gets or sets the passing style (by value, out or ref) of parameters to which this attribute applies. (Inherited from MulticastAttribute.)
Public property | AttributeTargetParameters | Gets or sets the expression specifying to which parameters this instance applies. (Inherited from MulticastAttribute.)
Public property | AttributeTargetTypeAttributes | Gets or sets the visibilities of types to which this attribute applies. (Inherited from MulticastAttribute.)
Public property | AttributeTargetTypes | Gets or sets the expression specifying to which types this instance applies. (Inherited from MulticastAttribute.)
Public property | ErrorMessage | Gets or sets the error message formatting string. (Inherited from LocationContractAttribute.)
Back to Top
See Also
CreditCardAttribute Class
PostSharp.Patterns.Contracts Namespace

Online Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


EmailAddressAttribute Class

EmailAddressAttribute Class PostSharp Documentation
Custom attribute that, when added to a field, property or parameter, throws an Online ArgumentException if the target is assigned a value that is not a valid email address. Null strings are accepted and do not throw an exception.
Inheritance Hierarchy
Online System Object
Online System Attribute
PostSharp.Extensibility MulticastAttribute
PostSharp.Patterns.Contracts LocationContractAttribute
PostSharp.Patterns.Contracts RegularExpressionAttribute
PostSharp.Patterns.Contracts EmailAddressAttribute

Namespace: PostSharp.Patterns.Contracts
Assembly: PostSharp.Patterns.Model (in PostSharp.Patterns.Model.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
public sealed class EmailAddressAttribute : RegularExpressionAttribute
public sealed class EmailAddressAttribute : RegularExpressionAttribute
See Also
EmailAddressAttribute Members
PostSharp.Patterns.Contracts Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


EmailAddressAttribute Members

EmailAddressAttribute Members PostSharp Documentation

The EmailAddressAttribute type exposes the following members.
Constructors
 | Name | Description
Public method | EmailAddressAttribute | Initializes a new EmailAddressAttribute.
Back to Top
Properties
 | Name | Description
Public property | AttributeExclude | If true, indicates that this attribute removes all other instances of the same attribute type from the set of elements defined by the current instance. (Inherited from MulticastAttribute.)
Public property | AttributeId | Obsolete. (Inherited from MulticastAttribute.)
Public property | AttributeInheritance | Determines whether this attribute is inherited (Inherited from MulticastAttribute.)
Public property | AttributePriority | Gets or sets the priority of the current attribute in case that multiple instances are defined on the same element (lower values are processed before). (Inherited from MulticastAttribute.)
Public property | AttributeReplace | Determines whether this attribute replaces other attributes found on the target declarations. (Inherited from MulticastAttribute.)
Public property | AttributeTargetAssemblies | Gets or sets the assemblies to which the current attribute apply. (Inherited from MulticastAttribute.)
Public property | AttributeTargetElements | Gets or sets the kind of elements to which this custom attributes applies. (Inherited from MulticastAttribute.)
Public property | AttributeTargetExternalMemberAttributes | Gets or sets the visibilities, scopes, virtualities, and implementation of members to which this attribute applies, when the member is external to the current module. (Inherited from MulticastAttribute.)
Public property | AttributeTargetExternalTypeAttributes | Gets or sets the visibilities of types to which this attribute applies, when this type is external to the current module. (Inherited from MulticastAttribute.)
Public property | AttributeTargetMemberAttributes | Gets or sets the visibilities, scopes, virtualities, and implementation of members to which this attribute applies. (Inherited from MulticastAttribute.)
Public property | AttributeTargetMembers | Gets or sets the expression specifying to which members this instance applies. (Inherited from MulticastAttribute.)
Public property | AttributeTargetParameterAttributes | Gets or sets the passing style (by value, out or ref) of parameters to which this attribute applies. (Inherited from MulticastAttribute.)
Public property | AttributeTargetParameters | Gets or sets the expression specifying to which parameters this instance applies. (Inherited from MulticastAttribute.)
Public property | AttributeTargetTypeAttributes | Gets or sets the visibilities of types to which this attribute applies. (Inherited from MulticastAttribute.)
Public property | AttributeTargetTypes | Gets or sets the expression specifying to which types this instance applies. (Inherited from MulticastAttribute.)
Public property | ErrorMessage | Gets or sets the error message formatting string. (Inherited from LocationContractAttribute.)
Back to Top
See Also
EmailAddressAttribute Class
PostSharp.Patterns.Contracts Namespace

Online Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


EmailAddressAttribute Constructor

EmailAddressAttribute Constructor PostSharp Documentation
Initializes a new EmailAddressAttribute.

Namespace: PostSharp.Patterns.Contracts
Assembly: PostSharp.Patterns.Model (in PostSharp.Patterns.Model.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
public EmailAddressAttribute()
public EmailAddressAttribute()
See Also
EmailAddressAttribute Class
EmailAddressAttribute Members
PostSharp.Patterns.Contracts Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


EmailAddressAttribute Properties

EmailAddressAttribute Properties PostSharp Documentation
The EmailAddressAttribute type exposes the following members.
Properties
 | Name | Description
Public property | AttributeExclude | If true, indicates that this attribute removes all other instances of the same attribute type from the set of elements defined by the current instance. (Inherited from MulticastAttribute.)
Public property | AttributeId | Obsolete. (Inherited from MulticastAttribute.)
Public property | AttributeInheritance | Determines whether this attribute is inherited (Inherited from MulticastAttribute.)
Public property | AttributePriority | Gets or sets the priority of the current attribute in case that multiple instances are defined on the same element (lower values are processed before). (Inherited from MulticastAttribute.)
Public property | AttributeReplace | Determines whether this attribute replaces other attributes found on the target declarations. (Inherited from MulticastAttribute.)
Public property | AttributeTargetAssemblies | Gets or sets the assemblies to which the current attribute apply. (Inherited from MulticastAttribute.)
Public property | AttributeTargetElements | Gets or sets the kind of elements to which this custom attributes applies. (Inherited from MulticastAttribute.)
Public property | AttributeTargetExternalMemberAttributes | Gets or sets the visibilities, scopes, virtualities, and implementation of members to which this attribute applies, when the member is external to the current module. (Inherited from MulticastAttribute.)
Public property | AttributeTargetExternalTypeAttributes | Gets or sets the visibilities of types to which this attribute applies, when this type is external to the current module. (Inherited from MulticastAttribute.)
Public property | AttributeTargetMemberAttributes | Gets or sets the visibilities, scopes, virtualities, and implementation of members to which this attribute applies. (Inherited from MulticastAttribute.)
Public property | AttributeTargetMembers | Gets or sets the expression specifying to which members this instance applies. (Inherited from MulticastAttribute.)
Public property | AttributeTargetParameterAttributes | Gets or sets the passing style (by value, out or ref) of parameters to which this attribute applies. (Inherited from MulticastAttribute.)
Public property | AttributeTargetParameters | Gets or sets the expression specifying to which parameters this instance applies. (Inherited from MulticastAttribute.)
Public property | AttributeTargetTypeAttributes | Gets or sets the visibilities of types to which this attribute applies. (Inherited from MulticastAttribute.)
Public property | AttributeTargetTypes | Gets or sets the expression specifying to which types this instance applies. (Inherited from MulticastAttribute.)
Public property | ErrorMessage | Gets or sets the error message formatting string. (Inherited from LocationContractAttribute.)
Back to Top
See Also
EmailAddressAttribute Class
PostSharp.Patterns.Contracts Namespace

Online Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


EnumDataTypeAttribute Class

EnumDataTypeAttribute Class PostSharp Documentation
Custom attribute that, when added to a field, property or parameter, throws an Online ArgumentException if the target is assigned a value that is not a valid member of an enumeration.
Inheritance Hierarchy
Online System Object
Online System Attribute
PostSharp.Extensibility MulticastAttribute
PostSharp.Patterns.Contracts LocationContractAttribute
PostSharp.Patterns.Contracts EnumDataTypeAttribute

Namespace: PostSharp.Patterns.Contracts
Assembly: PostSharp.Patterns.Model (in PostSharp.Patterns.Model.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
public sealed class EnumDataTypeAttribute : LocationContractAttribute,
    ILocationValidationAspect<string>, ILocationValidationAspect<Object>, ILocationValidationAspect<Nullable<long>>,
    ILocationValidationAspect<Nullable<ulong>>, ILocationValidationAspect<Nullable<int>>,
    ILocationValidationAspect<Nullable<uint>>, ILocationValidationAspect<Nullable<short>>,
    ILocationValidationAspect<Nullable<byte>>, ILocationValidationAspect<Nullable<sbyte>>,
    ILocationValidationAspect<Nullable<ushort>>, ILocationValidationAspect<long>,
    ILocationValidationAspect<ulong>, ILocationValidationAspect<int>, ILocationValidationAspect<uint>,
    ILocationValidationAspect<short>, ILocationValidationAspect<byte>, ILocationValidationAspect<sbyte>,
    ILocationValidationAspect<ushort>, ILocationValidationAspect, IAspect
public sealed class EnumDataTypeAttribute : LocationContractAttribute,
    ILocationValidationAspect<string>, ILocationValidationAspect<Object>, ILocationValidationAspect<Nullable<long>>,
    ILocationValidationAspect<Nullable<ulong>>, ILocationValidationAspect<Nullable<int>>,
    ILocationValidationAspect<Nullable<uint>>, ILocationValidationAspect<Nullable<short>>,
    ILocationValidationAspect<Nullable<byte>>, ILocationValidationAspect<Nullable<sbyte>>,
    ILocationValidationAspect<Nullable<ushort>>, ILocationValidationAspect<long>,
    ILocationValidationAspect<ulong>, ILocationValidationAspect<int>, ILocationValidationAspect<uint>,
    ILocationValidationAspect<short>, ILocationValidationAspect<byte>, ILocationValidationAspect<sbyte>,
    ILocationValidationAspect<ushort>, ILocationValidationAspect, IAspect
Remarks
Strings are matched against enumeration member names. Integers
            are matched against enumeration member values.     Null values are accepted and do not
            throw exception.

See Also
EnumDataTypeAttribute Members
PostSharp.Patterns.Contracts Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


EnumDataTypeAttribute Members

EnumDataTypeAttribute Members PostSharp Documentation

The EnumDataTypeAttribute type exposes the following members.
Constructors
 | Name | Description
Public method | EnumDataTypeAttribute | Initializes a new EnumDataTypeAttribute.
Back to Top
Properties
 | Name | Description
Public property | AttributeExclude | If true, indicates that this attribute removes all other instances of the same attribute type from the set of elements defined by the current instance. (Inherited from MulticastAttribute.)
Public property | AttributeId | Obsolete. (Inherited from MulticastAttribute.)
Public property | AttributeInheritance | Determines whether this attribute is inherited (Inherited from MulticastAttribute.)
Public property | AttributePriority | Gets or sets the priority of the current attribute in case that multiple instances are defined on the same element (lower values are processed before). (Inherited from MulticastAttribute.)
Public property | AttributeReplace | Determines whether this attribute replaces other attributes found on the target declarations. (Inherited from MulticastAttribute.)
Public property | AttributeTargetAssemblies | Gets or sets the assemblies to which the current attribute apply. (Inherited from MulticastAttribute.)
Public property | AttributeTargetElements | Gets or sets the kind of elements to which this custom attributes applies. (Inherited from MulticastAttribute.)
Public property | AttributeTargetExternalMemberAttributes | Gets or sets the visibilities, scopes, virtualities, and implementation of members to which this attribute applies, when the member is external to the current module. (Inherited from MulticastAttribute.)
Public property | AttributeTargetExternalTypeAttributes | Gets or sets the visibilities of types to which this attribute applies, when this type is external to the current module. (Inherited from MulticastAttribute.)
Public property | AttributeTargetMemberAttributes | Gets or sets the visibilities, scopes, virtualities, and implementation of members to which this attribute applies. (Inherited from MulticastAttribute.)
Public property | AttributeTargetMembers | Gets or sets the expression specifying to which members this instance applies. (Inherited from MulticastAttribute.)
Public property | AttributeTargetParameterAttributes | Gets or sets the passing style (by value, out or ref) of parameters to which this attribute applies. (Inherited from MulticastAttribute.)
Public property | AttributeTargetParameters | Gets or sets the expression specifying to which parameters this instance applies. (Inherited from MulticastAttribute.)
Public property | AttributeTargetTypeAttributes | Gets or sets the visibilities of types to which this attribute applies. (Inherited from MulticastAttribute.)
Public property | AttributeTargetTypes | Gets or sets the expression specifying to which types this instance applies. (Inherited from MulticastAttribute.)
Public property | EnumType | Gets the enumeration type.
Public property | ErrorMessage | Gets or sets the error message formatting string. (Inherited from LocationContractAttribute.)
Back to Top
See Also
EnumDataTypeAttribute Class
PostSharp.Patterns.Contracts Namespace

Online Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


EnumDataTypeAttribute Constructor

EnumDataTypeAttribute Constructor PostSharp Documentation
Initializes a new EnumDataTypeAttribute.

Namespace: PostSharp.Patterns.Contracts
Assembly: PostSharp.Patterns.Model (in PostSharp.Patterns.Model.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
public EnumDataTypeAttribute(
    Type enumType
)
public EnumDataTypeAttribute(
    Type enumType
)
Parameters
enumType
Type:   Online System Type
Enumeration type.
See Also
EnumDataTypeAttribute Class
EnumDataTypeAttribute Members
PostSharp.Patterns.Contracts Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


EnumDataTypeAttribute Properties

EnumDataTypeAttribute Properties PostSharp Documentation
The EnumDataTypeAttribute type exposes the following members.
Properties
 | Name | Description
Public property | AttributeExclude | If true, indicates that this attribute removes all other instances of the same attribute type from the set of elements defined by the current instance. (Inherited from MulticastAttribute.)
Public property | AttributeId | Obsolete. (Inherited from MulticastAttribute.)
Public property | AttributeInheritance | Determines whether this attribute is inherited (Inherited from MulticastAttribute.)
Public property | AttributePriority | Gets or sets the priority of the current attribute in case that multiple instances are defined on the same element (lower values are processed before). (Inherited from MulticastAttribute.)
Public property | AttributeReplace | Determines whether this attribute replaces other attributes found on the target declarations. (Inherited from MulticastAttribute.)
Public property | AttributeTargetAssemblies | Gets or sets the assemblies to which the current attribute apply. (Inherited from MulticastAttribute.)
Public property | AttributeTargetElements | Gets or sets the kind of elements to which this custom attributes applies. (Inherited from MulticastAttribute.)
Public property | AttributeTargetExternalMemberAttributes | Gets or sets the visibilities, scopes, virtualities, and implementation of members to which this attribute applies, when the member is external to the current module. (Inherited from MulticastAttribute.)
Public property | AttributeTargetExternalTypeAttributes | Gets or sets the visibilities of types to which this attribute applies, when this type is external to the current module. (Inherited from MulticastAttribute.)
Public property | AttributeTargetMemberAttributes | Gets or sets the visibilities, scopes, virtualities, and implementation of members to which this attribute applies. (Inherited from MulticastAttribute.)
Public property | AttributeTargetMembers | Gets or sets the expression specifying to which members this instance applies. (Inherited from MulticastAttribute.)
Public property | AttributeTargetParameterAttributes | Gets or sets the passing style (by value, out or ref) of parameters to which this attribute applies. (Inherited from MulticastAttribute.)
Public property | AttributeTargetParameters | Gets or sets the expression specifying to which parameters this instance applies. (Inherited from MulticastAttribute.)
Public property | AttributeTargetTypeAttributes | Gets or sets the visibilities of types to which this attribute applies. (Inherited from MulticastAttribute.)
Public property | AttributeTargetTypes | Gets or sets the expression specifying to which types this instance applies. (Inherited from MulticastAttribute.)
Public property | EnumType | Gets the enumeration type.
Public property | ErrorMessage | Gets or sets the error message formatting string. (Inherited from LocationContractAttribute.)
Back to Top
See Also
EnumDataTypeAttribute Class
PostSharp.Patterns.Contracts Namespace

Online Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


EnumDataTypeAttribute.EnumType Property

EnumDataTypeAttribute EnumType Property PostSharp Documentation
Gets the enumeration type.

Namespace: PostSharp.Patterns.Contracts
Assembly: PostSharp.Patterns.Model (in PostSharp.Patterns.Model.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
public Type EnumType { get; private set; }
public Type EnumType { get; private set; }
Property Value
Type:   Online Type
See Also
EnumDataTypeAttribute Class
EnumDataTypeAttribute Members
PostSharp.Patterns.Contracts Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


GreaterThanAttribute Class

GreaterThanAttribute Class PostSharp Documentation
Custom attribute that, when added to a field, property or parameter, throws an Online ArgumentOutOfRangeException if the target is assigned a value that is smaller or equal to a given value.
Inheritance Hierarchy
Online System Object
Online System Attribute
PostSharp.Extensibility MulticastAttribute
PostSharp.Patterns.Contracts LocationContractAttribute
PostSharp.Patterns.Contracts RangeAttribute
PostSharp.Patterns.Contracts GreaterThanAttribute
PostSharp.Patterns.Contracts PositiveAttribute

Namespace: PostSharp.Patterns.Contracts
Assembly: PostSharp.Patterns.Model (in PostSharp.Patterns.Model.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
public class GreaterThanAttribute : RangeAttribute
public class GreaterThanAttribute : RangeAttribute
Remarks
Null values are accepted and do not throw an exception.

See Also
GreaterThanAttribute Members
PostSharp.Patterns.Contracts Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


GreaterThanAttribute Members

GreaterThanAttribute Members PostSharp Documentation

The GreaterThanAttribute type exposes the following members.
Constructors
 | Name | Description
Public method | GreaterThanAttribute(Double) | Initializes a new GreaterThanAttribute and specify a floating-point bound.
Public method | GreaterThanAttribute(Int64) | Initializes a new GreaterThanAttribute and specify an integer bound.
Public method | GreaterThanAttribute(UInt64) | Initializes a new GreaterThanAttribute and specify a Online UInt64 bound.
Back to Top
Methods
 | Name | Description
Protected method | CreateArgumentException | Creates an Online ArgumentException with an error message formatted from ErrorMessage and given concrete values. (Inherited from LocationContractAttribute.)
Protected method | CreateArgumentNullException | Creates an Online ArgumentNullException with an error message formatted from ErrorMessage and given concrete values. (Inherited from LocationContractAttribute.)
Protected method | CreateArgumentOutOfRangeException | Creates an Online ArgumentOutOfRangeException with an error message formatted from ErrorMessage and given concrete values. (Inherited from LocationContractAttribute.)
Protected method | FormatErrorMessage | Formats the ErrorMessage with concrete values. (Inherited from LocationContractAttribute.)
Back to Top
Properties
 | Name | Description
Public property | AttributeExclude | If true, indicates that this attribute removes all other instances of the same attribute type from the set of elements defined by the current instance. (Inherited from MulticastAttribute.)
Public property | AttributeId | Obsolete. (Inherited from MulticastAttribute.)
Public property | AttributeInheritance | Determines whether this attribute is inherited (Inherited from MulticastAttribute.)
Public property | AttributePriority | Gets or sets the priority of the current attribute in case that multiple instances are defined on the same element (lower values are processed before). (Inherited from MulticastAttribute.)
Public property | AttributeReplace | Determines whether this attribute replaces other attributes found on the target declarations. (Inherited from MulticastAttribute.)
Public property | AttributeTargetAssemblies | Gets or sets the assemblies to which the current attribute apply. (Inherited from MulticastAttribute.)
Public property | AttributeTargetElements | Gets or sets the kind of elements to which this custom attributes applies. (Inherited from MulticastAttribute.)
Public property | AttributeTargetExternalMemberAttributes | Gets or sets the visibilities, scopes, virtualities, and implementation of members to which this attribute applies, when the member is external to the current module. (Inherited from MulticastAttribute.)
Public property | AttributeTargetExternalTypeAttributes | Gets or sets the visibilities of types to which this attribute applies, when this type is external to the current module. (Inherited from MulticastAttribute.)
Public property | AttributeTargetMemberAttributes | Gets or sets the visibilities, scopes, virtualities, and implementation of members to which this attribute applies. (Inherited from MulticastAttribute.)
Public property | AttributeTargetMembers | Gets or sets the expression specifying to which members this instance applies. (Inherited from MulticastAttribute.)
Public property | AttributeTargetParameterAttributes | Gets or sets the passing style (by value, out or ref) of parameters to which this attribute applies. (Inherited from MulticastAttribute.)
Public property | AttributeTargetParameters | Gets or sets the expression specifying to which parameters this instance applies. (Inherited from MulticastAttribute.)
Public property | AttributeTargetTypeAttributes | Gets or sets the visibilities of types to which this attribute applies. (Inherited from MulticastAttribute.)
Public property | AttributeTargetTypes | Gets or sets the expression specifying to which types this instance applies. (Inherited from MulticastAttribute.)
Public property | ErrorMessage | Gets or sets the error message formatting string. (Inherited from LocationContractAttribute.)
Back to Top
See Also
GreaterThanAttribute Class
PostSharp.Patterns.Contracts Namespace

Online Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


GreaterThanAttribute Constructor

GreaterThanAttribute Constructor PostSharp Documentation
Overload List
 | Name | Description
Public method | GreaterThanAttribute(Double) | Initializes a new GreaterThanAttribute and specify a floating-point bound.
Public method | GreaterThanAttribute(Int64) | Initializes a new GreaterThanAttribute and specify an integer bound.
Public method | GreaterThanAttribute(UInt64) | Initializes a new GreaterThanAttribute and specify a Online UInt64 bound.
Back to Top
See Also
GreaterThanAttribute Class
GreaterThanAttribute Members
PostSharp.Patterns.Contracts Namespace

Online Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


GreaterThanAttribute Constructor (Double)

GreaterThanAttribute Constructor (Double) PostSharp Documentation
Initializes a new GreaterThanAttribute and specify a floating-point bound.

Namespace: PostSharp.Patterns.Contracts
Assembly: PostSharp.Patterns.Model (in PostSharp.Patterns.Model.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
public GreaterThanAttribute(
    double min
)
public GreaterThanAttribute(
    double min
)
Parameters
min
Type:   Online System Double
The lower bound.
See Also
GreaterThanAttribute Class
GreaterThanAttribute Members
GreaterThanAttribute Overload
PostSharp.Patterns.Contracts Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


GreaterThanAttribute Constructor (Int64)

GreaterThanAttribute Constructor (Int64) PostSharp Documentation
Initializes a new GreaterThanAttribute and specify an integer bound.

Namespace: PostSharp.Patterns.Contracts
Assembly: PostSharp.Patterns.Model (in PostSharp.Patterns.Model.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
public GreaterThanAttribute(
    long min
)
public GreaterThanAttribute(
    long min
)
Parameters
min
Type:   Online System Int64
The lower bound.
See Also
GreaterThanAttribute Class
GreaterThanAttribute Members
GreaterThanAttribute Overload
PostSharp.Patterns.Contracts Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


GreaterThanAttribute Constructor (UInt64)

GreaterThanAttribute Constructor (UInt64) PostSharp Documentation
Initializes a new GreaterThanAttribute and specify a Online UInt64 bound.

Namespace: PostSharp.Patterns.Contracts
Assembly: PostSharp.Patterns.Model (in PostSharp.Patterns.Model.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
public GreaterThanAttribute(
    ulong min
)
public GreaterThanAttribute(
    ulong min
)
Parameters
min
Type:   Online System UInt64
The lower bound.
See Also
GreaterThanAttribute Class
GreaterThanAttribute Members
GreaterThanAttribute Overload
PostSharp.Patterns.Contracts Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


GreaterThanAttribute Methods

GreaterThanAttribute Methods PostSharp Documentation
The GreaterThanAttribute type exposes the following members.
Methods
 | Name | Description
Protected method | CreateArgumentException | Creates an Online ArgumentException with an error message formatted from ErrorMessage and given concrete values. (Inherited from LocationContractAttribute.)
Protected method | CreateArgumentNullException | Creates an Online ArgumentNullException with an error message formatted from ErrorMessage and given concrete values. (Inherited from LocationContractAttribute.)
Protected method | CreateArgumentOutOfRangeException | Creates an Online ArgumentOutOfRangeException with an error message formatted from ErrorMessage and given concrete values. (Inherited from LocationContractAttribute.)
Protected method | FormatErrorMessage | Formats the ErrorMessage with concrete values. (Inherited from LocationContractAttribute.)
Back to Top
See Also
GreaterThanAttribute Class
PostSharp.Patterns.Contracts Namespace

Online Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


GreaterThanAttribute Properties

GreaterThanAttribute Properties PostSharp Documentation
The GreaterThanAttribute type exposes the following members.
Properties
 | Name | Description
Public property | AttributeExclude | If true, indicates that this attribute removes all other instances of the same attribute type from the set of elements defined by the current instance. (Inherited from MulticastAttribute.)
Public property | AttributeId | Obsolete. (Inherited from MulticastAttribute.)
Public property | AttributeInheritance | Determines whether this attribute is inherited (Inherited from MulticastAttribute.)
Public property | AttributePriority | Gets or sets the priority of the current attribute in case that multiple instances are defined on the same element (lower values are processed before). (Inherited from MulticastAttribute.)
Public property | AttributeReplace | Determines whether this attribute replaces other attributes found on the target declarations. (Inherited from MulticastAttribute.)
Public property | AttributeTargetAssemblies | Gets or sets the assemblies to which the current attribute apply. (Inherited from MulticastAttribute.)
Public property | AttributeTargetElements | Gets or sets the kind of elements to which this custom attributes applies. (Inherited from MulticastAttribute.)
Public property | AttributeTargetExternalMemberAttributes | Gets or sets the visibilities, scopes, virtualities, and implementation of members to which this attribute applies, when the member is external to the current module. (Inherited from MulticastAttribute.)
Public property | AttributeTargetExternalTypeAttributes | Gets or sets the visibilities of types to which this attribute applies, when this type is external to the current module. (Inherited from MulticastAttribute.)
Public property | AttributeTargetMemberAttributes | Gets or sets the visibilities, scopes, virtualities, and implementation of members to which this attribute applies. (Inherited from MulticastAttribute.)
Public property | AttributeTargetMembers | Gets or sets the expression specifying to which members this instance applies. (Inherited from MulticastAttribute.)
Public property | AttributeTargetParameterAttributes | Gets or sets the passing style (by value, out or ref) of parameters to which this attribute applies. (Inherited from MulticastAttribute.)
Public property | AttributeTargetParameters | Gets or sets the expression specifying to which parameters this instance applies. (Inherited from MulticastAttribute.)
Public property | AttributeTargetTypeAttributes | Gets or sets the visibilities of types to which this attribute applies. (Inherited from MulticastAttribute.)
Public property | AttributeTargetTypes | Gets or sets the expression specifying to which types this instance applies. (Inherited from MulticastAttribute.)
Public property | ErrorMessage | Gets or sets the error message formatting string. (Inherited from LocationContractAttribute.)
Back to Top
See Also
GreaterThanAttribute Class
PostSharp.Patterns.Contracts Namespace

Online Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


LessThanAttribute Class

LessThanAttribute Class PostSharp Documentation
Custom attribute that, when added to a field, property or parameter, throws an Online ArgumentOutOfRangeException if the target is assigned a value that is greater or equal to a given value.
Inheritance Hierarchy
Online System Object
Online System Attribute
PostSharp.Extensibility MulticastAttribute
PostSharp.Patterns.Contracts LocationContractAttribute
PostSharp.Patterns.Contracts RangeAttribute
PostSharp.Patterns.Contracts LessThanAttribute

Namespace: PostSharp.Patterns.Contracts
Assembly: PostSharp.Patterns.Model (in PostSharp.Patterns.Model.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
public sealed class LessThanAttribute : RangeAttribute
public sealed class LessThanAttribute : RangeAttribute
Remarks
Null values are accepted and do not throw an exception.
See Also
LessThanAttribute Members
PostSharp.Patterns.Contracts Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


LessThanAttribute Members

LessThanAttribute Members PostSharp Documentation

The LessThanAttribute type exposes the following members.
Constructors
 | Name | Description
Public method | LessThanAttribute(Double) | Initializes a new GreaterThanAttribute and specify a floating-point bound.
Public method | LessThanAttribute(Int64) | Initializes a new GreaterThanAttribute and specify an integer bound.
Public method | LessThanAttribute(UInt64) | Initializes a new GreaterThanAttribute and specify a Online UInt64 bound.
Back to Top
Properties
 | Name | Description
Public property | AttributeExclude | If true, indicates that this attribute removes all other instances of the same attribute type from the set of elements defined by the current instance. (Inherited from MulticastAttribute.)
Public property | AttributeId | Obsolete. (Inherited from MulticastAttribute.)
Public property | AttributeInheritance | Determines whether this attribute is inherited (Inherited from MulticastAttribute.)
Public property | AttributePriority | Gets or sets the priority of the current attribute in case that multiple instances are defined on the same element (lower values are processed before). (Inherited from MulticastAttribute.)
Public property | AttributeReplace | Determines whether this attribute replaces other attributes found on the target declarations. (Inherited from MulticastAttribute.)
Public property | AttributeTargetAssemblies | Gets or sets the assemblies to which the current attribute apply. (Inherited from MulticastAttribute.)
Public property | AttributeTargetElements | Gets or sets the kind of elements to which this custom attributes applies. (Inherited from MulticastAttribute.)
Public property | AttributeTargetExternalMemberAttributes | Gets or sets the visibilities, scopes, virtualities, and implementation of members to which this attribute applies, when the member is external to the current module. (Inherited from MulticastAttribute.)
Public property | AttributeTargetExternalTypeAttributes | Gets or sets the visibilities of types to which this attribute applies, when this type is external to the current module. (Inherited from MulticastAttribute.)
Public property | AttributeTargetMemberAttributes | Gets or sets the visibilities, scopes, virtualities, and implementation of members to which this attribute applies. (Inherited from MulticastAttribute.)
Public property | AttributeTargetMembers | Gets or sets the expression specifying to which members this instance applies. (Inherited from MulticastAttribute.)
Public property | AttributeTargetParameterAttributes | Gets or sets the passing style (by value, out or ref) of parameters to which this attribute applies. (Inherited from MulticastAttribute.)
Public property | AttributeTargetParameters | Gets or sets the expression specifying to which parameters this instance applies. (Inherited from MulticastAttribute.)
Public property | AttributeTargetTypeAttributes | Gets or sets the visibilities of types to which this attribute applies. (Inherited from MulticastAttribute.)
Public property | AttributeTargetTypes | Gets or sets the expression specifying to which types this instance applies. (Inherited from MulticastAttribute.)
Public property | ErrorMessage | Gets or sets the error message formatting string. (Inherited from LocationContractAttribute.)
Back to Top
See Also
LessThanAttribute Class
PostSharp.Patterns.Contracts Namespace

Online Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


LessThanAttribute Constructor

LessThanAttribute Constructor PostSharp Documentation
Overload List
 | Name | Description
Public method | LessThanAttribute(Double) | Initializes a new GreaterThanAttribute and specify a floating-point bound.
Public method | LessThanAttribute(Int64) | Initializes a new GreaterThanAttribute and specify an integer bound.
Public method | LessThanAttribute(UInt64) | Initializes a new GreaterThanAttribute and specify a Online UInt64 bound.
Back to Top
See Also
LessThanAttribute Class
LessThanAttribute Members
PostSharp.Patterns.Contracts Namespace

Online Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


LessThanAttribute Constructor (Double)

LessThanAttribute Constructor (Double) PostSharp Documentation
Initializes a new GreaterThanAttribute and specify a floating-point bound.

Namespace: PostSharp.Patterns.Contracts
Assembly: PostSharp.Patterns.Model (in PostSharp.Patterns.Model.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
public LessThanAttribute(
    double max
)
public LessThanAttribute(
    double max
)
Parameters
max
Type:   Online System Double
The upper bound.
See Also
LessThanAttribute Class
LessThanAttribute Members
LessThanAttribute Overload
PostSharp.Patterns.Contracts Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


LessThanAttribute Constructor (Int64)

LessThanAttribute Constructor (Int64) PostSharp Documentation
Initializes a new GreaterThanAttribute and specify an integer bound.

Namespace: PostSharp.Patterns.Contracts
Assembly: PostSharp.Patterns.Model (in PostSharp.Patterns.Model.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
public LessThanAttribute(
    long max
)
public LessThanAttribute(
    long max
)
Parameters
max
Type:   Online System Int64
The upper bound.
See Also
LessThanAttribute Class
LessThanAttribute Members
LessThanAttribute Overload
PostSharp.Patterns.Contracts Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


LessThanAttribute Constructor (UInt64)

LessThanAttribute Constructor (UInt64) PostSharp Documentation
Initializes a new GreaterThanAttribute and specify a Online UInt64 bound.

Namespace: PostSharp.Patterns.Contracts
Assembly: PostSharp.Patterns.Model (in PostSharp.Patterns.Model.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
public LessThanAttribute(
    ulong max
)
public LessThanAttribute(
    ulong max
)
Parameters
max
Type:   Online System UInt64
The upper bound.
See Also
LessThanAttribute Class
LessThanAttribute Members
LessThanAttribute Overload
PostSharp.Patterns.Contracts Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


LessThanAttribute Properties

LessThanAttribute Properties PostSharp Documentation
The LessThanAttribute type exposes the following members.
Properties
 | Name | Description
Public property | AttributeExclude | If true, indicates that this attribute removes all other instances of the same attribute type from the set of elements defined by the current instance. (Inherited from MulticastAttribute.)
Public property | AttributeId | Obsolete. (Inherited from MulticastAttribute.)
Public property | AttributeInheritance | Determines whether this attribute is inherited (Inherited from MulticastAttribute.)
Public property | AttributePriority | Gets or sets the priority of the current attribute in case that multiple instances are defined on the same element (lower values are processed before). (Inherited from MulticastAttribute.)
Public property | AttributeReplace | Determines whether this attribute replaces other attributes found on the target declarations. (Inherited from MulticastAttribute.)
Public property | AttributeTargetAssemblies | Gets or sets the assemblies to which the current attribute apply. (Inherited from MulticastAttribute.)
Public property | AttributeTargetElements | Gets or sets the kind of elements to which this custom attributes applies. (Inherited from MulticastAttribute.)
Public property | AttributeTargetExternalMemberAttributes | Gets or sets the visibilities, scopes, virtualities, and implementation of members to which this attribute applies, when the member is external to the current module. (Inherited from MulticastAttribute.)
Public property | AttributeTargetExternalTypeAttributes | Gets or sets the visibilities of types to which this attribute applies, when this type is external to the current module. (Inherited from MulticastAttribute.)
Public property | AttributeTargetMemberAttributes | Gets or sets the visibilities, scopes, virtualities, and implementation of members to which this attribute applies. (Inherited from MulticastAttribute.)
Public property | AttributeTargetMembers | Gets or sets the expression specifying to which members this instance applies. (Inherited from MulticastAttribute.)
Public property | AttributeTargetParameterAttributes | Gets or sets the passing style (by value, out or ref) of parameters to which this attribute applies. (Inherited from MulticastAttribute.)
Public property | AttributeTargetParameters | Gets or sets the expression specifying to which parameters this instance applies. (Inherited from MulticastAttribute.)
Public property | AttributeTargetTypeAttributes | Gets or sets the visibilities of types to which this attribute applies. (Inherited from MulticastAttribute.)
Public property | AttributeTargetTypes | Gets or sets the expression specifying to which types this instance applies. (Inherited from MulticastAttribute.)
Public property | ErrorMessage | Gets or sets the error message formatting string. (Inherited from LocationContractAttribute.)
Back to Top
See Also
LessThanAttribute Class
PostSharp.Patterns.Contracts Namespace

Online Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


LocationContractAttribute Class

LocationContractAttribute Class PostSharp Documentation
Base class for other custom attributes in this namespace.
Inheritance Hierarchy
Online System Object
Online System Attribute
PostSharp.Extensibility MulticastAttribute
PostSharp.Patterns.Contracts LocationContractAttribute
PostSharp.Patterns.Contracts CreditCardAttribute
PostSharp.Patterns.Contracts EnumDataTypeAttribute
PostSharp.Patterns.Contracts NotEmptyAttribute
PostSharp.Patterns.Contracts NotNullAttribute
PostSharp.Patterns.Contracts RangeAttribute
PostSharp.Patterns.Contracts RegularExpressionAttribute
PostSharp.Patterns.Contracts RequiredAttribute
PostSharp.Patterns.Contracts StringLengthAttribute

Namespace: PostSharp.Patterns.Contracts
Assembly: PostSharp.Patterns.Model (in PostSharp.Patterns.Model.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
public abstract class LocationContractAttribute : MulticastAttribute
public abstract class LocationContractAttribute : MulticastAttribute
See Also
LocationContractAttribute Members
PostSharp.Patterns.Contracts Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


LocationContractAttribute Members

LocationContractAttribute Members PostSharp Documentation

The LocationContractAttribute type exposes the following members.
Constructors
 | Name | Description
Protected method | LocationContractAttribute | Initializes a new LocationContractAttribute.
Back to Top
Methods
 | Name | Description
Protected method | CreateArgumentException | Creates an Online ArgumentException with an error message formatted from ErrorMessage and given concrete values.
Protected method | CreateArgumentNullException | Creates an Online ArgumentNullException with an error message formatted from ErrorMessage and given concrete values.
Protected method | CreateArgumentOutOfRangeException | Creates an Online ArgumentOutOfRangeException with an error message formatted from ErrorMessage and given concrete values.
Protected method | FormatErrorMessage | Formats the ErrorMessage with concrete values.
Back to Top
Properties
 | Name | Description
Public property | AttributeExclude | If true, indicates that this attribute removes all other instances of the same attribute type from the set of elements defined by the current instance. (Inherited from MulticastAttribute.)
Public property | AttributeId | Obsolete. (Inherited from MulticastAttribute.)
Public property | AttributeInheritance | Determines whether this attribute is inherited (Inherited from MulticastAttribute.)
Public property | AttributePriority | Gets or sets the priority of the current attribute in case that multiple instances are defined on the same element (lower values are processed before). (Inherited from MulticastAttribute.)
Public property | AttributeReplace | Determines whether this attribute replaces other attributes found on the target declarations. (Inherited from MulticastAttribute.)
Public property | AttributeTargetAssemblies | Gets or sets the assemblies to which the current attribute apply. (Inherited from MulticastAttribute.)
Public property | AttributeTargetElements | Gets or sets the kind of elements to which this custom attributes applies. (Inherited from MulticastAttribute.)
Public property | AttributeTargetExternalMemberAttributes | Gets or sets the visibilities, scopes, virtualities, and implementation of members to which this attribute applies, when the member is external to the current module. (Inherited from MulticastAttribute.)
Public property | AttributeTargetExternalTypeAttributes | Gets or sets the visibilities of types to which this attribute applies, when this type is external to the current module. (Inherited from MulticastAttribute.)
Public property | AttributeTargetMemberAttributes | Gets or sets the visibilities, scopes, virtualities, and implementation of members to which this attribute applies. (Inherited from MulticastAttribute.)
Public property | AttributeTargetMembers | Gets or sets the expression specifying to which members this instance applies. (Inherited from MulticastAttribute.)
Public property | AttributeTargetParameterAttributes | Gets or sets the passing style (by value, out or ref) of parameters to which this attribute applies. (Inherited from MulticastAttribute.)
Public property | AttributeTargetParameters | Gets or sets the expression specifying to which parameters this instance applies. (Inherited from MulticastAttribute.)
Public property | AttributeTargetTypeAttributes | Gets or sets the visibilities of types to which this attribute applies. (Inherited from MulticastAttribute.)
Public property | AttributeTargetTypes | Gets or sets the expression specifying to which types this instance applies. (Inherited from MulticastAttribute.)
Public property | ErrorMessage | Gets or sets the error message formatting string.
Back to Top
See Also
LocationContractAttribute Class
PostSharp.Patterns.Contracts Namespace

Online Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


LocationContractAttribute Constructor

LocationContractAttribute Constructor PostSharp Documentation
Initializes a new LocationContractAttribute.

Namespace: PostSharp.Patterns.Contracts
Assembly: PostSharp.Patterns.Model (in PostSharp.Patterns.Model.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
protected LocationContractAttribute()
protected LocationContractAttribute()
See Also
LocationContractAttribute Class
LocationContractAttribute Members
PostSharp.Patterns.Contracts Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


LocationContractAttribute Methods

LocationContractAttribute Methods PostSharp Documentation
The LocationContractAttribute type exposes the following members.
Methods
 | Name | Description
Protected method | CreateArgumentException | Creates an Online ArgumentException with an error message formatted from ErrorMessage and given concrete values.
Protected method | CreateArgumentNullException | Creates an Online ArgumentNullException with an error message formatted from ErrorMessage and given concrete values.
Protected method | CreateArgumentOutOfRangeException | Creates an Online ArgumentOutOfRangeException with an error message formatted from ErrorMessage and given concrete values.
Protected method | FormatErrorMessage | Formats the ErrorMessage with concrete values.
Back to Top
See Also
LocationContractAttribute Class
PostSharp.Patterns.Contracts Namespace

Online Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


LocationContractAttribute.CreateArgumentException Method

LocationContractAttribute CreateArgumentException Method PostSharp Documentation
Creates an Online ArgumentException with an error message formatted from ErrorMessage and given concrete values.

Namespace: PostSharp.Patterns.Contracts
Assembly: PostSharp.Patterns.Model (in PostSharp.Patterns.Model.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
protected ArgumentException CreateArgumentException(
    Object value,
    string locationName,
    LocationKind locationKind
)
protected ArgumentException CreateArgumentException(
    Object value,
    string locationName,
    LocationKind locationKind
)
Parameters
value
Type:   Online System Object
Value assigned to the property.
locationName
Type:   Online System String
Name of the location.
locationKind
Type: PostSharp.Reflection LocationKind
Location kind.
Return Value
Type:   Online ArgumentException
A new   Online ArgumentException  where the message, has been derived from ErrorMessage, with placeholders replaced by their concrete value.
See Also
LocationContractAttribute Class
LocationContractAttribute Members
PostSharp.Patterns.Contracts Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


LocationContractAttribute.CreateArgumentNullException Method

LocationContractAttribute CreateArgumentNullException Method PostSharp Documentation
Creates an Online ArgumentNullException with an error message formatted from ErrorMessage and given concrete values.

Namespace: PostSharp.Patterns.Contracts
Assembly: PostSharp.Patterns.Model (in PostSharp.Patterns.Model.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
protected ArgumentNullException CreateArgumentNullException(
    Object value,
    string locationName,
    LocationKind locationKind
)
protected ArgumentNullException CreateArgumentNullException(
    Object value,
    string locationName,
    LocationKind locationKind
)
Parameters
value
Type:   Online System Object
Value assigned to the property.
locationName
Type:   Online System String
Name of the location.
locationKind
Type: PostSharp.Reflection LocationKind
Location kind.
Return Value
Type:   Online ArgumentNullException
A new   Online ArgumentNullException  where the message, has been derived from ErrorMessage, with placeholders replaced by their concrete value.
See Also
LocationContractAttribute Class
LocationContractAttribute Members
PostSharp.Patterns.Contracts Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


LocationContractAttribute.CreateArgumentOutOfRangeException Method

LocationContractAttribute CreateArgumentOutOfRangeException Method PostSharp Documentation
Creates an Online ArgumentOutOfRangeException with an error message formatted from ErrorMessage and given concrete values.

Namespace: PostSharp.Patterns.Contracts
Assembly: PostSharp.Patterns.Model (in PostSharp.Patterns.Model.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
protected ArgumentOutOfRangeException CreateArgumentOutOfRangeException(
    Object value,
    string locationName,
    LocationKind locationKind
)
protected ArgumentOutOfRangeException CreateArgumentOutOfRangeException(
    Object value,
    string locationName,
    LocationKind locationKind
)
Parameters
value
Type:   Online System Object
Value assigned to the property.
locationName
Type:   Online System String
Name of the location.
locationKind
Type: PostSharp.Reflection LocationKind
Location kind.
Return Value
Type:   Online ArgumentOutOfRangeException
A new   Online ArgumentOutOfRangeException  where the message, has been derived from ErrorMessage, with placeholders replaced by their concrete value.
See Also
LocationContractAttribute Class
LocationContractAttribute Members
PostSharp.Patterns.Contracts Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


LocationContractAttribute.FormatErrorMessage Method

LocationContractAttribute FormatErrorMessage Method PostSharp Documentation
Formats the ErrorMessage with concrete values.

Namespace: PostSharp.Patterns.Contracts
Assembly: PostSharp.Patterns.Model (in PostSharp.Patterns.Model.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
protected string FormatErrorMessage(
    Object value,
    string locationName,
    LocationKind locationKind
)
protected string FormatErrorMessage(
    Object value,
    string locationName,
    LocationKind locationKind
)
Parameters
value
Type:   Online System Object
Value assigned to the property.
locationName
Type:   Online System String
Name of the location.
locationKind
Type: PostSharp.Reflection LocationKind
Location kind.
Return Value
Type:   Online String
A string derived from ErrorMessage, where placeholders have been
            replaced by their concrete value.
See Also
LocationContractAttribute Class
LocationContractAttribute Members
PostSharp.Patterns.Contracts Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


LocationContractAttribute Properties

LocationContractAttribute Properties PostSharp Documentation
The LocationContractAttribute type exposes the following members.
Properties
 | Name | Description
Public property | AttributeExclude | If true, indicates that this attribute removes all other instances of the same attribute type from the set of elements defined by the current instance. (Inherited from MulticastAttribute.)
Public property | AttributeId | Obsolete. (Inherited from MulticastAttribute.)
Public property | AttributeInheritance | Determines whether this attribute is inherited (Inherited from MulticastAttribute.)
Public property | AttributePriority | Gets or sets the priority of the current attribute in case that multiple instances are defined on the same element (lower values are processed before). (Inherited from MulticastAttribute.)
Public property | AttributeReplace | Determines whether this attribute replaces other attributes found on the target declarations. (Inherited from MulticastAttribute.)
Public property | AttributeTargetAssemblies | Gets or sets the assemblies to which the current attribute apply. (Inherited from MulticastAttribute.)
Public property | AttributeTargetElements | Gets or sets the kind of elements to which this custom attributes applies. (Inherited from MulticastAttribute.)
Public property | AttributeTargetExternalMemberAttributes | Gets or sets the visibilities, scopes, virtualities, and implementation of members to which this attribute applies, when the member is external to the current module. (Inherited from MulticastAttribute.)
Public property | AttributeTargetExternalTypeAttributes | Gets or sets the visibilities of types to which this attribute applies, when this type is external to the current module. (Inherited from MulticastAttribute.)
Public property | AttributeTargetMemberAttributes | Gets or sets the visibilities, scopes, virtualities, and implementation of members to which this attribute applies. (Inherited from MulticastAttribute.)
Public property | AttributeTargetMembers | Gets or sets the expression specifying to which members this instance applies. (Inherited from MulticastAttribute.)
Public property | AttributeTargetParameterAttributes | Gets or sets the passing style (by value, out or ref) of parameters to which this attribute applies. (Inherited from MulticastAttribute.)
Public property | AttributeTargetParameters | Gets or sets the expression specifying to which parameters this instance applies. (Inherited from MulticastAttribute.)
Public property | AttributeTargetTypeAttributes | Gets or sets the visibilities of types to which this attribute applies. (Inherited from MulticastAttribute.)
Public property | AttributeTargetTypes | Gets or sets the expression specifying to which types this instance applies. (Inherited from MulticastAttribute.)
Public property | ErrorMessage | Gets or sets the error message formatting string.
Back to Top
See Also
LocationContractAttribute Class
PostSharp.Patterns.Contracts Namespace

Online Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


LocationContractAttribute.ErrorMessage Property

LocationContractAttribute ErrorMessage Property PostSharp Documentation
Gets or sets the error message formatting string.

Namespace: PostSharp.Patterns.Contracts
Assembly: PostSharp.Patterns.Model (in PostSharp.Patterns.Model.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
public string ErrorMessage { get; set; }
public string ErrorMessage { get; set; }
Property Value
Type:   Online String
Remarks
In the this formatting string, the {0} parameter is replaced by the location name,
            {1} by the location kind, {2} by a string that contains both the location kind
            and name, and {3} by the value assigned to the location.
See Also
LocationContractAttribute Class
LocationContractAttribute Members
PostSharp.Patterns.Contracts Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


NotEmptyAttribute Class

NotEmptyAttribute Class PostSharp Documentation
Custom attribute that, when added to a field, property or parameter, throws an Online ArgumentNullException if the target is assigned a null or empty value. The custom attributes can be added to locations of type Online String (where empty means zero character) or Online ICollection (where empty means zero item).
Inheritance Hierarchy
Online System Object
Online System Attribute
PostSharp.Extensibility MulticastAttribute
PostSharp.Patterns.Contracts LocationContractAttribute
PostSharp.Patterns.Contracts NotEmptyAttribute

Namespace: PostSharp.Patterns.Contracts
Assembly: PostSharp.Patterns.Model (in PostSharp.Patterns.Model.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
public sealed class NotEmptyAttribute : LocationContractAttribute,
    ILocationValidationAspect<string>, ILocationValidationAspect<ICollection>, ILocationValidationAspect,
    IAspect
public sealed class NotEmptyAttribute : LocationContractAttribute,
    ILocationValidationAspect<string>, ILocationValidationAspect<ICollection>, ILocationValidationAspect,
    IAspect
See Also
NotEmptyAttribute Members
PostSharp.Patterns.Contracts Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


NotEmptyAttribute Members

NotEmptyAttribute Members PostSharp Documentation

The NotEmptyAttribute type exposes the following members.
Constructors
 | Name | Description
Public method | NotEmptyAttribute | Initializes a new NotEmptyAttribute.
Back to Top
Properties
 | Name | Description
Public property | AttributeExclude | If true, indicates that this attribute removes all other instances of the same attribute type from the set of elements defined by the current instance. (Inherited from MulticastAttribute.)
Public property | AttributeId | Obsolete. (Inherited from MulticastAttribute.)
Public property | AttributeInheritance | Determines whether this attribute is inherited (Inherited from MulticastAttribute.)
Public property | AttributePriority | Gets or sets the priority of the current attribute in case that multiple instances are defined on the same element (lower values are processed before). (Inherited from MulticastAttribute.)
Public property | AttributeReplace | Determines whether this attribute replaces other attributes found on the target declarations. (Inherited from MulticastAttribute.)
Public property | AttributeTargetAssemblies | Gets or sets the assemblies to which the current attribute apply. (Inherited from MulticastAttribute.)
Public property | AttributeTargetElements | Gets or sets the kind of elements to which this custom attributes applies. (Inherited from MulticastAttribute.)
Public property | AttributeTargetExternalMemberAttributes | Gets or sets the visibilities, scopes, virtualities, and implementation of members to which this attribute applies, when the member is external to the current module. (Inherited from MulticastAttribute.)
Public property | AttributeTargetExternalTypeAttributes | Gets or sets the visibilities of types to which this attribute applies, when this type is external to the current module. (Inherited from MulticastAttribute.)
Public property | AttributeTargetMemberAttributes | Gets or sets the visibilities, scopes, virtualities, and implementation of members to which this attribute applies. (Inherited from MulticastAttribute.)
Public property | AttributeTargetMembers | Gets or sets the expression specifying to which members this instance applies. (Inherited from MulticastAttribute.)
Public property | AttributeTargetParameterAttributes | Gets or sets the passing style (by value, out or ref) of parameters to which this attribute applies. (Inherited from MulticastAttribute.)
Public property | AttributeTargetParameters | Gets or sets the expression specifying to which parameters this instance applies. (Inherited from MulticastAttribute.)
Public property | AttributeTargetTypeAttributes | Gets or sets the visibilities of types to which this attribute applies. (Inherited from MulticastAttribute.)
Public property | AttributeTargetTypes | Gets or sets the expression specifying to which types this instance applies. (Inherited from MulticastAttribute.)
Public property | ErrorMessage | Gets or sets the error message formatting string. (Inherited from LocationContractAttribute.)
Back to Top
See Also
NotEmptyAttribute Class
PostSharp.Patterns.Contracts Namespace

Online Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


NotEmptyAttribute Constructor

NotEmptyAttribute Constructor PostSharp Documentation
Initializes a new NotEmptyAttribute.

Namespace: PostSharp.Patterns.Contracts
Assembly: PostSharp.Patterns.Model (in PostSharp.Patterns.Model.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
public NotEmptyAttribute()
public NotEmptyAttribute()
See Also
NotEmptyAttribute Class
NotEmptyAttribute Members
PostSharp.Patterns.Contracts Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


NotEmptyAttribute Properties

NotEmptyAttribute Properties PostSharp Documentation
The NotEmptyAttribute type exposes the following members.
Properties
 | Name | Description
Public property | AttributeExclude | If true, indicates that this attribute removes all other instances of the same attribute type from the set of elements defined by the current instance. (Inherited from MulticastAttribute.)
Public property | AttributeId | Obsolete. (Inherited from MulticastAttribute.)
Public property | AttributeInheritance | Determines whether this attribute is inherited (Inherited from MulticastAttribute.)
Public property | AttributePriority | Gets or sets the priority of the current attribute in case that multiple instances are defined on the same element (lower values are processed before). (Inherited from MulticastAttribute.)
Public property | AttributeReplace | Determines whether this attribute replaces other attributes found on the target declarations. (Inherited from MulticastAttribute.)
Public property | AttributeTargetAssemblies | Gets or sets the assemblies to which the current attribute apply. (Inherited from MulticastAttribute.)
Public property | AttributeTargetElements | Gets or sets the kind of elements to which this custom attributes applies. (Inherited from MulticastAttribute.)
Public property | AttributeTargetExternalMemberAttributes | Gets or sets the visibilities, scopes, virtualities, and implementation of members to which this attribute applies, when the member is external to the current module. (Inherited from MulticastAttribute.)
Public property | AttributeTargetExternalTypeAttributes | Gets or sets the visibilities of types to which this attribute applies, when this type is external to the current module. (Inherited from MulticastAttribute.)
Public property | AttributeTargetMemberAttributes | Gets or sets the visibilities, scopes, virtualities, and implementation of members to which this attribute applies. (Inherited from MulticastAttribute.)
Public property | AttributeTargetMembers | Gets or sets the expression specifying to which members this instance applies. (Inherited from MulticastAttribute.)
Public property | AttributeTargetParameterAttributes | Gets or sets the passing style (by value, out or ref) of parameters to which this attribute applies. (Inherited from MulticastAttribute.)
Public property | AttributeTargetParameters | Gets or sets the expression specifying to which parameters this instance applies. (Inherited from MulticastAttribute.)
Public property | AttributeTargetTypeAttributes | Gets or sets the visibilities of types to which this attribute applies. (Inherited from MulticastAttribute.)
Public property | AttributeTargetTypes | Gets or sets the expression specifying to which types this instance applies. (Inherited from MulticastAttribute.)
Public property | ErrorMessage | Gets or sets the error message formatting string. (Inherited from LocationContractAttribute.)
Back to Top
See Also
NotEmptyAttribute Class
PostSharp.Patterns.Contracts Namespace

Online Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


NotNullAttribute Class

NotNullAttribute Class PostSharp Documentation
Custom attribute that, when added to a field, property or parameter, throws an Online ArgumentNullException if the target is assigned a null value.
Inheritance Hierarchy
Online System Object
Online System Attribute
PostSharp.Extensibility MulticastAttribute
PostSharp.Patterns.Contracts LocationContractAttribute
PostSharp.Patterns.Contracts NotNullAttribute

Namespace: PostSharp.Patterns.Contracts
Assembly: PostSharp.Patterns.Model (in PostSharp.Patterns.Model.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
public sealed class NotNullAttribute : LocationContractAttribute,
    ILocationValidationAspect<Object>, ILocationValidationAspect, IAspect
public sealed class NotNullAttribute : LocationContractAttribute,
    ILocationValidationAspect<Object>, ILocationValidationAspect, IAspect
See Also
NotNullAttribute Members
PostSharp.Patterns.Contracts Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


NotNullAttribute Members

NotNullAttribute Members PostSharp Documentation

The NotNullAttribute type exposes the following members.
Constructors
 | Name | Description
Public method | NotNullAttribute | Initializes a new Online ArgumentNullException.
Back to Top
Properties
 | Name | Description
Public property | AttributeExclude | If true, indicates that this attribute removes all other instances of the same attribute type from the set of elements defined by the current instance. (Inherited from MulticastAttribute.)
Public property | AttributeId | Obsolete. (Inherited from MulticastAttribute.)
Public property | AttributeInheritance | Determines whether this attribute is inherited (Inherited from MulticastAttribute.)
Public property | AttributePriority | Gets or sets the priority of the current attribute in case that multiple instances are defined on the same element (lower values are processed before). (Inherited from MulticastAttribute.)
Public property | AttributeReplace | Determines whether this attribute replaces other attributes found on the target declarations. (Inherited from MulticastAttribute.)
Public property | AttributeTargetAssemblies | Gets or sets the assemblies to which the current attribute apply. (Inherited from MulticastAttribute.)
Public property | AttributeTargetElements | Gets or sets the kind of elements to which this custom attributes applies. (Inherited from MulticastAttribute.)
Public property | AttributeTargetExternalMemberAttributes | Gets or sets the visibilities, scopes, virtualities, and implementation of members to which this attribute applies, when the member is external to the current module. (Inherited from MulticastAttribute.)
Public property | AttributeTargetExternalTypeAttributes | Gets or sets the visibilities of types to which this attribute applies, when this type is external to the current module. (Inherited from MulticastAttribute.)
Public property | AttributeTargetMemberAttributes | Gets or sets the visibilities, scopes, virtualities, and implementation of members to which this attribute applies. (Inherited from MulticastAttribute.)
Public property | AttributeTargetMembers | Gets or sets the expression specifying to which members this instance applies. (Inherited from MulticastAttribute.)
Public property | AttributeTargetParameterAttributes | Gets or sets the passing style (by value, out or ref) of parameters to which this attribute applies. (Inherited from MulticastAttribute.)
Public property | AttributeTargetParameters | Gets or sets the expression specifying to which parameters this instance applies. (Inherited from MulticastAttribute.)
Public property | AttributeTargetTypeAttributes | Gets or sets the visibilities of types to which this attribute applies. (Inherited from MulticastAttribute.)
Public property | AttributeTargetTypes | Gets or sets the expression specifying to which types this instance applies. (Inherited from MulticastAttribute.)
Public property | ErrorMessage | Gets or sets the error message formatting string. (Inherited from LocationContractAttribute.)
Back to Top
See Also
NotNullAttribute Class
PostSharp.Patterns.Contracts Namespace

Online Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


NotNullAttribute Constructor

NotNullAttribute Constructor PostSharp Documentation
Initializes a new Online ArgumentNullException.

Namespace: PostSharp.Patterns.Contracts
Assembly: PostSharp.Patterns.Model (in PostSharp.Patterns.Model.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
public NotNullAttribute()
public NotNullAttribute()
See Also
NotNullAttribute Class
NotNullAttribute Members
PostSharp.Patterns.Contracts Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


NotNullAttribute Properties

NotNullAttribute Properties PostSharp Documentation
The NotNullAttribute type exposes the following members.
Properties
 | Name | Description
Public property | AttributeExclude | If true, indicates that this attribute removes all other instances of the same attribute type from the set of elements defined by the current instance. (Inherited from MulticastAttribute.)
Public property | AttributeId | Obsolete. (Inherited from MulticastAttribute.)
Public property | AttributeInheritance | Determines whether this attribute is inherited (Inherited from MulticastAttribute.)
Public property | AttributePriority | Gets or sets the priority of the current attribute in case that multiple instances are defined on the same element (lower values are processed before). (Inherited from MulticastAttribute.)
Public property | AttributeReplace | Determines whether this attribute replaces other attributes found on the target declarations. (Inherited from MulticastAttribute.)
Public property | AttributeTargetAssemblies | Gets or sets the assemblies to which the current attribute apply. (Inherited from MulticastAttribute.)
Public property | AttributeTargetElements | Gets or sets the kind of elements to which this custom attributes applies. (Inherited from MulticastAttribute.)
Public property | AttributeTargetExternalMemberAttributes | Gets or sets the visibilities, scopes, virtualities, and implementation of members to which this attribute applies, when the member is external to the current module. (Inherited from MulticastAttribute.)
Public property | AttributeTargetExternalTypeAttributes | Gets or sets the visibilities of types to which this attribute applies, when this type is external to the current module. (Inherited from MulticastAttribute.)
Public property | AttributeTargetMemberAttributes | Gets or sets the visibilities, scopes, virtualities, and implementation of members to which this attribute applies. (Inherited from MulticastAttribute.)
Public property | AttributeTargetMembers | Gets or sets the expression specifying to which members this instance applies. (Inherited from MulticastAttribute.)
Public property | AttributeTargetParameterAttributes | Gets or sets the passing style (by value, out or ref) of parameters to which this attribute applies. (Inherited from MulticastAttribute.)
Public property | AttributeTargetParameters | Gets or sets the expression specifying to which parameters this instance applies. (Inherited from MulticastAttribute.)
Public property | AttributeTargetTypeAttributes | Gets or sets the visibilities of types to which this attribute applies. (Inherited from MulticastAttribute.)
Public property | AttributeTargetTypes | Gets or sets the expression specifying to which types this instance applies. (Inherited from MulticastAttribute.)
Public property | ErrorMessage | Gets or sets the error message formatting string. (Inherited from LocationContractAttribute.)
Back to Top
See Also
NotNullAttribute Class
PostSharp.Patterns.Contracts Namespace

Online Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


PhoneAttribute Class

PhoneAttribute Class PostSharp Documentation
Custom attribute that, when added to a field, property or parameter, throws an Online ArgumentException if the target is assigned a value that is not a valid phone number. Null strings are accepted and do not throw an exception.
Inheritance Hierarchy
Online System Object
Online System Attribute
PostSharp.Extensibility MulticastAttribute
PostSharp.Patterns.Contracts LocationContractAttribute
PostSharp.Patterns.Contracts RegularExpressionAttribute
PostSharp.Patterns.Contracts PhoneAttribute

Namespace: PostSharp.Patterns.Contracts
Assembly: PostSharp.Patterns.Model (in PostSharp.Patterns.Model.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
public sealed class PhoneAttribute : RegularExpressionAttribute
public sealed class PhoneAttribute : RegularExpressionAttribute
See Also
PhoneAttribute Members
PostSharp.Patterns.Contracts Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


PhoneAttribute Members

PhoneAttribute Members PostSharp Documentation

The PhoneAttribute type exposes the following members.
Constructors
 | Name | Description
Public method | PhoneAttribute | Initializes a new PhoneAttribute.
Back to Top
Properties
 | Name | Description
Public property | AttributeExclude | If true, indicates that this attribute removes all other instances of the same attribute type from the set of elements defined by the current instance. (Inherited from MulticastAttribute.)
Public property | AttributeId | Obsolete. (Inherited from MulticastAttribute.)
Public property | AttributeInheritance | Determines whether this attribute is inherited (Inherited from MulticastAttribute.)
Public property | AttributePriority | Gets or sets the priority of the current attribute in case that multiple instances are defined on the same element (lower values are processed before). (Inherited from MulticastAttribute.)
Public property | AttributeReplace | Determines whether this attribute replaces other attributes found on the target declarations. (Inherited from MulticastAttribute.)
Public property | AttributeTargetAssemblies | Gets or sets the assemblies to which the current attribute apply. (Inherited from MulticastAttribute.)
Public property | AttributeTargetElements | Gets or sets the kind of elements to which this custom attributes applies. (Inherited from MulticastAttribute.)
Public property | AttributeTargetExternalMemberAttributes | Gets or sets the visibilities, scopes, virtualities, and implementation of members to which this attribute applies, when the member is external to the current module. (Inherited from MulticastAttribute.)
Public property | AttributeTargetExternalTypeAttributes | Gets or sets the visibilities of types to which this attribute applies, when this type is external to the current module. (Inherited from MulticastAttribute.)
Public property | AttributeTargetMemberAttributes | Gets or sets the visibilities, scopes, virtualities, and implementation of members to which this attribute applies. (Inherited from MulticastAttribute.)
Public property | AttributeTargetMembers | Gets or sets the expression specifying to which members this instance applies. (Inherited from MulticastAttribute.)
Public property | AttributeTargetParameterAttributes | Gets or sets the passing style (by value, out or ref) of parameters to which this attribute applies. (Inherited from MulticastAttribute.)
Public property | AttributeTargetParameters | Gets or sets the expression specifying to which parameters this instance applies. (Inherited from MulticastAttribute.)
Public property | AttributeTargetTypeAttributes | Gets or sets the visibilities of types to which this attribute applies. (Inherited from MulticastAttribute.)
Public property | AttributeTargetTypes | Gets or sets the expression specifying to which types this instance applies. (Inherited from MulticastAttribute.)
Public property | ErrorMessage | Gets or sets the error message formatting string. (Inherited from LocationContractAttribute.)
Back to Top
See Also
PhoneAttribute Class
PostSharp.Patterns.Contracts Namespace

Online Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


PhoneAttribute Constructor

PhoneAttribute Constructor PostSharp Documentation
Initializes a new PhoneAttribute.

Namespace: PostSharp.Patterns.Contracts
Assembly: PostSharp.Patterns.Model (in PostSharp.Patterns.Model.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
public PhoneAttribute()
public PhoneAttribute()
See Also
PhoneAttribute Class
PhoneAttribute Members
PostSharp.Patterns.Contracts Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


PhoneAttribute Properties

PhoneAttribute Properties PostSharp Documentation
The PhoneAttribute type exposes the following members.
Properties
 | Name | Description
Public property | AttributeExclude | If true, indicates that this attribute removes all other instances of the same attribute type from the set of elements defined by the current instance. (Inherited from MulticastAttribute.)
Public property | AttributeId | Obsolete. (Inherited from MulticastAttribute.)
Public property | AttributeInheritance | Determines whether this attribute is inherited (Inherited from MulticastAttribute.)
Public property | AttributePriority | Gets or sets the priority of the current attribute in case that multiple instances are defined on the same element (lower values are processed before). (Inherited from MulticastAttribute.)
Public property | AttributeReplace | Determines whether this attribute replaces other attributes found on the target declarations. (Inherited from MulticastAttribute.)
Public property | AttributeTargetAssemblies | Gets or sets the assemblies to which the current attribute apply. (Inherited from MulticastAttribute.)
Public property | AttributeTargetElements | Gets or sets the kind of elements to which this custom attributes applies. (Inherited from MulticastAttribute.)
Public property | AttributeTargetExternalMemberAttributes | Gets or sets the visibilities, scopes, virtualities, and implementation of members to which this attribute applies, when the member is external to the current module. (Inherited from MulticastAttribute.)
Public property | AttributeTargetExternalTypeAttributes | Gets or sets the visibilities of types to which this attribute applies, when this type is external to the current module. (Inherited from MulticastAttribute.)
Public property | AttributeTargetMemberAttributes | Gets or sets the visibilities, scopes, virtualities, and implementation of members to which this attribute applies. (Inherited from MulticastAttribute.)
Public property | AttributeTargetMembers | Gets or sets the expression specifying to which members this instance applies. (Inherited from MulticastAttribute.)
Public property | AttributeTargetParameterAttributes | Gets or sets the passing style (by value, out or ref) of parameters to which this attribute applies. (Inherited from MulticastAttribute.)
Public property | AttributeTargetParameters | Gets or sets the expression specifying to which parameters this instance applies. (Inherited from MulticastAttribute.)
Public property | AttributeTargetTypeAttributes | Gets or sets the visibilities of types to which this attribute applies. (Inherited from MulticastAttribute.)
Public property | AttributeTargetTypes | Gets or sets the expression specifying to which types this instance applies. (Inherited from MulticastAttribute.)
Public property | ErrorMessage | Gets or sets the error message formatting string. (Inherited from LocationContractAttribute.)
Back to Top
See Also
PhoneAttribute Class
PostSharp.Patterns.Contracts Namespace

Online Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


PositiveAttribute Class

PositiveAttribute Class PostSharp Documentation
Custom attribute that, when added to a field, property or parameter, throws an Online ArgumentOutOfRangeException if the target is assigned a value that smaller than zero.
Inheritance Hierarchy
Online System Object
Online System Attribute
PostSharp.Extensibility MulticastAttribute
PostSharp.Patterns.Contracts LocationContractAttribute
PostSharp.Patterns.Contracts RangeAttribute
PostSharp.Patterns.Contracts GreaterThanAttribute
PostSharp.Patterns.Contracts PositiveAttribute

Namespace: PostSharp.Patterns.Contracts
Assembly: PostSharp.Patterns.Model (in PostSharp.Patterns.Model.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
public class PositiveAttribute : GreaterThanAttribute
public class PositiveAttribute : GreaterThanAttribute
Remarks
Null values are accepted and do not throw an exception.

See Also
PositiveAttribute Members
PostSharp.Patterns.Contracts Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


PositiveAttribute Members

PositiveAttribute Members PostSharp Documentation

The PositiveAttribute type exposes the following members.
Constructors
 | Name | Description
Public method | PositiveAttribute | Initializes a new PositiveAttribute.
Back to Top
Methods
 | Name | Description
Protected method | CreateArgumentException | Creates an Online ArgumentException with an error message formatted from ErrorMessage and given concrete values. (Inherited from LocationContractAttribute.)
Protected method | CreateArgumentNullException | Creates an Online ArgumentNullException with an error message formatted from ErrorMessage and given concrete values. (Inherited from LocationContractAttribute.)
Protected method | CreateArgumentOutOfRangeException | Creates an Online ArgumentOutOfRangeException with an error message formatted from ErrorMessage and given concrete values. (Inherited from LocationContractAttribute.)
Protected method | FormatErrorMessage | Formats the ErrorMessage with concrete values. (Inherited from LocationContractAttribute.)
Back to Top
Properties
 | Name | Description
Public property | AttributeExclude | If true, indicates that this attribute removes all other instances of the same attribute type from the set of elements defined by the current instance. (Inherited from MulticastAttribute.)
Public property | AttributeId | Obsolete. (Inherited from MulticastAttribute.)
Public property | AttributeInheritance | Determines whether this attribute is inherited (Inherited from MulticastAttribute.)
Public property | AttributePriority | Gets or sets the priority of the current attribute in case that multiple instances are defined on the same element (lower values are processed before). (Inherited from MulticastAttribute.)
Public property | AttributeReplace | Determines whether this attribute replaces other attributes found on the target declarations. (Inherited from MulticastAttribute.)
Public property | AttributeTargetAssemblies | Gets or sets the assemblies to which the current attribute apply. (Inherited from MulticastAttribute.)
Public property | AttributeTargetElements | Gets or sets the kind of elements to which this custom attributes applies. (Inherited from MulticastAttribute.)
Public property | AttributeTargetExternalMemberAttributes | Gets or sets the visibilities, scopes, virtualities, and implementation of members to which this attribute applies, when the member is external to the current module. (Inherited from MulticastAttribute.)
Public property | AttributeTargetExternalTypeAttributes | Gets or sets the visibilities of types to which this attribute applies, when this type is external to the current module. (Inherited from MulticastAttribute.)
Public property | AttributeTargetMemberAttributes | Gets or sets the visibilities, scopes, virtualities, and implementation of members to which this attribute applies. (Inherited from MulticastAttribute.)
Public property | AttributeTargetMembers | Gets or sets the expression specifying to which members this instance applies. (Inherited from MulticastAttribute.)
Public property | AttributeTargetParameterAttributes | Gets or sets the passing style (by value, out or ref) of parameters to which this attribute applies. (Inherited from MulticastAttribute.)
Public property | AttributeTargetParameters | Gets or sets the expression specifying to which parameters this instance applies. (Inherited from MulticastAttribute.)
Public property | AttributeTargetTypeAttributes | Gets or sets the visibilities of types to which this attribute applies. (Inherited from MulticastAttribute.)
Public property | AttributeTargetTypes | Gets or sets the expression specifying to which types this instance applies. (Inherited from MulticastAttribute.)
Public property | ErrorMessage | Gets or sets the error message formatting string. (Inherited from LocationContractAttribute.)
Back to Top
See Also
PositiveAttribute Class
PostSharp.Patterns.Contracts Namespace

Online Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


PositiveAttribute Constructor

PositiveAttribute Constructor PostSharp Documentation
Initializes a new PositiveAttribute.

Namespace: PostSharp.Patterns.Contracts
Assembly: PostSharp.Patterns.Model (in PostSharp.Patterns.Model.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
public PositiveAttribute()
public PositiveAttribute()
See Also
PositiveAttribute Class
PositiveAttribute Members
PostSharp.Patterns.Contracts Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


PositiveAttribute Methods

PositiveAttribute Methods PostSharp Documentation
The PositiveAttribute type exposes the following members.
Methods
 | Name | Description
Protected method | CreateArgumentException | Creates an Online ArgumentException with an error message formatted from ErrorMessage and given concrete values. (Inherited from LocationContractAttribute.)
Protected method | CreateArgumentNullException | Creates an Online ArgumentNullException with an error message formatted from ErrorMessage and given concrete values. (Inherited from LocationContractAttribute.)
Protected method | CreateArgumentOutOfRangeException | Creates an Online ArgumentOutOfRangeException with an error message formatted from ErrorMessage and given concrete values. (Inherited from LocationContractAttribute.)
Protected method | FormatErrorMessage | Formats the ErrorMessage with concrete values. (Inherited from LocationContractAttribute.)
Back to Top
See Also
PositiveAttribute Class
PostSharp.Patterns.Contracts Namespace

Online Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


PositiveAttribute Properties

PositiveAttribute Properties PostSharp Documentation
The PositiveAttribute type exposes the following members.
Properties
 | Name | Description
Public property | AttributeExclude | If true, indicates that this attribute removes all other instances of the same attribute type from the set of elements defined by the current instance. (Inherited from MulticastAttribute.)
Public property | AttributeId | Obsolete. (Inherited from MulticastAttribute.)
Public property | AttributeInheritance | Determines whether this attribute is inherited (Inherited from MulticastAttribute.)
Public property | AttributePriority | Gets or sets the priority of the current attribute in case that multiple instances are defined on the same element (lower values are processed before). (Inherited from MulticastAttribute.)
Public property | AttributeReplace | Determines whether this attribute replaces other attributes found on the target declarations. (Inherited from MulticastAttribute.)
Public property | AttributeTargetAssemblies | Gets or sets the assemblies to which the current attribute apply. (Inherited from MulticastAttribute.)
Public property | AttributeTargetElements | Gets or sets the kind of elements to which this custom attributes applies. (Inherited from MulticastAttribute.)
Public property | AttributeTargetExternalMemberAttributes | Gets or sets the visibilities, scopes, virtualities, and implementation of members to which this attribute applies, when the member is external to the current module. (Inherited from MulticastAttribute.)
Public property | AttributeTargetExternalTypeAttributes | Gets or sets the visibilities of types to which this attribute applies, when this type is external to the current module. (Inherited from MulticastAttribute.)
Public property | AttributeTargetMemberAttributes | Gets or sets the visibilities, scopes, virtualities, and implementation of members to which this attribute applies. (Inherited from MulticastAttribute.)
Public property | AttributeTargetMembers | Gets or sets the expression specifying to which members this instance applies. (Inherited from MulticastAttribute.)
Public property | AttributeTargetParameterAttributes | Gets or sets the passing style (by value, out or ref) of parameters to which this attribute applies. (Inherited from MulticastAttribute.)
Public property | AttributeTargetParameters | Gets or sets the expression specifying to which parameters this instance applies. (Inherited from MulticastAttribute.)
Public property | AttributeTargetTypeAttributes | Gets or sets the visibilities of types to which this attribute applies. (Inherited from MulticastAttribute.)
Public property | AttributeTargetTypes | Gets or sets the expression specifying to which types this instance applies. (Inherited from MulticastAttribute.)
Public property | ErrorMessage | Gets or sets the error message formatting string. (Inherited from LocationContractAttribute.)
Back to Top
See Also
PositiveAttribute Class
PostSharp.Patterns.Contracts Namespace

Online Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


RangeAttribute Class

RangeAttribute Class PostSharp Documentation
Custom attribute that, when added to a field, property or parameter, throws an Online ArgumentOutOfRangeException if the target is assigned a value that is outside a given range.
Inheritance Hierarchy
Online System Object
Online System Attribute
PostSharp.Extensibility MulticastAttribute
PostSharp.Patterns.Contracts LocationContractAttribute
PostSharp.Patterns.Contracts RangeAttribute
PostSharp.Patterns.Contracts GreaterThanAttribute
PostSharp.Patterns.Contracts LessThanAttribute
PostSharp.Patterns.Contracts StrictlyGreaterThanAttribute

Namespace: PostSharp.Patterns.Contracts
Assembly: PostSharp.Patterns.Model (in PostSharp.Patterns.Model.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
public class RangeAttribute : LocationContractAttribute,
    IValidableAnnotation, ILocationValidationAspect<Nullable<long>>, ILocationValidationAspect<Nullable<ulong>>,
    ILocationValidationAspect<Nullable<int>>, ILocationValidationAspect<Nullable<uint>>,
    ILocationValidationAspect<Nullable<short>>, ILocationValidationAspect<Nullable<byte>>,
    ILocationValidationAspect<Nullable<sbyte>>, ILocationValidationAspect<Nullable<ushort>>,
    ILocationValidationAspect<Nullable<double>>, ILocationValidationAspect<Nullable<decimal>>,
    ILocationValidationAspect<long>, ILocationValidationAspect<ulong>, ILocationValidationAspect<double>,
    ILocationValidationAspect<decimal>, ILocationValidationAspect<int>, ILocationValidationAspect<uint>,
    ILocationValidationAspect<short>, ILocationValidationAspect<byte>, ILocationValidationAspect<sbyte>,
    ILocationValidationAspect<ushort>, ILocationValidationAspect, IAspect
public class RangeAttribute : LocationContractAttribute,
    IValidableAnnotation, ILocationValidationAspect<Nullable<long>>, ILocationValidationAspect<Nullable<ulong>>,
    ILocationValidationAspect<Nullable<int>>, ILocationValidationAspect<Nullable<uint>>,
    ILocationValidationAspect<Nullable<short>>, ILocationValidationAspect<Nullable<byte>>,
    ILocationValidationAspect<Nullable<sbyte>>, ILocationValidationAspect<Nullable<ushort>>,
    ILocationValidationAspect<Nullable<double>>, ILocationValidationAspect<Nullable<decimal>>,
    ILocationValidationAspect<long>, ILocationValidationAspect<ulong>, ILocationValidationAspect<double>,
    ILocationValidationAspect<decimal>, ILocationValidationAspect<int>, ILocationValidationAspect<uint>,
    ILocationValidationAspect<short>, ILocationValidationAspect<byte>, ILocationValidationAspect<sbyte>,
    ILocationValidationAspect<ushort>, ILocationValidationAspect, IAspect
Remarks
Null values are accepted and do not throw an exception.

See Also
RangeAttribute Members
PostSharp.Patterns.Contracts Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


RangeAttribute Members

RangeAttribute Members PostSharp Documentation

The RangeAttribute type exposes the following members.
Constructors
 | Name | Description
Public method | RangeAttribute(Decimal, Decimal) | Initializes a new GreaterThanAttribute and specify a Online Decimal bound.
Public method | RangeAttribute(Double, Double) | Initializes a new GreaterThanAttribute and specify a floating-point bound.
Public method | RangeAttribute(Int64, Int64) | Initializes a new GreaterThanAttribute and specify an integer bound.
Public method | RangeAttribute(UInt64, UInt64) | Initializes a new GreaterThanAttribute and specify a Online UInt64 bound.
Back to Top
Methods
 | Name | Description
Protected method | CreateArgumentException | Creates an Online ArgumentException with an error message formatted from ErrorMessage and given concrete values. (Inherited from LocationContractAttribute.)
Protected method | CreateArgumentNullException | Creates an Online ArgumentNullException with an error message formatted from ErrorMessage and given concrete values. (Inherited from LocationContractAttribute.)
Protected method | CreateArgumentOutOfRangeException | Creates an Online ArgumentOutOfRangeException with an error message formatted from ErrorMessage and given concrete values. (Inherited from LocationContractAttribute.)
Protected method | FormatErrorMessage | Formats the ErrorMessage with concrete values. (Inherited from LocationContractAttribute.)
Back to Top
Properties
 | Name | Description
Public property | AttributeExclude | If true, indicates that this attribute removes all other instances of the same attribute type from the set of elements defined by the current instance. (Inherited from MulticastAttribute.)
Public property | AttributeId | Obsolete. (Inherited from MulticastAttribute.)
Public property | AttributeInheritance | Determines whether this attribute is inherited (Inherited from MulticastAttribute.)
Public property | AttributePriority | Gets or sets the priority of the current attribute in case that multiple instances are defined on the same element (lower values are processed before). (Inherited from MulticastAttribute.)
Public property | AttributeReplace | Determines whether this attribute replaces other attributes found on the target declarations. (Inherited from MulticastAttribute.)
Public property | AttributeTargetAssemblies | Gets or sets the assemblies to which the current attribute apply. (Inherited from MulticastAttribute.)
Public property | AttributeTargetElements | Gets or sets the kind of elements to which this custom attributes applies. (Inherited from MulticastAttribute.)
Public property | AttributeTargetExternalMemberAttributes | Gets or sets the visibilities, scopes, virtualities, and implementation of members to which this attribute applies, when the member is external to the current module. (Inherited from MulticastAttribute.)
Public property | AttributeTargetExternalTypeAttributes | Gets or sets the visibilities of types to which this attribute applies, when this type is external to the current module. (Inherited from MulticastAttribute.)
Public property | AttributeTargetMemberAttributes | Gets or sets the visibilities, scopes, virtualities, and implementation of members to which this attribute applies. (Inherited from MulticastAttribute.)
Public property | AttributeTargetMembers | Gets or sets the expression specifying to which members this instance applies. (Inherited from MulticastAttribute.)
Public property | AttributeTargetParameterAttributes | Gets or sets the passing style (by value, out or ref) of parameters to which this attribute applies. (Inherited from MulticastAttribute.)
Public property | AttributeTargetParameters | Gets or sets the expression specifying to which parameters this instance applies. (Inherited from MulticastAttribute.)
Public property | AttributeTargetTypeAttributes | Gets or sets the visibilities of types to which this attribute applies. (Inherited from MulticastAttribute.)
Public property | AttributeTargetTypes | Gets or sets the expression specifying to which types this instance applies. (Inherited from MulticastAttribute.)
Public property | ErrorMessage | Gets or sets the error message formatting string. (Inherited from LocationContractAttribute.)
Back to Top
See Also
RangeAttribute Class
PostSharp.Patterns.Contracts Namespace

Online Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


RangeAttribute Constructor

RangeAttribute Constructor PostSharp Documentation
Overload List
 | Name | Description
Public method | RangeAttribute(Decimal, Decimal) | Initializes a new GreaterThanAttribute and specify a Online Decimal bound.
Public method | RangeAttribute(Double, Double) | Initializes a new GreaterThanAttribute and specify a floating-point bound.
Public method | RangeAttribute(Int64, Int64) | Initializes a new GreaterThanAttribute and specify an integer bound.
Public method | RangeAttribute(UInt64, UInt64) | Initializes a new GreaterThanAttribute and specify a Online UInt64 bound.
Back to Top
See Also
RangeAttribute Class
RangeAttribute Members
PostSharp.Patterns.Contracts Namespace

Online Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


RangeAttribute Constructor (Decimal, Decimal)

RangeAttribute Constructor (Decimal, Decimal) PostSharp Documentation
Initializes a new GreaterThanAttribute and specify a Online Decimal bound.

Namespace: PostSharp.Patterns.Contracts
Assembly: PostSharp.Patterns.Model (in PostSharp.Patterns.Model.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
public RangeAttribute(
    decimal min,
    decimal max
)
public RangeAttribute(
    decimal min,
    decimal max
)
Parameters
min
Type:   Online System Decimal
The lower bound.
max
Type:   Online System Decimal
The upper bound.
See Also
RangeAttribute Class
RangeAttribute Members
RangeAttribute Overload
PostSharp.Patterns.Contracts Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


RangeAttribute Constructor (Double, Double)

RangeAttribute Constructor (Double, Double) PostSharp Documentation
Initializes a new GreaterThanAttribute and specify a floating-point bound.

Namespace: PostSharp.Patterns.Contracts
Assembly: PostSharp.Patterns.Model (in PostSharp.Patterns.Model.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
public RangeAttribute(
    double min,
    double max
)
public RangeAttribute(
    double min,
    double max
)
Parameters
min
Type:   Online System Double
The lower bound.
max
Type:   Online System Double
The upper bound.
See Also
RangeAttribute Class
RangeAttribute Members
RangeAttribute Overload
PostSharp.Patterns.Contracts Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


RangeAttribute Constructor (Int64, Int64)

RangeAttribute Constructor (Int64, Int64) PostSharp Documentation
Initializes a new GreaterThanAttribute and specify an integer bound.

Namespace: PostSharp.Patterns.Contracts
Assembly: PostSharp.Patterns.Model (in PostSharp.Patterns.Model.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
public RangeAttribute(
    long min,
    long max
)
public RangeAttribute(
    long min,
    long max
)
Parameters
min
Type:   Online System Int64
The lower bound.
max
Type:   Online System Int64
The upper bound.
See Also
RangeAttribute Class
RangeAttribute Members
RangeAttribute Overload
PostSharp.Patterns.Contracts Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


RangeAttribute Constructor (UInt64, UInt64)

RangeAttribute Constructor (UInt64, UInt64) PostSharp Documentation
Initializes a new GreaterThanAttribute and specify a Online UInt64 bound.

Namespace: PostSharp.Patterns.Contracts
Assembly: PostSharp.Patterns.Model (in PostSharp.Patterns.Model.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
public RangeAttribute(
    ulong min,
    ulong max
)
public RangeAttribute(
    ulong min,
    ulong max
)
Parameters
min
Type:   Online System UInt64
The lower bound.
max
Type:   Online System UInt64
The upper bound.
See Also
RangeAttribute Class
RangeAttribute Members
RangeAttribute Overload
PostSharp.Patterns.Contracts Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


RangeAttribute Methods

RangeAttribute Methods PostSharp Documentation
The RangeAttribute type exposes the following members.
Methods
 | Name | Description
Protected method | CreateArgumentException | Creates an Online ArgumentException with an error message formatted from ErrorMessage and given concrete values. (Inherited from LocationContractAttribute.)
Protected method | CreateArgumentNullException | Creates an Online ArgumentNullException with an error message formatted from ErrorMessage and given concrete values. (Inherited from LocationContractAttribute.)
Protected method | CreateArgumentOutOfRangeException | Creates an Online ArgumentOutOfRangeException with an error message formatted from ErrorMessage and given concrete values. (Inherited from LocationContractAttribute.)
Protected method | FormatErrorMessage | Formats the ErrorMessage with concrete values. (Inherited from LocationContractAttribute.)
Back to Top
See Also
RangeAttribute Class
PostSharp.Patterns.Contracts Namespace

Online Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


RangeAttribute Properties

RangeAttribute Properties PostSharp Documentation
The RangeAttribute type exposes the following members.
Properties
 | Name | Description
Public property | AttributeExclude | If true, indicates that this attribute removes all other instances of the same attribute type from the set of elements defined by the current instance. (Inherited from MulticastAttribute.)
Public property | AttributeId | Obsolete. (Inherited from MulticastAttribute.)
Public property | AttributeInheritance | Determines whether this attribute is inherited (Inherited from MulticastAttribute.)
Public property | AttributePriority | Gets or sets the priority of the current attribute in case that multiple instances are defined on the same element (lower values are processed before). (Inherited from MulticastAttribute.)
Public property | AttributeReplace | Determines whether this attribute replaces other attributes found on the target declarations. (Inherited from MulticastAttribute.)
Public property | AttributeTargetAssemblies | Gets or sets the assemblies to which the current attribute apply. (Inherited from MulticastAttribute.)
Public property | AttributeTargetElements | Gets or sets the kind of elements to which this custom attributes applies. (Inherited from MulticastAttribute.)
Public property | AttributeTargetExternalMemberAttributes | Gets or sets the visibilities, scopes, virtualities, and implementation of members to which this attribute applies, when the member is external to the current module. (Inherited from MulticastAttribute.)
Public property | AttributeTargetExternalTypeAttributes | Gets or sets the visibilities of types to which this attribute applies, when this type is external to the current module. (Inherited from MulticastAttribute.)
Public property | AttributeTargetMemberAttributes | Gets or sets the visibilities, scopes, virtualities, and implementation of members to which this attribute applies. (Inherited from MulticastAttribute.)
Public property | AttributeTargetMembers | Gets or sets the expression specifying to which members this instance applies. (Inherited from MulticastAttribute.)
Public property | AttributeTargetParameterAttributes | Gets or sets the passing style (by value, out or ref) of parameters to which this attribute applies. (Inherited from MulticastAttribute.)
Public property | AttributeTargetParameters | Gets or sets the expression specifying to which parameters this instance applies. (Inherited from MulticastAttribute.)
Public property | AttributeTargetTypeAttributes | Gets or sets the visibilities of types to which this attribute applies. (Inherited from MulticastAttribute.)
Public property | AttributeTargetTypes | Gets or sets the expression specifying to which types this instance applies. (Inherited from MulticastAttribute.)
Public property | ErrorMessage | Gets or sets the error message formatting string. (Inherited from LocationContractAttribute.)
Back to Top
See Also
RangeAttribute Class
PostSharp.Patterns.Contracts Namespace

Online Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


RegularExpressionAttribute Class

RegularExpressionAttribute Class PostSharp Documentation
Custom attribute that, when added to a field, property or parameter, throws an Online ArgumentException if the target is assigned a value that does not match a given regular expression. Null strings are accepted and do not throw an exception.
Inheritance Hierarchy
Online System Object
Online System Attribute
PostSharp.Extensibility MulticastAttribute
PostSharp.Patterns.Contracts LocationContractAttribute
PostSharp.Patterns.Contracts RegularExpressionAttribute
PostSharp.Patterns.Contracts EmailAddressAttribute
PostSharp.Patterns.Contracts PhoneAttribute
PostSharp.Patterns.Contracts UrlAttribute

Namespace: PostSharp.Patterns.Contracts
Assembly: PostSharp.Patterns.Model (in PostSharp.Patterns.Model.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
public class RegularExpressionAttribute : LocationContractAttribute,
    ILocationValidationAspect<string>, ILocationValidationAspect, IAspect
public class RegularExpressionAttribute : LocationContractAttribute,
    ILocationValidationAspect<string>, ILocationValidationAspect, IAspect
See Also
RegularExpressionAttribute Members
PostSharp.Patterns.Contracts Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


RegularExpressionAttribute Members

RegularExpressionAttribute Members PostSharp Documentation

The RegularExpressionAttribute type exposes the following members.
Constructors
 | Name | Description
Public method | RegularExpressionAttribute(String) | Initializes a new RegularExpressionAttribute.
Public method | RegularExpressionAttribute(String, RegexOptions) | Initializes a new RegularExpressionAttribute and specify options.
Back to Top
Methods
 | Name | Description
Protected method | CreateArgumentException | Creates an Online ArgumentException with an error message formatted from ErrorMessage and given concrete values. (Inherited from LocationContractAttribute.)
Protected method | CreateArgumentNullException | Creates an Online ArgumentNullException with an error message formatted from ErrorMessage and given concrete values. (Inherited from LocationContractAttribute.)
Protected method | CreateArgumentOutOfRangeException | Creates an Online ArgumentOutOfRangeException with an error message formatted from ErrorMessage and given concrete values. (Inherited from LocationContractAttribute.)
Protected method | FormatErrorMessage | Formats the ErrorMessage with concrete values. (Inherited from LocationContractAttribute.)
Back to Top
Properties
 | Name | Description
Public property | AttributeExclude | If true, indicates that this attribute removes all other instances of the same attribute type from the set of elements defined by the current instance. (Inherited from MulticastAttribute.)
Public property | AttributeId | Obsolete. (Inherited from MulticastAttribute.)
Public property | AttributeInheritance | Determines whether this attribute is inherited (Inherited from MulticastAttribute.)
Public property | AttributePriority | Gets or sets the priority of the current attribute in case that multiple instances are defined on the same element (lower values are processed before). (Inherited from MulticastAttribute.)
Public property | AttributeReplace | Determines whether this attribute replaces other attributes found on the target declarations. (Inherited from MulticastAttribute.)
Public property | AttributeTargetAssemblies | Gets or sets the assemblies to which the current attribute apply. (Inherited from MulticastAttribute.)
Public property | AttributeTargetElements | Gets or sets the kind of elements to which this custom attributes applies. (Inherited from MulticastAttribute.)
Public property | AttributeTargetExternalMemberAttributes | Gets or sets the visibilities, scopes, virtualities, and implementation of members to which this attribute applies, when the member is external to the current module. (Inherited from MulticastAttribute.)
Public property | AttributeTargetExternalTypeAttributes | Gets or sets the visibilities of types to which this attribute applies, when this type is external to the current module. (Inherited from MulticastAttribute.)
Public property | AttributeTargetMemberAttributes | Gets or sets the visibilities, scopes, virtualities, and implementation of members to which this attribute applies. (Inherited from MulticastAttribute.)
Public property | AttributeTargetMembers | Gets or sets the expression specifying to which members this instance applies. (Inherited from MulticastAttribute.)
Public property | AttributeTargetParameterAttributes | Gets or sets the passing style (by value, out or ref) of parameters to which this attribute applies. (Inherited from MulticastAttribute.)
Public property | AttributeTargetParameters | Gets or sets the expression specifying to which parameters this instance applies. (Inherited from MulticastAttribute.)
Public property | AttributeTargetTypeAttributes | Gets or sets the visibilities of types to which this attribute applies. (Inherited from MulticastAttribute.)
Public property | AttributeTargetTypes | Gets or sets the expression specifying to which types this instance applies. (Inherited from MulticastAttribute.)
Public property | ErrorMessage | Gets or sets the error message formatting string. (Inherited from LocationContractAttribute.)
Back to Top
See Also
RegularExpressionAttribute Class
PostSharp.Patterns.Contracts Namespace

Online Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


RegularExpressionAttribute Constructor

RegularExpressionAttribute Constructor PostSharp Documentation
Overload List
 | Name | Description
Public method | RegularExpressionAttribute(String) | Initializes a new RegularExpressionAttribute.
Public method | RegularExpressionAttribute(String, RegexOptions) | Initializes a new RegularExpressionAttribute and specify options.
Back to Top
See Also
RegularExpressionAttribute Class
RegularExpressionAttribute Members
PostSharp.Patterns.Contracts Namespace

Online Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


RegularExpressionAttribute Constructor (String)

RegularExpressionAttribute Constructor (String) PostSharp Documentation
Initializes a new RegularExpressionAttribute.

Namespace: PostSharp.Patterns.Contracts
Assembly: PostSharp.Patterns.Model (in PostSharp.Patterns.Model.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
public RegularExpressionAttribute(
    string pattern
)
public RegularExpressionAttribute(
    string pattern
)
Parameters
pattern
Type:   Online System String
The regular expression.
See Also
RegularExpressionAttribute Class
RegularExpressionAttribute Members
RegularExpressionAttribute Overload
PostSharp.Patterns.Contracts Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


RegularExpressionAttribute Constructor (String, RegexOptions)

RegularExpressionAttribute Constructor (String, RegexOptions) PostSharp Documentation
Initializes a new RegularExpressionAttribute and specify options.

Namespace: PostSharp.Patterns.Contracts
Assembly: PostSharp.Patterns.Model (in PostSharp.Patterns.Model.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
public RegularExpressionAttribute(
    string pattern,
    RegexOptions options
)
public RegularExpressionAttribute(
    string pattern,
    RegexOptions options
)
Parameters
pattern
Type:   Online System String
The regular expression.
options
Type:   Online System.Text.RegularExpressions RegexOptions
Options.
See Also
RegularExpressionAttribute Class
RegularExpressionAttribute Members
RegularExpressionAttribute Overload
PostSharp.Patterns.Contracts Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


RegularExpressionAttribute Methods

RegularExpressionAttribute Methods PostSharp Documentation
The RegularExpressionAttribute type exposes the following members.
Methods
 | Name | Description
Protected method | CreateArgumentException | Creates an Online ArgumentException with an error message formatted from ErrorMessage and given concrete values. (Inherited from LocationContractAttribute.)
Protected method | CreateArgumentNullException | Creates an Online ArgumentNullException with an error message formatted from ErrorMessage and given concrete values. (Inherited from LocationContractAttribute.)
Protected method | CreateArgumentOutOfRangeException | Creates an Online ArgumentOutOfRangeException with an error message formatted from ErrorMessage and given concrete values. (Inherited from LocationContractAttribute.)
Protected method | FormatErrorMessage | Formats the ErrorMessage with concrete values. (Inherited from LocationContractAttribute.)
Back to Top
See Also
RegularExpressionAttribute Class
PostSharp.Patterns.Contracts Namespace

Online Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


RegularExpressionAttribute Properties

RegularExpressionAttribute Properties PostSharp Documentation
The RegularExpressionAttribute type exposes the following members.
Properties
 | Name | Description
Public property | AttributeExclude | If true, indicates that this attribute removes all other instances of the same attribute type from the set of elements defined by the current instance. (Inherited from MulticastAttribute.)
Public property | AttributeId | Obsolete. (Inherited from MulticastAttribute.)
Public property | AttributeInheritance | Determines whether this attribute is inherited (Inherited from MulticastAttribute.)
Public property | AttributePriority | Gets or sets the priority of the current attribute in case that multiple instances are defined on the same element (lower values are processed before). (Inherited from MulticastAttribute.)
Public property | AttributeReplace | Determines whether this attribute replaces other attributes found on the target declarations. (Inherited from MulticastAttribute.)
Public property | AttributeTargetAssemblies | Gets or sets the assemblies to which the current attribute apply. (Inherited from MulticastAttribute.)
Public property | AttributeTargetElements | Gets or sets the kind of elements to which this custom attributes applies. (Inherited from MulticastAttribute.)
Public property | AttributeTargetExternalMemberAttributes | Gets or sets the visibilities, scopes, virtualities, and implementation of members to which this attribute applies, when the member is external to the current module. (Inherited from MulticastAttribute.)
Public property | AttributeTargetExternalTypeAttributes | Gets or sets the visibilities of types to which this attribute applies, when this type is external to the current module. (Inherited from MulticastAttribute.)
Public property | AttributeTargetMemberAttributes | Gets or sets the visibilities, scopes, virtualities, and implementation of members to which this attribute applies. (Inherited from MulticastAttribute.)
Public property | AttributeTargetMembers | Gets or sets the expression specifying to which members this instance applies. (Inherited from MulticastAttribute.)
Public property | AttributeTargetParameterAttributes | Gets or sets the passing style (by value, out or ref) of parameters to which this attribute applies. (Inherited from MulticastAttribute.)
Public property | AttributeTargetParameters | Gets or sets the expression specifying to which parameters this instance applies. (Inherited from MulticastAttribute.)
Public property | AttributeTargetTypeAttributes | Gets or sets the visibilities of types to which this attribute applies. (Inherited from MulticastAttribute.)
Public property | AttributeTargetTypes | Gets or sets the expression specifying to which types this instance applies. (Inherited from MulticastAttribute.)
Public property | ErrorMessage | Gets or sets the error message formatting string. (Inherited from LocationContractAttribute.)
Back to Top
See Also
RegularExpressionAttribute Class
PostSharp.Patterns.Contracts Namespace

Online Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


RequiredAttribute Class

RequiredAttribute Class PostSharp Documentation
Custom attribute that, when added to a field, property or parameter, throws an Online ArgumentNullException if the target is assigned a null value or an empty or white-space string.
Inheritance Hierarchy
Online System Object
Online System Attribute
PostSharp.Extensibility MulticastAttribute
PostSharp.Patterns.Contracts LocationContractAttribute
PostSharp.Patterns.Contracts RequiredAttribute

Namespace: PostSharp.Patterns.Contracts
Assembly: PostSharp.Patterns.Model (in PostSharp.Patterns.Model.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
public sealed class RequiredAttribute : LocationContractAttribute,
    ILocationValidationAspect<Object>, ILocationValidationAspect<string>, ILocationValidationAspect,
    IAspect
public sealed class RequiredAttribute : LocationContractAttribute,
    ILocationValidationAspect<Object>, ILocationValidationAspect<string>, ILocationValidationAspect,
    IAspect
See Also
RequiredAttribute Members
PostSharp.Patterns.Contracts Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


RequiredAttribute Members

RequiredAttribute Members PostSharp Documentation

The RequiredAttribute type exposes the following members.
Constructors
 | Name | Description
Public method | RequiredAttribute | Initializes a new RequiredAttribute.
Back to Top
Properties
 | Name | Description
Public property | AttributeExclude | If true, indicates that this attribute removes all other instances of the same attribute type from the set of elements defined by the current instance. (Inherited from MulticastAttribute.)
Public property | AttributeId | Obsolete. (Inherited from MulticastAttribute.)
Public property | AttributeInheritance | Determines whether this attribute is inherited (Inherited from MulticastAttribute.)
Public property | AttributePriority | Gets or sets the priority of the current attribute in case that multiple instances are defined on the same element (lower values are processed before). (Inherited from MulticastAttribute.)
Public property | AttributeReplace | Determines whether this attribute replaces other attributes found on the target declarations. (Inherited from MulticastAttribute.)
Public property | AttributeTargetAssemblies | Gets or sets the assemblies to which the current attribute apply. (Inherited from MulticastAttribute.)
Public property | AttributeTargetElements | Gets or sets the kind of elements to which this custom attributes applies. (Inherited from MulticastAttribute.)
Public property | AttributeTargetExternalMemberAttributes | Gets or sets the visibilities, scopes, virtualities, and implementation of members to which this attribute applies, when the member is external to the current module. (Inherited from MulticastAttribute.)
Public property | AttributeTargetExternalTypeAttributes | Gets or sets the visibilities of types to which this attribute applies, when this type is external to the current module. (Inherited from MulticastAttribute.)
Public property | AttributeTargetMemberAttributes | Gets or sets the visibilities, scopes, virtualities, and implementation of members to which this attribute applies. (Inherited from MulticastAttribute.)
Public property | AttributeTargetMembers | Gets or sets the expression specifying to which members this instance applies. (Inherited from MulticastAttribute.)
Public property | AttributeTargetParameterAttributes | Gets or sets the passing style (by value, out or ref) of parameters to which this attribute applies. (Inherited from MulticastAttribute.)
Public property | AttributeTargetParameters | Gets or sets the expression specifying to which parameters this instance applies. (Inherited from MulticastAttribute.)
Public property | AttributeTargetTypeAttributes | Gets or sets the visibilities of types to which this attribute applies. (Inherited from MulticastAttribute.)
Public property | AttributeTargetTypes | Gets or sets the expression specifying to which types this instance applies. (Inherited from MulticastAttribute.)
Public property | ErrorMessage | Gets or sets the error message formatting string. (Inherited from LocationContractAttribute.)
Back to Top
See Also
RequiredAttribute Class
PostSharp.Patterns.Contracts Namespace

Online Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


RequiredAttribute Constructor

RequiredAttribute Constructor PostSharp Documentation
Initializes a new RequiredAttribute.

Namespace: PostSharp.Patterns.Contracts
Assembly: PostSharp.Patterns.Model (in PostSharp.Patterns.Model.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
public RequiredAttribute()
public RequiredAttribute()
See Also
RequiredAttribute Class
RequiredAttribute Members
PostSharp.Patterns.Contracts Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


RequiredAttribute Properties

RequiredAttribute Properties PostSharp Documentation
The RequiredAttribute type exposes the following members.
Properties
 | Name | Description
Public property | AttributeExclude | If true, indicates that this attribute removes all other instances of the same attribute type from the set of elements defined by the current instance. (Inherited from MulticastAttribute.)
Public property | AttributeId | Obsolete. (Inherited from MulticastAttribute.)
Public property | AttributeInheritance | Determines whether this attribute is inherited (Inherited from MulticastAttribute.)
Public property | AttributePriority | Gets or sets the priority of the current attribute in case that multiple instances are defined on the same element (lower values are processed before). (Inherited from MulticastAttribute.)
Public property | AttributeReplace | Determines whether this attribute replaces other attributes found on the target declarations. (Inherited from MulticastAttribute.)
Public property | AttributeTargetAssemblies | Gets or sets the assemblies to which the current attribute apply. (Inherited from MulticastAttribute.)
Public property | AttributeTargetElements | Gets or sets the kind of elements to which this custom attributes applies. (Inherited from MulticastAttribute.)
Public property | AttributeTargetExternalMemberAttributes | Gets or sets the visibilities, scopes, virtualities, and implementation of members to which this attribute applies, when the member is external to the current module. (Inherited from MulticastAttribute.)
Public property | AttributeTargetExternalTypeAttributes | Gets or sets the visibilities of types to which this attribute applies, when this type is external to the current module. (Inherited from MulticastAttribute.)
Public property | AttributeTargetMemberAttributes | Gets or sets the visibilities, scopes, virtualities, and implementation of members to which this attribute applies. (Inherited from MulticastAttribute.)
Public property | AttributeTargetMembers | Gets or sets the expression specifying to which members this instance applies. (Inherited from MulticastAttribute.)
Public property | AttributeTargetParameterAttributes | Gets or sets the passing style (by value, out or ref) of parameters to which this attribute applies. (Inherited from MulticastAttribute.)
Public property | AttributeTargetParameters | Gets or sets the expression specifying to which parameters this instance applies. (Inherited from MulticastAttribute.)
Public property | AttributeTargetTypeAttributes | Gets or sets the visibilities of types to which this attribute applies. (Inherited from MulticastAttribute.)
Public property | AttributeTargetTypes | Gets or sets the expression specifying to which types this instance applies. (Inherited from MulticastAttribute.)
Public property | ErrorMessage | Gets or sets the error message formatting string. (Inherited from LocationContractAttribute.)
Back to Top
See Also
RequiredAttribute Class
PostSharp.Patterns.Contracts Namespace

Online Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


StrictlyGreaterThanAttribute Class

StrictlyGreaterThanAttribute Class PostSharp Documentation
Custom attribute that, when added to a field, property or parameter, throws an Online ArgumentOutOfRangeException if the target is assigned a value that is strictly smaller than a given value.
Inheritance Hierarchy
Online System Object
Online System Attribute
PostSharp.Extensibility MulticastAttribute
PostSharp.Patterns.Contracts LocationContractAttribute
PostSharp.Patterns.Contracts RangeAttribute
PostSharp.Patterns.Contracts StrictlyGreaterThanAttribute
PostSharp.Patterns.Contracts StrictlyPositiveAttribute

Namespace: PostSharp.Patterns.Contracts
Assembly: PostSharp.Patterns.Model (in PostSharp.Patterns.Model.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
public class StrictlyGreaterThanAttribute : RangeAttribute
public class StrictlyGreaterThanAttribute : RangeAttribute
Remarks
Null values are accepted and do not throw an exception.

                Floating-point values are tested to be greater or equal than the minimum value
                plus a tolerance value. The tolerance value is set to   Online Epsilon
                if the minimum value is 0, or one millionth (1E-6) of the minimum value otherwise.

See Also
StrictlyGreaterThanAttribute Members
PostSharp.Patterns.Contracts Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


StrictlyGreaterThanAttribute Members

StrictlyGreaterThanAttribute Members PostSharp Documentation

The StrictlyGreaterThanAttribute type exposes the following members.
Constructors
 | Name | Description
Public method | StrictlyGreaterThanAttribute(Decimal) | Initializes a new StrictlyGreaterThanAttribute and specifies a floating-point bound.
Public method | StrictlyGreaterThanAttribute(Double) | Initializes a new StrictlyGreaterThanAttribute and specifies a floating-point bound.
Public method | StrictlyGreaterThanAttribute(Int64) | Initializes a new StrictlyGreaterThanAttribute and specify an integer bound.
Public method | StrictlyGreaterThanAttribute(UInt64) | Initializes a new StrictlyGreaterThanAttribute and specifies a Online UInt64 bound.
Back to Top
Methods
 | Name | Description
Protected method | CreateArgumentException | Creates an Online ArgumentException with an error message formatted from ErrorMessage and given concrete values. (Inherited from LocationContractAttribute.)
Protected method | CreateArgumentNullException | Creates an Online ArgumentNullException with an error message formatted from ErrorMessage and given concrete values. (Inherited from LocationContractAttribute.)
Protected method | CreateArgumentOutOfRangeException | Creates an Online ArgumentOutOfRangeException with an error message formatted from ErrorMessage and given concrete values. (Inherited from LocationContractAttribute.)
Protected method | FormatErrorMessage | Formats the ErrorMessage with concrete values. (Inherited from LocationContractAttribute.)
Back to Top
Properties
 | Name | Description
Public property | AttributeExclude | If true, indicates that this attribute removes all other instances of the same attribute type from the set of elements defined by the current instance. (Inherited from MulticastAttribute.)
Public property | AttributeId | Obsolete. (Inherited from MulticastAttribute.)
Public property | AttributeInheritance | Determines whether this attribute is inherited (Inherited from MulticastAttribute.)
Public property | AttributePriority | Gets or sets the priority of the current attribute in case that multiple instances are defined on the same element (lower values are processed before). (Inherited from MulticastAttribute.)
Public property | AttributeReplace | Determines whether this attribute replaces other attributes found on the target declarations. (Inherited from MulticastAttribute.)
Public property | AttributeTargetAssemblies | Gets or sets the assemblies to which the current attribute apply. (Inherited from MulticastAttribute.)
Public property | AttributeTargetElements | Gets or sets the kind of elements to which this custom attributes applies. (Inherited from MulticastAttribute.)
Public property | AttributeTargetExternalMemberAttributes | Gets or sets the visibilities, scopes, virtualities, and implementation of members to which this attribute applies, when the member is external to the current module. (Inherited from MulticastAttribute.)
Public property | AttributeTargetExternalTypeAttributes | Gets or sets the visibilities of types to which this attribute applies, when this type is external to the current module. (Inherited from MulticastAttribute.)
Public property | AttributeTargetMemberAttributes | Gets or sets the visibilities, scopes, virtualities, and implementation of members to which this attribute applies. (Inherited from MulticastAttribute.)
Public property | AttributeTargetMembers | Gets or sets the expression specifying to which members this instance applies. (Inherited from MulticastAttribute.)
Public property | AttributeTargetParameterAttributes | Gets or sets the passing style (by value, out or ref) of parameters to which this attribute applies. (Inherited from MulticastAttribute.)
Public property | AttributeTargetParameters | Gets or sets the expression specifying to which parameters this instance applies. (Inherited from MulticastAttribute.)
Public property | AttributeTargetTypeAttributes | Gets or sets the visibilities of types to which this attribute applies. (Inherited from MulticastAttribute.)
Public property | AttributeTargetTypes | Gets or sets the expression specifying to which types this instance applies. (Inherited from MulticastAttribute.)
Public property | ErrorMessage | Gets or sets the error message formatting string. (Inherited from LocationContractAttribute.)
Back to Top
See Also
StrictlyGreaterThanAttribute Class
PostSharp.Patterns.Contracts Namespace

Online Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


StrictlyGreaterThanAttribute Constructor

StrictlyGreaterThanAttribute Constructor PostSharp Documentation
Overload List
 | Name | Description
Public method | StrictlyGreaterThanAttribute(Decimal) | Initializes a new StrictlyGreaterThanAttribute and specifies a floating-point bound.
Public method | StrictlyGreaterThanAttribute(Double) | Initializes a new StrictlyGreaterThanAttribute and specifies a floating-point bound.
Public method | StrictlyGreaterThanAttribute(Int64) | Initializes a new StrictlyGreaterThanAttribute and specify an integer bound.
Public method | StrictlyGreaterThanAttribute(UInt64) | Initializes a new StrictlyGreaterThanAttribute and specifies a Online UInt64 bound.
Back to Top
See Also
StrictlyGreaterThanAttribute Class
StrictlyGreaterThanAttribute Members
PostSharp.Patterns.Contracts Namespace

Online Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


StrictlyGreaterThanAttribute Constructor (Decimal)

StrictlyGreaterThanAttribute Constructor (Decimal) PostSharp Documentation
Initializes a new StrictlyGreaterThanAttribute and specifies a floating-point bound.

Namespace: PostSharp.Patterns.Contracts
Assembly: PostSharp.Patterns.Model (in PostSharp.Patterns.Model.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
public StrictlyGreaterThanAttribute(
    decimal min
)
public StrictlyGreaterThanAttribute(
    decimal min
)
Parameters
min
Type:   Online System Decimal
The lower bound.
See Also
StrictlyGreaterThanAttribute Class
StrictlyGreaterThanAttribute Members
StrictlyGreaterThanAttribute Overload
PostSharp.Patterns.Contracts Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


StrictlyGreaterThanAttribute Constructor (Double)

StrictlyGreaterThanAttribute Constructor (Double) PostSharp Documentation
Initializes a new StrictlyGreaterThanAttribute and specifies a floating-point bound.

Namespace: PostSharp.Patterns.Contracts
Assembly: PostSharp.Patterns.Model (in PostSharp.Patterns.Model.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
public StrictlyGreaterThanAttribute(
    double min
)
public StrictlyGreaterThanAttribute(
    double min
)
Parameters
min
Type:   Online System Double
The lower bound.
See Also
StrictlyGreaterThanAttribute Class
StrictlyGreaterThanAttribute Members
StrictlyGreaterThanAttribute Overload
PostSharp.Patterns.Contracts Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


StrictlyGreaterThanAttribute Constructor (Int64)

StrictlyGreaterThanAttribute Constructor (Int64) PostSharp Documentation
Initializes a new StrictlyGreaterThanAttribute and specify an integer bound.

Namespace: PostSharp.Patterns.Contracts
Assembly: PostSharp.Patterns.Model (in PostSharp.Patterns.Model.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
public StrictlyGreaterThanAttribute(
    long min
)
public StrictlyGreaterThanAttribute(
    long min
)
Parameters
min
Type:   Online System Int64
The lower bound.
See Also
StrictlyGreaterThanAttribute Class
StrictlyGreaterThanAttribute Members
StrictlyGreaterThanAttribute Overload
PostSharp.Patterns.Contracts Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


StrictlyGreaterThanAttribute Constructor (UInt64)

StrictlyGreaterThanAttribute Constructor (UInt64) PostSharp Documentation
Initializes a new StrictlyGreaterThanAttribute and specifies a Online UInt64 bound.

Namespace: PostSharp.Patterns.Contracts
Assembly: PostSharp.Patterns.Model (in PostSharp.Patterns.Model.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
public StrictlyGreaterThanAttribute(
    ulong min
)
public StrictlyGreaterThanAttribute(
    ulong min
)
Parameters
min
Type:   Online System UInt64
The lower bound.
See Also
StrictlyGreaterThanAttribute Class
StrictlyGreaterThanAttribute Members
StrictlyGreaterThanAttribute Overload
PostSharp.Patterns.Contracts Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


StrictlyGreaterThanAttribute Methods

StrictlyGreaterThanAttribute Methods PostSharp Documentation
The StrictlyGreaterThanAttribute type exposes the following members.
Methods
 | Name | Description
Protected method | CreateArgumentException | Creates an Online ArgumentException with an error message formatted from ErrorMessage and given concrete values. (Inherited from LocationContractAttribute.)
Protected method | CreateArgumentNullException | Creates an Online ArgumentNullException with an error message formatted from ErrorMessage and given concrete values. (Inherited from LocationContractAttribute.)
Protected method | CreateArgumentOutOfRangeException | Creates an Online ArgumentOutOfRangeException with an error message formatted from ErrorMessage and given concrete values. (Inherited from LocationContractAttribute.)
Protected method | FormatErrorMessage | Formats the ErrorMessage with concrete values. (Inherited from LocationContractAttribute.)
Back to Top
See Also
StrictlyGreaterThanAttribute Class
PostSharp.Patterns.Contracts Namespace

Online Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


StrictlyGreaterThanAttribute Properties

StrictlyGreaterThanAttribute Properties PostSharp Documentation
The StrictlyGreaterThanAttribute type exposes the following members.
Properties
 | Name | Description
Public property | AttributeExclude | If true, indicates that this attribute removes all other instances of the same attribute type from the set of elements defined by the current instance. (Inherited from MulticastAttribute.)
Public property | AttributeId | Obsolete. (Inherited from MulticastAttribute.)
Public property | AttributeInheritance | Determines whether this attribute is inherited (Inherited from MulticastAttribute.)
Public property | AttributePriority | Gets or sets the priority of the current attribute in case that multiple instances are defined on the same element (lower values are processed before). (Inherited from MulticastAttribute.)
Public property | AttributeReplace | Determines whether this attribute replaces other attributes found on the target declarations. (Inherited from MulticastAttribute.)
Public property | AttributeTargetAssemblies | Gets or sets the assemblies to which the current attribute apply. (Inherited from MulticastAttribute.)
Public property | AttributeTargetElements | Gets or sets the kind of elements to which this custom attributes applies. (Inherited from MulticastAttribute.)
Public property | AttributeTargetExternalMemberAttributes | Gets or sets the visibilities, scopes, virtualities, and implementation of members to which this attribute applies, when the member is external to the current module. (Inherited from MulticastAttribute.)
Public property | AttributeTargetExternalTypeAttributes | Gets or sets the visibilities of types to which this attribute applies, when this type is external to the current module. (Inherited from MulticastAttribute.)
Public property | AttributeTargetMemberAttributes | Gets or sets the visibilities, scopes, virtualities, and implementation of members to which this attribute applies. (Inherited from MulticastAttribute.)
Public property | AttributeTargetMembers | Gets or sets the expression specifying to which members this instance applies. (Inherited from MulticastAttribute.)
Public property | AttributeTargetParameterAttributes | Gets or sets the passing style (by value, out or ref) of parameters to which this attribute applies. (Inherited from MulticastAttribute.)
Public property | AttributeTargetParameters | Gets or sets the expression specifying to which parameters this instance applies. (Inherited from MulticastAttribute.)
Public property | AttributeTargetTypeAttributes | Gets or sets the visibilities of types to which this attribute applies. (Inherited from MulticastAttribute.)
Public property | AttributeTargetTypes | Gets or sets the expression specifying to which types this instance applies. (Inherited from MulticastAttribute.)
Public property | ErrorMessage | Gets or sets the error message formatting string. (Inherited from LocationContractAttribute.)
Back to Top
See Also
StrictlyGreaterThanAttribute Class
PostSharp.Patterns.Contracts Namespace

Online Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


StrictlyPositiveAttribute Class

StrictlyPositiveAttribute Class PostSharp Documentation
Custom attribute that, when added to a field, property or parameter, throws an Online ArgumentOutOfRangeException if the target is assigned a value that smaller than zero.
Inheritance Hierarchy
Online System Object
Online System Attribute
PostSharp.Extensibility MulticastAttribute
PostSharp.Patterns.Contracts LocationContractAttribute
PostSharp.Patterns.Contracts RangeAttribute
PostSharp.Patterns.Contracts StrictlyGreaterThanAttribute
PostSharp.Patterns.Contracts StrictlyPositiveAttribute

Namespace: PostSharp.Patterns.Contracts
Assembly: PostSharp.Patterns.Model (in PostSharp.Patterns.Model.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
public class StrictlyPositiveAttribute : StrictlyGreaterThanAttribute
public class StrictlyPositiveAttribute : StrictlyGreaterThanAttribute
Remarks
Null values are accepted and do not throw an exception.

See Also
StrictlyPositiveAttribute Members
PostSharp.Patterns.Contracts Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


StrictlyPositiveAttribute Members

StrictlyPositiveAttribute Members PostSharp Documentation

The StrictlyPositiveAttribute type exposes the following members.
Constructors
 | Name | Description
Public method | StrictlyPositiveAttribute | Initializes a new StrictlyPositiveAttribute.
Back to Top
Methods
 | Name | Description
Protected method | CreateArgumentException | Creates an Online ArgumentException with an error message formatted from ErrorMessage and given concrete values. (Inherited from LocationContractAttribute.)
Protected method | CreateArgumentNullException | Creates an Online ArgumentNullException with an error message formatted from ErrorMessage and given concrete values. (Inherited from LocationContractAttribute.)
Protected method | CreateArgumentOutOfRangeException | Creates an Online ArgumentOutOfRangeException with an error message formatted from ErrorMessage and given concrete values. (Inherited from LocationContractAttribute.)
Protected method | FormatErrorMessage | Formats the ErrorMessage with concrete values. (Inherited from LocationContractAttribute.)
Back to Top
Properties
 | Name | Description
Public property | AttributeExclude | If true, indicates that this attribute removes all other instances of the same attribute type from the set of elements defined by the current instance. (Inherited from MulticastAttribute.)
Public property | AttributeId | Obsolete. (Inherited from MulticastAttribute.)
Public property | AttributeInheritance | Determines whether this attribute is inherited (Inherited from MulticastAttribute.)
Public property | AttributePriority | Gets or sets the priority of the current attribute in case that multiple instances are defined on the same element (lower values are processed before). (Inherited from MulticastAttribute.)
Public property | AttributeReplace | Determines whether this attribute replaces other attributes found on the target declarations. (Inherited from MulticastAttribute.)
Public property | AttributeTargetAssemblies | Gets or sets the assemblies to which the current attribute apply. (Inherited from MulticastAttribute.)
Public property | AttributeTargetElements | Gets or sets the kind of elements to which this custom attributes applies. (Inherited from MulticastAttribute.)
Public property | AttributeTargetExternalMemberAttributes | Gets or sets the visibilities, scopes, virtualities, and implementation of members to which this attribute applies, when the member is external to the current module. (Inherited from MulticastAttribute.)
Public property | AttributeTargetExternalTypeAttributes | Gets or sets the visibilities of types to which this attribute applies, when this type is external to the current module. (Inherited from MulticastAttribute.)
Public property | AttributeTargetMemberAttributes | Gets or sets the visibilities, scopes, virtualities, and implementation of members to which this attribute applies. (Inherited from MulticastAttribute.)
Public property | AttributeTargetMembers | Gets or sets the expression specifying to which members this instance applies. (Inherited from MulticastAttribute.)
Public property | AttributeTargetParameterAttributes | Gets or sets the passing style (by value, out or ref) of parameters to which this attribute applies. (Inherited from MulticastAttribute.)
Public property | AttributeTargetParameters | Gets or sets the expression specifying to which parameters this instance applies. (Inherited from MulticastAttribute.)
Public property | AttributeTargetTypeAttributes | Gets or sets the visibilities of types to which this attribute applies. (Inherited from MulticastAttribute.)
Public property | AttributeTargetTypes | Gets or sets the expression specifying to which types this instance applies. (Inherited from MulticastAttribute.)
Public property | ErrorMessage | Gets or sets the error message formatting string. (Inherited from LocationContractAttribute.)
Back to Top
See Also
StrictlyPositiveAttribute Class
PostSharp.Patterns.Contracts Namespace

Online Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


StrictlyPositiveAttribute Constructor

StrictlyPositiveAttribute Constructor PostSharp Documentation
Initializes a new StrictlyPositiveAttribute.

Namespace: PostSharp.Patterns.Contracts
Assembly: PostSharp.Patterns.Model (in PostSharp.Patterns.Model.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
public StrictlyPositiveAttribute()
public StrictlyPositiveAttribute()
See Also
StrictlyPositiveAttribute Class
StrictlyPositiveAttribute Members
PostSharp.Patterns.Contracts Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


StrictlyPositiveAttribute Methods

StrictlyPositiveAttribute Methods PostSharp Documentation
The StrictlyPositiveAttribute type exposes the following members.
Methods
 | Name | Description
Protected method | CreateArgumentException | Creates an Online ArgumentException with an error message formatted from ErrorMessage and given concrete values. (Inherited from LocationContractAttribute.)
Protected method | CreateArgumentNullException | Creates an Online ArgumentNullException with an error message formatted from ErrorMessage and given concrete values. (Inherited from LocationContractAttribute.)
Protected method | CreateArgumentOutOfRangeException | Creates an Online ArgumentOutOfRangeException with an error message formatted from ErrorMessage and given concrete values. (Inherited from LocationContractAttribute.)
Protected method | FormatErrorMessage | Formats the ErrorMessage with concrete values. (Inherited from LocationContractAttribute.)
Back to Top
See Also
StrictlyPositiveAttribute Class
PostSharp.Patterns.Contracts Namespace

Online Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


StrictlyPositiveAttribute Properties

StrictlyPositiveAttribute Properties PostSharp Documentation
The StrictlyPositiveAttribute type exposes the following members.
Properties
 | Name | Description
Public property | AttributeExclude | If true, indicates that this attribute removes all other instances of the same attribute type from the set of elements defined by the current instance. (Inherited from MulticastAttribute.)
Public property | AttributeId | Obsolete. (Inherited from MulticastAttribute.)
Public property | AttributeInheritance | Determines whether this attribute is inherited (Inherited from MulticastAttribute.)
Public property | AttributePriority | Gets or sets the priority of the current attribute in case that multiple instances are defined on the same element (lower values are processed before). (Inherited from MulticastAttribute.)
Public property | AttributeReplace | Determines whether this attribute replaces other attributes found on the target declarations. (Inherited from MulticastAttribute.)
Public property | AttributeTargetAssemblies | Gets or sets the assemblies to which the current attribute apply. (Inherited from MulticastAttribute.)
Public property | AttributeTargetElements | Gets or sets the kind of elements to which this custom attributes applies. (Inherited from MulticastAttribute.)
Public property | AttributeTargetExternalMemberAttributes | Gets or sets the visibilities, scopes, virtualities, and implementation of members to which this attribute applies, when the member is external to the current module. (Inherited from MulticastAttribute.)
Public property | AttributeTargetExternalTypeAttributes | Gets or sets the visibilities of types to which this attribute applies, when this type is external to the current module. (Inherited from MulticastAttribute.)
Public property | AttributeTargetMemberAttributes | Gets or sets the visibilities, scopes, virtualities, and implementation of members to which this attribute applies. (Inherited from MulticastAttribute.)
Public property | AttributeTargetMembers | Gets or sets the expression specifying to which members this instance applies. (Inherited from MulticastAttribute.)
Public property | AttributeTargetParameterAttributes | Gets or sets the passing style (by value, out or ref) of parameters to which this attribute applies. (Inherited from MulticastAttribute.)
Public property | AttributeTargetParameters | Gets or sets the expression specifying to which parameters this instance applies. (Inherited from MulticastAttribute.)
Public property | AttributeTargetTypeAttributes | Gets or sets the visibilities of types to which this attribute applies. (Inherited from MulticastAttribute.)
Public property | AttributeTargetTypes | Gets or sets the expression specifying to which types this instance applies. (Inherited from MulticastAttribute.)
Public property | ErrorMessage | Gets or sets the error message formatting string. (Inherited from LocationContractAttribute.)
Back to Top
See Also
StrictlyPositiveAttribute Class
PostSharp.Patterns.Contracts Namespace

Online Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


StringLengthAttribute Class

StringLengthAttribute Class PostSharp Documentation
Custom attribute that, when added to a field, property or parameter, throws an Online ArgumentException if the target is assigned a string of invalid lenght. Null strings are accepted and do not throw an exception.
Inheritance Hierarchy
Online System Object
Online System Attribute
PostSharp.Extensibility MulticastAttribute
PostSharp.Patterns.Contracts LocationContractAttribute
PostSharp.Patterns.Contracts StringLengthAttribute

Namespace: PostSharp.Patterns.Contracts
Assembly: PostSharp.Patterns.Model (in PostSharp.Patterns.Model.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
public sealed class StringLengthAttribute : LocationContractAttribute,
    ILocationValidationAspect<string>, ILocationValidationAspect, IAspect
public sealed class StringLengthAttribute : LocationContractAttribute,
    ILocationValidationAspect<string>, ILocationValidationAspect, IAspect
See Also
StringLengthAttribute Members
PostSharp.Patterns.Contracts Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


StringLengthAttribute Members

StringLengthAttribute Members PostSharp Documentation

The StringLengthAttribute type exposes the following members.
Constructors
 | Name | Description
Public method | StringLengthAttribute(Int32) | Initializes a new StringLengthAttribute and specifies the maximum lenght.
Public method | StringLengthAttribute(Int32, Int32) | Initializes a new StringLengthAttribute and specifies the maximum lenght and the minimum lenght.
Back to Top
Properties
 | Name | Description
Public property | AttributeExclude | If true, indicates that this attribute removes all other instances of the same attribute type from the set of elements defined by the current instance. (Inherited from MulticastAttribute.)
Public property | AttributeId | Obsolete. (Inherited from MulticastAttribute.)
Public property | AttributeInheritance | Determines whether this attribute is inherited (Inherited from MulticastAttribute.)
Public property | AttributePriority | Gets or sets the priority of the current attribute in case that multiple instances are defined on the same element (lower values are processed before). (Inherited from MulticastAttribute.)
Public property | AttributeReplace | Determines whether this attribute replaces other attributes found on the target declarations. (Inherited from MulticastAttribute.)
Public property | AttributeTargetAssemblies | Gets or sets the assemblies to which the current attribute apply. (Inherited from MulticastAttribute.)
Public property | AttributeTargetElements | Gets or sets the kind of elements to which this custom attributes applies. (Inherited from MulticastAttribute.)
Public property | AttributeTargetExternalMemberAttributes | Gets or sets the visibilities, scopes, virtualities, and implementation of members to which this attribute applies, when the member is external to the current module. (Inherited from MulticastAttribute.)
Public property | AttributeTargetExternalTypeAttributes | Gets or sets the visibilities of types to which this attribute applies, when this type is external to the current module. (Inherited from MulticastAttribute.)
Public property | AttributeTargetMemberAttributes | Gets or sets the visibilities, scopes, virtualities, and implementation of members to which this attribute applies. (Inherited from MulticastAttribute.)
Public property | AttributeTargetMembers | Gets or sets the expression specifying to which members this instance applies. (Inherited from MulticastAttribute.)
Public property | AttributeTargetParameterAttributes | Gets or sets the passing style (by value, out or ref) of parameters to which this attribute applies. (Inherited from MulticastAttribute.)
Public property | AttributeTargetParameters | Gets or sets the expression specifying to which parameters this instance applies. (Inherited from MulticastAttribute.)
Public property | AttributeTargetTypeAttributes | Gets or sets the visibilities of types to which this attribute applies. (Inherited from MulticastAttribute.)
Public property | AttributeTargetTypes | Gets or sets the expression specifying to which types this instance applies. (Inherited from MulticastAttribute.)
Public property | ErrorMessage | Gets or sets the error message formatting string. (Inherited from LocationContractAttribute.)
Public property | MaximumLength | Gets the maximum lenght.
Public property | MinimumLength | Gets the minimum lenght.
Back to Top
See Also
StringLengthAttribute Class
PostSharp.Patterns.Contracts Namespace

Online Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


StringLengthAttribute Constructor

StringLengthAttribute Constructor PostSharp Documentation
Overload List
 | Name | Description
Public method | StringLengthAttribute(Int32) | Initializes a new StringLengthAttribute and specifies the maximum lenght.
Public method | StringLengthAttribute(Int32, Int32) | Initializes a new StringLengthAttribute and specifies the maximum lenght and the minimum lenght.
Back to Top
See Also
StringLengthAttribute Class
StringLengthAttribute Members
PostSharp.Patterns.Contracts Namespace

Online Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


StringLengthAttribute Constructor (Int32)

StringLengthAttribute Constructor (Int32) PostSharp Documentation
Initializes a new StringLengthAttribute and specifies the maximum lenght.

Namespace: PostSharp.Patterns.Contracts
Assembly: PostSharp.Patterns.Model (in PostSharp.Patterns.Model.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
public StringLengthAttribute(
    int maximumLength
)
public StringLengthAttribute(
    int maximumLength
)
Parameters
maximumLength
Type:   Online System Int32
Maximum lenght.
See Also
StringLengthAttribute Class
StringLengthAttribute Members
StringLengthAttribute Overload
PostSharp.Patterns.Contracts Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


StringLengthAttribute Constructor (Int32, Int32)

StringLengthAttribute Constructor (Int32, Int32) PostSharp Documentation
Initializes a new StringLengthAttribute and specifies the maximum lenght and the minimum lenght.

Namespace: PostSharp.Patterns.Contracts
Assembly: PostSharp.Patterns.Model (in PostSharp.Patterns.Model.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
public StringLengthAttribute(
    int minimumLength,
    int maximumLength
)
public StringLengthAttribute(
    int minimumLength,
    int maximumLength
)
Parameters
minimumLength
Type:   Online System Int32
Minimul length.
maximumLength
Type:   Online System Int32
Maximum lenght.
See Also
StringLengthAttribute Class
StringLengthAttribute Members
StringLengthAttribute Overload
PostSharp.Patterns.Contracts Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


StringLengthAttribute Properties

StringLengthAttribute Properties PostSharp Documentation
The StringLengthAttribute type exposes the following members.
Properties
 | Name | Description
Public property | AttributeExclude | If true, indicates that this attribute removes all other instances of the same attribute type from the set of elements defined by the current instance. (Inherited from MulticastAttribute.)
Public property | AttributeId | Obsolete. (Inherited from MulticastAttribute.)
Public property | AttributeInheritance | Determines whether this attribute is inherited (Inherited from MulticastAttribute.)
Public property | AttributePriority | Gets or sets the priority of the current attribute in case that multiple instances are defined on the same element (lower values are processed before). (Inherited from MulticastAttribute.)
Public property | AttributeReplace | Determines whether this attribute replaces other attributes found on the target declarations. (Inherited from MulticastAttribute.)
Public property | AttributeTargetAssemblies | Gets or sets the assemblies to which the current attribute apply. (Inherited from MulticastAttribute.)
Public property | AttributeTargetElements | Gets or sets the kind of elements to which this custom attributes applies. (Inherited from MulticastAttribute.)
Public property | AttributeTargetExternalMemberAttributes | Gets or sets the visibilities, scopes, virtualities, and implementation of members to which this attribute applies, when the member is external to the current module. (Inherited from MulticastAttribute.)
Public property | AttributeTargetExternalTypeAttributes | Gets or sets the visibilities of types to which this attribute applies, when this type is external to the current module. (Inherited from MulticastAttribute.)
Public property | AttributeTargetMemberAttributes | Gets or sets the visibilities, scopes, virtualities, and implementation of members to which this attribute applies. (Inherited from MulticastAttribute.)
Public property | AttributeTargetMembers | Gets or sets the expression specifying to which members this instance applies. (Inherited from MulticastAttribute.)
Public property | AttributeTargetParameterAttributes | Gets or sets the passing style (by value, out or ref) of parameters to which this attribute applies. (Inherited from MulticastAttribute.)
Public property | AttributeTargetParameters | Gets or sets the expression specifying to which parameters this instance applies. (Inherited from MulticastAttribute.)
Public property | AttributeTargetTypeAttributes | Gets or sets the visibilities of types to which this attribute applies. (Inherited from MulticastAttribute.)
Public property | AttributeTargetTypes | Gets or sets the expression specifying to which types this instance applies. (Inherited from MulticastAttribute.)
Public property | ErrorMessage | Gets or sets the error message formatting string. (Inherited from LocationContractAttribute.)
Public property | MaximumLength | Gets the maximum lenght.
Public property | MinimumLength | Gets the minimum lenght.
Back to Top
See Also
StringLengthAttribute Class
PostSharp.Patterns.Contracts Namespace

Online Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


StringLengthAttribute.MaximumLength Property

StringLengthAttribute MaximumLength Property PostSharp Documentation
Gets the maximum lenght.

Namespace: PostSharp.Patterns.Contracts
Assembly: PostSharp.Patterns.Model (in PostSharp.Patterns.Model.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
public int MaximumLength { get; private set; }
public int MaximumLength { get; private set; }
Property Value
Type:   Online Int32
See Also
StringLengthAttribute Class
StringLengthAttribute Members
PostSharp.Patterns.Contracts Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


StringLengthAttribute.MinimumLength Property

StringLengthAttribute MinimumLength Property PostSharp Documentation
Gets the minimum lenght.

Namespace: PostSharp.Patterns.Contracts
Assembly: PostSharp.Patterns.Model (in PostSharp.Patterns.Model.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
public int MinimumLength { get; private set; }
public int MinimumLength { get; private set; }
Property Value
Type:   Online Int32
See Also
StringLengthAttribute Class
StringLengthAttribute Members
PostSharp.Patterns.Contracts Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


UrlAttribute Class

UrlAttribute Class PostSharp Documentation
Custom attribute that, when added to a field, property or parameter, throws an Online ArgumentException if the target is assigned a value that is not a valid URL starting with http://, https:// or ftp://. Null strings are accepted and do not throw an exception.
Inheritance Hierarchy
Online System Object
Online System Attribute
PostSharp.Extensibility MulticastAttribute
PostSharp.Patterns.Contracts LocationContractAttribute
PostSharp.Patterns.Contracts RegularExpressionAttribute
PostSharp.Patterns.Contracts UrlAttribute

Namespace: PostSharp.Patterns.Contracts
Assembly: PostSharp.Patterns.Model (in PostSharp.Patterns.Model.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
public sealed class UrlAttribute : RegularExpressionAttribute
public sealed class UrlAttribute : RegularExpressionAttribute
See Also
UrlAttribute Members
PostSharp.Patterns.Contracts Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


UrlAttribute Members

UrlAttribute Members PostSharp Documentation

The UrlAttribute type exposes the following members.
Constructors
 | Name | Description
Public method | UrlAttribute | Initializes a new UrlAttribute.
Back to Top
Properties
 | Name | Description
Public property | AttributeExclude | If true, indicates that this attribute removes all other instances of the same attribute type from the set of elements defined by the current instance. (Inherited from MulticastAttribute.)
Public property | AttributeId | Obsolete. (Inherited from MulticastAttribute.)
Public property | AttributeInheritance | Determines whether this attribute is inherited (Inherited from MulticastAttribute.)
Public property | AttributePriority | Gets or sets the priority of the current attribute in case that multiple instances are defined on the same element (lower values are processed before). (Inherited from MulticastAttribute.)
Public property | AttributeReplace | Determines whether this attribute replaces other attributes found on the target declarations. (Inherited from MulticastAttribute.)
Public property | AttributeTargetAssemblies | Gets or sets the assemblies to which the current attribute apply. (Inherited from MulticastAttribute.)
Public property | AttributeTargetElements | Gets or sets the kind of elements to which this custom attributes applies. (Inherited from MulticastAttribute.)
Public property | AttributeTargetExternalMemberAttributes | Gets or sets the visibilities, scopes, virtualities, and implementation of members to which this attribute applies, when the member is external to the current module. (Inherited from MulticastAttribute.)
Public property | AttributeTargetExternalTypeAttributes | Gets or sets the visibilities of types to which this attribute applies, when this type is external to the current module. (Inherited from MulticastAttribute.)
Public property | AttributeTargetMemberAttributes | Gets or sets the visibilities, scopes, virtualities, and implementation of members to which this attribute applies. (Inherited from MulticastAttribute.)
Public property | AttributeTargetMembers | Gets or sets the expression specifying to which members this instance applies. (Inherited from MulticastAttribute.)
Public property | AttributeTargetParameterAttributes | Gets or sets the passing style (by value, out or ref) of parameters to which this attribute applies. (Inherited from MulticastAttribute.)
Public property | AttributeTargetParameters | Gets or sets the expression specifying to which parameters this instance applies. (Inherited from MulticastAttribute.)
Public property | AttributeTargetTypeAttributes | Gets or sets the visibilities of types to which this attribute applies. (Inherited from MulticastAttribute.)
Public property | AttributeTargetTypes | Gets or sets the expression specifying to which types this instance applies. (Inherited from MulticastAttribute.)
Public property | ErrorMessage | Gets or sets the error message formatting string. (Inherited from LocationContractAttribute.)
Back to Top
See Also
UrlAttribute Class
PostSharp.Patterns.Contracts Namespace

Online Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


UrlAttribute Constructor

UrlAttribute Constructor PostSharp Documentation
Initializes a new UrlAttribute.

Namespace: PostSharp.Patterns.Contracts
Assembly: PostSharp.Patterns.Model (in PostSharp.Patterns.Model.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
public UrlAttribute()
public UrlAttribute()
See Also
UrlAttribute Class
UrlAttribute Members
PostSharp.Patterns.Contracts Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


UrlAttribute Properties

UrlAttribute Properties PostSharp Documentation
The UrlAttribute type exposes the following members.
Properties
 | Name | Description
Public property | AttributeExclude | If true, indicates that this attribute removes all other instances of the same attribute type from the set of elements defined by the current instance. (Inherited from MulticastAttribute.)
Public property | AttributeId | Obsolete. (Inherited from MulticastAttribute.)
Public property | AttributeInheritance | Determines whether this attribute is inherited (Inherited from MulticastAttribute.)
Public property | AttributePriority | Gets or sets the priority of the current attribute in case that multiple instances are defined on the same element (lower values are processed before). (Inherited from MulticastAttribute.)
Public property | AttributeReplace | Determines whether this attribute replaces other attributes found on the target declarations. (Inherited from MulticastAttribute.)
Public property | AttributeTargetAssemblies | Gets or sets the assemblies to which the current attribute apply. (Inherited from MulticastAttribute.)
Public property | AttributeTargetElements | Gets or sets the kind of elements to which this custom attributes applies. (Inherited from MulticastAttribute.)
Public property | AttributeTargetExternalMemberAttributes | Gets or sets the visibilities, scopes, virtualities, and implementation of members to which this attribute applies, when the member is external to the current module. (Inherited from MulticastAttribute.)
Public property | AttributeTargetExternalTypeAttributes | Gets or sets the visibilities of types to which this attribute applies, when this type is external to the current module. (Inherited from MulticastAttribute.)
Public property | AttributeTargetMemberAttributes | Gets or sets the visibilities, scopes, virtualities, and implementation of members to which this attribute applies. (Inherited from MulticastAttribute.)
Public property | AttributeTargetMembers | Gets or sets the expression specifying to which members this instance applies. (Inherited from MulticastAttribute.)
Public property | AttributeTargetParameterAttributes | Gets or sets the passing style (by value, out or ref) of parameters to which this attribute applies. (Inherited from MulticastAttribute.)
Public property | AttributeTargetParameters | Gets or sets the expression specifying to which parameters this instance applies. (Inherited from MulticastAttribute.)
Public property | AttributeTargetTypeAttributes | Gets or sets the visibilities of types to which this attribute applies. (Inherited from MulticastAttribute.)
Public property | AttributeTargetTypes | Gets or sets the expression specifying to which types this instance applies. (Inherited from MulticastAttribute.)
Public property | ErrorMessage | Gets or sets the error message formatting string. (Inherited from LocationContractAttribute.)
Back to Top
See Also
UrlAttribute Class
PostSharp.Patterns.Contracts Namespace

Online Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


PostSharp.Patterns.Diagnostics Namespace

PostSharp.Patterns.Diagnostics Namespace PostSharp Documentation
The PostSharp.Patterns.Diagnostics namespace contains a logging aspect.
Classes
 | Class | Description
Public class | LogAspectConfiguration | Configuration of an ILogAspect.
Public class | LogAspectConfigurationAttribute | Configures an aspect of type ILogAspect.
Public class | LogAttribute | Custom attribute that, when applied on a method, causes PostSharp to implement tracing before and after execution of this method.
Public class | LogAttributeBase | Base class for all logging aspects.
Public class | LogExceptionAttribute | Custom attribute that, when applied on a method, causes PostSharp to implement tracing upon exception in this method.
Public class | LoggingProfile | Logging profiles are named configurations of logging aspects. They are typically instantiated in the PostSharp XML project file.
Interfaces
 | Interface | Description
Public interface | ILogAspect | Runtime semanics of the logging aspect.
Enumerations
 | Enumeration | Description
Public enumeration | LogLevel | Specifies the severity of a logged message.
Public enumeration | LogOptions | Specifies the options for logging parameter names, types and values.

Online Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


ILogAspect Interface

ILogAspect Interface PostSharp Documentation
Runtime semanics of the logging aspect.

Namespace: PostSharp.Patterns.Diagnostics
Assembly: PostSharp.Patterns.Diagnostics (in PostSharp.Patterns.Diagnostics.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
public interface ILogAspect : IAspect
public interface ILogAspect : IAspect
Remarks
 This aspect has no semantic, therefore this interface is empty. However,
            it is required to bind aspect classes to the weaver. The aspect is configured through the LogAspectConfiguration object.
            Implementations of ILogAspect can implement IAspectBuildSemantics to provide the configuration objects,
            or the configuration objects can be provided otherwise (LogAspectConfigurationAttribute or IAspectProvider).
See Also
PostSharp.Patterns.Diagnostics Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


LogAspectConfiguration Class

LogAspectConfiguration Class PostSharp Documentation
Configuration of an ILogAspect.
Inheritance Hierarchy
Online System Object
PostSharp.Aspects.Configuration AspectConfiguration
PostSharp.Patterns.Diagnostics LogAspectConfiguration

Namespace: PostSharp.Patterns.Diagnostics
Assembly: PostSharp.Patterns.Diagnostics (in PostSharp.Patterns.Diagnostics.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
public class LogAspectConfiguration : AspectConfiguration,
    IProfileAwareConfiguration
public class LogAspectConfiguration : AspectConfiguration,
    IProfileAwareConfiguration
See Also
LogAspectConfiguration Members
PostSharp.Patterns.Diagnostics Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


LogAspectConfiguration Members

LogAspectConfiguration Members PostSharp Documentation

The LogAspectConfiguration type exposes the following members.
Constructors
 | Name | Description
Public method | LogAspectConfiguration | Initializes a new instance of the LogAspectConfiguration class
Back to Top
Properties
 | Name | Description
Public property | AspectPriority | Gets or sets the aspect priority. Aspects with smaller priority are processed first. The default priority is zero. (Inherited from AspectConfiguration.)
Public property | Dependencies | Gets or sets the collection of dependencies. (Inherited from AspectConfiguration.)
Public property | OnEntryLevel | Gets or sets the severity level for logging before method execution.
Public property | OnEntryOptions | Gets or sets options for logging before method execution.
Public property | OnExceptionLevel | Gets or sets the severity level for logging on method exception.
Public property | OnExceptionOptions | Gets or sets options for logging on method exception.
Public property | OnSuccessLevel | Gets or sets the severity level for logging on method success.
Public property | OnSuccessOptions | Gets or sets options for logging on method success.
Public property | ProfileName | Gets or sets the name of the logging profile.
Public property | SerializerType | Gets or sets the type of the serializer that will be used to configure the current aspect. (Inherited from AspectConfiguration.)
Back to Top
See Also
LogAspectConfiguration Class
PostSharp.Patterns.Diagnostics Namespace

Online Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


LogAspectConfiguration Constructor

LogAspectConfiguration Constructor PostSharp Documentation
Initializes a new instance of the LogAspectConfiguration class

Namespace: PostSharp.Patterns.Diagnostics
Assembly: PostSharp.Patterns.Diagnostics (in PostSharp.Patterns.Diagnostics.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
public LogAspectConfiguration()
public LogAspectConfiguration()
See Also
LogAspectConfiguration Class
LogAspectConfiguration Members
PostSharp.Patterns.Diagnostics Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


LogAspectConfiguration Properties

LogAspectConfiguration Properties PostSharp Documentation
The LogAspectConfiguration type exposes the following members.
Properties
 | Name | Description
Public property | AspectPriority | Gets or sets the aspect priority. Aspects with smaller priority are processed first. The default priority is zero. (Inherited from AspectConfiguration.)
Public property | Dependencies | Gets or sets the collection of dependencies. (Inherited from AspectConfiguration.)
Public property | OnEntryLevel | Gets or sets the severity level for logging before method execution.
Public property | OnEntryOptions | Gets or sets options for logging before method execution.
Public property | OnExceptionLevel | Gets or sets the severity level for logging on method exception.
Public property | OnExceptionOptions | Gets or sets options for logging on method exception.
Public property | OnSuccessLevel | Gets or sets the severity level for logging on method success.
Public property | OnSuccessOptions | Gets or sets options for logging on method success.
Public property | ProfileName | Gets or sets the name of the logging profile.
Public property | SerializerType | Gets or sets the type of the serializer that will be used to configure the current aspect. (Inherited from AspectConfiguration.)
Back to Top
See Also
LogAspectConfiguration Class
PostSharp.Patterns.Diagnostics Namespace

Online Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


LogAspectConfiguration.OnEntryLevel Property

LogAspectConfiguration OnEntryLevel Property PostSharp Documentation
Gets or sets the severity level for logging before method execution.

Namespace: PostSharp.Patterns.Diagnostics
Assembly: PostSharp.Patterns.Diagnostics (in PostSharp.Patterns.Diagnostics.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
public Nullable<LogLevel> OnEntryLevel { get; set; }
public Nullable<LogLevel> OnEntryLevel { get; set; }
Property Value
Type:   Online Nullable  LogLevel
See Also
LogAspectConfiguration Class
LogAspectConfiguration Members
PostSharp.Patterns.Diagnostics Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


LogAspectConfiguration.OnEntryOptions Property

LogAspectConfiguration OnEntryOptions Property PostSharp Documentation
Gets or sets options for logging before method execution.

Namespace: PostSharp.Patterns.Diagnostics
Assembly: PostSharp.Patterns.Diagnostics (in PostSharp.Patterns.Diagnostics.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
public Nullable<LogOptions> OnEntryOptions { get; set; }
public Nullable<LogOptions> OnEntryOptions { get; set; }
Property Value
Type:   Online Nullable  LogOptions
See Also
LogAspectConfiguration Class
LogAspectConfiguration Members
PostSharp.Patterns.Diagnostics Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


LogAspectConfiguration.OnExceptionLevel Property

LogAspectConfiguration OnExceptionLevel Property PostSharp Documentation
Gets or sets the severity level for logging on method exception.

Namespace: PostSharp.Patterns.Diagnostics
Assembly: PostSharp.Patterns.Diagnostics (in PostSharp.Patterns.Diagnostics.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
public Nullable<LogLevel> OnExceptionLevel { get; set; }
public Nullable<LogLevel> OnExceptionLevel { get; set; }
Property Value
Type:   Online Nullable  LogLevel
See Also
LogAspectConfiguration Class
LogAspectConfiguration Members
PostSharp.Patterns.Diagnostics Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


LogAspectConfiguration.OnExceptionOptions Property

LogAspectConfiguration OnExceptionOptions Property PostSharp Documentation
Gets or sets options for logging on method exception.

Namespace: PostSharp.Patterns.Diagnostics
Assembly: PostSharp.Patterns.Diagnostics (in PostSharp.Patterns.Diagnostics.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
public Nullable<LogOptions> OnExceptionOptions { get; set; }
public Nullable<LogOptions> OnExceptionOptions { get; set; }
Property Value
Type:   Online Nullable  LogOptions
See Also
LogAspectConfiguration Class
LogAspectConfiguration Members
PostSharp.Patterns.Diagnostics Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


LogAspectConfiguration.OnSuccessLevel Property

LogAspectConfiguration OnSuccessLevel Property PostSharp Documentation
Gets or sets the severity level for logging on method success.

Namespace: PostSharp.Patterns.Diagnostics
Assembly: PostSharp.Patterns.Diagnostics (in PostSharp.Patterns.Diagnostics.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
public Nullable<LogLevel> OnSuccessLevel { get; set; }
public Nullable<LogLevel> OnSuccessLevel { get; set; }
Property Value
Type:   Online Nullable  LogLevel
See Also
LogAspectConfiguration Class
LogAspectConfiguration Members
PostSharp.Patterns.Diagnostics Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


LogAspectConfiguration.OnSuccessOptions Property

LogAspectConfiguration OnSuccessOptions Property PostSharp Documentation
Gets or sets options for logging on method success.

Namespace: PostSharp.Patterns.Diagnostics
Assembly: PostSharp.Patterns.Diagnostics (in PostSharp.Patterns.Diagnostics.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
public Nullable<LogOptions> OnSuccessOptions { get; set; }
public Nullable<LogOptions> OnSuccessOptions { get; set; }
Property Value
Type:   Online Nullable  LogOptions
See Also
LogAspectConfiguration Class
LogAspectConfiguration Members
PostSharp.Patterns.Diagnostics Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


LogAspectConfiguration.ProfileName Property

LogAspectConfiguration ProfileName Property PostSharp Documentation
Gets or sets the name of the logging profile.

Namespace: PostSharp.Patterns.Diagnostics
Assembly: PostSharp.Patterns.Diagnostics (in PostSharp.Patterns.Diagnostics.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
public string ProfileName { get; set; }
public string ProfileName { get; set; }
Property Value
Type:   Online String

            The name of the logging profile, or null to use the default logging profile

Implements
IProfileAwareConfiguration ProfileName
See Also
LogAspectConfiguration Class
LogAspectConfiguration Members
PostSharp.Patterns.Diagnostics Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


LogAspectConfigurationAttribute Class

LogAspectConfigurationAttribute Class PostSharp Documentation
Configures an aspect of type ILogAspect.
Inheritance Hierarchy
Online System Object
Online System Attribute
PostSharp.Aspects.Configuration AspectConfigurationAttribute
PostSharp.Patterns.Diagnostics LogAspectConfigurationAttribute

Namespace: PostSharp.Patterns.Diagnostics
Assembly: PostSharp.Patterns.Diagnostics (in PostSharp.Patterns.Diagnostics.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
public class LogAspectConfigurationAttribute : AspectConfigurationAttribute
public class LogAspectConfigurationAttribute : AspectConfigurationAttribute
See Also
LogAspectConfigurationAttribute Members
PostSharp.Patterns.Diagnostics Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


LogAspectConfigurationAttribute Members

LogAspectConfigurationAttribute Members PostSharp Documentation

The LogAspectConfigurationAttribute type exposes the following members.
Constructors
 | Name | Description
Public method | LogAspectConfigurationAttribute | Initializes a new instance of the LogAspectConfigurationAttribute class
Back to Top
Methods
 | Name | Description
Protected method | CreateAspectConfiguration | Creates a concrete AspectConfiguration instance specifically for the current AspectConfigurationAttribute type. (Overrides AspectConfigurationAttribute CreateAspectConfiguration .)
Public method | GetAspectConfiguration | Gets the AspectConfiguration corresponding to the current custom attribute. (Inherited from AspectConfigurationAttribute.)
Protected method | SetAspectConfiguration | Sets up an AspectConfiguration object according to the current custom attribute instance. (Inherited from AspectConfigurationAttribute.)
Back to Top
Properties
 | Name | Description
Public property | AspectPriority | Gets or sets the weaving priority of the aspect. (Inherited from AspectConfigurationAttribute.)
Public property | OnEntryLevel | Gets or sets the severity level for logging before method execution.
Public property | OnEntryOptions | Gets or sets options for logging before method execution.
Public property | OnExceptionLevel | Gets or sets the severity level for logging on method exception.
Public property | OnExceptionOptions | Gets or sets options for logging on method exception.
Public property | OnSuccessLevel | Gets or sets the severity level for logging on method success.
Public property | OnSuccessOptions | Gets or sets options for logging on method success.
Public property | SerializerType | Gets or sets the Online Type of the serializer that will be used to configure the current aspect. (Inherited from AspectConfigurationAttribute.)
Back to Top
See Also
LogAspectConfigurationAttribute Class
PostSharp.Patterns.Diagnostics Namespace

Online Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


LogAspectConfigurationAttribute Constructor

LogAspectConfigurationAttribute Constructor PostSharp Documentation
Initializes a new instance of the LogAspectConfigurationAttribute class

Namespace: PostSharp.Patterns.Diagnostics
Assembly: PostSharp.Patterns.Diagnostics (in PostSharp.Patterns.Diagnostics.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
public LogAspectConfigurationAttribute()
public LogAspectConfigurationAttribute()
See Also
LogAspectConfigurationAttribute Class
LogAspectConfigurationAttribute Members
PostSharp.Patterns.Diagnostics Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


LogAspectConfigurationAttribute Methods

LogAspectConfigurationAttribute Methods PostSharp Documentation
The LogAspectConfigurationAttribute type exposes the following members.
Methods
 | Name | Description
Protected method | CreateAspectConfiguration | Creates a concrete AspectConfiguration instance specifically for the current AspectConfigurationAttribute type. (Overrides AspectConfigurationAttribute CreateAspectConfiguration .)
Public method | GetAspectConfiguration | Gets the AspectConfiguration corresponding to the current custom attribute. (Inherited from AspectConfigurationAttribute.)
Protected method | SetAspectConfiguration | Sets up an AspectConfiguration object according to the current custom attribute instance. (Inherited from AspectConfigurationAttribute.)
Back to Top
See Also
LogAspectConfigurationAttribute Class
PostSharp.Patterns.Diagnostics Namespace

Online Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


LogAspectConfigurationAttribute.CreateAspectConfiguration Method

LogAspectConfigurationAttribute CreateAspectConfiguration Method PostSharp Documentation
Creates a concrete AspectConfiguration instance specifically for the current AspectConfigurationAttribute type.

Namespace: PostSharp.Patterns.Diagnostics
Assembly: PostSharp.Patterns.Diagnostics (in PostSharp.Patterns.Diagnostics.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
protected override sealed AspectConfiguration CreateAspectConfiguration()
protected override sealed AspectConfiguration CreateAspectConfiguration()
Return Value
Type: AspectConfiguration
A new and empty instance of AspectConfiguration, whose concrete type corresponds to
              the concrete type of the AspectConfigurationAttribute.
Remarks

              This method should not set up the returned AspectConfiguration. After the current method has
              returned, the SetAspectConfiguration(AspectConfiguration) method will be invoked, and this method is responsible
              for setting up the AspectConfigurationobject.

See Also
LogAspectConfigurationAttribute Class
LogAspectConfigurationAttribute Members
PostSharp.Patterns.Diagnostics Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


LogAspectConfigurationAttribute Properties

LogAspectConfigurationAttribute Properties PostSharp Documentation
The LogAspectConfigurationAttribute type exposes the following members.
Properties
 | Name | Description
Public property | AspectPriority | Gets or sets the weaving priority of the aspect. (Inherited from AspectConfigurationAttribute.)
Public property | OnEntryLevel | Gets or sets the severity level for logging before method execution.
Public property | OnEntryOptions | Gets or sets options for logging before method execution.
Public property | OnExceptionLevel | Gets or sets the severity level for logging on method exception.
Public property | OnExceptionOptions | Gets or sets options for logging on method exception.
Public property | OnSuccessLevel | Gets or sets the severity level for logging on method success.
Public property | OnSuccessOptions | Gets or sets options for logging on method success.
Public property | SerializerType | Gets or sets the Online Type of the serializer that will be used to configure the current aspect. (Inherited from AspectConfigurationAttribute.)
Back to Top
See Also
LogAspectConfigurationAttribute Class
PostSharp.Patterns.Diagnostics Namespace

Online Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


LogAspectConfigurationAttribute.OnEntryLevel Property

LogAspectConfigurationAttribute OnEntryLevel Property PostSharp Documentation
Gets or sets the severity level for logging before method execution.

Namespace: PostSharp.Patterns.Diagnostics
Assembly: PostSharp.Patterns.Diagnostics (in PostSharp.Patterns.Diagnostics.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
public LogLevel OnEntryLevel { get; set; }
public LogLevel OnEntryLevel { get; set; }
Property Value
Type: LogLevel
See Also
LogAspectConfigurationAttribute Class
LogAspectConfigurationAttribute Members
PostSharp.Patterns.Diagnostics Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


LogAspectConfigurationAttribute.OnEntryOptions Property

LogAspectConfigurationAttribute OnEntryOptions Property PostSharp Documentation
Gets or sets options for logging before method execution.

Namespace: PostSharp.Patterns.Diagnostics
Assembly: PostSharp.Patterns.Diagnostics (in PostSharp.Patterns.Diagnostics.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
public LogOptions OnEntryOptions { get; set; }
public LogOptions OnEntryOptions { get; set; }
Property Value
Type: LogOptions
See Also
LogAspectConfigurationAttribute Class
LogAspectConfigurationAttribute Members
PostSharp.Patterns.Diagnostics Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


LogAspectConfigurationAttribute.OnExceptionLevel Property

LogAspectConfigurationAttribute OnExceptionLevel Property PostSharp Documentation
Gets or sets the severity level for logging on method exception.

Namespace: PostSharp.Patterns.Diagnostics
Assembly: PostSharp.Patterns.Diagnostics (in PostSharp.Patterns.Diagnostics.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
public LogLevel OnExceptionLevel { get; set; }
public LogLevel OnExceptionLevel { get; set; }
Property Value
Type: LogLevel
See Also
LogAspectConfigurationAttribute Class
LogAspectConfigurationAttribute Members
PostSharp.Patterns.Diagnostics Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


LogAspectConfigurationAttribute.OnExceptionOptions Property

LogAspectConfigurationAttribute OnExceptionOptions Property PostSharp Documentation
Gets or sets options for logging on method exception.

Namespace: PostSharp.Patterns.Diagnostics
Assembly: PostSharp.Patterns.Diagnostics (in PostSharp.Patterns.Diagnostics.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
public LogOptions OnExceptionOptions { get; set; }
public LogOptions OnExceptionOptions { get; set; }
Property Value
Type: LogOptions
See Also
LogAspectConfigurationAttribute Class
LogAspectConfigurationAttribute Members
PostSharp.Patterns.Diagnostics Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


LogAspectConfigurationAttribute.OnSuccessLevel Property

LogAspectConfigurationAttribute OnSuccessLevel Property PostSharp Documentation
Gets or sets the severity level for logging on method success.

Namespace: PostSharp.Patterns.Diagnostics
Assembly: PostSharp.Patterns.Diagnostics (in PostSharp.Patterns.Diagnostics.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
public LogLevel OnSuccessLevel { get; set; }
public LogLevel OnSuccessLevel { get; set; }
Property Value
Type: LogLevel
See Also
LogAspectConfigurationAttribute Class
LogAspectConfigurationAttribute Members
PostSharp.Patterns.Diagnostics Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


LogAspectConfigurationAttribute.OnSuccessOptions Property

LogAspectConfigurationAttribute OnSuccessOptions Property PostSharp Documentation
Gets or sets options for logging on method success.

Namespace: PostSharp.Patterns.Diagnostics
Assembly: PostSharp.Patterns.Diagnostics (in PostSharp.Patterns.Diagnostics.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
public LogOptions OnSuccessOptions { get; set; }
public LogOptions OnSuccessOptions { get; set; }
Property Value
Type: LogOptions
See Also
LogAspectConfigurationAttribute Class
LogAspectConfigurationAttribute Members
PostSharp.Patterns.Diagnostics Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


LogAttribute Class

LogAttribute Class PostSharp Documentation
Custom attribute that, when applied on a method, causes PostSharp to implement tracing before and after execution of this method.
Inheritance Hierarchy
Online System Object
Online System Attribute
PostSharp.Extensibility MulticastAttribute
PostSharp.Aspects Aspect
PostSharp.Aspects MethodLevelAspect
PostSharp.Patterns.Diagnostics LogAttributeBase
PostSharp.Patterns.Diagnostics LogAttribute

Namespace: PostSharp.Patterns.Diagnostics
Assembly: PostSharp.Patterns.Diagnostics (in PostSharp.Patterns.Diagnostics.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
[SerializableAttribute]
public class LogAttribute : LogAttributeBase
[SerializableAttribute]
public class LogAttribute : LogAttributeBase
Remarks
By default, the current custom attribute follows the settings of the default profile, which adds a Debug message
                on entry and on success, and a Warning on exception. All messages include parameter values. You
                can change these default settings by setting the properties of this class, or by choosing a different logging profile. The values set to
                properties in this class override the values set by the logging profile.
            debug
See Also
LogAttribute Members
PostSharp.Patterns.Diagnostics Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


LogAttribute Members

LogAttribute Members PostSharp Documentation

The LogAttribute type exposes the following members.
Constructors
 | Name | Description
Public method | LogAttribute | Initializes a new LogAttribute.
Public method | LogAttribute(String) | Initializes a new LogAttribute and specifies a logging profile.
Back to Top
Methods
 | Name | Description
Public method | CompileTimeInitialize | Method invoked at build time to initialize the instance fields of the current aspect. This method is invoked before any other build-time method. (Inherited from MethodLevelAspect.)
Public method | CompileTimeValidate | Method invoked at build time to ensure that the aspect has been applied to the right target. (Inherited from Aspect.)
Protected method | CreateAspectConfiguration | Method invoked at build time to create a concrete AspectConfiguration instance specifically for the current Aspect type. (Inherited from LogAttributeBase.)
Public method | GetAspectConfiguration | Method invoked at build tome to get the imperative configuration of the current Aspect. (Inherited from Aspect.)
Public method | RuntimeInitialize | Initializes the current aspect. (Inherited from MethodLevelAspect.)
Protected method | SetAspectConfiguration | Method invoked at build time to set up an AspectConfiguration object according to the current Aspect instance and a specified target element of the current aspect. (Inherited from Aspect.)
Back to Top
Properties
 | Name | Description
Public property | AspectPriority | Gets or sets the weaving priority of the aspect. (Inherited from Aspect.)
Public property | AttributeExclude | If true, indicates that this attribute removes all other instances of the same attribute type from the set of elements defined by the current instance. (Inherited from MulticastAttribute.)
Public property | AttributeId | Obsolete. (Inherited from MulticastAttribute.)
Public property | AttributeInheritance | Determines whether this attribute is inherited (Inherited from MulticastAttribute.)
Public property | AttributePriority | Gets or sets the priority of the current attribute in case that multiple instances are defined on the same element (lower values are processed before). (Inherited from MulticastAttribute.)
Public property | AttributeReplace | Determines whether this attribute replaces other attributes found on the target declarations. (Inherited from MulticastAttribute.)
Public property | AttributeTargetAssemblies | Gets or sets the assemblies to which the current attribute apply. (Inherited from MulticastAttribute.)
Public property | AttributeTargetElements | Gets or sets the kind of elements to which this custom attributes applies. (Inherited from MulticastAttribute.)
Public property | AttributeTargetExternalMemberAttributes | Gets or sets the visibilities, scopes, virtualities, and implementation of members to which this attribute applies, when the member is external to the current module. (Inherited from MulticastAttribute.)
Public property | AttributeTargetExternalTypeAttributes | Gets or sets the visibilities of types to which this attribute applies, when this type is external to the current module. (Inherited from MulticastAttribute.)
Public property | AttributeTargetMemberAttributes | Gets or sets the visibilities, scopes, virtualities, and implementation of members to which this attribute applies. (Inherited from MulticastAttribute.)
Public property | AttributeTargetMembers | Gets or sets the expression specifying to which members this instance applies. (Inherited from MulticastAttribute.)
Public property | AttributeTargetParameterAttributes | Gets or sets the passing style (by value, out or ref) of parameters to which this attribute applies. (Inherited from MulticastAttribute.)
Public property | AttributeTargetParameters | Gets or sets the expression specifying to which parameters this instance applies. (Inherited from MulticastAttribute.)
Public property | AttributeTargetTypeAttributes | Gets or sets the visibilities of types to which this attribute applies. (Inherited from MulticastAttribute.)
Public property | AttributeTargetTypes | Gets or sets the expression specifying to which types this instance applies. (Inherited from MulticastAttribute.)
Protected property | Configuration | Gets the aspect configuration. (Inherited from LogAttributeBase.)
Public property | OnEntryLevel | Gets or sets the severity level for logging before method execution.
Public property | OnEntryOptions | Gets or sets options for logging before method execution.
Public property | OnExceptionLevel | Gets or sets the severity level for logging on method exception.
Public property | OnExceptionOptions | Gets or sets options for logging on method exception.
Public property | OnSuccessLevel | Gets or sets the severity level for logging on method success.
Public property | OnSuccessOptions | Gets or sets options for logging on method success.
Public property | ProfileName | Gets or sets the name of the logging profile. (Inherited from LogAttributeBase.)
Protected property | SerializerType | Gets or sets the Online Type of the serializer (a type derived from AspectSerializer) used to serialize the aspect instance at build time and deserialize it at runtime. (Inherited from Aspect.)
Back to Top
See Also
LogAttribute Class
PostSharp.Patterns.Diagnostics Namespace

Online Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


LogAttribute Constructor

LogAttribute Constructor PostSharp Documentation
Overload List
 | Name | Description
Public method | LogAttribute | Initializes a new LogAttribute.
Public method | LogAttribute(String) | Initializes a new LogAttribute and specifies a logging profile.
Back to Top
See Also
LogAttribute Class
LogAttribute Members
PostSharp.Patterns.Diagnostics Namespace

Online Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


LogAttribute Constructor

LogAttribute Constructor PostSharp Documentation
Initializes a new LogAttribute.

Namespace: PostSharp.Patterns.Diagnostics
Assembly: PostSharp.Patterns.Diagnostics (in PostSharp.Patterns.Diagnostics.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
public LogAttribute()
public LogAttribute()
See Also
LogAttribute Class
LogAttribute Members
LogAttribute Overload
PostSharp.Patterns.Diagnostics Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


LogAttribute Constructor (String)

LogAttribute Constructor (String) PostSharp Documentation
Initializes a new LogAttribute and specifies a logging profile.

Namespace: PostSharp.Patterns.Diagnostics
Assembly: PostSharp.Patterns.Diagnostics (in PostSharp.Patterns.Diagnostics.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
public LogAttribute(
    string profileName
)
public LogAttribute(
    string profileName
)
Parameters
profileName
Type:   Online System String
The name of the logging profile, or null to use the default logging profile.
See Also
LogAttribute Class
LogAttribute Members
LogAttribute Overload
PostSharp.Patterns.Diagnostics Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


LogAttribute Methods

LogAttribute Methods PostSharp Documentation
The LogAttribute type exposes the following members.
Methods
 | Name | Description
Public method | CompileTimeInitialize | Method invoked at build time to initialize the instance fields of the current aspect. This method is invoked before any other build-time method. (Inherited from MethodLevelAspect.)
Public method | CompileTimeValidate | Method invoked at build time to ensure that the aspect has been applied to the right target. (Inherited from Aspect.)
Protected method | CreateAspectConfiguration | Method invoked at build time to create a concrete AspectConfiguration instance specifically for the current Aspect type. (Inherited from LogAttributeBase.)
Public method | GetAspectConfiguration | Method invoked at build tome to get the imperative configuration of the current Aspect. (Inherited from Aspect.)
Public method | RuntimeInitialize | Initializes the current aspect. (Inherited from MethodLevelAspect.)
Protected method | SetAspectConfiguration | Method invoked at build time to set up an AspectConfiguration object according to the current Aspect instance and a specified target element of the current aspect. (Inherited from Aspect.)
Back to Top
See Also
LogAttribute Class
PostSharp.Patterns.Diagnostics Namespace

Online Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


LogAttribute Properties

LogAttribute Properties PostSharp Documentation
The LogAttribute type exposes the following members.
Properties
 | Name | Description
Public property | AspectPriority | Gets or sets the weaving priority of the aspect. (Inherited from Aspect.)
Public property | AttributeExclude | If true, indicates that this attribute removes all other instances of the same attribute type from the set of elements defined by the current instance. (Inherited from MulticastAttribute.)
Public property | AttributeId | Obsolete. (Inherited from MulticastAttribute.)
Public property | AttributeInheritance | Determines whether this attribute is inherited (Inherited from MulticastAttribute.)
Public property | AttributePriority | Gets or sets the priority of the current attribute in case that multiple instances are defined on the same element (lower values are processed before). (Inherited from MulticastAttribute.)
Public property | AttributeReplace | Determines whether this attribute replaces other attributes found on the target declarations. (Inherited from MulticastAttribute.)
Public property | AttributeTargetAssemblies | Gets or sets the assemblies to which the current attribute apply. (Inherited from MulticastAttribute.)
Public property | AttributeTargetElements | Gets or sets the kind of elements to which this custom attributes applies. (Inherited from MulticastAttribute.)
Public property | AttributeTargetExternalMemberAttributes | Gets or sets the visibilities, scopes, virtualities, and implementation of members to which this attribute applies, when the member is external to the current module. (Inherited from MulticastAttribute.)
Public property | AttributeTargetExternalTypeAttributes | Gets or sets the visibilities of types to which this attribute applies, when this type is external to the current module. (Inherited from MulticastAttribute.)
Public property | AttributeTargetMemberAttributes | Gets or sets the visibilities, scopes, virtualities, and implementation of members to which this attribute applies. (Inherited from MulticastAttribute.)
Public property | AttributeTargetMembers | Gets or sets the expression specifying to which members this instance applies. (Inherited from MulticastAttribute.)
Public property | AttributeTargetParameterAttributes | Gets or sets the passing style (by value, out or ref) of parameters to which this attribute applies. (Inherited from MulticastAttribute.)
Public property | AttributeTargetParameters | Gets or sets the expression specifying to which parameters this instance applies. (Inherited from MulticastAttribute.)
Public property | AttributeTargetTypeAttributes | Gets or sets the visibilities of types to which this attribute applies. (Inherited from MulticastAttribute.)
Public property | AttributeTargetTypes | Gets or sets the expression specifying to which types this instance applies. (Inherited from MulticastAttribute.)
Protected property | Configuration | Gets the aspect configuration. (Inherited from LogAttributeBase.)
Public property | OnEntryLevel | Gets or sets the severity level for logging before method execution.
Public property | OnEntryOptions | Gets or sets options for logging before method execution.
Public property | OnExceptionLevel | Gets or sets the severity level for logging on method exception.
Public property | OnExceptionOptions | Gets or sets options for logging on method exception.
Public property | OnSuccessLevel | Gets or sets the severity level for logging on method success.
Public property | OnSuccessOptions | Gets or sets options for logging on method success.
Public property | ProfileName | Gets or sets the name of the logging profile. (Inherited from LogAttributeBase.)
Protected property | SerializerType | Gets or sets the Online Type of the serializer (a type derived from AspectSerializer) used to serialize the aspect instance at build time and deserialize it at runtime. (Inherited from Aspect.)
Back to Top
See Also
LogAttribute Class
PostSharp.Patterns.Diagnostics Namespace

Online Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


LogAttribute.OnEntryLevel Property

LogAttribute OnEntryLevel Property PostSharp Documentation
Gets or sets the severity level for logging before method execution.

Namespace: PostSharp.Patterns.Diagnostics
Assembly: PostSharp.Patterns.Diagnostics (in PostSharp.Patterns.Diagnostics.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
public LogLevel OnEntryLevel { get; set; }
public LogLevel OnEntryLevel { get; set; }
Property Value
Type: LogLevel
See Also
LogAttribute Class
LogAttribute Members
PostSharp.Patterns.Diagnostics Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


LogAttribute.OnEntryOptions Property

LogAttribute OnEntryOptions Property PostSharp Documentation
Gets or sets options for logging before method execution.

Namespace: PostSharp.Patterns.Diagnostics
Assembly: PostSharp.Patterns.Diagnostics (in PostSharp.Patterns.Diagnostics.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
public LogOptions OnEntryOptions { get; set; }
public LogOptions OnEntryOptions { get; set; }
Property Value
Type: LogOptions
See Also
LogAttribute Class
LogAttribute Members
PostSharp.Patterns.Diagnostics Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


LogAttribute.OnExceptionLevel Property

LogAttribute OnExceptionLevel Property PostSharp Documentation
Gets or sets the severity level for logging on method exception.

Namespace: PostSharp.Patterns.Diagnostics
Assembly: PostSharp.Patterns.Diagnostics (in PostSharp.Patterns.Diagnostics.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
public LogLevel OnExceptionLevel { get; set; }
public LogLevel OnExceptionLevel { get; set; }
Property Value
Type: LogLevel
See Also
LogAttribute Class
LogAttribute Members
PostSharp.Patterns.Diagnostics Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


LogAttribute.OnExceptionOptions Property

LogAttribute OnExceptionOptions Property PostSharp Documentation
Gets or sets options for logging on method exception.

Namespace: PostSharp.Patterns.Diagnostics
Assembly: PostSharp.Patterns.Diagnostics (in PostSharp.Patterns.Diagnostics.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
public LogOptions OnExceptionOptions { get; set; }
public LogOptions OnExceptionOptions { get; set; }
Property Value
Type: LogOptions
See Also
LogAttribute Class
LogAttribute Members
PostSharp.Patterns.Diagnostics Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


LogAttribute.OnSuccessLevel Property

LogAttribute OnSuccessLevel Property PostSharp Documentation
Gets or sets the severity level for logging on method success.

Namespace: PostSharp.Patterns.Diagnostics
Assembly: PostSharp.Patterns.Diagnostics (in PostSharp.Patterns.Diagnostics.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
public LogLevel OnSuccessLevel { get; set; }
public LogLevel OnSuccessLevel { get; set; }
Property Value
Type: LogLevel
See Also
LogAttribute Class
LogAttribute Members
PostSharp.Patterns.Diagnostics Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


LogAttribute.OnSuccessOptions Property

LogAttribute OnSuccessOptions Property PostSharp Documentation
Gets or sets options for logging on method success.

Namespace: PostSharp.Patterns.Diagnostics
Assembly: PostSharp.Patterns.Diagnostics (in PostSharp.Patterns.Diagnostics.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
public LogOptions OnSuccessOptions { get; set; }
public LogOptions OnSuccessOptions { get; set; }
Property Value
Type: LogOptions
See Also
LogAttribute Class
LogAttribute Members
PostSharp.Patterns.Diagnostics Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


LogAttributeBase Class

LogAttributeBase Class PostSharp Documentation
Base class for all logging aspects.
Inheritance Hierarchy
Online System Object
Online System Attribute
PostSharp.Extensibility MulticastAttribute
PostSharp.Aspects Aspect
PostSharp.Aspects MethodLevelAspect
PostSharp.Patterns.Diagnostics LogAttributeBase
PostSharp.Patterns.Diagnostics LogAttribute
PostSharp.Patterns.Diagnostics LogExceptionAttribute

Namespace: PostSharp.Patterns.Diagnostics
Assembly: PostSharp.Patterns.Diagnostics (in PostSharp.Patterns.Diagnostics.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
public abstract class LogAttributeBase : MethodLevelAspect,
    ILogAspect, IAspect
public abstract class LogAttributeBase : MethodLevelAspect,
    ILogAspect, IAspect
Remarks
Implementations must configure the aspect by setting properties of the Configuration object. Optionally,
            the SetAspectConfiguration(AspectConfiguration, MethodBase) method may be overridden.
See Also
LogAttributeBase Members
PostSharp.Patterns.Diagnostics Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


LogAttributeBase Members

LogAttributeBase Members PostSharp Documentation

The LogAttributeBase type exposes the following members.
Constructors
 | Name | Description
Protected method | LogAttributeBase | Initializes a new instance of the LogAttributeBase class
Back to Top
Methods
 | Name | Description
Public method | CompileTimeInitialize | Method invoked at build time to initialize the instance fields of the current aspect. This method is invoked before any other build-time method. (Inherited from MethodLevelAspect.)
Public method | CompileTimeValidate | Method invoked at build time to ensure that the aspect has been applied to the right target. (Inherited from Aspect.)
Protected method | CreateAspectConfiguration | Method invoked at build time to create a concrete AspectConfiguration instance specifically for the current Aspect type. (Overrides Aspect CreateAspectConfiguration .)
Public method | GetAspectConfiguration | Method invoked at build tome to get the imperative configuration of the current Aspect. (Inherited from Aspect.)
Public method | RuntimeInitialize | Initializes the current aspect. (Inherited from MethodLevelAspect.)
Protected method | SetAspectConfiguration | Method invoked at build time to set up an AspectConfiguration object according to the current Aspect instance and a specified target element of the current aspect. (Inherited from Aspect.)
Back to Top
Properties
 | Name | Description
Public property | AspectPriority | Gets or sets the weaving priority of the aspect. (Inherited from Aspect.)
Public property | AttributeExclude | If true, indicates that this attribute removes all other instances of the same attribute type from the set of elements defined by the current instance. (Inherited from MulticastAttribute.)
Public property | AttributeId | Obsolete. (Inherited from MulticastAttribute.)
Public property | AttributeInheritance | Determines whether this attribute is inherited (Inherited from MulticastAttribute.)
Public property | AttributePriority | Gets or sets the priority of the current attribute in case that multiple instances are defined on the same element (lower values are processed before). (Inherited from MulticastAttribute.)
Public property | AttributeReplace | Determines whether this attribute replaces other attributes found on the target declarations. (Inherited from MulticastAttribute.)
Public property | AttributeTargetAssemblies | Gets or sets the assemblies to which the current attribute apply. (Inherited from MulticastAttribute.)
Public property | AttributeTargetElements | Gets or sets the kind of elements to which this custom attributes applies. (Inherited from MulticastAttribute.)
Public property | AttributeTargetExternalMemberAttributes | Gets or sets the visibilities, scopes, virtualities, and implementation of members to which this attribute applies, when the member is external to the current module. (Inherited from MulticastAttribute.)
Public property | AttributeTargetExternalTypeAttributes | Gets or sets the visibilities of types to which this attribute applies, when this type is external to the current module. (Inherited from MulticastAttribute.)
Public property | AttributeTargetMemberAttributes | Gets or sets the visibilities, scopes, virtualities, and implementation of members to which this attribute applies. (Inherited from MulticastAttribute.)
Public property | AttributeTargetMembers | Gets or sets the expression specifying to which members this instance applies. (Inherited from MulticastAttribute.)
Public property | AttributeTargetParameterAttributes | Gets or sets the passing style (by value, out or ref) of parameters to which this attribute applies. (Inherited from MulticastAttribute.)
Public property | AttributeTargetParameters | Gets or sets the expression specifying to which parameters this instance applies. (Inherited from MulticastAttribute.)
Public property | AttributeTargetTypeAttributes | Gets or sets the visibilities of types to which this attribute applies. (Inherited from MulticastAttribute.)
Public property | AttributeTargetTypes | Gets or sets the expression specifying to which types this instance applies. (Inherited from MulticastAttribute.)
Protected property | Configuration | Gets the aspect configuration.
Public property | ProfileName | Gets or sets the name of the logging profile.
Protected property | SerializerType | Gets or sets the Online Type of the serializer (a type derived from AspectSerializer) used to serialize the aspect instance at build time and deserialize it at runtime. (Inherited from Aspect.)
Back to Top
See Also
LogAttributeBase Class
PostSharp.Patterns.Diagnostics Namespace

Online Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


LogAttributeBase Constructor

LogAttributeBase Constructor PostSharp Documentation
Initializes a new instance of the LogAttributeBase class

Namespace: PostSharp.Patterns.Diagnostics
Assembly: PostSharp.Patterns.Diagnostics (in PostSharp.Patterns.Diagnostics.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
protected LogAttributeBase()
protected LogAttributeBase()
See Also
LogAttributeBase Class
LogAttributeBase Members
PostSharp.Patterns.Diagnostics Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


LogAttributeBase Methods

LogAttributeBase Methods PostSharp Documentation
The LogAttributeBase type exposes the following members.
Methods
 | Name | Description
Public method | CompileTimeInitialize | Method invoked at build time to initialize the instance fields of the current aspect. This method is invoked before any other build-time method. (Inherited from MethodLevelAspect.)
Public method | CompileTimeValidate | Method invoked at build time to ensure that the aspect has been applied to the right target. (Inherited from Aspect.)
Protected method | CreateAspectConfiguration | Method invoked at build time to create a concrete AspectConfiguration instance specifically for the current Aspect type. (Overrides Aspect CreateAspectConfiguration .)
Public method | GetAspectConfiguration | Method invoked at build tome to get the imperative configuration of the current Aspect. (Inherited from Aspect.)
Public method | RuntimeInitialize | Initializes the current aspect. (Inherited from MethodLevelAspect.)
Protected method | SetAspectConfiguration | Method invoked at build time to set up an AspectConfiguration object according to the current Aspect instance and a specified target element of the current aspect. (Inherited from Aspect.)
Back to Top
See Also
LogAttributeBase Class
PostSharp.Patterns.Diagnostics Namespace

Online Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


LogAttributeBase.CreateAspectConfiguration Method

LogAttributeBase CreateAspectConfiguration Method PostSharp Documentation
Method invoked at build time to create a concrete AspectConfiguration instance specifically for the current Aspect type.

Namespace: PostSharp.Patterns.Diagnostics
Assembly: PostSharp.Patterns.Diagnostics (in PostSharp.Patterns.Diagnostics.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
protected override sealed AspectConfiguration CreateAspectConfiguration()
protected override sealed AspectConfiguration CreateAspectConfiguration()
Return Value
Type: AspectConfiguration
A new and empty instance of AspectConfiguration, whose concrete type corresponds to
              the concrete type of the Aspect.
Remarks

              This method should not set up the returned AspectConfiguration. After the current method has
              returned, the SetAspectConfiguration(AspectConfiguration, Object) method will be invoked, and this method is responsible
              for setting up the AspectConfigurationobject.

See Also
LogAttributeBase Class
LogAttributeBase Members
PostSharp.Patterns.Diagnostics Namespace

      Conceptual Documentation: Configuring Aspects

  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


LogAttributeBase Properties

LogAttributeBase Properties PostSharp Documentation
The LogAttributeBase type exposes the following members.
Properties
 | Name | Description
Public property | AspectPriority | Gets or sets the weaving priority of the aspect. (Inherited from Aspect.)
Public property | AttributeExclude | If true, indicates that this attribute removes all other instances of the same attribute type from the set of elements defined by the current instance. (Inherited from MulticastAttribute.)
Public property | AttributeId | Obsolete. (Inherited from MulticastAttribute.)
Public property | AttributeInheritance | Determines whether this attribute is inherited (Inherited from MulticastAttribute.)
Public property | AttributePriority | Gets or sets the priority of the current attribute in case that multiple instances are defined on the same element (lower values are processed before). (Inherited from MulticastAttribute.)
Public property | AttributeReplace | Determines whether this attribute replaces other attributes found on the target declarations. (Inherited from MulticastAttribute.)
Public property | AttributeTargetAssemblies | Gets or sets the assemblies to which the current attribute apply. (Inherited from MulticastAttribute.)
Public property | AttributeTargetElements | Gets or sets the kind of elements to which this custom attributes applies. (Inherited from MulticastAttribute.)
Public property | AttributeTargetExternalMemberAttributes | Gets or sets the visibilities, scopes, virtualities, and implementation of members to which this attribute applies, when the member is external to the current module. (Inherited from MulticastAttribute.)
Public property | AttributeTargetExternalTypeAttributes | Gets or sets the visibilities of types to which this attribute applies, when this type is external to the current module. (Inherited from MulticastAttribute.)
Public property | AttributeTargetMemberAttributes | Gets or sets the visibilities, scopes, virtualities, and implementation of members to which this attribute applies. (Inherited from MulticastAttribute.)
Public property | AttributeTargetMembers | Gets or sets the expression specifying to which members this instance applies. (Inherited from MulticastAttribute.)
Public property | AttributeTargetParameterAttributes | Gets or sets the passing style (by value, out or ref) of parameters to which this attribute applies. (Inherited from MulticastAttribute.)
Public property | AttributeTargetParameters | Gets or sets the expression specifying to which parameters this instance applies. (Inherited from MulticastAttribute.)
Public property | AttributeTargetTypeAttributes | Gets or sets the visibilities of types to which this attribute applies. (Inherited from MulticastAttribute.)
Public property | AttributeTargetTypes | Gets or sets the expression specifying to which types this instance applies. (Inherited from MulticastAttribute.)
Protected property | Configuration | Gets the aspect configuration.
Public property | ProfileName | Gets or sets the name of the logging profile.
Protected property | SerializerType | Gets or sets the Online Type of the serializer (a type derived from AspectSerializer) used to serialize the aspect instance at build time and deserialize it at runtime. (Inherited from Aspect.)
Back to Top
See Also
LogAttributeBase Class
PostSharp.Patterns.Diagnostics Namespace

Online Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


LogAttributeBase.Configuration Property

LogAttributeBase Configuration Property PostSharp Documentation
Gets the aspect configuration.

Namespace: PostSharp.Patterns.Diagnostics
Assembly: PostSharp.Patterns.Diagnostics (in PostSharp.Patterns.Diagnostics.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
protected LogAspectConfiguration Configuration { get; }
protected LogAspectConfiguration Configuration { get; }
Property Value
Type: LogAspectConfiguration
See Also
LogAttributeBase Class
LogAttributeBase Members
PostSharp.Patterns.Diagnostics Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


LogAttributeBase.ProfileName Property

LogAttributeBase ProfileName Property PostSharp Documentation
Gets or sets the name of the logging profile.

Namespace: PostSharp.Patterns.Diagnostics
Assembly: PostSharp.Patterns.Diagnostics (in PostSharp.Patterns.Diagnostics.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
public string ProfileName { get; set; }
public string ProfileName { get; set; }
Property Value
Type:   Online String
Remarks
Settings of the logging profile are overwritten by properties of the current custom attributes, if
            these properties are specified.
See Also
LogAttributeBase Class
LogAttributeBase Members
PostSharp.Patterns.Diagnostics Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


LogExceptionAttribute Class

LogExceptionAttribute Class PostSharp Documentation
Custom attribute that, when applied on a method, causes PostSharp to implement tracing upon exception in this method.
Inheritance Hierarchy
Online System Object
Online System Attribute
PostSharp.Extensibility MulticastAttribute
PostSharp.Aspects Aspect
PostSharp.Aspects MethodLevelAspect
PostSharp.Patterns.Diagnostics LogAttributeBase
PostSharp.Patterns.Diagnostics LogExceptionAttribute

Namespace: PostSharp.Patterns.Diagnostics
Assembly: PostSharp.Patterns.Diagnostics (in PostSharp.Patterns.Diagnostics.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
[SerializableAttribute]
public class LogExceptionAttribute : LogAttributeBase
[SerializableAttribute]
public class LogExceptionAttribute : LogAttributeBase
Remarks
Using this custom attribute is strictly equivalent to using the LogAttribute with the Exceptions profile
            and no other property set.
See Also
LogExceptionAttribute Members
PostSharp.Patterns.Diagnostics Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


LogExceptionAttribute Members

LogExceptionAttribute Members PostSharp Documentation

The LogExceptionAttribute type exposes the following members.
Constructors
 | Name | Description
Public method | LogExceptionAttribute | Initializes a new LogExceptionAttribute.
Back to Top
Methods
 | Name | Description
Public method | CompileTimeInitialize | Method invoked at build time to initialize the instance fields of the current aspect. This method is invoked before any other build-time method. (Inherited from MethodLevelAspect.)
Public method | CompileTimeValidate | Method invoked at build time to ensure that the aspect has been applied to the right target. (Inherited from Aspect.)
Protected method | CreateAspectConfiguration | Method invoked at build time to create a concrete AspectConfiguration instance specifically for the current Aspect type. (Inherited from LogAttributeBase.)
Public method | GetAspectConfiguration | Method invoked at build tome to get the imperative configuration of the current Aspect. (Inherited from Aspect.)
Public method | RuntimeInitialize | Initializes the current aspect. (Inherited from MethodLevelAspect.)
Protected method | SetAspectConfiguration | Method invoked at build time to set up an AspectConfiguration object according to the current Aspect instance and a specified target element of the current aspect. (Inherited from Aspect.)
Back to Top
Properties
 | Name | Description
Public property | AspectPriority | Gets or sets the weaving priority of the aspect. (Inherited from Aspect.)
Public property | AttributeExclude | If true, indicates that this attribute removes all other instances of the same attribute type from the set of elements defined by the current instance. (Inherited from MulticastAttribute.)
Public property | AttributeId | Obsolete. (Inherited from MulticastAttribute.)
Public property | AttributeInheritance | Determines whether this attribute is inherited (Inherited from MulticastAttribute.)
Public property | AttributePriority | Gets or sets the priority of the current attribute in case that multiple instances are defined on the same element (lower values are processed before). (Inherited from MulticastAttribute.)
Public property | AttributeReplace | Determines whether this attribute replaces other attributes found on the target declarations. (Inherited from MulticastAttribute.)
Public property | AttributeTargetAssemblies | Gets or sets the assemblies to which the current attribute apply. (Inherited from MulticastAttribute.)
Public property | AttributeTargetElements | Gets or sets the kind of elements to which this custom attributes applies. (Inherited from MulticastAttribute.)
Public property | AttributeTargetExternalMemberAttributes | Gets or sets the visibilities, scopes, virtualities, and implementation of members to which this attribute applies, when the member is external to the current module. (Inherited from MulticastAttribute.)
Public property | AttributeTargetExternalTypeAttributes | Gets or sets the visibilities of types to which this attribute applies, when this type is external to the current module. (Inherited from MulticastAttribute.)
Public property | AttributeTargetMemberAttributes | Gets or sets the visibilities, scopes, virtualities, and implementation of members to which this attribute applies. (Inherited from MulticastAttribute.)
Public property | AttributeTargetMembers | Gets or sets the expression specifying to which members this instance applies. (Inherited from MulticastAttribute.)
Public property | AttributeTargetParameterAttributes | Gets or sets the passing style (by value, out or ref) of parameters to which this attribute applies. (Inherited from MulticastAttribute.)
Public property | AttributeTargetParameters | Gets or sets the expression specifying to which parameters this instance applies. (Inherited from MulticastAttribute.)
Public property | AttributeTargetTypeAttributes | Gets or sets the visibilities of types to which this attribute applies. (Inherited from MulticastAttribute.)
Public property | AttributeTargetTypes | Gets or sets the expression specifying to which types this instance applies. (Inherited from MulticastAttribute.)
Protected property | Configuration | Gets the aspect configuration. (Inherited from LogAttributeBase.)
Public property | ProfileName | Gets or sets the name of the logging profile. (Inherited from LogAttributeBase.)
Protected property | SerializerType | Gets or sets the Online Type of the serializer (a type derived from AspectSerializer) used to serialize the aspect instance at build time and deserialize it at runtime. (Inherited from Aspect.)
Back to Top
See Also
LogExceptionAttribute Class
PostSharp.Patterns.Diagnostics Namespace

Online Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


LogExceptionAttribute Constructor

LogExceptionAttribute Constructor PostSharp Documentation
Initializes a new LogExceptionAttribute.

Namespace: PostSharp.Patterns.Diagnostics
Assembly: PostSharp.Patterns.Diagnostics (in PostSharp.Patterns.Diagnostics.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
public LogExceptionAttribute()
public LogExceptionAttribute()
See Also
LogExceptionAttribute Class
LogExceptionAttribute Members
PostSharp.Patterns.Diagnostics Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


LogExceptionAttribute Methods

LogExceptionAttribute Methods PostSharp Documentation
The LogExceptionAttribute type exposes the following members.
Methods
 | Name | Description
Public method | CompileTimeInitialize | Method invoked at build time to initialize the instance fields of the current aspect. This method is invoked before any other build-time method. (Inherited from MethodLevelAspect.)
Public method | CompileTimeValidate | Method invoked at build time to ensure that the aspect has been applied to the right target. (Inherited from Aspect.)
Protected method | CreateAspectConfiguration | Method invoked at build time to create a concrete AspectConfiguration instance specifically for the current Aspect type. (Inherited from LogAttributeBase.)
Public method | GetAspectConfiguration | Method invoked at build tome to get the imperative configuration of the current Aspect. (Inherited from Aspect.)
Public method | RuntimeInitialize | Initializes the current aspect. (Inherited from MethodLevelAspect.)
Protected method | SetAspectConfiguration | Method invoked at build time to set up an AspectConfiguration object according to the current Aspect instance and a specified target element of the current aspect. (Inherited from Aspect.)
Back to Top
See Also
LogExceptionAttribute Class
PostSharp.Patterns.Diagnostics Namespace

Online Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


LogExceptionAttribute Properties

LogExceptionAttribute Properties PostSharp Documentation
The LogExceptionAttribute type exposes the following members.
Properties
 | Name | Description
Public property | AspectPriority | Gets or sets the weaving priority of the aspect. (Inherited from Aspect.)
Public property | AttributeExclude | If true, indicates that this attribute removes all other instances of the same attribute type from the set of elements defined by the current instance. (Inherited from MulticastAttribute.)
Public property | AttributeId | Obsolete. (Inherited from MulticastAttribute.)
Public property | AttributeInheritance | Determines whether this attribute is inherited (Inherited from MulticastAttribute.)
Public property | AttributePriority | Gets or sets the priority of the current attribute in case that multiple instances are defined on the same element (lower values are processed before). (Inherited from MulticastAttribute.)
Public property | AttributeReplace | Determines whether this attribute replaces other attributes found on the target declarations. (Inherited from MulticastAttribute.)
Public property | AttributeTargetAssemblies | Gets or sets the assemblies to which the current attribute apply. (Inherited from MulticastAttribute.)
Public property | AttributeTargetElements | Gets or sets the kind of elements to which this custom attributes applies. (Inherited from MulticastAttribute.)
Public property | AttributeTargetExternalMemberAttributes | Gets or sets the visibilities, scopes, virtualities, and implementation of members to which this attribute applies, when the member is external to the current module. (Inherited from MulticastAttribute.)
Public property | AttributeTargetExternalTypeAttributes | Gets or sets the visibilities of types to which this attribute applies, when this type is external to the current module. (Inherited from MulticastAttribute.)
Public property | AttributeTargetMemberAttributes | Gets or sets the visibilities, scopes, virtualities, and implementation of members to which this attribute applies. (Inherited from MulticastAttribute.)
Public property | AttributeTargetMembers | Gets or sets the expression specifying to which members this instance applies. (Inherited from MulticastAttribute.)
Public property | AttributeTargetParameterAttributes | Gets or sets the passing style (by value, out or ref) of parameters to which this attribute applies. (Inherited from MulticastAttribute.)
Public property | AttributeTargetParameters | Gets or sets the expression specifying to which parameters this instance applies. (Inherited from MulticastAttribute.)
Public property | AttributeTargetTypeAttributes | Gets or sets the visibilities of types to which this attribute applies. (Inherited from MulticastAttribute.)
Public property | AttributeTargetTypes | Gets or sets the expression specifying to which types this instance applies. (Inherited from MulticastAttribute.)
Protected property | Configuration | Gets the aspect configuration. (Inherited from LogAttributeBase.)
Public property | ProfileName | Gets or sets the name of the logging profile. (Inherited from LogAttributeBase.)
Protected property | SerializerType | Gets or sets the Online Type of the serializer (a type derived from AspectSerializer) used to serialize the aspect instance at build time and deserialize it at runtime. (Inherited from Aspect.)
Back to Top
See Also
LogExceptionAttribute Class
PostSharp.Patterns.Diagnostics Namespace

Online Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


LoggingProfile Class

LoggingProfile Class PostSharp Documentation
Logging profiles are named configurations of logging aspects. They are typically instantiated in the PostSharp XML project file.
Inheritance Hierarchy
Online System Object
PostSharp.Patterns.Diagnostics LoggingProfile

Namespace: PostSharp.Patterns.Diagnostics
Assembly: PostSharp.Patterns.Diagnostics (in PostSharp.Patterns.Diagnostics.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
public class LoggingProfile
public class LoggingProfile
Remarks

            Logging profiles are defined in the PostSharp XML project file,
            in the section LoggingProfiles of XML namespace clr-namespace:PostSharp.Patterns.Diagnostics;assembly:PostSharp.Patterns.Diagnostics.
            Logging profiles can then be referred to from the LogAttribute. There are two system-defined logging profiles: Default
            and Exceptions
See Also
LoggingProfile Members
PostSharp.Patterns.Diagnostics Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


LoggingProfile Members

LoggingProfile Members PostSharp Documentation

The LoggingProfile type exposes the following members.
Constructors
 | Name | Description
Public method | LoggingProfile | Initializes a new instance of the LoggingProfile class
Back to Top
Properties
 | Name | Description
Public property | OnEntryLevel | Gets or sets the severity level for logging before method execution.
Public property | OnEntryOptions | Gets or sets options for logging before method execution.
Public property | OnExceptionLevel | Gets or sets the severity level for logging on method exception.
Public property | OnExceptionOptions | Gets or sets options for logging on method exception.
Public property | OnSuccessLevel | Gets or sets the severity level for logging on method success.
Public property | OnSuccessOptions | Gets or sets options for logging on method success.
Back to Top
See Also
LoggingProfile Class
PostSharp.Patterns.Diagnostics Namespace

Online Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


LoggingProfile Constructor

LoggingProfile Constructor PostSharp Documentation
Initializes a new instance of the LoggingProfile class

Namespace: PostSharp.Patterns.Diagnostics
Assembly: PostSharp.Patterns.Diagnostics (in PostSharp.Patterns.Diagnostics.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
public LoggingProfile()
public LoggingProfile()
See Also
LoggingProfile Class
LoggingProfile Members
PostSharp.Patterns.Diagnostics Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


LoggingProfile Properties

LoggingProfile Properties PostSharp Documentation
The LoggingProfile type exposes the following members.
Properties
 | Name | Description
Public property | OnEntryLevel | Gets or sets the severity level for logging before method execution.
Public property | OnEntryOptions | Gets or sets options for logging before method execution.
Public property | OnExceptionLevel | Gets or sets the severity level for logging on method exception.
Public property | OnExceptionOptions | Gets or sets options for logging on method exception.
Public property | OnSuccessLevel | Gets or sets the severity level for logging on method success.
Public property | OnSuccessOptions | Gets or sets options for logging on method success.
Back to Top
See Also
LoggingProfile Class
PostSharp.Patterns.Diagnostics Namespace

Online Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


LoggingProfile.OnEntryLevel Property

LoggingProfile OnEntryLevel Property PostSharp Documentation
Gets or sets the severity level for logging before method execution.

Namespace: PostSharp.Patterns.Diagnostics
Assembly: PostSharp.Patterns.Diagnostics (in PostSharp.Patterns.Diagnostics.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
public Nullable<LogLevel> OnEntryLevel { get; set; }
public Nullable<LogLevel> OnEntryLevel { get; set; }
Property Value
Type:   Online Nullable  LogLevel
See Also
LoggingProfile Class
LoggingProfile Members
PostSharp.Patterns.Diagnostics Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


LoggingProfile.OnEntryOptions Property

LoggingProfile OnEntryOptions Property PostSharp Documentation
Gets or sets options for logging before method execution.

Namespace: PostSharp.Patterns.Diagnostics
Assembly: PostSharp.Patterns.Diagnostics (in PostSharp.Patterns.Diagnostics.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
public Nullable<LogOptions> OnEntryOptions { get; set; }
public Nullable<LogOptions> OnEntryOptions { get; set; }
Property Value
Type:   Online Nullable  LogOptions
See Also
LoggingProfile Class
LoggingProfile Members
PostSharp.Patterns.Diagnostics Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


LoggingProfile.OnExceptionLevel Property

LoggingProfile OnExceptionLevel Property PostSharp Documentation
Gets or sets the severity level for logging on method exception.

Namespace: PostSharp.Patterns.Diagnostics
Assembly: PostSharp.Patterns.Diagnostics (in PostSharp.Patterns.Diagnostics.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
public Nullable<LogLevel> OnExceptionLevel { get; set; }
public Nullable<LogLevel> OnExceptionLevel { get; set; }
Property Value
Type:   Online Nullable  LogLevel
See Also
LoggingProfile Class
LoggingProfile Members
PostSharp.Patterns.Diagnostics Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


LoggingProfile.OnExceptionOptions Property

LoggingProfile OnExceptionOptions Property PostSharp Documentation
Gets or sets options for logging on method exception.

Namespace: PostSharp.Patterns.Diagnostics
Assembly: PostSharp.Patterns.Diagnostics (in PostSharp.Patterns.Diagnostics.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
public Nullable<LogOptions> OnExceptionOptions { get; set; }
public Nullable<LogOptions> OnExceptionOptions { get; set; }
Property Value
Type:   Online Nullable  LogOptions
See Also
LoggingProfile Class
LoggingProfile Members
PostSharp.Patterns.Diagnostics Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


LoggingProfile.OnSuccessLevel Property

LoggingProfile OnSuccessLevel Property PostSharp Documentation
Gets or sets the severity level for logging on method success.

Namespace: PostSharp.Patterns.Diagnostics
Assembly: PostSharp.Patterns.Diagnostics (in PostSharp.Patterns.Diagnostics.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
public Nullable<LogLevel> OnSuccessLevel { get; set; }
public Nullable<LogLevel> OnSuccessLevel { get; set; }
Property Value
Type:   Online Nullable  LogLevel
See Also
LoggingProfile Class
LoggingProfile Members
PostSharp.Patterns.Diagnostics Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


LoggingProfile.OnSuccessOptions Property

LoggingProfile OnSuccessOptions Property PostSharp Documentation
Gets or sets options for logging on method success.

Namespace: PostSharp.Patterns.Diagnostics
Assembly: PostSharp.Patterns.Diagnostics (in PostSharp.Patterns.Diagnostics.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
public Nullable<LogOptions> OnSuccessOptions { get; set; }
public Nullable<LogOptions> OnSuccessOptions { get; set; }
Property Value
Type:   Online Nullable  LogOptions
See Also
LoggingProfile Class
LoggingProfile Members
PostSharp.Patterns.Diagnostics Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


LogLevel Enumeration

LogLevel Enumeration PostSharp Documentation
Specifies the severity of a logged message.

Namespace: PostSharp.Patterns.Diagnostics
Assembly: PostSharp.Patterns.Diagnostics (in PostSharp.Patterns.Diagnostics.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
[SerializableAttribute]
public enum LogLevel
[SerializableAttribute]
public enum LogLevel
Members
Member name | Value | Description
None | 0 | No message should be logged.
Debug | 1 | The message should be logged at Debug/Trace level (when applicable).
Info | 2 | The message should be logged at Info level (when applicable).
Warning | 3 | The message should be logged at Warning level (when applicable).
Error | 4 | The message should be logged at Error level (when applicable).
Fatal | 5 | The message should be logged at Fatal level (when applicable).
See Also
PostSharp.Patterns.Diagnostics Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


LogOptions Enumeration

LogOptions Enumeration PostSharp Documentation
Specifies the options for logging parameter names, types and values.

Namespace: PostSharp.Patterns.Diagnostics
Assembly: PostSharp.Patterns.Diagnostics (in PostSharp.Patterns.Diagnostics.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
[SerializableAttribute]
[FlagsAttribute]
public enum LogOptions
[SerializableAttribute]
[FlagsAttribute]
public enum LogOptions
Members
Member name | Value | Description
None | 0 | No parameter information included.
IncludeParameterType | 1 | Includes parameter type information.
IncludeParameterName | 2 | Includes parameter name.
IncludeParameterValue | 4 | Includes parameter value, by calling Online ToString on the object instance.
IncludeReturnValue | 8 | Includes the return value.
IncludeThisArgument | 16 | Includes the value of this argument in an instance method.
See Also
PostSharp.Patterns.Diagnostics Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


PostSharp.Patterns.Model Namespace

PostSharp.Patterns.Model Namespace PostSharp Documentation
The PostSharp.Patterns.Model namespace contains an implementation of the Observer pattern (INotifyPropertyChanged interface).
Classes
 | Class | Description
Public class | Depends | Provides a way to specify dependencies of a method to properties or chains of properties. This class should be used from methods marked with the SafeForDependencyAnalysisAttribute custom attribute.
Public class | IgnoreAutoChangeNotificationAttribute | Custom attribute that, when applied to a method, prevents the NotifyPropertyChangedAttribute aspect to raise change notifications for this property.
Public class | NotifyPropertyChangedAttribute | Custom attribute that, when applied on a type, causes PostSharp to implement the Online INotifyPropertyChanged for this class and all children classes.
Public class | NotifyPropertyChangedOverflowException | Exception thrown at runtime when the NotifyPropertyChangedAttribute aspect encounters an excessively long chain is dependency. This situation is typically caused by a cyclic dependency.
Public class | PureAttribute | Custom attribute that, when applied on a method, specifies that this method is a pure function, i.e. the method always returns the same result given the same parameter values. In the context of NotifyPropertyChangedAttribute, it is also assumed that pure functions have only parameters of primitive types ( Online Int32, Online String, ...). The Online Object parameter type is also accepted, but then it is assumed that instances passed are immutable (and changes to these objects will not be tracked).
Public class | SafeForDependencyAnalysisAttribute | Custom attribute that, when applied on a property, prevents the dependency analysis algorithm used by the NotifyPropertyChangedAttribute aspect from emitting errors when it encounters constructs that it cannot analyze.

Online Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


Depends Class

Depends Class PostSharp Documentation
Provides a way to specify dependencies of a method to properties or chains of properties. This class should be used from methods marked with the SafeForDependencyAnalysisAttribute custom attribute.
Inheritance Hierarchy
Online System Object
PostSharp.Patterns.Model Depends

Namespace: PostSharp.Patterns.Model
Assembly: PostSharp.Patterns.Model (in PostSharp.Patterns.Model.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
public static class Depends
public static class Depends
Remarks
Members of this class are considered metadata-only. They are used only at build time, where
            their arguments are decompiled. They have no runtime effect. For performance reason, it is preferable to
            skip their runtime execution. This can be achieved by using the Guard field in the construct:

View Colorized Copy to Clipboard Print
if ( Depends.Guard )
{
  Depends.On(this.foo.Bar);
}
if ( Depends.Guard )
{
  Depends.On(this.foo.Bar);
}
See Also
Depends Members
PostSharp.Patterns.Model Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


Depends Members

Depends Members PostSharp Documentation

The Depends type exposes the following members.
Methods
Name | Description
On(Object) | Specifies an explicit dependency between the calling method and the argument passed to this method.
On(Object, Object) | Specifies an explicit dependency between the calling method and the arguments passed to this method.
On(Object, Object, Object) | Specifies an explicit dependency between the calling method and the arguments passed to this method.
On(Object, Object, Object, Object) | Specifies an explicit dependency between the calling method and the arguments passed to this method.
On(Object, Object, Object, Object, Object) | Specifies an explicit dependency between the calling method and the arguments passed to this method.
On(Object, Object, Object, Object, Object, Object) | Specifies an explicit dependency between the calling method and the arguments passed to this method.
On(Object, Object, Object, Object, Object, Object, Object) | Specifies an explicit dependency between the calling method and the arguments passed to this method.
On(Object, Object, Object, Object, Object, Object, Object, Object) | Specifies an explicit dependency between the calling method and the arguments passed to this method.
On(Object, Object, Object, Object, Object, Object, Object, Object, Object) | Specifies an explicit dependency between the calling method and the arguments passed to this method.
On(Object, Object, Object, Object, Object, Object, Object, Object, Object, Object) | Specifies an explicit dependency between the calling method and the arguments passed to this method.
Back to Top
Fields
Name | Description
Guard |
Back to Top
See Also
Depends Class
PostSharp.Patterns.Model Namespace

Online Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


Depends Fields

Depends Fields PostSharp Documentation
The Depends type exposes the following members.
Fields
Name | Description
Guard |
Back to Top
See Also
Depends Class
PostSharp.Patterns.Model Namespace

Online Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


Depends.Guard Field

Depends Guard Field PostSharp Documentation

[Missing <summary> documentation for "F:PostSharp.Patterns.Model.Depends.Guard"]

Namespace: PostSharp.Patterns.Model
Assembly: PostSharp.Patterns.Model (in PostSharp.Patterns.Model.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
public static readonly bool Guard
public static readonly bool Guard
Field Value
Type:   Online Boolean
See Also
Depends Class
Depends Members
PostSharp.Patterns.Model Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


Depends Methods

Depends Methods PostSharp Documentation
Methods
Name | Description
On(Object) | Specifies an explicit dependency between the calling method and the argument passed to this method.
On(Object, Object) | Specifies an explicit dependency between the calling method and the arguments passed to this method.
On(Object, Object, Object) | Specifies an explicit dependency between the calling method and the arguments passed to this method.
On(Object, Object, Object, Object) | Specifies an explicit dependency between the calling method and the arguments passed to this method.
On(Object, Object, Object, Object, Object) | Specifies an explicit dependency between the calling method and the arguments passed to this method.
On(Object, Object, Object, Object, Object, Object) | Specifies an explicit dependency between the calling method and the arguments passed to this method.
On(Object, Object, Object, Object, Object, Object, Object) | Specifies an explicit dependency between the calling method and the arguments passed to this method.
On(Object, Object, Object, Object, Object, Object, Object, Object) | Specifies an explicit dependency between the calling method and the arguments passed to this method.
On(Object, Object, Object, Object, Object, Object, Object, Object, Object) | Specifies an explicit dependency between the calling method and the arguments passed to this method.
On(Object, Object, Object, Object, Object, Object, Object, Object, Object, Object) | Specifies an explicit dependency between the calling method and the arguments passed to this method.
Back to Top
See Also
Depends Class
PostSharp.Patterns.Model Namespace

Online Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


Depends.On Method

Depends On Method PostSharp Documentation
Overload List
Name | Description
On(Object) | Specifies an explicit dependency between the calling method and the argument passed to this method.
On(Object, Object) | Specifies an explicit dependency between the calling method and the arguments passed to this method.
On(Object, Object, Object) | Specifies an explicit dependency between the calling method and the arguments passed to this method.
On(Object, Object, Object, Object) | Specifies an explicit dependency between the calling method and the arguments passed to this method.
On(Object, Object, Object, Object, Object) | Specifies an explicit dependency between the calling method and the arguments passed to this method.
On(Object, Object, Object, Object, Object, Object) | Specifies an explicit dependency between the calling method and the arguments passed to this method.
On(Object, Object, Object, Object, Object, Object, Object) | Specifies an explicit dependency between the calling method and the arguments passed to this method.
On(Object, Object, Object, Object, Object, Object, Object, Object) | Specifies an explicit dependency between the calling method and the arguments passed to this method.
On(Object, Object, Object, Object, Object, Object, Object, Object, Object) | Specifies an explicit dependency between the calling method and the arguments passed to this method.
On(Object, Object, Object, Object, Object, Object, Object, Object, Object, Object) | Specifies an explicit dependency between the calling method and the arguments passed to this method.
Back to Top
See Also
Depends Class
Depends Members
PostSharp.Patterns.Model Namespace

Online Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


Depends.On Method (Object)

Depends On Method (Object) PostSharp Documentation
Specifies an explicit dependency between the calling method and the argument passed to this method.

Namespace: PostSharp.Patterns.Model
Assembly: PostSharp.Patterns.Model (in PostSharp.Patterns.Model.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
public static void On(
    Object dependency1
)
public static void On(
    Object dependency1
)
Parameters
dependency1
Type:   Online System Object
[Missing <param name="dependency1"/> documentation for "M:PostSharp.Patterns.Model.Depends.On(System.Object)"]
See Also
Depends Class
Depends Members
On Overload
PostSharp.Patterns.Model Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


Depends.On Method (Object, Object)

Depends On Method (Object, Object) PostSharp Documentation
Specifies an explicit dependency between the calling method and the arguments passed to this method.

Namespace: PostSharp.Patterns.Model
Assembly: PostSharp.Patterns.Model (in PostSharp.Patterns.Model.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
public static void On(
    Object dependency1,
    Object dependency2
)
public static void On(
    Object dependency1,
    Object dependency2
)
Parameters
dependency1
Type:   Online System Object
[Missing <param name="dependency1"/> documentation for "M:PostSharp.Patterns.Model.Depends.On(System.Object,System.Object)"]
dependency2
Type:   Online System Object
[Missing <param name="dependency2"/> documentation for "M:PostSharp.Patterns.Model.Depends.On(System.Object,System.Object)"]
See Also
Depends Class
Depends Members
On Overload
PostSharp.Patterns.Model Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


Depends.On Method (Object, Object, Object)

Depends On Method (Object, Object, Object) PostSharp Documentation
Specifies an explicit dependency between the calling method and the arguments passed to this method.

Namespace: PostSharp.Patterns.Model
Assembly: PostSharp.Patterns.Model (in PostSharp.Patterns.Model.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
public static void On(
    Object dependency1,
    Object dependency2,
    Object dependency3
)
public static void On(
    Object dependency1,
    Object dependency2,
    Object dependency3
)
Parameters
dependency1
Type:   Online System Object
[Missing <param name="dependency1"/> documentation for "M:PostSharp.Patterns.Model.Depends.On(System.Object,System.Object,System.Object)"]
dependency2
Type:   Online System Object
[Missing <param name="dependency2"/> documentation for "M:PostSharp.Patterns.Model.Depends.On(System.Object,System.Object,System.Object)"]
dependency3
Type:   Online System Object
[Missing <param name="dependency3"/> documentation for "M:PostSharp.Patterns.Model.Depends.On(System.Object,System.Object,System.Object)"]
See Also
Depends Class
Depends Members
On Overload
PostSharp.Patterns.Model Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


Depends.On Method (Object, Object, Object, Object)

Depends On Method (Object, Object, Object, Object) PostSharp Documentation
Specifies an explicit dependency between the calling method and the arguments passed to this method.

Namespace: PostSharp.Patterns.Model
Assembly: PostSharp.Patterns.Model (in PostSharp.Patterns.Model.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
public static void On(
    Object dependency1,
    Object dependency2,
    Object dependency3,
    Object dependency4
)
public static void On(
    Object dependency1,
    Object dependency2,
    Object dependency3,
    Object dependency4
)
Parameters
dependency1
Type:   Online System Object
[Missing <param name="dependency1"/> documentation for "M:PostSharp.Patterns.Model.Depends.On(System.Object,System.Object,System.Object,System.Object)"]
dependency2
Type:   Online System Object
[Missing <param name="dependency2"/> documentation for "M:PostSharp.Patterns.Model.Depends.On(System.Object,System.Object,System.Object,System.Object)"]
dependency3
Type:   Online System Object
[Missing <param name="dependency3"/> documentation for "M:PostSharp.Patterns.Model.Depends.On(System.Object,System.Object,System.Object,System.Object)"]
dependency4
Type:   Online System Object
[Missing <param name="dependency4"/> documentation for "M:PostSharp.Patterns.Model.Depends.On(System.Object,System.Object,System.Object,System.Object)"]
See Also
Depends Class
Depends Members
On Overload
PostSharp.Patterns.Model Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


Depends.On Method (Object, Object, Object, Object, Object)

Depends On Method (Object, Object, Object, Object, Object) PostSharp Documentation
Specifies an explicit dependency between the calling method and the arguments passed to this method.

Namespace: PostSharp.Patterns.Model
Assembly: PostSharp.Patterns.Model (in PostSharp.Patterns.Model.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
public static void On(
    Object dependency1,
    Object dependency2,
    Object dependency3,
    Object dependency4,
    Object dependency5
)
public static void On(
    Object dependency1,
    Object dependency2,
    Object dependency3,
    Object dependency4,
    Object dependency5
)
Parameters
dependency1
Type:   Online System Object
[Missing <param name="dependency1"/> documentation for "M:PostSharp.Patterns.Model.Depends.On(System.Object,System.Object,System.Object,System.Object,System.Object)"]
dependency2
Type:   Online System Object
[Missing <param name="dependency2"/> documentation for "M:PostSharp.Patterns.Model.Depends.On(System.Object,System.Object,System.Object,System.Object,System.Object)"]
dependency3
Type:   Online System Object
[Missing <param name="dependency3"/> documentation for "M:PostSharp.Patterns.Model.Depends.On(System.Object,System.Object,System.Object,System.Object,System.Object)"]
dependency4
Type:   Online System Object
[Missing <param name="dependency4"/> documentation for "M:PostSharp.Patterns.Model.Depends.On(System.Object,System.Object,System.Object,System.Object,System.Object)"]
dependency5
Type:   Online System Object
[Missing <param name="dependency5"/> documentation for "M:PostSharp.Patterns.Model.Depends.On(System.Object,System.Object,System.Object,System.Object,System.Object)"]
See Also
Depends Class
Depends Members
On Overload
PostSharp.Patterns.Model Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


Depends.On Method (Object, Object, Object, Object, Object, Object)

Depends On Method (Object, Object, Object, Object, Object, Object) PostSharp Documentation
Specifies an explicit dependency between the calling method and the arguments passed to this method.

Namespace: PostSharp.Patterns.Model
Assembly: PostSharp.Patterns.Model (in PostSharp.Patterns.Model.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
public static void On(
    Object dependency1,
    Object dependency2,
    Object dependency3,
    Object dependency4,
    Object dependency5,
    Object dependency6
)
public static void On(
    Object dependency1,
    Object dependency2,
    Object dependency3,
    Object dependency4,
    Object dependency5,
    Object dependency6
)
Parameters
dependency1
Type:   Online System Object
[Missing <param name="dependency1"/> documentation for "M:PostSharp.Patterns.Model.Depends.On(System.Object,System.Object,System.Object,System.Object,System.Object,System.Object)"]
dependency2
Type:   Online System Object
[Missing <param name="dependency2"/> documentation for "M:PostSharp.Patterns.Model.Depends.On(System.Object,System.Object,System.Object,System.Object,System.Object,System.Object)"]
dependency3
Type:   Online System Object
[Missing <param name="dependency3"/> documentation for "M:PostSharp.Patterns.Model.Depends.On(System.Object,System.Object,System.Object,System.Object,System.Object,System.Object)"]
dependency4
Type:   Online System Object
[Missing <param name="dependency4"/> documentation for "M:PostSharp.Patterns.Model.Depends.On(System.Object,System.Object,System.Object,System.Object,System.Object,System.Object)"]
dependency5
Type:   Online System Object
[Missing <param name="dependency5"/> documentation for "M:PostSharp.Patterns.Model.Depends.On(System.Object,System.Object,System.Object,System.Object,System.Object,System.Object)"]
dependency6
Type:   Online System Object
[Missing <param name="dependency6"/> documentation for "M:PostSharp.Patterns.Model.Depends.On(System.Object,System.Object,System.Object,System.Object,System.Object,System.Object)"]
See Also
Depends Class
Depends Members
On Overload
PostSharp.Patterns.Model Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


Depends.On Method (Object, Object, Object, Object, Object, Object, Object)

Depends On Method (Object, Object, Object, Object, Object, Object, Object) PostSharp Documentation
Specifies an explicit dependency between the calling method and the arguments passed to this method.

Namespace: PostSharp.Patterns.Model
Assembly: PostSharp.Patterns.Model (in PostSharp.Patterns.Model.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
public static void On(
    Object dependency1,
    Object dependency2,
    Object dependency3,
    Object dependency4,
    Object dependency5,
    Object dependency6,
    Object dependency7
)
public static void On(
    Object dependency1,
    Object dependency2,
    Object dependency3,
    Object dependency4,
    Object dependency5,
    Object dependency6,
    Object dependency7
)
Parameters
dependency1
Type:   Online System Object
[Missing <param name="dependency1"/> documentation for "M:PostSharp.Patterns.Model.Depends.On(System.Object,System.Object,System.Object,System.Object,System.Object,System.Object,System.Object)"]
dependency2
Type:   Online System Object
[Missing <param name="dependency2"/> documentation for "M:PostSharp.Patterns.Model.Depends.On(System.Object,System.Object,System.Object,System.Object,System.Object,System.Object,System.Object)"]
dependency3
Type:   Online System Object
[Missing <param name="dependency3"/> documentation for "M:PostSharp.Patterns.Model.Depends.On(System.Object,System.Object,System.Object,System.Object,System.Object,System.Object,System.Object)"]
dependency4
Type:   Online System Object
[Missing <param name="dependency4"/> documentation for "M:PostSharp.Patterns.Model.Depends.On(System.Object,System.Object,System.Object,System.Object,System.Object,System.Object,System.Object)"]
dependency5
Type:   Online System Object
[Missing <param name="dependency5"/> documentation for "M:PostSharp.Patterns.Model.Depends.On(System.Object,System.Object,System.Object,System.Object,System.Object,System.Object,System.Object)"]
dependency6
Type:   Online System Object
[Missing <param name="dependency6"/> documentation for "M:PostSharp.Patterns.Model.Depends.On(System.Object,System.Object,System.Object,System.Object,System.Object,System.Object,System.Object)"]
dependency7
Type:   Online System Object
[Missing <param name="dependency7"/> documentation for "M:PostSharp.Patterns.Model.Depends.On(System.Object,System.Object,System.Object,System.Object,System.Object,System.Object,System.Object)"]
See Also
Depends Class
Depends Members
On Overload
PostSharp.Patterns.Model Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


Depends.On Method (Object, Object, Object, Object, Object, Object, Object, Object)

Depends On Method (Object, Object, Object, Object, Object, Object, Object, Object) PostSharp Documentation
Specifies an explicit dependency between the calling method and the arguments passed to this method.

Namespace: PostSharp.Patterns.Model
Assembly: PostSharp.Patterns.Model (in PostSharp.Patterns.Model.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
public static void On(
    Object dependency1,
    Object dependency2,
    Object dependency3,
    Object dependency4,
    Object dependency5,
    Object dependency6,
    Object dependency7,
    Object dependency8
)
public static void On(
    Object dependency1,
    Object dependency2,
    Object dependency3,
    Object dependency4,
    Object dependency5,
    Object dependency6,
    Object dependency7,
    Object dependency8
)
Parameters
dependency1
Type:   Online System Object
[Missing <param name="dependency1"/> documentation for "M:PostSharp.Patterns.Model.Depends.On(System.Object,System.Object,System.Object,System.Object,System.Object,System.Object,System.Object,System.Object)"]
dependency2
Type:   Online System Object
[Missing <param name="dependency2"/> documentation for "M:PostSharp.Patterns.Model.Depends.On(System.Object,System.Object,System.Object,System.Object,System.Object,System.Object,System.Object,System.Object)"]
dependency3
Type:   Online System Object
[Missing <param name="dependency3"/> documentation for "M:PostSharp.Patterns.Model.Depends.On(System.Object,System.Object,System.Object,System.Object,System.Object,System.Object,System.Object,System.Object)"]
dependency4
Type:   Online System Object
[Missing <param name="dependency4"/> documentation for "M:PostSharp.Patterns.Model.Depends.On(System.Object,System.Object,System.Object,System.Object,System.Object,System.Object,System.Object,System.Object)"]
dependency5
Type:   Online System Object
[Missing <param name="dependency5"/> documentation for "M:PostSharp.Patterns.Model.Depends.On(System.Object,System.Object,System.Object,System.Object,System.Object,System.Object,System.Object,System.Object)"]
dependency6
Type:   Online System Object
[Missing <param name="dependency6"/> documentation for "M:PostSharp.Patterns.Model.Depends.On(System.Object,System.Object,System.Object,System.Object,System.Object,System.Object,System.Object,System.Object)"]
dependency7
Type:   Online System Object
[Missing <param name="dependency7"/> documentation for "M:PostSharp.Patterns.Model.Depends.On(System.Object,System.Object,System.Object,System.Object,System.Object,System.Object,System.Object,System.Object)"]
dependency8
Type:   Online System Object
[Missing <param name="dependency8"/> documentation for "M:PostSharp.Patterns.Model.Depends.On(System.Object,System.Object,System.Object,System.Object,System.Object,System.Object,System.Object,System.Object)"]
See Also
Depends Class
Depends Members
On Overload
PostSharp.Patterns.Model Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


Depends.On Method (Object, Object, Object, Object, Object, Object, Object, Object, Object)

Depends On Method (Object, Object, Object, Object, Object, Object, Object, Object, Object) PostSharp Documentation
Specifies an explicit dependency between the calling method and the arguments passed to this method.

Namespace: PostSharp.Patterns.Model
Assembly: PostSharp.Patterns.Model (in PostSharp.Patterns.Model.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
public static void On(
    Object dependency1,
    Object dependency2,
    Object dependency3,
    Object dependency4,
    Object dependency5,
    Object dependency6,
    Object dependency7,
    Object dependency8,
    Object dependency9
)
public static void On(
    Object dependency1,
    Object dependency2,
    Object dependency3,
    Object dependency4,
    Object dependency5,
    Object dependency6,
    Object dependency7,
    Object dependency8,
    Object dependency9
)
Parameters
dependency1
Type:   Online System Object
[Missing <param name="dependency1"/> documentation for "M:PostSharp.Patterns.Model.Depends.On(System.Object,System.Object,System.Object,System.Object,System.Object,System.Object,System.Object,System.Object,System.Object)"]
dependency2
Type:   Online System Object
[Missing <param name="dependency2"/> documentation for "M:PostSharp.Patterns.Model.Depends.On(System.Object,System.Object,System.Object,System.Object,System.Object,System.Object,System.Object,System.Object,System.Object)"]
dependency3
Type:   Online System Object
[Missing <param name="dependency3"/> documentation for "M:PostSharp.Patterns.Model.Depends.On(System.Object,System.Object,System.Object,System.Object,System.Object,System.Object,System.Object,System.Object,System.Object)"]
dependency4
Type:   Online System Object
[Missing <param name="dependency4"/> documentation for "M:PostSharp.Patterns.Model.Depends.On(System.Object,System.Object,System.Object,System.Object,System.Object,System.Object,System.Object,System.Object,System.Object)"]
dependency5
Type:   Online System Object
[Missing <param name="dependency5"/> documentation for "M:PostSharp.Patterns.Model.Depends.On(System.Object,System.Object,System.Object,System.Object,System.Object,System.Object,System.Object,System.Object,System.Object)"]
dependency6
Type:   Online System Object
[Missing <param name="dependency6"/> documentation for "M:PostSharp.Patterns.Model.Depends.On(System.Object,System.Object,System.Object,System.Object,System.Object,System.Object,System.Object,System.Object,System.Object)"]
dependency7
Type:   Online System Object
[Missing <param name="dependency7"/> documentation for "M:PostSharp.Patterns.Model.Depends.On(System.Object,System.Object,System.Object,System.Object,System.Object,System.Object,System.Object,System.Object,System.Object)"]
dependency8
Type:   Online System Object
[Missing <param name="dependency8"/> documentation for "M:PostSharp.Patterns.Model.Depends.On(System.Object,System.Object,System.Object,System.Object,System.Object,System.Object,System.Object,System.Object,System.Object)"]
dependency9
Type:   Online System Object
[Missing <param name="dependency9"/> documentation for "M:PostSharp.Patterns.Model.Depends.On(System.Object,System.Object,System.Object,System.Object,System.Object,System.Object,System.Object,System.Object,System.Object)"]
See Also
Depends Class
Depends Members
On Overload
PostSharp.Patterns.Model Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


Depends.On Method (Object, Object, Object, Object, Object, Object, Object, Object, Object, Object)

Depends On Method (Object, Object, Object, Object, Object, Object, Object, Object, Object, Object) PostSharp Documentation
Specifies an explicit dependency between the calling method and the arguments passed to this method.

Namespace: PostSharp.Patterns.Model
Assembly: PostSharp.Patterns.Model (in PostSharp.Patterns.Model.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
public static void On(
    Object dependency1,
    Object dependency2,
    Object dependency3,
    Object dependency4,
    Object dependency5,
    Object dependency6,
    Object dependency7,
    Object dependency8,
    Object dependency9,
    Object dependency10
)
public static void On(
    Object dependency1,
    Object dependency2,
    Object dependency3,
    Object dependency4,
    Object dependency5,
    Object dependency6,
    Object dependency7,
    Object dependency8,
    Object dependency9,
    Object dependency10
)
Parameters
dependency1
Type:   Online System Object
[Missing <param name="dependency1"/> documentation for "M:PostSharp.Patterns.Model.Depends.On(System.Object,System.Object,System.Object,System.Object,System.Object,System.Object,System.Object,System.Object,System.Object,System.Object)"]
dependency2
Type:   Online System Object
[Missing <param name="dependency2"/> documentation for "M:PostSharp.Patterns.Model.Depends.On(System.Object,System.Object,System.Object,System.Object,System.Object,System.Object,System.Object,System.Object,System.Object,System.Object)"]
dependency3
Type:   Online System Object
[Missing <param name="dependency3"/> documentation for "M:PostSharp.Patterns.Model.Depends.On(System.Object,System.Object,System.Object,System.Object,System.Object,System.Object,System.Object,System.Object,System.Object,System.Object)"]
dependency4
Type:   Online System Object
[Missing <param name="dependency4"/> documentation for "M:PostSharp.Patterns.Model.Depends.On(System.Object,System.Object,System.Object,System.Object,System.Object,System.Object,System.Object,System.Object,System.Object,System.Object)"]
dependency5
Type:   Online System Object
[Missing <param name="dependency5"/> documentation for "M:PostSharp.Patterns.Model.Depends.On(System.Object,System.Object,System.Object,System.Object,System.Object,System.Object,System.Object,System.Object,System.Object,System.Object)"]
dependency6
Type:   Online System Object
[Missing <param name="dependency6"/> documentation for "M:PostSharp.Patterns.Model.Depends.On(System.Object,System.Object,System.Object,System.Object,System.Object,System.Object,System.Object,System.Object,System.Object,System.Object)"]
dependency7
Type:   Online System Object
[Missing <param name="dependency7"/> documentation for "M:PostSharp.Patterns.Model.Depends.On(System.Object,System.Object,System.Object,System.Object,System.Object,System.Object,System.Object,System.Object,System.Object,System.Object)"]
dependency8
Type:   Online System Object
[Missing <param name="dependency8"/> documentation for "M:PostSharp.Patterns.Model.Depends.On(System.Object,System.Object,System.Object,System.Object,System.Object,System.Object,System.Object,System.Object,System.Object,System.Object)"]
dependency9
Type:   Online System Object
[Missing <param name="dependency9"/> documentation for "M:PostSharp.Patterns.Model.Depends.On(System.Object,System.Object,System.Object,System.Object,System.Object,System.Object,System.Object,System.Object,System.Object,System.Object)"]
dependency10
Type:   Online System Object
[Missing <param name="dependency10"/> documentation for "M:PostSharp.Patterns.Model.Depends.On(System.Object,System.Object,System.Object,System.Object,System.Object,System.Object,System.Object,System.Object,System.Object,System.Object)"]
See Also
Depends Class
Depends Members
On Overload
PostSharp.Patterns.Model Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


IgnoreAutoChangeNotificationAttribute Class

IgnoreAutoChangeNotificationAttribute Class PostSharp Documentation
Custom attribute that, when applied to a method, prevents the NotifyPropertyChangedAttribute aspect to raise change notifications for this property.
Inheritance Hierarchy
Online System Object
Online System Attribute
PostSharp.Patterns.Model IgnoreAutoChangeNotificationAttribute

Namespace: PostSharp.Patterns.Model
Assembly: PostSharp.Patterns.Model (in PostSharp.Patterns.Model.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
public sealed class IgnoreAutoChangeNotificationAttribute : Attribute
public sealed class IgnoreAutoChangeNotificationAttribute : Attribute
See Also
IgnoreAutoChangeNotificationAttribute Members
PostSharp.Patterns.Model Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


IgnoreAutoChangeNotificationAttribute Members

IgnoreAutoChangeNotificationAttribute Members PostSharp Documentation

The IgnoreAutoChangeNotificationAttribute type exposes the following members.
Constructors
 | Name | Description
Public method | IgnoreAutoChangeNotificationAttribute | Initializes a new instance of the IgnoreAutoChangeNotificationAttribute class
Back to Top
See Also
IgnoreAutoChangeNotificationAttribute Class
PostSharp.Patterns.Model Namespace

Online Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


IgnoreAutoChangeNotificationAttribute Constructor

IgnoreAutoChangeNotificationAttribute Constructor PostSharp Documentation
Initializes a new instance of the IgnoreAutoChangeNotificationAttribute class

Namespace: PostSharp.Patterns.Model
Assembly: PostSharp.Patterns.Model (in PostSharp.Patterns.Model.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
public IgnoreAutoChangeNotificationAttribute()
public IgnoreAutoChangeNotificationAttribute()
See Also
IgnoreAutoChangeNotificationAttribute Class
IgnoreAutoChangeNotificationAttribute Members
PostSharp.Patterns.Model Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


NotifyPropertyChangedAttribute Class

NotifyPropertyChangedAttribute Class PostSharp Documentation
Custom attribute that, when applied on a type, causes PostSharp to implement the Online INotifyPropertyChanged for this class and all children classes.
Inheritance Hierarchy
Online System Object
Online System Attribute
PostSharp.Extensibility MulticastAttribute
PostSharp.Aspects Aspect
PostSharp.Aspects TypeLevelAspect
PostSharp.Aspects InstanceLevelAspect
PostSharp.Patterns.Model NotifyPropertyChangedAttribute

Namespace: PostSharp.Patterns.Model
Assembly: PostSharp.Patterns.Model (in PostSharp.Patterns.Model.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
public sealed class NotifyPropertyChangedAttribute : InstanceLevelAspect,
    ISerializationCallback, INotifyPropertyChangedController, INotifyChildPropertyChanged, INotifyPropertyChanged
public sealed class NotifyPropertyChangedAttribute : InstanceLevelAspect,
    ISerializationCallback, INotifyPropertyChangedController, INotifyChildPropertyChanged, INotifyPropertyChanged
Remarks
The aspect analyzes dependencies between property getters and fields. The aspect understands indirect dependencies. For instance, a property
            getter may depend on several other methods or property getters, which in turn can depend on other methods or fields. The algorithm is not able
            to analyze calls to virtual methods or delegates (because of prohibitive computational cost), and will only try to analyze methods in the current class.

                The aspect will emit a build-time error will be emitted if it is not able to understand your code. In this case, you exclude the property from
            automatic change notification by applying the IgnoreAutoChangeNotificationAttribute custom attribute to the bothersome property, or
            SafeForDependencyAnalysisAttribute to ignore the warnings of the dependency analysis engine. You will then need to specify dependencies explicitly using
            the Depends class. You can also mark a helper method with the PureAttribute to make it safe from use in a property getter.
            For instance, the string.Format method is pure.

See Also
NotifyPropertyChangedAttribute Members
PostSharp.Patterns.Model Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


NotifyPropertyChangedAttribute Members

NotifyPropertyChangedAttribute Members PostSharp Documentation

The NotifyPropertyChangedAttribute type exposes the following members.
Constructors
 | Name | Description
Public method | NotifyPropertyChangedAttribute | Initializes a new instance of the NotifyPropertyChangedAttribute class
Back to Top
Methods
 | Name | Description
Public method | CompileTimeInitialize | Method invoked at build time to initialize the instance fields of the current aspect. This method is invoked before any other build-time method. (Inherited from TypeLevelAspect.)
Public method | CompileTimeValidate | Method invoked at build time to ensure that the aspect has been applied to the right target. (Inherited from Aspect.)
Public method | CreateInstance | (Overrides InstanceLevelAspect CreateInstance(AdviceArgs).)
Public method | GetAspectConfiguration | Method invoked at build tome to get the imperative configuration of the current Aspect. (Inherited from Aspect.)
Public method | OnCloned | (Overrides InstanceLevelAspect OnCloned(ICloneAwareAspect).)
Public method | RuntimeInitialize | Initializes the current aspect. (Inherited from TypeLevelAspect.)
Public method | RuntimeInitializeInstance | Initializes the aspect instance. This method is invoked when all system elements of the aspect (like member imports) have completed. (Inherited from InstanceLevelAspect.)
Back to Top
Properties
 | Name | Description
Public property | AspectPriority | Gets or sets the weaving priority of the aspect. (Inherited from Aspect.)
Public property | AttributeExclude | If true, indicates that this attribute removes all other instances of the same attribute type from the set of elements defined by the current instance. (Inherited from MulticastAttribute.)
Public property | AttributeId | Obsolete. (Inherited from MulticastAttribute.)
Public property | AttributeInheritance | Determines whether this attribute is inherited (Inherited from MulticastAttribute.)
Public property | AttributePriority | Gets or sets the priority of the current attribute in case that multiple instances are defined on the same element (lower values are processed before). (Inherited from MulticastAttribute.)
Public property | AttributeReplace | Determines whether this attribute replaces other attributes found on the target declarations. (Inherited from MulticastAttribute.)
Public property | AttributeTargetAssemblies | Gets or sets the assemblies to which the current attribute apply. (Inherited from MulticastAttribute.)
Public property | AttributeTargetElements | Gets or sets the kind of elements to which this custom attributes applies. (Inherited from MulticastAttribute.)
Public property | AttributeTargetExternalMemberAttributes | Gets or sets the visibilities, scopes, virtualities, and implementation of members to which this attribute applies, when the member is external to the current module. (Inherited from MulticastAttribute.)
Public property | AttributeTargetExternalTypeAttributes | Gets or sets the visibilities of types to which this attribute applies, when this type is external to the current module. (Inherited from MulticastAttribute.)
Public property | AttributeTargetMemberAttributes | Gets or sets the visibilities, scopes, virtualities, and implementation of members to which this attribute applies. (Inherited from MulticastAttribute.)
Public property | AttributeTargetMembers | Gets or sets the expression specifying to which members this instance applies. (Inherited from MulticastAttribute.)
Public property | AttributeTargetParameterAttributes | Gets or sets the passing style (by value, out or ref) of parameters to which this attribute applies. (Inherited from MulticastAttribute.)
Public property | AttributeTargetParameters | Gets or sets the expression specifying to which parameters this instance applies. (Inherited from MulticastAttribute.)
Public property | AttributeTargetTypeAttributes | Gets or sets the visibilities of types to which this attribute applies. (Inherited from MulticastAttribute.)
Public property | AttributeTargetTypes | Gets or sets the expression specifying to which types this instance applies. (Inherited from MulticastAttribute.)
Public property | Instance | Gets the object to which the current aspect has been applied. (Inherited from InstanceLevelAspect.)
Back to Top
See Also
NotifyPropertyChangedAttribute Class
PostSharp.Patterns.Model Namespace

Online Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


NotifyPropertyChangedAttribute Constructor

NotifyPropertyChangedAttribute Constructor PostSharp Documentation
Initializes a new instance of the NotifyPropertyChangedAttribute class

Namespace: PostSharp.Patterns.Model
Assembly: PostSharp.Patterns.Model (in PostSharp.Patterns.Model.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
public NotifyPropertyChangedAttribute()
public NotifyPropertyChangedAttribute()
See Also
NotifyPropertyChangedAttribute Class
NotifyPropertyChangedAttribute Members
PostSharp.Patterns.Model Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


NotifyPropertyChangedAttribute Constructor

NotifyPropertyChangedAttribute Constructor PostSharp Documentation
Initializes a new instance of the NotifyPropertyChangedAttribute class

Namespace: PostSharp.Patterns.Model
Assembly: PostSharp.Patterns.Model (in PostSharp.Patterns.Model.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
protected NotifyPropertyChangedAttribute(
    PortableFormatterConstructorContext context
)
protected NotifyPropertyChangedAttribute(
    PortableFormatterConstructorContext context
)
Parameters
context
Type: PortableFormatterConstructorContext
[Missing <param name="context"/> documentation for "M:PostSharp.Patterns.Model.NotifyPropertyChangedAttribute.#ctor(PostSharp.Serialization.PortableFormatterConstructorContext)"]
See Also
NotifyPropertyChangedAttribute Class
NotifyPropertyChangedAttribute Members
PostSharp.Patterns.Model Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


NotifyPropertyChangedAttribute Methods

NotifyPropertyChangedAttribute Methods PostSharp Documentation
The NotifyPropertyChangedAttribute type exposes the following members.
Methods
 | Name | Description
Public method | CompileTimeInitialize | Method invoked at build time to initialize the instance fields of the current aspect. This method is invoked before any other build-time method. (Inherited from TypeLevelAspect.)
Public method | CompileTimeValidate | Method invoked at build time to ensure that the aspect has been applied to the right target. (Inherited from Aspect.)
Public method | CreateInstance | (Overrides InstanceLevelAspect CreateInstance(AdviceArgs).)
Public method | GetAspectConfiguration | Method invoked at build tome to get the imperative configuration of the current Aspect. (Inherited from Aspect.)
Public method | OnCloned | (Overrides InstanceLevelAspect OnCloned(ICloneAwareAspect).)
Public method | RuntimeInitialize | Initializes the current aspect. (Inherited from TypeLevelAspect.)
Public method | RuntimeInitializeInstance | Initializes the aspect instance. This method is invoked when all system elements of the aspect (like member imports) have completed. (Inherited from InstanceLevelAspect.)
Back to Top
See Also
NotifyPropertyChangedAttribute Class
PostSharp.Patterns.Model Namespace

Online Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


NotifyPropertyChangedAttribute.CreateInstance Method

NotifyPropertyChangedAttribute CreateInstance Method PostSharp Documentation

[Missing <summary> documentation for "M:PostSharp.Patterns.Model.NotifyPropertyChangedAttribute.CreateInstance(PostSharp.Aspects.AdviceArgs)"]

Namespace: PostSharp.Patterns.Model
Assembly: PostSharp.Patterns.Model (in PostSharp.Patterns.Model.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
public override Object CreateInstance(
    AdviceArgs adviceArgs
)
public override Object CreateInstance(
    AdviceArgs adviceArgs
)
Parameters
adviceArgs
Type: PostSharp.Aspects AdviceArgs
[Missing <param name="adviceArgs"/> documentation for "M:PostSharp.Patterns.Model.NotifyPropertyChangedAttribute.CreateInstance(PostSharp.Aspects.AdviceArgs)"]
Return Value
Type:   Online Object
[Missing <returns> documentation for "M:PostSharp.Patterns.Model.NotifyPropertyChangedAttribute.CreateInstance(PostSharp.Aspects.AdviceArgs)"]
Implements
IInstanceScopedAspect CreateInstance(AdviceArgs)
See Also
NotifyPropertyChangedAttribute Class
NotifyPropertyChangedAttribute Members
PostSharp.Patterns.Model Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


NotifyPropertyChangedAttribute.OnCloned Method

NotifyPropertyChangedAttribute OnCloned Method PostSharp Documentation

[Missing <summary> documentation for "M:PostSharp.Patterns.Model.NotifyPropertyChangedAttribute.OnCloned(PostSharp.Aspects.ICloneAwareAspect)"]

Namespace: PostSharp.Patterns.Model
Assembly: PostSharp.Patterns.Model (in PostSharp.Patterns.Model.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
public override void OnCloned(
    ICloneAwareAspect source
)
public override void OnCloned(
    ICloneAwareAspect source
)
Parameters
source
Type: PostSharp.Aspects ICloneAwareAspect
[Missing <param name="source"/> documentation for "M:PostSharp.Patterns.Model.NotifyPropertyChangedAttribute.OnCloned(PostSharp.Aspects.ICloneAwareAspect)"]
Implements
ICloneAwareAspect OnCloned(ICloneAwareAspect)
See Also
NotifyPropertyChangedAttribute Class
NotifyPropertyChangedAttribute Members
PostSharp.Patterns.Model Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


NotifyPropertyChangedAttribute Properties

NotifyPropertyChangedAttribute Properties PostSharp Documentation
The NotifyPropertyChangedAttribute type exposes the following members.
Properties
 | Name | Description
Public property | AspectPriority | Gets or sets the weaving priority of the aspect. (Inherited from Aspect.)
Public property | AttributeExclude | If true, indicates that this attribute removes all other instances of the same attribute type from the set of elements defined by the current instance. (Inherited from MulticastAttribute.)
Public property | AttributeId | Obsolete. (Inherited from MulticastAttribute.)
Public property | AttributeInheritance | Determines whether this attribute is inherited (Inherited from MulticastAttribute.)
Public property | AttributePriority | Gets or sets the priority of the current attribute in case that multiple instances are defined on the same element (lower values are processed before). (Inherited from MulticastAttribute.)
Public property | AttributeReplace | Determines whether this attribute replaces other attributes found on the target declarations. (Inherited from MulticastAttribute.)
Public property | AttributeTargetAssemblies | Gets or sets the assemblies to which the current attribute apply. (Inherited from MulticastAttribute.)
Public property | AttributeTargetElements | Gets or sets the kind of elements to which this custom attributes applies. (Inherited from MulticastAttribute.)
Public property | AttributeTargetExternalMemberAttributes | Gets or sets the visibilities, scopes, virtualities, and implementation of members to which this attribute applies, when the member is external to the current module. (Inherited from MulticastAttribute.)
Public property | AttributeTargetExternalTypeAttributes | Gets or sets the visibilities of types to which this attribute applies, when this type is external to the current module. (Inherited from MulticastAttribute.)
Public property | AttributeTargetMemberAttributes | Gets or sets the visibilities, scopes, virtualities, and implementation of members to which this attribute applies. (Inherited from MulticastAttribute.)
Public property | AttributeTargetMembers | Gets or sets the expression specifying to which members this instance applies. (Inherited from MulticastAttribute.)
Public property | AttributeTargetParameterAttributes | Gets or sets the passing style (by value, out or ref) of parameters to which this attribute applies. (Inherited from MulticastAttribute.)
Public property | AttributeTargetParameters | Gets or sets the expression specifying to which parameters this instance applies. (Inherited from MulticastAttribute.)
Public property | AttributeTargetTypeAttributes | Gets or sets the visibilities of types to which this attribute applies. (Inherited from MulticastAttribute.)
Public property | AttributeTargetTypes | Gets or sets the expression specifying to which types this instance applies. (Inherited from MulticastAttribute.)
Public property | Instance | Gets the object to which the current aspect has been applied. (Inherited from InstanceLevelAspect.)
Back to Top
See Also
NotifyPropertyChangedAttribute Class
PostSharp.Patterns.Model Namespace

Online Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


NotifyPropertyChangedOverflowException Class

NotifyPropertyChangedOverflowException Class PostSharp Documentation
Exception thrown at runtime when the NotifyPropertyChangedAttribute aspect encounters an excessively long chain is dependency. This situation is typically caused by a cyclic dependency.
Inheritance Hierarchy
Online System Object
Online System Exception
PostSharp.Patterns.Model NotifyPropertyChangedOverflowException

Namespace: PostSharp.Patterns.Model
Assembly: PostSharp.Patterns.Model (in PostSharp.Patterns.Model.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
public sealed class NotifyPropertyChangedOverflowException : Exception
public sealed class NotifyPropertyChangedOverflowException : Exception
See Also
NotifyPropertyChangedOverflowException Members
PostSharp.Patterns.Model Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


NotifyPropertyChangedOverflowException Members

NotifyPropertyChangedOverflowException Members PostSharp Documentation

Constructors
 | Name | Description
Public method | NotifyPropertyChangedOverflowException | Initializes a new NotifyPropertyChangedOverflowException.
Public method | NotifyPropertyChangedOverflowException(String) | Initializes a new NotifyPropertyChangedOverflowException and sets the exception message.
Public method | NotifyPropertyChangedOverflowException(String, Exception) | Initializes a new NotifyPropertyChangedOverflowException and sets the exception message and the inner exception.
Back to Top
See Also
NotifyPropertyChangedOverflowException Class
PostSharp.Patterns.Model Namespace

Online Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


NotifyPropertyChangedOverflowException Constructor

NotifyPropertyChangedOverflowException Constructor PostSharp Documentation
Overload List
 | Name | Description
Public method | NotifyPropertyChangedOverflowException | Initializes a new NotifyPropertyChangedOverflowException.
Public method | NotifyPropertyChangedOverflowException(String) | Initializes a new NotifyPropertyChangedOverflowException and sets the exception message.
Public method | NotifyPropertyChangedOverflowException(String, Exception) | Initializes a new NotifyPropertyChangedOverflowException and sets the exception message and the inner exception.
Back to Top
See Also
NotifyPropertyChangedOverflowException Class
NotifyPropertyChangedOverflowException Members
PostSharp.Patterns.Model Namespace

Online Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


NotifyPropertyChangedOverflowException Constructor

NotifyPropertyChangedOverflowException Constructor PostSharp Documentation
Initializes a new NotifyPropertyChangedOverflowException.

Namespace: PostSharp.Patterns.Model
Assembly: PostSharp.Patterns.Model (in PostSharp.Patterns.Model.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
public NotifyPropertyChangedOverflowException()
public NotifyPropertyChangedOverflowException()
See Also
NotifyPropertyChangedOverflowException Class
NotifyPropertyChangedOverflowException Members
NotifyPropertyChangedOverflowException Overload
PostSharp.Patterns.Model Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


NotifyPropertyChangedOverflowException Constructor (String)

NotifyPropertyChangedOverflowException Constructor (String) PostSharp Documentation
Initializes a new NotifyPropertyChangedOverflowException and sets the exception message.

Namespace: PostSharp.Patterns.Model
Assembly: PostSharp.Patterns.Model (in PostSharp.Patterns.Model.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
public NotifyPropertyChangedOverflowException(
    string message
)
public NotifyPropertyChangedOverflowException(
    string message
)
Parameters
message
Type:   Online System String
Exception message.
See Also
NotifyPropertyChangedOverflowException Class
NotifyPropertyChangedOverflowException Members
NotifyPropertyChangedOverflowException Overload
PostSharp.Patterns.Model Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


NotifyPropertyChangedOverflowException Constructor (String, Exception)

NotifyPropertyChangedOverflowException Constructor (String, Exception) PostSharp Documentation
Initializes a new NotifyPropertyChangedOverflowException and sets the exception message and the inner exception.

Namespace: PostSharp.Patterns.Model
Assembly: PostSharp.Patterns.Model (in PostSharp.Patterns.Model.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
public NotifyPropertyChangedOverflowException(
    string message,
    Exception innerException
)
public NotifyPropertyChangedOverflowException(
    string message,
    Exception innerException
)
Parameters
message
Type:   Online System String
Exception message.
innerException
Type:   Online System Exception
Inner exception.
See Also
NotifyPropertyChangedOverflowException Class
NotifyPropertyChangedOverflowException Members
NotifyPropertyChangedOverflowException Overload
PostSharp.Patterns.Model Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


PureAttribute Class

PureAttribute Class PostSharp Documentation
Custom attribute that, when applied on a method, specifies that this method is a pure function, i.e. the method always returns the same result given the same parameter values. In the context of NotifyPropertyChangedAttribute, it is also assumed that pure functions have only parameters of primitive types ( Online Int32, Online String, ...). The Online Object parameter type is also accepted, but then it is assumed that instances passed are immutable (and changes to these objects will not be tracked).
Inheritance Hierarchy
Online System Object
Online System Attribute
PostSharp.Extensibility MulticastAttribute
PostSharp.Patterns.Model PureAttribute

Namespace: PostSharp.Patterns.Model
Assembly: PostSharp.Patterns.Model (in PostSharp.Patterns.Model.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
public sealed class PureAttribute : MulticastAttribute,
    IValidableAnnotation
public sealed class PureAttribute : MulticastAttribute,
    IValidableAnnotation
See Also
PureAttribute Members
PostSharp.Patterns.Model Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


PureAttribute Members

PureAttribute Members PostSharp Documentation

The PureAttribute type exposes the following members.
Constructors
 | Name | Description
Public method | PureAttribute | Initializes a new instance of the PureAttribute class
Back to Top
Properties
 | Name | Description
Public property | AttributeExclude | If true, indicates that this attribute removes all other instances of the same attribute type from the set of elements defined by the current instance. (Inherited from MulticastAttribute.)
Public property | AttributeId | Obsolete. (Inherited from MulticastAttribute.)
Public property | AttributeInheritance | Determines whether this attribute is inherited (Inherited from MulticastAttribute.)
Public property | AttributePriority | Gets or sets the priority of the current attribute in case that multiple instances are defined on the same element (lower values are processed before). (Inherited from MulticastAttribute.)
Public property | AttributeReplace | Determines whether this attribute replaces other attributes found on the target declarations. (Inherited from MulticastAttribute.)
Public property | AttributeTargetAssemblies | Gets or sets the assemblies to which the current attribute apply. (Inherited from MulticastAttribute.)
Public property | AttributeTargetElements | Gets or sets the kind of elements to which this custom attributes applies. (Inherited from MulticastAttribute.)
Public property | AttributeTargetExternalMemberAttributes | Gets or sets the visibilities, scopes, virtualities, and implementation of members to which this attribute applies, when the member is external to the current module. (Inherited from MulticastAttribute.)
Public property | AttributeTargetExternalTypeAttributes | Gets or sets the visibilities of types to which this attribute applies, when this type is external to the current module. (Inherited from MulticastAttribute.)
Public property | AttributeTargetMemberAttributes | Gets or sets the visibilities, scopes, virtualities, and implementation of members to which this attribute applies. (Inherited from MulticastAttribute.)
Public property | AttributeTargetMembers | Gets or sets the expression specifying to which members this instance applies. (Inherited from MulticastAttribute.)
Public property | AttributeTargetParameterAttributes | Gets or sets the passing style (by value, out or ref) of parameters to which this attribute applies. (Inherited from MulticastAttribute.)
Public property | AttributeTargetParameters | Gets or sets the expression specifying to which parameters this instance applies. (Inherited from MulticastAttribute.)
Public property | AttributeTargetTypeAttributes | Gets or sets the visibilities of types to which this attribute applies. (Inherited from MulticastAttribute.)
Public property | AttributeTargetTypes | Gets or sets the expression specifying to which types this instance applies. (Inherited from MulticastAttribute.)
Back to Top
See Also
PureAttribute Class
PostSharp.Patterns.Model Namespace

Online Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


PureAttribute Constructor

PureAttribute Constructor PostSharp Documentation
Initializes a new instance of the PureAttribute class

Namespace: PostSharp.Patterns.Model
Assembly: PostSharp.Patterns.Model (in PostSharp.Patterns.Model.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
public PureAttribute()
public PureAttribute()
See Also
PureAttribute Class
PureAttribute Members
PostSharp.Patterns.Model Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


PureAttribute Properties

PureAttribute Properties PostSharp Documentation
The PureAttribute type exposes the following members.
Properties
 | Name | Description
Public property | AttributeExclude | If true, indicates that this attribute removes all other instances of the same attribute type from the set of elements defined by the current instance. (Inherited from MulticastAttribute.)
Public property | AttributeId | Obsolete. (Inherited from MulticastAttribute.)
Public property | AttributeInheritance | Determines whether this attribute is inherited (Inherited from MulticastAttribute.)
Public property | AttributePriority | Gets or sets the priority of the current attribute in case that multiple instances are defined on the same element (lower values are processed before). (Inherited from MulticastAttribute.)
Public property | AttributeReplace | Determines whether this attribute replaces other attributes found on the target declarations. (Inherited from MulticastAttribute.)
Public property | AttributeTargetAssemblies | Gets or sets the assemblies to which the current attribute apply. (Inherited from MulticastAttribute.)
Public property | AttributeTargetElements | Gets or sets the kind of elements to which this custom attributes applies. (Inherited from MulticastAttribute.)
Public property | AttributeTargetExternalMemberAttributes | Gets or sets the visibilities, scopes, virtualities, and implementation of members to which this attribute applies, when the member is external to the current module. (Inherited from MulticastAttribute.)
Public property | AttributeTargetExternalTypeAttributes | Gets or sets the visibilities of types to which this attribute applies, when this type is external to the current module. (Inherited from MulticastAttribute.)
Public property | AttributeTargetMemberAttributes | Gets or sets the visibilities, scopes, virtualities, and implementation of members to which this attribute applies. (Inherited from MulticastAttribute.)
Public property | AttributeTargetMembers | Gets or sets the expression specifying to which members this instance applies. (Inherited from MulticastAttribute.)
Public property | AttributeTargetParameterAttributes | Gets or sets the passing style (by value, out or ref) of parameters to which this attribute applies. (Inherited from MulticastAttribute.)
Public property | AttributeTargetParameters | Gets or sets the expression specifying to which parameters this instance applies. (Inherited from MulticastAttribute.)
Public property | AttributeTargetTypeAttributes | Gets or sets the visibilities of types to which this attribute applies. (Inherited from MulticastAttribute.)
Public property | AttributeTargetTypes | Gets or sets the expression specifying to which types this instance applies. (Inherited from MulticastAttribute.)
Back to Top
See Also
PureAttribute Class
PostSharp.Patterns.Model Namespace

Online Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


SafeForDependencyAnalysisAttribute Class

SafeForDependencyAnalysisAttribute Class PostSharp Documentation
Custom attribute that, when applied on a property, prevents the dependency analysis algorithm used by the NotifyPropertyChangedAttribute aspect from emitting errors when it encounters constructs that it cannot analyze.
Inheritance Hierarchy
Online System Object
Online System Attribute
PostSharp.Patterns.Model SafeForDependencyAnalysisAttribute

Namespace: PostSharp.Patterns.Model
Assembly: PostSharp.Patterns.Model (in PostSharp.Patterns.Model.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
public sealed class SafeForDependencyAnalysisAttribute : Attribute
public sealed class SafeForDependencyAnalysisAttribute : Attribute
Remarks
Getters of properties annotated with SafeForDependencyAnalysisAttribute should typically
            specify dependencies manually using the Depends class. Note that all dependencies that can be
            found using code analysis will be taken into account. The SafeForDependencyAnalysisAttribute only
            disables errors, but not the code analysis itself.
See Also
SafeForDependencyAnalysisAttribute Members
PostSharp.Patterns.Model Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


SafeForDependencyAnalysisAttribute Members

SafeForDependencyAnalysisAttribute Members PostSharp Documentation

The SafeForDependencyAnalysisAttribute type exposes the following members.
Constructors
 | Name | Description
Public method | SafeForDependencyAnalysisAttribute | Initializes a new instance of the SafeForDependencyAnalysisAttribute class
Back to Top
See Also
SafeForDependencyAnalysisAttribute Class
PostSharp.Patterns.Model Namespace

Online Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


SafeForDependencyAnalysisAttribute Constructor

SafeForDependencyAnalysisAttribute Constructor PostSharp Documentation
Initializes a new instance of the SafeForDependencyAnalysisAttribute class

Namespace: PostSharp.Patterns.Model
Assembly: PostSharp.Patterns.Model (in PostSharp.Patterns.Model.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
public SafeForDependencyAnalysisAttribute()
public SafeForDependencyAnalysisAttribute()
See Also
SafeForDependencyAnalysisAttribute Class
SafeForDependencyAnalysisAttribute Members
PostSharp.Patterns.Model Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


PostSharp.Patterns.Threading Namespace

PostSharp.Patterns.Threading Namespace PostSharp Documentation
The PostSharp.Patterns.Threading namespace contains an implementation of several threading models, and other thread dispatching aspects.
Classes
 | Class | Description
Public class | Actor | Base class for entities implementing the actor threading model, in which calls to methods are processed asynchronously from a single thread, suppressing concurrency inside each instance of the Actor class.
Public class | ActorDispatcher | A dispatcher compatible with the Actor threading model, with a message queue based on a Online ConcurrentQueue T
Public class | ActorExceptionEventArgs | Argument of the Actor.OnException(ActorExceptionEventArgs) method.
Public class | BackgroundAttribute | Custom attribute that, when applied on a method, makes it asynchronous, i.e. causes the method method to be started in a new Online Task.
Public class | ConcurrentAccessException | Exception thrown when two threads simultaneously attempt to access a method annotated with the ThreadUnsafeAttribute custom attribute.
Public class | DeadlockDetectionPolicy | Detects deadlocks occurring because of circular wait conditions.
Public class | DeadlockException | Exception thrown by the DeadlockDetectionPolicy class when a deadlock is detected.
Public class | DispatchedAttribute | Custom attribute that, when applied on a method, specifies that the method should be executed in UI thread.
Public class | ExplicitlySynchronizedAttribute | Custom attribute that, when applied to a method or field, specifies that multithreaded access to this method or field is synchronized manually in user code. This custom attribute prevents PostSharp threading aspects (Actor, ReaderWriterSynchronizedAttribute and ThreadUnsafeAttribute) from generating synchronization or verification code for the field or method, and from emitting build-time errors and warnings.
Public class | LockNotHeldException | Exception thrown by the ReaderWriterSynchronizedAttribute and ThreadUnsafeAttribute when a thread attempts to access fields without holding the proper lock.
Public class | ObserverLockAttribute | Custom attribute that, when applied on a method or event, specifies that it should be executed in a observer lock. When current thread holds the writer lock, the lock is downgraded to upgradeable reader lock during execution of the method. Otherwise, a reader lock is acquired. When the aspect is applied to an event, the lock is acquired when the event is fired.
Public class | PortableReaderWriterLock | Encapsulates a Online ReaderWriterLockSlim.
Public class | ReaderLockAttribute | Custom attribute that, when applied on a method, specifies that it should be executed in a reader lock. The method can then execute concurrently with other threads holding a reader lock on the object, but will wait if another thread holds a writer lock.
Public class | ReaderWriterLockAttribute | Base class for ReaderLockAttribute, WriterLockAttribute and UpgradeableReaderLockAttribute.
Public class | ReaderWriterSynchronizedAttribute | Custom attribute that, when applied on a class, applies the reader-writer threading model to this class and all derived class. Members of this class must then be annoted with attributes specifying the required access level (ReaderWriterLockAttribute, WriterLockAttribute, ObserverLockAttribute or UpgradeableReaderLockAttribute), otherwise build-time and run-time errors are emitted.
Public class | ThreadingException | Base class for exceptions thrown by the PostSharp.Patterns.Threading component.
Public class | ThreadingPatternsAspectRoles | Enumerates the aspect roles (for use with AspectRoleDependencyAttribute) used by the PostSharp.Patterns.Threading component.
Public class | ThreadMismatchException | Exception thrown when a thread attempts to access an object that is affined to another thread.
Public class | ThreadUnsafeAttribute | Custom attribute that, when applied on a type, ensures that only one thread executes in methods of this type. When more than one thread accesses methods of this type, a ConcurrentAccessException exception is thrown.
Public class | UpgradeableReaderLockAttribute | Custom attribute that, when applied on a method, specifies that it should be executed in a upgradeable reader lock. This aspect acquires a read lock immediately but reserves the possibility to upgrade to a writer lock later (by calling another method enhanced with the WriterLockAttribute aspect) by preventing other threads to acquire a writer lock. from acquiring a write lock.
Public class | VerifyCallingThreadAttribute | Custom attribute that, when applied to a method or field, causes the ThreadUnsafeAttribute aspect to introduce runtime generation code even if target of the attribute is private or protected.
Public class | WriterLockAttribute | Custom attribute that, when applied on a method, specifies that it should be executed in a writer lock. This level of lock is required by any method that writes a field.
Interfaces
 | Interface | Description
Public interface | IAction | Defines a parameterless Invoke method.
Public interface | IDispatcher | Defines the semantics of a facility that executes actions synchronously or asynchronously, possibly on a different thread.
Public interface | IDispatcherObject | Interface implemented by objects that are whose access to methods is being controlled by a Dispatcher.
Public interface | IReaderWriterSynchronized | Exposes the Online ReaderWriterLockSlim that should be used to synchronize access to an object. This interface is used by the ReaderWriterSynchronizedAttribute aspect.
Enumerations
 | Enumeration | Description
Public enumeration | ThreadUnsafePolicy | Enumerates policies of the ThreadUnsafeAttribute aspect.

Online Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


Actor Class

Actor Class PostSharp Documentation

Base class for entities implementing the actor threading model, in which calls to methods are processed asynchronously from a single thread, suppressing concurrency inside each instance of the Actor class.

Inheritance Hierarchy
Online System Object
PostSharp.Patterns.Threading Actor

Namespace: PostSharp.Patterns.Threading
Assembly: PostSharp.Patterns.Threading (in PostSharp.Patterns.Threading.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
public abstract class Actor : IDispatcherObject
public abstract class Actor : IDispatcherObject
Remarks

            Calls to public methods of actors are appended to a message queue. This message queue is processed
            by a single thread. Therefore, there is never more than one thread accessing the object, which makes
            the this object thread safe.

Public methods must be void (with no ref or out parameter), or must
            be async. Other methods cannot be executed asynchronously, and therefore are forbidden
            in a class derived from the Actor class unless these methods are annotated
            with the ExplicitlySynchronizedAttribute custom attribute. This attribute
            specifies that no dispatching should be done for this method. Using ExplicitlySynchronizedAttribute
            breaks the thread-safety guarantees of the Actor threading model.

            Several actors can share the same message queue by sharing the same instance of IDispatcher object
            (see Actor(IDispatcher)).

See Also
Actor Members
PostSharp.Patterns.Threading Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


Actor Members

Actor Members PostSharp Documentation

The Actor type exposes the following members.
Constructors
 | Name | Description
Protected method | Actor | Initializes a new Actor with the default dispatcher.
Protected method | Actor(IDispatcher) | Initializes a new Actor and specifies the dispatcher.
Back to Top
Methods
 | Name | Description
Public method | Equals | Determines whether the specified Online Object is equal to the current Online Object. (Overrides Online Object Equals(Object).)
Public method | GetHashCode | Serves as a hash function for a particular type. (Overrides Online Object GetHashCode .)
Protected method | OnException | Method invoked when a dispatched method results in an exception.
Public method | ToString | Returns a string that represents the current object. (Overrides Online Object ToString .)
Back to Top
Properties
 | Name | Description
Public property | Dispatcher | Gets the dispatcher used to dispatch access to the current Actor.
Back to Top
See Also
Actor Class
PostSharp.Patterns.Threading Namespace

Online Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


Actor Constructor

Actor Constructor PostSharp Documentation
Overload List
 | Name | Description
Protected method | Actor | Initializes a new Actor with the default dispatcher.
Protected method | Actor(IDispatcher) | Initializes a new Actor and specifies the dispatcher.
Back to Top
See Also
Actor Class
Actor Members
PostSharp.Patterns.Threading Namespace

Online Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


Actor Constructor

Actor Constructor PostSharp Documentation
Initializes a new Actor with the default dispatcher.

Namespace: PostSharp.Patterns.Threading
Assembly: PostSharp.Patterns.Threading (in PostSharp.Patterns.Threading.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
protected Actor()
protected Actor()
See Also
Actor Class
Actor Members
Actor Overload
PostSharp.Patterns.Threading Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


Actor Constructor (IDispatcher)

Actor Constructor (IDispatcher) PostSharp Documentation
Initializes a new Actor and specifies the dispatcher.

Namespace: PostSharp.Patterns.Threading
Assembly: PostSharp.Patterns.Threading (in PostSharp.Patterns.Threading.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
protected Actor(
    IDispatcher dispatcher
)
protected Actor(
    IDispatcher dispatcher
)
Parameters
dispatcher
Type: PostSharp.Patterns.Threading IDispatcher
A dispatcher, or null if the default dispatcher should be used.
See Also
Actor Class
Actor Members
Actor Overload
PostSharp.Patterns.Threading Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


Actor Methods

Actor Methods PostSharp Documentation
The Actor type exposes the following members.
Methods
 | Name | Description
Public method | Equals | Determines whether the specified Online Object is equal to the current Online Object. (Overrides Online Object Equals(Object).)
Public method | GetHashCode | Serves as a hash function for a particular type. (Overrides Online Object GetHashCode .)
Protected method | OnException | Method invoked when a dispatched method results in an exception.
Public method | ToString | Returns a string that represents the current object. (Overrides Online Object ToString .)
Back to Top
See Also
Actor Class
PostSharp.Patterns.Threading Namespace

Online Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


Actor.Equals Method

Actor Equals Method PostSharp Documentation
Determines whether the specified Online Object is equal to the current Online Object.

Namespace: PostSharp.Patterns.Threading
Assembly: PostSharp.Patterns.Threading (in PostSharp.Patterns.Threading.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
public override bool Equals(
    Object obj
)
public override bool Equals(
    Object obj
)
Parameters
obj
Type:   Online System Object
The object to compare with the current object.
Return Value
Type:   Online Boolean
true if the specified   Online Object is equal to the current   Online Object; otherwise, false.
See Also
Actor Class
Actor Members
PostSharp.Patterns.Threading Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


Actor.GetHashCode Method

Actor GetHashCode Method PostSharp Documentation
Serves as a hash function for a particular type.

Namespace: PostSharp.Patterns.Threading
Assembly: PostSharp.Patterns.Threading (in PostSharp.Patterns.Threading.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
public override int GetHashCode()
public override int GetHashCode()
Return Value
Type:   Online Int32
A hash code for the current   Online Object.
See Also
Actor Class
Actor Members
PostSharp.Patterns.Threading Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


Actor.OnException Method

Actor OnException Method PostSharp Documentation
Method invoked when a dispatched method results in an exception.

Namespace: PostSharp.Patterns.Threading
Assembly: PostSharp.Patterns.Threading (in PostSharp.Patterns.Threading.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
protected virtual void OnException(
    ActorExceptionEventArgs eventArgs
)
protected virtual void OnException(
    ActorExceptionEventArgs eventArgs
)
Parameters
eventArgs
Type: PostSharp.Patterns.Threading ActorExceptionEventArgs
Gives access to the   Online Exception, and a IsHandled flag determining if the implementation
            of OnException(ActorExceptionEventArgs) has handled the exception.

Remarks
    This method is invoked in the same thread as the thread that processed the dispatched method.
The exception will be rethrown is the IsHandled flag is still equal to false after OnException(ActorExceptionEventArgs)
            exits.
See Also
Actor Class
Actor Members
PostSharp.Patterns.Threading Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


Actor.ToString Method

Actor ToString Method PostSharp Documentation
Returns a string that represents the current object.

Namespace: PostSharp.Patterns.Threading
Assembly: PostSharp.Patterns.Threading (in PostSharp.Patterns.Threading.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
public override string ToString()
public override string ToString()
Return Value
Type:   Online String
A string that represents the current object.
See Also
Actor Class
Actor Members
PostSharp.Patterns.Threading Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


Actor Properties

Actor Properties PostSharp Documentation
The Actor type exposes the following members.
Properties
 | Name | Description
Public property | Dispatcher | Gets the dispatcher used to dispatch access to the current Actor.
Back to Top
See Also
Actor Class
PostSharp.Patterns.Threading Namespace

Online Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


Actor.Dispatcher Property

Actor Dispatcher Property PostSharp Documentation
Gets the dispatcher used to dispatch access to the current Actor.

Namespace: PostSharp.Patterns.Threading
Assembly: PostSharp.Patterns.Threading (in PostSharp.Patterns.Threading.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
public IDispatcher Dispatcher {
    [ExplicitlySynchronizedAttribute]
    get;
 }
public IDispatcher Dispatcher {
    [ExplicitlySynchronizedAttribute]
    get;
 }
Property Value
Type: IDispatcher
See Also
Actor Class
Actor Members
PostSharp.Patterns.Threading Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


ActorDispatcher Class

ActorDispatcher Class PostSharp Documentation
A dispatcher compatible with the Actor threading model, with a message queue based on a Online ConcurrentQueue T
Inheritance Hierarchy
Online System Object
PostSharp.Patterns.Threading ActorDispatcher

Namespace: PostSharp.Patterns.Threading
Assembly: PostSharp.Patterns.Threading (in PostSharp.Patterns.Threading.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
public sealed class ActorDispatcher : IDispatcher
public sealed class ActorDispatcher : IDispatcher
Remarks
This implementation will append every action (as a result of the  BeginInvoke(IAction) method) into a
              Online ConcurrentQueue T . If will then create a   Online Task to process the   Online ConcurrentQueue T .
            The same   Online Task will keep running unless the message queue is empty, then will terminate. The implementation relies
            on the   Online Task component to assign tasks to threads, and relies on the operating system to preempt threads in
            case of very busy message queues.
Note that the Invoke(IAction) method of the IDispatcher interface is not supported,
            because the Actor model does not support synchronous calls.

See Also
ActorDispatcher Members
PostSharp.Patterns.Threading Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


ActorDispatcher Members

ActorDispatcher Members PostSharp Documentation

The ActorDispatcher type exposes the following members.
Constructors
 | Name | Description
Public method | ActorDispatcher | Initializes a new ActorDispatcher.
Back to Top
Methods
 | Name | Description
Public method | BeginInvoke | Queues an action for asynchronous execution.
Public method | CheckAccess | Determines whether the current thread has access to the current dispatcher.
Back to Top
See Also
ActorDispatcher Class
PostSharp.Patterns.Threading Namespace

Online Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


ActorDispatcher Constructor

ActorDispatcher Constructor PostSharp Documentation
Initializes a new ActorDispatcher.

Namespace: PostSharp.Patterns.Threading
Assembly: PostSharp.Patterns.Threading (in PostSharp.Patterns.Threading.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
public ActorDispatcher()
public ActorDispatcher()
See Also
ActorDispatcher Class
ActorDispatcher Members
PostSharp.Patterns.Threading Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


ActorDispatcher Methods

ActorDispatcher Methods PostSharp Documentation
The ActorDispatcher type exposes the following members.
Methods
 | Name | Description
Public method | BeginInvoke | Queues an action for asynchronous execution.
Public method | CheckAccess | Determines whether the current thread has access to the current dispatcher.
Back to Top
See Also
ActorDispatcher Class
PostSharp.Patterns.Threading Namespace

Online Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


ActorDispatcher.BeginInvoke Method

ActorDispatcher BeginInvoke Method PostSharp Documentation
Queues an action for asynchronous execution.

Namespace: PostSharp.Patterns.Threading
Assembly: PostSharp.Patterns.Threading (in PostSharp.Patterns.Threading.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
public void BeginInvoke(
    IAction action
)
public void BeginInvoke(
    IAction action
)
Parameters
action
Type: PostSharp.Patterns.Threading IAction
Action to be executed.
Implements
IDispatcher BeginInvoke(IAction)
Remarks
This method qu
See Also
ActorDispatcher Class
ActorDispatcher Members
PostSharp.Patterns.Threading Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


ActorDispatcher.CheckAccess Method

ActorDispatcher CheckAccess Method PostSharp Documentation
Determines whether the current thread has access to the current dispatcher.

Namespace: PostSharp.Patterns.Threading
Assembly: PostSharp.Patterns.Threading (in PostSharp.Patterns.Threading.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
public bool CheckAccess()
public bool CheckAccess()
Return Value
Type:   Online Boolean
true if the current thread can directly call methods of objects protected
            by the current dispatcher, or false if methods Invoke(IAction) or BeginInvoke(IAction)
            must be used.
Implements
IDispatcher CheckAccess
See Also
ActorDispatcher Class
ActorDispatcher Members
PostSharp.Patterns.Threading Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


ActorExceptionEventArgs Class

ActorExceptionEventArgs Class PostSharp Documentation
Argument of the Actor.OnException(ActorExceptionEventArgs) method.
Inheritance Hierarchy
Online System Object
Online System EventArgs
PostSharp.Patterns.Threading ActorExceptionEventArgs

Namespace: PostSharp.Patterns.Threading
Assembly: PostSharp.Patterns.Threading (in PostSharp.Patterns.Threading.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
public sealed class ActorExceptionEventArgs : EventArgs
public sealed class ActorExceptionEventArgs : EventArgs
See Also
ActorExceptionEventArgs Members
PostSharp.Patterns.Threading Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


ActorExceptionEventArgs Members

ActorExceptionEventArgs Members PostSharp Documentation

The ActorExceptionEventArgs type exposes the following members.
Properties
 | Name | Description
Public property | Exception | Gets the exception.
Public property | IsHandled | Determines whether the OnException(ActorExceptionEventArgs) handled the exception. The the value is left to false, the exception will be rethrown. Otherwise, it will be ignored.
Back to Top
See Also
ActorExceptionEventArgs Class
PostSharp.Patterns.Threading Namespace

Online Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


ActorExceptionEventArgs Properties

ActorExceptionEventArgs Properties PostSharp Documentation
The ActorExceptionEventArgs type exposes the following members.
Properties
 | Name | Description
Public property | Exception | Gets the exception.
Public property | IsHandled | Determines whether the OnException(ActorExceptionEventArgs) handled the exception. The the value is left to false, the exception will be rethrown. Otherwise, it will be ignored.
Back to Top
See Also
ActorExceptionEventArgs Class
PostSharp.Patterns.Threading Namespace

Online Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


ActorExceptionEventArgs.Exception Property

ActorExceptionEventArgs Exception Property PostSharp Documentation
Gets the exception.

Namespace: PostSharp.Patterns.Threading
Assembly: PostSharp.Patterns.Threading (in PostSharp.Patterns.Threading.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
public Exception Exception { get; private set; }
public Exception Exception { get; private set; }
Property Value
Type:   Online Exception
See Also
ActorExceptionEventArgs Class
ActorExceptionEventArgs Members
PostSharp.Patterns.Threading Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


ActorExceptionEventArgs.IsHandled Property

ActorExceptionEventArgs IsHandled Property PostSharp Documentation
Determines whether the OnException(ActorExceptionEventArgs) handled the exception. The the value is left to false, the exception will be rethrown. Otherwise, it will be ignored.

Namespace: PostSharp.Patterns.Threading
Assembly: PostSharp.Patterns.Threading (in PostSharp.Patterns.Threading.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
public bool IsHandled { get; set; }
public bool IsHandled { get; set; }
Property Value
Type:   Online Boolean
See Also
ActorExceptionEventArgs Class
ActorExceptionEventArgs Members
PostSharp.Patterns.Threading Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


BackgroundAttribute Class

BackgroundAttribute Class PostSharp Documentation
Custom attribute that, when applied on a method, makes it asynchronous, i.e. causes the method method to be started in a new Online Task.
Inheritance Hierarchy
Online System Object
Online System Attribute
PostSharp.Extensibility MulticastAttribute
PostSharp.Aspects Aspect
PostSharp.Aspects MethodLevelAspect
PostSharp.Aspects MethodInterceptionAspect
PostSharp.Patterns.Threading BackgroundAttribute

Namespace: PostSharp.Patterns.Threading
Assembly: PostSharp.Patterns.Threading (in PostSharp.Patterns.Threading.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
[SerializableAttribute]
public sealed class BackgroundAttribute : MethodInterceptionAspect
[SerializableAttribute]
public sealed class BackgroundAttribute : MethodInterceptionAspect
See Also
BackgroundAttribute Members
PostSharp.Patterns.Threading Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


BackgroundAttribute Members

BackgroundAttribute Members PostSharp Documentation

The BackgroundAttribute type exposes the following members.
Constructors
 | Name | Description
Public method | BackgroundAttribute | Initializes a new instance of the BackgroundAttribute class
Back to Top
Methods
 | Name | Description
Public method | CompileTimeInitialize | Method invoked at build time to initialize the instance fields of the current aspect. This method is invoked before any other build-time method. (Inherited from MethodLevelAspect.)
Public method | CompileTimeValidate | Method invoked at build time to ensure that the aspect has been applied to the right target. (Inherited from Aspect.)
Public method | GetAspectConfiguration | Method invoked at build tome to get the imperative configuration of the current Aspect. (Inherited from Aspect.)
Public method | OnInvoke | Method invoked instead of the method to which the aspect has been applied. (Inherited from MethodInterceptionAspect.)
Public method | RuntimeInitialize | Initializes the current aspect. (Inherited from MethodLevelAspect.)
Back to Top
Properties
 | Name | Description
Public property | AspectPriority | Gets or sets the weaving priority of the aspect. (Inherited from Aspect.)
Public property | AttributeExclude | If true, indicates that this attribute removes all other instances of the same attribute type from the set of elements defined by the current instance. (Inherited from MulticastAttribute.)
Public property | AttributeId | Obsolete. (Inherited from MulticastAttribute.)
Public property | AttributeInheritance | Determines whether this attribute is inherited (Inherited from MulticastAttribute.)
Public property | AttributePriority | Gets or sets the priority of the current attribute in case that multiple instances are defined on the same element (lower values are processed before). (Inherited from MulticastAttribute.)
Public property | AttributeReplace | Determines whether this attribute replaces other attributes found on the target declarations. (Inherited from MulticastAttribute.)
Public property | AttributeTargetAssemblies | Gets or sets the assemblies to which the current attribute apply. (Inherited from MulticastAttribute.)
Public property | AttributeTargetElements | Gets or sets the kind of elements to which this custom attributes applies. (Inherited from MulticastAttribute.)
Public property | AttributeTargetExternalMemberAttributes | Gets or sets the visibilities, scopes, virtualities, and implementation of members to which this attribute applies, when the member is external to the current module. (Inherited from MulticastAttribute.)
Public property | AttributeTargetExternalTypeAttributes | Gets or sets the visibilities of types to which this attribute applies, when this type is external to the current module. (Inherited from MulticastAttribute.)
Public property | AttributeTargetMemberAttributes | Gets or sets the visibilities, scopes, virtualities, and implementation of members to which this attribute applies. (Inherited from MulticastAttribute.)
Public property | AttributeTargetMembers | Gets or sets the expression specifying to which members this instance applies. (Inherited from MulticastAttribute.)
Public property | AttributeTargetParameterAttributes | Gets or sets the passing style (by value, out or ref) of parameters to which this attribute applies. (Inherited from MulticastAttribute.)
Public property | AttributeTargetParameters | Gets or sets the expression specifying to which parameters this instance applies. (Inherited from MulticastAttribute.)
Public property | AttributeTargetTypeAttributes | Gets or sets the visibilities of types to which this attribute applies. (Inherited from MulticastAttribute.)
Public property | AttributeTargetTypes | Gets or sets the expression specifying to which types this instance applies. (Inherited from MulticastAttribute.)
Public property | IsLongRunning | Determines whether the method is long-running. This property maps to the Online LongRunning flag of the Online Task.[!:Task.Options] property.
Back to Top
See Also
BackgroundAttribute Class
PostSharp.Patterns.Threading Namespace

Online Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


BackgroundAttribute Constructor

BackgroundAttribute Constructor PostSharp Documentation
Initializes a new instance of the BackgroundAttribute class

Namespace: PostSharp.Patterns.Threading
Assembly: PostSharp.Patterns.Threading (in PostSharp.Patterns.Threading.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
public BackgroundAttribute()
public BackgroundAttribute()
See Also
BackgroundAttribute Class
BackgroundAttribute Members
PostSharp.Patterns.Threading Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


BackgroundAttribute Methods

BackgroundAttribute Methods PostSharp Documentation
The BackgroundAttribute type exposes the following members.
Methods
 | Name | Description
Public method | CompileTimeInitialize | Method invoked at build time to initialize the instance fields of the current aspect. This method is invoked before any other build-time method. (Inherited from MethodLevelAspect.)
Public method | CompileTimeValidate | Method invoked at build time to ensure that the aspect has been applied to the right target. (Inherited from Aspect.)
Public method | GetAspectConfiguration | Method invoked at build tome to get the imperative configuration of the current Aspect. (Inherited from Aspect.)
Public method | OnInvoke | Method invoked instead of the method to which the aspect has been applied. (Inherited from MethodInterceptionAspect.)
Public method | RuntimeInitialize | Initializes the current aspect. (Inherited from MethodLevelAspect.)
Back to Top
See Also
BackgroundAttribute Class
PostSharp.Patterns.Threading Namespace

Online Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


BackgroundAttribute Properties

BackgroundAttribute Properties PostSharp Documentation
The BackgroundAttribute type exposes the following members.
Properties
 | Name | Description
Public property | AspectPriority | Gets or sets the weaving priority of the aspect. (Inherited from Aspect.)
Public property | AttributeExclude | If true, indicates that this attribute removes all other instances of the same attribute type from the set of elements defined by the current instance. (Inherited from MulticastAttribute.)
Public property | AttributeId | Obsolete. (Inherited from MulticastAttribute.)
Public property | AttributeInheritance | Determines whether this attribute is inherited (Inherited from MulticastAttribute.)
Public property | AttributePriority | Gets or sets the priority of the current attribute in case that multiple instances are defined on the same element (lower values are processed before). (Inherited from MulticastAttribute.)
Public property | AttributeReplace | Determines whether this attribute replaces other attributes found on the target declarations. (Inherited from MulticastAttribute.)
Public property | AttributeTargetAssemblies | Gets or sets the assemblies to which the current attribute apply. (Inherited from MulticastAttribute.)
Public property | AttributeTargetElements | Gets or sets the kind of elements to which this custom attributes applies. (Inherited from MulticastAttribute.)
Public property | AttributeTargetExternalMemberAttributes | Gets or sets the visibilities, scopes, virtualities, and implementation of members to which this attribute applies, when the member is external to the current module. (Inherited from MulticastAttribute.)
Public property | AttributeTargetExternalTypeAttributes | Gets or sets the visibilities of types to which this attribute applies, when this type is external to the current module. (Inherited from MulticastAttribute.)
Public property | AttributeTargetMemberAttributes | Gets or sets the visibilities, scopes, virtualities, and implementation of members to which this attribute applies. (Inherited from MulticastAttribute.)
Public property | AttributeTargetMembers | Gets or sets the expression specifying to which members this instance applies. (Inherited from MulticastAttribute.)
Public property | AttributeTargetParameterAttributes | Gets or sets the passing style (by value, out or ref) of parameters to which this attribute applies. (Inherited from MulticastAttribute.)
Public property | AttributeTargetParameters | Gets or sets the expression specifying to which parameters this instance applies. (Inherited from MulticastAttribute.)
Public property | AttributeTargetTypeAttributes | Gets or sets the visibilities of types to which this attribute applies. (Inherited from MulticastAttribute.)
Public property | AttributeTargetTypes | Gets or sets the expression specifying to which types this instance applies. (Inherited from MulticastAttribute.)
Public property | IsLongRunning | Determines whether the method is long-running. This property maps to the Online LongRunning flag of the Online Task.[!:Task.Options] property.
Back to Top
See Also
BackgroundAttribute Class
PostSharp.Patterns.Threading Namespace

Online Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


BackgroundAttribute.IsLongRunning Property

BackgroundAttribute IsLongRunning Property PostSharp Documentation
Determines whether the method is long-running. This property maps to the Online LongRunning flag of the Online Task.[!:Task.Options] property.

Namespace: PostSharp.Patterns.Threading
Assembly: PostSharp.Patterns.Threading (in PostSharp.Patterns.Threading.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
public bool IsLongRunning { get; set; }
public bool IsLongRunning { get; set; }
Property Value
Type:   Online Boolean
See Also
BackgroundAttribute Class
BackgroundAttribute Members
PostSharp.Patterns.Threading Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


ConcurrentAccessException Class

ConcurrentAccessException Class PostSharp Documentation
Exception thrown when two threads simultaneously attempt to access a method annotated with the ThreadUnsafeAttribute custom attribute.
Inheritance Hierarchy
Online System Object
Online System Exception
PostSharp.Patterns.Threading ThreadingException
PostSharp.Patterns.Threading ConcurrentAccessException

Namespace: PostSharp.Patterns.Threading
Assembly: PostSharp.Patterns.Threading (in PostSharp.Patterns.Threading.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
[SerializableAttribute]
public sealed class ConcurrentAccessException : ThreadingException
[SerializableAttribute]
public sealed class ConcurrentAccessException : ThreadingException
See Also
ConcurrentAccessException Members
PostSharp.Patterns.Threading Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


ConcurrentAccessException Members

ConcurrentAccessException Members PostSharp Documentation

Constructors
 | Name | Description
Public method | ConcurrentAccessException | Initializes a new ConcurrentAccessException.
Public method | ConcurrentAccessException(String) | Initializes a new ConcurrentAccessException and sets the error message.
Public method | ConcurrentAccessException(String, Exception) | Initializes a new ConcurrentAccessException and sets the error message and the inner exception.
Back to Top
See Also
ConcurrentAccessException Class
PostSharp.Patterns.Threading Namespace

Online Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


ConcurrentAccessException Constructor

ConcurrentAccessException Constructor PostSharp Documentation
Overload List
 | Name | Description
Public method | ConcurrentAccessException | Initializes a new ConcurrentAccessException.
Public method | ConcurrentAccessException(String) | Initializes a new ConcurrentAccessException and sets the error message.
Public method | ConcurrentAccessException(String, Exception) | Initializes a new ConcurrentAccessException and sets the error message and the inner exception.
Back to Top
See Also
ConcurrentAccessException Class
ConcurrentAccessException Members
PostSharp.Patterns.Threading Namespace

Online Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


ConcurrentAccessException Constructor

ConcurrentAccessException Constructor PostSharp Documentation
Initializes a new ConcurrentAccessException.

Namespace: PostSharp.Patterns.Threading
Assembly: PostSharp.Patterns.Threading (in PostSharp.Patterns.Threading.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
public ConcurrentAccessException()
public ConcurrentAccessException()
See Also
ConcurrentAccessException Class
ConcurrentAccessException Members
ConcurrentAccessException Overload
PostSharp.Patterns.Threading Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


ConcurrentAccessException Constructor (String)

ConcurrentAccessException Constructor (String) PostSharp Documentation
Initializes a new ConcurrentAccessException and sets the error message.

Namespace: PostSharp.Patterns.Threading
Assembly: PostSharp.Patterns.Threading (in PostSharp.Patterns.Threading.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
public ConcurrentAccessException(
    string message
)
public ConcurrentAccessException(
    string message
)
Parameters
message
Type:   Online System String
Error message.
See Also
ConcurrentAccessException Class
ConcurrentAccessException Members
ConcurrentAccessException Overload
PostSharp.Patterns.Threading Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


ConcurrentAccessException Constructor (String, Exception)

ConcurrentAccessException Constructor (String, Exception) PostSharp Documentation
Initializes a new ConcurrentAccessException and sets the error message and the inner exception.

Namespace: PostSharp.Patterns.Threading
Assembly: PostSharp.Patterns.Threading (in PostSharp.Patterns.Threading.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
public ConcurrentAccessException(
    string message,
    Exception inner
)
public ConcurrentAccessException(
    string message,
    Exception inner
)
Parameters
message
Type:   Online System String
Error message.
inner
Type:   Online System Exception
Inner exception.
See Also
ConcurrentAccessException Class
ConcurrentAccessException Members
ConcurrentAccessException Overload
PostSharp.Patterns.Threading Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


DeadlockDetectionPolicy Class

DeadlockDetectionPolicy Class PostSharp Documentation
Detects deadlocks occurring because of circular wait conditions.
Inheritance Hierarchy
Online System Object
Online System Attribute
PostSharp.Extensibility MulticastAttribute
PostSharp.Aspects Aspect
PostSharp.Aspects AssemblyLevelAspect
PostSharp.Patterns.Threading DeadlockDetectionPolicy

Namespace: PostSharp.Patterns.Threading
Assembly: PostSharp.Patterns.Threading (in PostSharp.Patterns.Threading.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
[SerializableAttribute]
public sealed class DeadlockDetectionPolicy : AssemblyLevelAspect,
    IAspectProvider, IAspect, IService
[SerializableAttribute]
public sealed class DeadlockDetectionPolicy : AssemblyLevelAspect,
    IAspectProvider, IAspect, IService
Remarks

                    The DeadlockDetectionPolicy works by building, in real time, a graph
                    of dependencies between threads and waiting objects. All synchronization aspects of
                    the threading pattern library,  additionally to the most common .NET synchronization primitives.
                    The following .NET methods that are supported:
                    Mutex.WaitOne, Mutex.WaitAll, Mutex.Release, Monitor.Enter, Monitor.Exit, Thread.Join,
                    all methods of ReaderWriterLockSlim, all methods of ReaderWriterLock except
                    ReaderWriterLock.ReleaseLock, ReaderWriterLock.RestoreLock.

                    When synchronization objects wait for more then 200ms, a deadlock detection is performed.
                    The algorithm analyzes the dependency graph for cycles and throws a DeadlockException
                    in all threads involved in the cycle if one is detected.

                    Some actions on synchronization primitives, such as ReaderWriterLock.RestoreLock and WaitHandle.Handle,
                    make it imposible to track deadlocks. If such methods are called, the synchronization primitive is excluded from
                    the deadlock detection mechanism.

See Also
DeadlockDetectionPolicy Members
PostSharp.Patterns.Threading Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


DeadlockDetectionPolicy Members

DeadlockDetectionPolicy Members PostSharp Documentation

The DeadlockDetectionPolicy type exposes the following members.
Constructors
 | Name | Description
Public method | DeadlockDetectionPolicy | Initializes a new instance of the DeadlockDetectionPolicy class
Back to Top
Methods
 | Name | Description
Public method | CompileTimeInitialize | Method invoked at build time to initialize the instance fields of the current aspect. This method is invoked before any other build-time method. (Inherited from AssemblyLevelAspect.)
Public method | CompileTimeValidate | Method invoked at build time to ensure that the aspect has been applied to the right target. (Inherited from Aspect.)
Public method | GetAspectConfiguration | Method invoked at build tome to get the imperative configuration of the current Aspect. (Inherited from Aspect.)
Back to Top
Properties
 | Name | Description
Public property | AspectPriority | Gets or sets the weaving priority of the aspect. (Inherited from Aspect.)
Public property | AttributeExclude | If true, indicates that this attribute removes all other instances of the same attribute type from the set of elements defined by the current instance. (Inherited from MulticastAttribute.)
Public property | AttributeId | Obsolete. (Inherited from MulticastAttribute.)
Public property | AttributeInheritance | Determines whether this attribute is inherited (Inherited from MulticastAttribute.)
Public property | AttributePriority | Gets or sets the priority of the current attribute in case that multiple instances are defined on the same element (lower values are processed before). (Inherited from MulticastAttribute.)
Public property | AttributeReplace | Determines whether this attribute replaces other attributes found on the target declarations. (Inherited from MulticastAttribute.)
Public property | AttributeTargetAssemblies | Gets or sets the assemblies to which the current attribute apply. (Inherited from MulticastAttribute.)
Public property | AttributeTargetElements | Gets or sets the kind of elements to which this custom attributes applies. (Inherited from MulticastAttribute.)
Public property | AttributeTargetExternalMemberAttributes | Gets or sets the visibilities, scopes, virtualities, and implementation of members to which this attribute applies, when the member is external to the current module. (Inherited from MulticastAttribute.)
Public property | AttributeTargetExternalTypeAttributes | Gets or sets the visibilities of types to which this attribute applies, when this type is external to the current module. (Inherited from MulticastAttribute.)
Public property | AttributeTargetMemberAttributes | Gets or sets the visibilities, scopes, virtualities, and implementation of members to which this attribute applies. (Inherited from MulticastAttribute.)
Public property | AttributeTargetMembers | Gets or sets the expression specifying to which members this instance applies. (Inherited from MulticastAttribute.)
Public property | AttributeTargetParameterAttributes | Gets or sets the passing style (by value, out or ref) of parameters to which this attribute applies. (Inherited from MulticastAttribute.)
Public property | AttributeTargetParameters | Gets or sets the expression specifying to which parameters this instance applies. (Inherited from MulticastAttribute.)
Public property | AttributeTargetTypeAttributes | Gets or sets the visibilities of types to which this attribute applies. (Inherited from MulticastAttribute.)
Public property | AttributeTargetTypes | Gets or sets the expression specifying to which types this instance applies. (Inherited from MulticastAttribute.)
Back to Top
See Also
DeadlockDetectionPolicy Class
PostSharp.Patterns.Threading Namespace

Online Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


DeadlockDetectionPolicy Constructor

DeadlockDetectionPolicy Constructor PostSharp Documentation
Initializes a new instance of the DeadlockDetectionPolicy class

Namespace: PostSharp.Patterns.Threading
Assembly: PostSharp.Patterns.Threading (in PostSharp.Patterns.Threading.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
public DeadlockDetectionPolicy()
public DeadlockDetectionPolicy()
See Also
DeadlockDetectionPolicy Class
DeadlockDetectionPolicy Members
PostSharp.Patterns.Threading Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


DeadlockDetectionPolicy Methods

DeadlockDetectionPolicy Methods PostSharp Documentation
The DeadlockDetectionPolicy type exposes the following members.
Methods
 | Name | Description
Public method | CompileTimeInitialize | Method invoked at build time to initialize the instance fields of the current aspect. This method is invoked before any other build-time method. (Inherited from AssemblyLevelAspect.)
Public method | CompileTimeValidate | Method invoked at build time to ensure that the aspect has been applied to the right target. (Inherited from Aspect.)
Public method | GetAspectConfiguration | Method invoked at build tome to get the imperative configuration of the current Aspect. (Inherited from Aspect.)
Back to Top
See Also
DeadlockDetectionPolicy Class
PostSharp.Patterns.Threading Namespace

Online Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


DeadlockDetectionPolicy Properties

DeadlockDetectionPolicy Properties PostSharp Documentation
The DeadlockDetectionPolicy type exposes the following members.
Properties
 | Name | Description
Public property | AspectPriority | Gets or sets the weaving priority of the aspect. (Inherited from Aspect.)
Public property | AttributeExclude | If true, indicates that this attribute removes all other instances of the same attribute type from the set of elements defined by the current instance. (Inherited from MulticastAttribute.)
Public property | AttributeId | Obsolete. (Inherited from MulticastAttribute.)
Public property | AttributeInheritance | Determines whether this attribute is inherited (Inherited from MulticastAttribute.)
Public property | AttributePriority | Gets or sets the priority of the current attribute in case that multiple instances are defined on the same element (lower values are processed before). (Inherited from MulticastAttribute.)
Public property | AttributeReplace | Determines whether this attribute replaces other attributes found on the target declarations. (Inherited from MulticastAttribute.)
Public property | AttributeTargetAssemblies | Gets or sets the assemblies to which the current attribute apply. (Inherited from MulticastAttribute.)
Public property | AttributeTargetElements | Gets or sets the kind of elements to which this custom attributes applies. (Inherited from MulticastAttribute.)
Public property | AttributeTargetExternalMemberAttributes | Gets or sets the visibilities, scopes, virtualities, and implementation of members to which this attribute applies, when the member is external to the current module. (Inherited from MulticastAttribute.)
Public property | AttributeTargetExternalTypeAttributes | Gets or sets the visibilities of types to which this attribute applies, when this type is external to the current module. (Inherited from MulticastAttribute.)
Public property | AttributeTargetMemberAttributes | Gets or sets the visibilities, scopes, virtualities, and implementation of members to which this attribute applies. (Inherited from MulticastAttribute.)
Public property | AttributeTargetMembers | Gets or sets the expression specifying to which members this instance applies. (Inherited from MulticastAttribute.)
Public property | AttributeTargetParameterAttributes | Gets or sets the passing style (by value, out or ref) of parameters to which this attribute applies. (Inherited from MulticastAttribute.)
Public property | AttributeTargetParameters | Gets or sets the expression specifying to which parameters this instance applies. (Inherited from MulticastAttribute.)
Public property | AttributeTargetTypeAttributes | Gets or sets the visibilities of types to which this attribute applies. (Inherited from MulticastAttribute.)
Public property | AttributeTargetTypes | Gets or sets the expression specifying to which types this instance applies. (Inherited from MulticastAttribute.)
Back to Top
See Also
DeadlockDetectionPolicy Class
PostSharp.Patterns.Threading Namespace

Online Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


DeadlockException Class

DeadlockException Class PostSharp Documentation
Exception thrown by the DeadlockDetectionPolicy class when a deadlock is detected.
Inheritance Hierarchy
Online System Object
Online System Exception
PostSharp.Patterns.Threading ThreadingException
PostSharp.Patterns.Threading DeadlockException

Namespace: PostSharp.Patterns.Threading
Assembly: PostSharp.Patterns.Threading (in PostSharp.Patterns.Threading.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
[SerializableAttribute]
public sealed class DeadlockException : ThreadingException
[SerializableAttribute]
public sealed class DeadlockException : ThreadingException
See Also
DeadlockException Members
PostSharp.Patterns.Threading Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


DeadlockException Members

DeadlockException Members PostSharp Documentation

Constructors
 | Name | Description
Public method | DeadlockException | Initializes a new DeadlockException.
Public method | DeadlockException(String) | Initializes a new DeadlockException and specifies the message.
Public method | DeadlockException(String, Exception) | Initializes a new DeadlockException and specifies the message and inner Online Exception.
Back to Top
See Also
DeadlockException Class
PostSharp.Patterns.Threading Namespace

Online Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


DeadlockException Constructor

DeadlockException Constructor PostSharp Documentation
Overload List
 | Name | Description
Public method | DeadlockException | Initializes a new DeadlockException.
Public method | DeadlockException(String) | Initializes a new DeadlockException and specifies the message.
Public method | DeadlockException(String, Exception) | Initializes a new DeadlockException and specifies the message and inner Online Exception.
Back to Top
See Also
DeadlockException Class
DeadlockException Members
PostSharp.Patterns.Threading Namespace

Online Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


DeadlockException Constructor

DeadlockException Constructor PostSharp Documentation
Initializes a new DeadlockException.

Namespace: PostSharp.Patterns.Threading
Assembly: PostSharp.Patterns.Threading (in PostSharp.Patterns.Threading.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
public DeadlockException()
public DeadlockException()
See Also
DeadlockException Class
DeadlockException Members
DeadlockException Overload
PostSharp.Patterns.Threading Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


DeadlockException Constructor (SerializationInfo, StreamingContext)

DeadlockException Constructor (SerializationInfo, StreamingContext) PostSharp Documentation
Deserialization constructor.

Namespace: PostSharp.Patterns.Threading
Assembly: PostSharp.Patterns.Threading (in PostSharp.Patterns.Threading.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
protected DeadlockException(
    SerializationInfo info,
    StreamingContext context
)
protected DeadlockException(
    SerializationInfo info,
    StreamingContext context
)
Parameters
info
Type:   Online System.Runtime.Serialization SerializationInfo
[Missing <param name="info"/> documentation for "M:PostSharp.Patterns.Threading.DeadlockException.#ctor(System.Runtime.Serialization.SerializationInfo,System.Runtime.Serialization.StreamingContext)"]
context
Type:   Online System.Runtime.Serialization StreamingContext
[Missing <param name="context"/> documentation for "M:PostSharp.Patterns.Threading.DeadlockException.#ctor(System.Runtime.Serialization.SerializationInfo,System.Runtime.Serialization.StreamingContext)"]
See Also
DeadlockException Class
DeadlockException Members
DeadlockException Overload
PostSharp.Patterns.Threading Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


DeadlockException Constructor (String)

DeadlockException Constructor (String) PostSharp Documentation
Initializes a new DeadlockException and specifies the message.

Namespace: PostSharp.Patterns.Threading
Assembly: PostSharp.Patterns.Threading (in PostSharp.Patterns.Threading.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
public DeadlockException(
    string message
)
public DeadlockException(
    string message
)
Parameters
message
Type:   Online System String
Exception message.
See Also
DeadlockException Class
DeadlockException Members
DeadlockException Overload
PostSharp.Patterns.Threading Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


DeadlockException Constructor (String, Exception)

DeadlockException Constructor (String, Exception) PostSharp Documentation
Initializes a new DeadlockException and specifies the message and inner Online Exception.

Namespace: PostSharp.Patterns.Threading
Assembly: PostSharp.Patterns.Threading (in PostSharp.Patterns.Threading.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
public DeadlockException(
    string message,
    Exception inner
)
public DeadlockException(
    string message,
    Exception inner
)
Parameters
message
Type:   Online System String
Exception message.
inner
Type:   Online System Exception
Inner   Online Exception.
See Also
DeadlockException Class
DeadlockException Members
DeadlockException Overload
PostSharp.Patterns.Threading Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


DispatchedAttribute Class

DispatchedAttribute Class PostSharp Documentation
Custom attribute that, when applied on a method, specifies that the method should be executed in UI thread.
Inheritance Hierarchy
Online System Object
Online System Attribute
PostSharp.Extensibility MulticastAttribute
PostSharp.Aspects Aspect
PostSharp.Aspects MethodLevelAspect
PostSharp.Patterns.Threading DispatchedAttribute

Namespace: PostSharp.Patterns.Threading
Assembly: PostSharp.Patterns.Threading (in PostSharp.Patterns.Threading.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
[SerializableAttribute]
public sealed class DispatchedAttribute : MethodLevelAspect,
    IAspectProvider, IAspect, IService
[SerializableAttribute]
public sealed class DispatchedAttribute : MethodLevelAspect,
    IAspectProvider, IAspect, IService
Remarks
Execution of the method can be synchronous or asynchronous according to the value of the IsAsync
            property.
This aspect can be applied to instance methods of UI controls (WinForms or WPF), or to any class implementing the IDispatcherObject manually.
See Also
DispatchedAttribute Members
PostSharp.Patterns.Threading Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


DispatchedAttribute Members

DispatchedAttribute Members PostSharp Documentation

The DispatchedAttribute type exposes the following members.
Constructors
 | Name | Description
Public method | DispatchedAttribute | Initializes a new DispatchedAttribute.
Back to Top
Methods
 | Name | Description
Public method | CompileTimeInitialize | Method invoked at build time to initialize the instance fields of the current aspect. This method is invoked before any other build-time method. (Inherited from MethodLevelAspect.)
Public method | CompileTimeValidate | Method invoked at build time to ensure that the aspect has been applied to the right target. (Inherited from Aspect.)
Public method | GetAspectConfiguration | Method invoked at build tome to get the imperative configuration of the current Aspect. (Inherited from Aspect.)
Public method | RuntimeInitialize | Initializes the current aspect. (Inherited from MethodLevelAspect.)
Back to Top
Properties
 | Name | Description
Public property | AspectPriority | Gets or sets the weaving priority of the aspect. (Inherited from Aspect.)
Public property | AttributeExclude | If true, indicates that this attribute removes all other instances of the same attribute type from the set of elements defined by the current instance. (Inherited from MulticastAttribute.)
Public property | AttributeId | Obsolete. (Inherited from MulticastAttribute.)
Public property | AttributeInheritance | Determines whether this attribute is inherited (Inherited from MulticastAttribute.)
Public property | AttributePriority | Gets or sets the priority of the current attribute in case that multiple instances are defined on the same element (lower values are processed before). (Inherited from MulticastAttribute.)
Public property | AttributeReplace | Determines whether this attribute replaces other attributes found on the target declarations. (Inherited from MulticastAttribute.)
Public property | AttributeTargetAssemblies | Gets or sets the assemblies to which the current attribute apply. (Inherited from MulticastAttribute.)
Public property | AttributeTargetElements | Gets or sets the kind of elements to which this custom attributes applies. (Inherited from MulticastAttribute.)
Public property | AttributeTargetExternalMemberAttributes | Gets or sets the visibilities, scopes, virtualities, and implementation of members to which this attribute applies, when the member is external to the current module. (Inherited from MulticastAttribute.)
Public property | AttributeTargetExternalTypeAttributes | Gets or sets the visibilities of types to which this attribute applies, when this type is external to the current module. (Inherited from MulticastAttribute.)
Public property | AttributeTargetMemberAttributes | Gets or sets the visibilities, scopes, virtualities, and implementation of members to which this attribute applies. (Inherited from MulticastAttribute.)
Public property | AttributeTargetMembers | Gets or sets the expression specifying to which members this instance applies. (Inherited from MulticastAttribute.)
Public property | AttributeTargetParameterAttributes | Gets or sets the passing style (by value, out or ref) of parameters to which this attribute applies. (Inherited from MulticastAttribute.)
Public property | AttributeTargetParameters | Gets or sets the expression specifying to which parameters this instance applies. (Inherited from MulticastAttribute.)
Public property | AttributeTargetTypeAttributes | Gets or sets the visibilities of types to which this attribute applies. (Inherited from MulticastAttribute.)
Public property | AttributeTargetTypes | Gets or sets the expression specifying to which types this instance applies. (Inherited from MulticastAttribute.)
Public property | IsAsync | Determines whether the target method is invoked asynchronously or asynchronously.
Back to Top
See Also
DispatchedAttribute Class
PostSharp.Patterns.Threading Namespace

Online Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


DispatchedAttribute Constructor

DispatchedAttribute Constructor PostSharp Documentation
Initializes a new DispatchedAttribute.

Namespace: PostSharp.Patterns.Threading
Assembly: PostSharp.Patterns.Threading (in PostSharp.Patterns.Threading.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
public DispatchedAttribute(
    bool isAsync = false
)
public DispatchedAttribute(
    bool isAsync = false
)
Parameters
isAsync (Optional)
Type:   Online System Boolean
true if the target method must be invoked asynchronously, or false
            if the target method must be invoked synchronously, that is, if the caller must wait for the
            dispatched method to complete.
Remarks
Method that have a non-void return type or ref or out parameters
            cannot be dispatched asynchronously.
See Also
DispatchedAttribute Class
DispatchedAttribute Members
PostSharp.Patterns.Threading Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


DispatchedAttribute Methods

DispatchedAttribute Methods PostSharp Documentation
The DispatchedAttribute type exposes the following members.
Methods
 | Name | Description
Public method | CompileTimeInitialize | Method invoked at build time to initialize the instance fields of the current aspect. This method is invoked before any other build-time method. (Inherited from MethodLevelAspect.)
Public method | CompileTimeValidate | Method invoked at build time to ensure that the aspect has been applied to the right target. (Inherited from Aspect.)
Public method | GetAspectConfiguration | Method invoked at build tome to get the imperative configuration of the current Aspect. (Inherited from Aspect.)
Public method | RuntimeInitialize | Initializes the current aspect. (Inherited from MethodLevelAspect.)
Back to Top
See Also
DispatchedAttribute Class
PostSharp.Patterns.Threading Namespace

Online Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


DispatchedAttribute Properties

DispatchedAttribute Properties PostSharp Documentation
The DispatchedAttribute type exposes the following members.
Properties
 | Name | Description
Public property | AspectPriority | Gets or sets the weaving priority of the aspect. (Inherited from Aspect.)
Public property | AttributeExclude | If true, indicates that this attribute removes all other instances of the same attribute type from the set of elements defined by the current instance. (Inherited from MulticastAttribute.)
Public property | AttributeId | Obsolete. (Inherited from MulticastAttribute.)
Public property | AttributeInheritance | Determines whether this attribute is inherited (Inherited from MulticastAttribute.)
Public property | AttributePriority | Gets or sets the priority of the current attribute in case that multiple instances are defined on the same element (lower values are processed before). (Inherited from MulticastAttribute.)
Public property | AttributeReplace | Determines whether this attribute replaces other attributes found on the target declarations. (Inherited from MulticastAttribute.)
Public property | AttributeTargetAssemblies | Gets or sets the assemblies to which the current attribute apply. (Inherited from MulticastAttribute.)
Public property | AttributeTargetElements | Gets or sets the kind of elements to which this custom attributes applies. (Inherited from MulticastAttribute.)
Public property | AttributeTargetExternalMemberAttributes | Gets or sets the visibilities, scopes, virtualities, and implementation of members to which this attribute applies, when the member is external to the current module. (Inherited from MulticastAttribute.)
Public property | AttributeTargetExternalTypeAttributes | Gets or sets the visibilities of types to which this attribute applies, when this type is external to the current module. (Inherited from MulticastAttribute.)
Public property | AttributeTargetMemberAttributes | Gets or sets the visibilities, scopes, virtualities, and implementation of members to which this attribute applies. (Inherited from MulticastAttribute.)
Public property | AttributeTargetMembers | Gets or sets the expression specifying to which members this instance applies. (Inherited from MulticastAttribute.)
Public property | AttributeTargetParameterAttributes | Gets or sets the passing style (by value, out or ref) of parameters to which this attribute applies. (Inherited from MulticastAttribute.)
Public property | AttributeTargetParameters | Gets or sets the expression specifying to which parameters this instance applies. (Inherited from MulticastAttribute.)
Public property | AttributeTargetTypeAttributes | Gets or sets the visibilities of types to which this attribute applies. (Inherited from MulticastAttribute.)
Public property | AttributeTargetTypes | Gets or sets the expression specifying to which types this instance applies. (Inherited from MulticastAttribute.)
Public property | IsAsync | Determines whether the target method is invoked asynchronously or asynchronously.
Back to Top
See Also
DispatchedAttribute Class
PostSharp.Patterns.Threading Namespace

Online Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


DispatchedAttribute.IsAsync Property

DispatchedAttribute IsAsync Property PostSharp Documentation
Determines whether the target method is invoked asynchronously or asynchronously.

Namespace: PostSharp.Patterns.Threading
Assembly: PostSharp.Patterns.Threading (in PostSharp.Patterns.Threading.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
public bool IsAsync { get; set; }
public bool IsAsync { get; set; }
Property Value
Type:   Online Boolean
true if the target method must be invoked asynchronously, or false
            if the target method must be invoked synchronously, that is, if the caller must wait for the
            dispatched method to complete.

Remarks
Method that have a non-void return type or ref or out parameters
            cannot be dispatched asynchronously.
See Also
DispatchedAttribute Class
DispatchedAttribute Members
PostSharp.Patterns.Threading Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


ExplicitlySynchronizedAttribute Class

ExplicitlySynchronizedAttribute Class PostSharp Documentation
Custom attribute that, when applied to a method or field, specifies that multithreaded access to this method or field is synchronized manually in user code. This custom attribute prevents PostSharp threading aspects (Actor, ReaderWriterSynchronizedAttribute and ThreadUnsafeAttribute) from generating synchronization or verification code for the field or method, and from emitting build-time errors and warnings.
Inheritance Hierarchy
Online System Object
Online System Attribute
PostSharp.Patterns.Threading ExplicitlySynchronizedAttribute

Namespace: PostSharp.Patterns.Threading
Assembly: PostSharp.Patterns.Threading (in PostSharp.Patterns.Threading.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
public sealed class ExplicitlySynchronizedAttribute : Attribute
public sealed class ExplicitlySynchronizedAttribute : Attribute
See Also
ExplicitlySynchronizedAttribute Members
PostSharp.Patterns.Threading Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


ExplicitlySynchronizedAttribute Members

ExplicitlySynchronizedAttribute Members PostSharp Documentation

The ExplicitlySynchronizedAttribute type exposes the following members.
Constructors
 | Name | Description
Public method | ExplicitlySynchronizedAttribute | Initializes a new instance of the ExplicitlySynchronizedAttribute class
Back to Top
See Also
ExplicitlySynchronizedAttribute Class
PostSharp.Patterns.Threading Namespace

Online Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


ExplicitlySynchronizedAttribute Constructor

ExplicitlySynchronizedAttribute Constructor PostSharp Documentation
Initializes a new instance of the ExplicitlySynchronizedAttribute class

Namespace: PostSharp.Patterns.Threading
Assembly: PostSharp.Patterns.Threading (in PostSharp.Patterns.Threading.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
public ExplicitlySynchronizedAttribute()
public ExplicitlySynchronizedAttribute()
See Also
ExplicitlySynchronizedAttribute Class
ExplicitlySynchronizedAttribute Members
PostSharp.Patterns.Threading Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


IAction Interface

IAction Interface PostSharp Documentation
Defines a parameterless Invoke method.

Namespace: PostSharp.Patterns.Threading
Assembly: PostSharp.Patterns.Threading (in PostSharp.Patterns.Threading.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
public interface IAction
public interface IAction
See Also
IAction Members
PostSharp.Patterns.Threading Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


IAction Members

IAction Members PostSharp Documentation

The IAction type exposes the following members.
Methods
 | Name | Description
Public method | Invoke | Invokes the action.
Back to Top
See Also
IAction Interface
PostSharp.Patterns.Threading Namespace

Online Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


IAction Methods

IAction Methods PostSharp Documentation
The IAction type exposes the following members.
Methods
 | Name | Description
Public method | Invoke | Invokes the action.
Back to Top
See Also
IAction Interface
PostSharp.Patterns.Threading Namespace

Online Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


IAction.Invoke Method

IAction Invoke Method PostSharp Documentation
Invokes the action.

Namespace: PostSharp.Patterns.Threading
Assembly: PostSharp.Patterns.Threading (in PostSharp.Patterns.Threading.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
void Invoke()
void Invoke()
See Also
IAction Interface
IAction Members
PostSharp.Patterns.Threading Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


IDispatcher Interface

IDispatcher Interface PostSharp Documentation
Defines the semantics of a facility that executes actions synchronously or asynchronously, possibly on a different thread.

Namespace: PostSharp.Patterns.Threading
Assembly: PostSharp.Patterns.Threading (in PostSharp.Patterns.Threading.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
public interface IDispatcher
public interface IDispatcher
See Also
IDispatcher Members
PostSharp.Patterns.Threading Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


IDispatcher Members

IDispatcher Members PostSharp Documentation

The IDispatcher type exposes the following members.
Methods
 | Name | Description
Public method | BeginInvoke | Queues an action for asynchronous execution.
Public method | CheckAccess | Determines whether the current thread has access to the current dispatcher.
Public method | Invoke | Executes an action synchronously.
Back to Top
Properties
 | Name | Description
Public property | IsInvokeSupported | Determines whether the Invoke(IAction) method is supported.
Back to Top
See Also
IDispatcher Interface
PostSharp.Patterns.Threading Namespace

Online Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


IDispatcher Methods

IDispatcher Methods PostSharp Documentation
The IDispatcher type exposes the following members.
Methods
 | Name | Description
Public method | BeginInvoke | Queues an action for asynchronous execution.
Public method | CheckAccess | Determines whether the current thread has access to the current dispatcher.
Public method | Invoke | Executes an action synchronously.
Back to Top
See Also
IDispatcher Interface
PostSharp.Patterns.Threading Namespace

Online Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


IDispatcher.BeginInvoke Method

IDispatcher BeginInvoke Method PostSharp Documentation
Queues an action for asynchronous execution.

Namespace: PostSharp.Patterns.Threading
Assembly: PostSharp.Patterns.Threading (in PostSharp.Patterns.Threading.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
void BeginInvoke(
    IAction action
)
void BeginInvoke(
    IAction action
)
Parameters
action
Type: PostSharp.Patterns.Threading IAction
Action to be executed.
Remarks
This method qu
See Also
IDispatcher Interface
IDispatcher Members
PostSharp.Patterns.Threading Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


IDispatcher.CheckAccess Method

IDispatcher CheckAccess Method PostSharp Documentation
Determines whether the current thread has access to the current dispatcher.

Namespace: PostSharp.Patterns.Threading
Assembly: PostSharp.Patterns.Threading (in PostSharp.Patterns.Threading.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
bool CheckAccess()
bool CheckAccess()
Return Value
Type:   Online Boolean
true if the current thread can directly call methods of objects protected
            by the current dispatcher, or false if methods Invoke(IAction) or BeginInvoke(IAction)
            must be used.
See Also
IDispatcher Interface
IDispatcher Members
PostSharp.Patterns.Threading Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


IDispatcher.Invoke Method

IDispatcher Invoke Method PostSharp Documentation
Executes an action synchronously.

Namespace: PostSharp.Patterns.Threading
Assembly: PostSharp.Patterns.Threading (in PostSharp.Patterns.Threading.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
void Invoke(
    IAction action
)
void Invoke(
    IAction action
)
Parameters
action
Type: PostSharp.Patterns.Threading IAction
Action to be executed.
See Also
IDispatcher Interface
IDispatcher Members
PostSharp.Patterns.Threading Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


IDispatcher Properties

IDispatcher Properties PostSharp Documentation
The IDispatcher type exposes the following members.
Properties
 | Name | Description
Public property | IsInvokeSupported | Determines whether the Invoke(IAction) method is supported.
Back to Top
See Also
IDispatcher Interface
PostSharp.Patterns.Threading Namespace

Online Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


IDispatcher.IsInvokeSupported Property

IDispatcher IsInvokeSupported Property PostSharp Documentation
Determines whether the Invoke(IAction) method is supported.

Namespace: PostSharp.Patterns.Threading
Assembly: PostSharp.Patterns.Threading (in PostSharp.Patterns.Threading.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
bool IsInvokeSupported { get; }
bool IsInvokeSupported { get; }
Property Value
Type:   Online Boolean
Remarks
 If false,
            the dispatcher only supports asynchronous invocation (BeginInvoke(IAction)).
See Also
IDispatcher Interface
IDispatcher Members
PostSharp.Patterns.Threading Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


IDispatcherObject Interface

IDispatcherObject Interface PostSharp Documentation
Interface implemented by objects that are whose access to methods is being controlled by a Dispatcher.

Namespace: PostSharp.Patterns.Threading
Assembly: PostSharp.Patterns.Threading (in PostSharp.Patterns.Threading.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
public interface IDispatcherObject
public interface IDispatcherObject
See Also
IDispatcherObject Members
PostSharp.Patterns.Threading Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


IDispatcherObject Members

IDispatcherObject Members PostSharp Documentation

The IDispatcherObject type exposes the following members.
Properties
 | Name | Description
Public property | Dispatcher | Gets the IDispatcher that controls access to methods of the current object.
Back to Top
See Also
IDispatcherObject Interface
PostSharp.Patterns.Threading Namespace

Online Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


IDispatcherObject Properties

IDispatcherObject Properties PostSharp Documentation
The IDispatcherObject type exposes the following members.
Properties
 | Name | Description
Public property | Dispatcher | Gets the IDispatcher that controls access to methods of the current object.
Back to Top
See Also
IDispatcherObject Interface
PostSharp.Patterns.Threading Namespace

Online Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


IDispatcherObject.Dispatcher Property

IDispatcherObject Dispatcher Property PostSharp Documentation
Gets the IDispatcher that controls access to methods of the current object.

Namespace: PostSharp.Patterns.Threading
Assembly: PostSharp.Patterns.Threading (in PostSharp.Patterns.Threading.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
IDispatcher Dispatcher { get; }
IDispatcher Dispatcher { get; }
Property Value
Type: IDispatcher
See Also
IDispatcherObject Interface
IDispatcherObject Members
PostSharp.Patterns.Threading Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


IReaderWriterSynchronized Interface

IReaderWriterSynchronized Interface PostSharp Documentation
Exposes the Online ReaderWriterLockSlim that should be used to synchronize access to an object. This interface is used by the ReaderWriterSynchronizedAttribute aspect.

Namespace: PostSharp.Patterns.Threading
Assembly: PostSharp.Patterns.Threading (in PostSharp.Patterns.Threading.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
public interface IReaderWriterSynchronized
public interface IReaderWriterSynchronized
See Also
IReaderWriterSynchronized Members
PostSharp.Patterns.Threading Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


IReaderWriterSynchronized Members

IReaderWriterSynchronized Members PostSharp Documentation

The IReaderWriterSynchronized type exposes the following members.
Properties
 | Name | Description
Public property | Lock | Gets the Online ReaderWriterLockSlim that has to be used to synchronize access to the current instance.
Back to Top
See Also
IReaderWriterSynchronized Interface
PostSharp.Patterns.Threading Namespace

Online Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


IReaderWriterSynchronized Properties

IReaderWriterSynchronized Properties PostSharp Documentation
The IReaderWriterSynchronized type exposes the following members.
Properties
 | Name | Description
Public property | Lock | Gets the Online ReaderWriterLockSlim that has to be used to synchronize access to the current instance.
Back to Top
See Also
IReaderWriterSynchronized Interface
PostSharp.Patterns.Threading Namespace

Online Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


IReaderWriterSynchronized.Lock Property

IReaderWriterSynchronized Lock Property PostSharp Documentation
Gets the Online ReaderWriterLockSlim that has to be used to synchronize access to the current instance.

Namespace: PostSharp.Patterns.Threading
Assembly: PostSharp.Patterns.Threading (in PostSharp.Patterns.Threading.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
PortableReaderWriterLock Lock { get; }
PortableReaderWriterLock Lock { get; }
Property Value
Type: PortableReaderWriterLock
See Also
IReaderWriterSynchronized Interface
IReaderWriterSynchronized Members
PostSharp.Patterns.Threading Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


LockNotHeldException Class

LockNotHeldException Class PostSharp Documentation
Exception thrown by the ReaderWriterSynchronizedAttribute and ThreadUnsafeAttribute when a thread attempts to access fields without holding the proper lock.
Inheritance Hierarchy
Online System Object
Online System Exception
PostSharp.Patterns.Threading LockNotHeldException

Namespace: PostSharp.Patterns.Threading
Assembly: PostSharp.Patterns.Threading (in PostSharp.Patterns.Threading.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
[SerializableAttribute]
public class LockNotHeldException : Exception
[SerializableAttribute]
public class LockNotHeldException : Exception
See Also
PostSharp.Patterns.Threading Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


ObserverLockAttribute Class

ObserverLockAttribute Class PostSharp Documentation
Custom attribute that, when applied on a method or event, specifies that it should be executed in a observer lock. When current thread holds the writer lock, the lock is downgraded to upgradeable reader lock during execution of the method. Otherwise, a reader lock is acquired. When the aspect is applied to an event, the lock is acquired when the event is fired.
Inheritance Hierarchy
Online System Object
Online System Attribute
PostSharp.Extensibility MulticastAttribute
PostSharp.Aspects Aspect
PostSharp.Patterns.Threading ObserverLockAttribute

Namespace: PostSharp.Patterns.Threading
Assembly: PostSharp.Patterns.Threading (in PostSharp.Patterns.Threading.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
[SerializableAttribute]
public sealed class ObserverLockAttribute : Aspect
[SerializableAttribute]
public sealed class ObserverLockAttribute : Aspect
Remarks
The current custom attribute can be applied to instance methods of classes enhanced by the
            ReaderWriterSynchronizedAttribute aspect or implementing the IReaderWriterSynchronized interface.
See Also
ObserverLockAttribute Members
PostSharp.Patterns.Threading Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


ObserverLockAttribute Members

ObserverLockAttribute Members PostSharp Documentation

The ObserverLockAttribute type exposes the following members.
Constructors
 | Name | Description
Public method | ObserverLockAttribute | Initializes a new ObserverLockAttribute.
Back to Top
Methods
 | Name | Description
Public method | CompileTimeValidate | Method invoked at build time to ensure that the aspect has been applied to the right target. (Inherited from Aspect.)
Public method | GetAspectConfiguration | Method invoked at build tome to get the imperative configuration of the current Aspect. (Inherited from Aspect.)
Back to Top
Properties
 | Name | Description
Public property | AspectPriority | Gets or sets the weaving priority of the aspect. (Inherited from Aspect.)
Public property | AttributeExclude | If true, indicates that this attribute removes all other instances of the same attribute type from the set of elements defined by the current instance. (Inherited from MulticastAttribute.)
Public property | AttributeId | Obsolete. (Inherited from MulticastAttribute.)
Public property | AttributeInheritance | Determines whether this attribute is inherited (Inherited from MulticastAttribute.)
Public property | AttributePriority | Gets or sets the priority of the current attribute in case that multiple instances are defined on the same element (lower values are processed before). (Inherited from MulticastAttribute.)
Public property | AttributeReplace | Determines whether this attribute replaces other attributes found on the target declarations. (Inherited from MulticastAttribute.)
Public property | AttributeTargetAssemblies | Gets or sets the assemblies to which the current attribute apply. (Inherited from MulticastAttribute.)
Public property | AttributeTargetElements | Gets or sets the kind of elements to which this custom attributes applies. (Inherited from MulticastAttribute.)
Public property | AttributeTargetExternalMemberAttributes | Gets or sets the visibilities, scopes, virtualities, and implementation of members to which this attribute applies, when the member is external to the current module. (Inherited from MulticastAttribute.)
Public property | AttributeTargetExternalTypeAttributes | Gets or sets the visibilities of types to which this attribute applies, when this type is external to the current module. (Inherited from MulticastAttribute.)
Public property | AttributeTargetMemberAttributes | Gets or sets the visibilities, scopes, virtualities, and implementation of members to which this attribute applies. (Inherited from MulticastAttribute.)
Public property | AttributeTargetMembers | Gets or sets the expression specifying to which members this instance applies. (Inherited from MulticastAttribute.)
Public property | AttributeTargetParameterAttributes | Gets or sets the passing style (by value, out or ref) of parameters to which this attribute applies. (Inherited from MulticastAttribute.)
Public property | AttributeTargetParameters | Gets or sets the expression specifying to which parameters this instance applies. (Inherited from MulticastAttribute.)
Public property | AttributeTargetTypeAttributes | Gets or sets the visibilities of types to which this attribute applies. (Inherited from MulticastAttribute.)
Public property | AttributeTargetTypes | Gets or sets the expression specifying to which types this instance applies. (Inherited from MulticastAttribute.)
Back to Top
See Also
ObserverLockAttribute Class
PostSharp.Patterns.Threading Namespace

Online Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


ObserverLockAttribute Constructor

ObserverLockAttribute Constructor PostSharp Documentation
Initializes a new ObserverLockAttribute.

Namespace: PostSharp.Patterns.Threading
Assembly: PostSharp.Patterns.Threading (in PostSharp.Patterns.Threading.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
public ObserverLockAttribute()
public ObserverLockAttribute()
See Also
ObserverLockAttribute Class
ObserverLockAttribute Members
PostSharp.Patterns.Threading Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


ObserverLockAttribute Methods

ObserverLockAttribute Methods PostSharp Documentation
The ObserverLockAttribute type exposes the following members.
Methods
 | Name | Description
Public method | CompileTimeValidate | Method invoked at build time to ensure that the aspect has been applied to the right target. (Inherited from Aspect.)
Public method | GetAspectConfiguration | Method invoked at build tome to get the imperative configuration of the current Aspect. (Inherited from Aspect.)
Back to Top
See Also
ObserverLockAttribute Class
PostSharp.Patterns.Threading Namespace

Online Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


ObserverLockAttribute Properties

ObserverLockAttribute Properties PostSharp Documentation
The ObserverLockAttribute type exposes the following members.
Properties
 | Name | Description
Public property | AspectPriority | Gets or sets the weaving priority of the aspect. (Inherited from Aspect.)
Public property | AttributeExclude | If true, indicates that this attribute removes all other instances of the same attribute type from the set of elements defined by the current instance. (Inherited from MulticastAttribute.)
Public property | AttributeId | Obsolete. (Inherited from MulticastAttribute.)
Public property | AttributeInheritance | Determines whether this attribute is inherited (Inherited from MulticastAttribute.)
Public property | AttributePriority | Gets or sets the priority of the current attribute in case that multiple instances are defined on the same element (lower values are processed before). (Inherited from MulticastAttribute.)
Public property | AttributeReplace | Determines whether this attribute replaces other attributes found on the target declarations. (Inherited from MulticastAttribute.)
Public property | AttributeTargetAssemblies | Gets or sets the assemblies to which the current attribute apply. (Inherited from MulticastAttribute.)
Public property | AttributeTargetElements | Gets or sets the kind of elements to which this custom attributes applies. (Inherited from MulticastAttribute.)
Public property | AttributeTargetExternalMemberAttributes | Gets or sets the visibilities, scopes, virtualities, and implementation of members to which this attribute applies, when the member is external to the current module. (Inherited from MulticastAttribute.)
Public property | AttributeTargetExternalTypeAttributes | Gets or sets the visibilities of types to which this attribute applies, when this type is external to the current module. (Inherited from MulticastAttribute.)
Public property | AttributeTargetMemberAttributes | Gets or sets the visibilities, scopes, virtualities, and implementation of members to which this attribute applies. (Inherited from MulticastAttribute.)
Public property | AttributeTargetMembers | Gets or sets the expression specifying to which members this instance applies. (Inherited from MulticastAttribute.)
Public property | AttributeTargetParameterAttributes | Gets or sets the passing style (by value, out or ref) of parameters to which this attribute applies. (Inherited from MulticastAttribute.)
Public property | AttributeTargetParameters | Gets or sets the expression specifying to which parameters this instance applies. (Inherited from MulticastAttribute.)
Public property | AttributeTargetTypeAttributes | Gets or sets the visibilities of types to which this attribute applies. (Inherited from MulticastAttribute.)
Public property | AttributeTargetTypes | Gets or sets the expression specifying to which types this instance applies. (Inherited from MulticastAttribute.)
Back to Top
See Also
ObserverLockAttribute Class
PostSharp.Patterns.Threading Namespace

Online Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


PortableReaderWriterLock Class

PortableReaderWriterLock Class PostSharp Documentation
Encapsulates a Online ReaderWriterLockSlim.
Inheritance Hierarchy
Online System Object
PostSharp.Patterns.Threading PortableReaderWriterLock

Namespace: PostSharp.Patterns.Threading
Assembly: PostSharp.Patterns.Threading (in PostSharp.Patterns.Threading.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
public class PortableReaderWriterLock
public class PortableReaderWriterLock
See Also
PortableReaderWriterLock Members
PostSharp.Patterns.Threading Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


PortableReaderWriterLock Members

PortableReaderWriterLock Members PostSharp Documentation

The PortableReaderWriterLock type exposes the following members.
Constructors
 | Name | Description
Public method | PortableReaderWriterLock | Initializes a new PortableReaderWriterLock.
Back to Top
See Also
PortableReaderWriterLock Class
PostSharp.Patterns.Threading Namespace

Online Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


PortableReaderWriterLock Constructor

PortableReaderWriterLock Constructor PostSharp Documentation
Initializes a new PortableReaderWriterLock.

Namespace: PostSharp.Patterns.Threading
Assembly: PostSharp.Patterns.Threading (in PostSharp.Patterns.Threading.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
public PortableReaderWriterLock()
public PortableReaderWriterLock()
See Also
PortableReaderWriterLock Class
PortableReaderWriterLock Members
PostSharp.Patterns.Threading Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


ReaderLockAttribute Class

ReaderLockAttribute Class PostSharp Documentation
Custom attribute that, when applied on a method, specifies that it should be executed in a reader lock. The method can then execute concurrently with other threads holding a reader lock on the object, but will wait if another thread holds a writer lock.
Inheritance Hierarchy
Online System Object
Online System Attribute
PostSharp.Extensibility MulticastAttribute
PostSharp.Aspects Aspect
PostSharp.Aspects MethodLevelAspect
PostSharp.Aspects OnMethodBoundaryAspect
PostSharp.Patterns.Threading ReaderWriterLockAttribute
PostSharp.Patterns.Threading ReaderLockAttribute

Namespace: PostSharp.Patterns.Threading
Assembly: PostSharp.Patterns.Threading (in PostSharp.Patterns.Threading.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
[SerializableAttribute]
public sealed class ReaderLockAttribute : ReaderWriterLockAttribute
[SerializableAttribute]
public sealed class ReaderLockAttribute : ReaderWriterLockAttribute
Remarks
The current custom attribute can be applied to instance methods of classes enhanced by the
            ReaderWriterSynchronizedAttribute aspect or implementing the IReaderWriterSynchronized interface.
See Also
ReaderLockAttribute Members
PostSharp.Patterns.Threading Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


ReaderLockAttribute Members

ReaderLockAttribute Members PostSharp Documentation

The ReaderLockAttribute type exposes the following members.
Constructors
 | Name | Description
Public method | ReaderLockAttribute | Initializes a new instance of the ReaderLockAttribute class
Back to Top
Methods
 | Name | Description
Public method | CompileTimeInitialize | Method invoked at build time to initialize the instance fields of the current aspect. This method is invoked before any other build-time method. (Inherited from MethodLevelAspect.)
Public method | CompileTimeValidate | Method invoked at build time to ensure that the aspect has been applied to the right target. (Inherited from Aspect.)
Public method | GetAspectConfiguration | Method invoked at build tome to get the imperative configuration of the current Aspect. (Inherited from Aspect.)
Public method | OnEntry | Method executed before the body of methods to which this aspect is applied. (Inherited from OnMethodBoundaryAspect.)
Public method | OnException | Method executed after the body of methods to which this aspect is applied, in case that the method resulted with an exception. (Inherited from OnMethodBoundaryAspect.)
Public method | OnExit | Method executed after the body of methods to which this aspect is applied, even when the method exists with an exception (this method is invoked from the finally block). (Inherited from OnMethodBoundaryAspect.)
Public method | OnSuccess | Method executed after the body of methods to which this aspect is applied, but only when the method successfully returns (i.e. when no exception flies out the method.). (Inherited from OnMethodBoundaryAspect.)
Public method | RuntimeInitialize | Initializes the current aspect. (Inherited from MethodLevelAspect.)
Back to Top
Properties
 | Name | Description
Public property | AspectPriority | Gets or sets the weaving priority of the aspect. (Inherited from Aspect.)
Public property | AttributeExclude | If true, indicates that this attribute removes all other instances of the same attribute type from the set of elements defined by the current instance. (Inherited from MulticastAttribute.)
Public property | AttributeId | Obsolete. (Inherited from MulticastAttribute.)
Public property | AttributeInheritance | Determines whether this attribute is inherited (Inherited from MulticastAttribute.)
Public property | AttributePriority | Gets or sets the priority of the current attribute in case that multiple instances are defined on the same element (lower values are processed before). (Inherited from MulticastAttribute.)
Public property | AttributeReplace | Determines whether this attribute replaces other attributes found on the target declarations. (Inherited from MulticastAttribute.)
Public property | AttributeTargetAssemblies | Gets or sets the assemblies to which the current attribute apply. (Inherited from MulticastAttribute.)
Public property | AttributeTargetElements | Gets or sets the kind of elements to which this custom attributes applies. (Inherited from MulticastAttribute.)
Public property | AttributeTargetExternalMemberAttributes | Gets or sets the visibilities, scopes, virtualities, and implementation of members to which this attribute applies, when the member is external to the current module. (Inherited from MulticastAttribute.)
Public property | AttributeTargetExternalTypeAttributes | Gets or sets the visibilities of types to which this attribute applies, when this type is external to the current module. (Inherited from MulticastAttribute.)
Public property | AttributeTargetMemberAttributes | Gets or sets the visibilities, scopes, virtualities, and implementation of members to which this attribute applies. (Inherited from MulticastAttribute.)
Public property | AttributeTargetMembers | Gets or sets the expression specifying to which members this instance applies. (Inherited from MulticastAttribute.)
Public property | AttributeTargetParameterAttributes | Gets or sets the passing style (by value, out or ref) of parameters to which this attribute applies. (Inherited from MulticastAttribute.)
Public property | AttributeTargetParameters | Gets or sets the expression specifying to which parameters this instance applies. (Inherited from MulticastAttribute.)
Public property | AttributeTargetTypeAttributes | Gets or sets the visibilities of types to which this attribute applies. (Inherited from MulticastAttribute.)
Public property | AttributeTargetTypes | Gets or sets the expression specifying to which types this instance applies. (Inherited from MulticastAttribute.)
Back to Top
See Also
ReaderLockAttribute Class
PostSharp.Patterns.Threading Namespace

Online Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


ReaderLockAttribute Constructor

ReaderLockAttribute Constructor PostSharp Documentation
Initializes a new instance of the ReaderLockAttribute class

Namespace: PostSharp.Patterns.Threading
Assembly: PostSharp.Patterns.Threading (in PostSharp.Patterns.Threading.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
public ReaderLockAttribute()
public ReaderLockAttribute()
See Also
ReaderLockAttribute Class
ReaderLockAttribute Members
PostSharp.Patterns.Threading Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


ReaderLockAttribute Methods

ReaderLockAttribute Methods PostSharp Documentation
The ReaderLockAttribute type exposes the following members.
Methods
 | Name | Description
Public method | CompileTimeInitialize | Method invoked at build time to initialize the instance fields of the current aspect. This method is invoked before any other build-time method. (Inherited from MethodLevelAspect.)
Public method | CompileTimeValidate | Method invoked at build time to ensure that the aspect has been applied to the right target. (Inherited from Aspect.)
Public method | GetAspectConfiguration | Method invoked at build tome to get the imperative configuration of the current Aspect. (Inherited from Aspect.)
Public method | OnEntry | Method executed before the body of methods to which this aspect is applied. (Inherited from OnMethodBoundaryAspect.)
Public method | OnException | Method executed after the body of methods to which this aspect is applied, in case that the method resulted with an exception. (Inherited from OnMethodBoundaryAspect.)
Public method | OnExit | Method executed after the body of methods to which this aspect is applied, even when the method exists with an exception (this method is invoked from the finally block). (Inherited from OnMethodBoundaryAspect.)
Public method | OnSuccess | Method executed after the body of methods to which this aspect is applied, but only when the method successfully returns (i.e. when no exception flies out the method.). (Inherited from OnMethodBoundaryAspect.)
Public method | RuntimeInitialize | Initializes the current aspect. (Inherited from MethodLevelAspect.)
Back to Top
See Also
ReaderLockAttribute Class
PostSharp.Patterns.Threading Namespace

Online Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


ReaderLockAttribute Properties

ReaderLockAttribute Properties PostSharp Documentation
The ReaderLockAttribute type exposes the following members.
Properties
 | Name | Description
Public property | AspectPriority | Gets or sets the weaving priority of the aspect. (Inherited from Aspect.)
Public property | AttributeExclude | If true, indicates that this attribute removes all other instances of the same attribute type from the set of elements defined by the current instance. (Inherited from MulticastAttribute.)
Public property | AttributeId | Obsolete. (Inherited from MulticastAttribute.)
Public property | AttributeInheritance | Determines whether this attribute is inherited (Inherited from MulticastAttribute.)
Public property | AttributePriority | Gets or sets the priority of the current attribute in case that multiple instances are defined on the same element (lower values are processed before). (Inherited from MulticastAttribute.)
Public property | AttributeReplace | Determines whether this attribute replaces other attributes found on the target declarations. (Inherited from MulticastAttribute.)
Public property | AttributeTargetAssemblies | Gets or sets the assemblies to which the current attribute apply. (Inherited from MulticastAttribute.)
Public property | AttributeTargetElements | Gets or sets the kind of elements to which this custom attributes applies. (Inherited from MulticastAttribute.)
Public property | AttributeTargetExternalMemberAttributes | Gets or sets the visibilities, scopes, virtualities, and implementation of members to which this attribute applies, when the member is external to the current module. (Inherited from MulticastAttribute.)
Public property | AttributeTargetExternalTypeAttributes | Gets or sets the visibilities of types to which this attribute applies, when this type is external to the current module. (Inherited from MulticastAttribute.)
Public property | AttributeTargetMemberAttributes | Gets or sets the visibilities, scopes, virtualities, and implementation of members to which this attribute applies. (Inherited from MulticastAttribute.)
Public property | AttributeTargetMembers | Gets or sets the expression specifying to which members this instance applies. (Inherited from MulticastAttribute.)
Public property | AttributeTargetParameterAttributes | Gets or sets the passing style (by value, out or ref) of parameters to which this attribute applies. (Inherited from MulticastAttribute.)
Public property | AttributeTargetParameters | Gets or sets the expression specifying to which parameters this instance applies. (Inherited from MulticastAttribute.)
Public property | AttributeTargetTypeAttributes | Gets or sets the visibilities of types to which this attribute applies. (Inherited from MulticastAttribute.)
Public property | AttributeTargetTypes | Gets or sets the expression specifying to which types this instance applies. (Inherited from MulticastAttribute.)
Back to Top
See Also
ReaderLockAttribute Class
PostSharp.Patterns.Threading Namespace

Online Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


ReaderWriterLockAttribute Class

ReaderWriterLockAttribute Class PostSharp Documentation
Base class for ReaderLockAttribute, WriterLockAttribute and UpgradeableReaderLockAttribute.
Inheritance Hierarchy
Online System Object
Online System Attribute
PostSharp.Extensibility MulticastAttribute
PostSharp.Aspects Aspect
PostSharp.Aspects MethodLevelAspect
PostSharp.Aspects OnMethodBoundaryAspect
PostSharp.Patterns.Threading ReaderWriterLockAttribute
PostSharp.Patterns.Threading ReaderLockAttribute
PostSharp.Patterns.Threading UpgradeableReaderLockAttribute
PostSharp.Patterns.Threading WriterLockAttribute

Namespace: PostSharp.Patterns.Threading
Assembly: PostSharp.Patterns.Threading (in PostSharp.Patterns.Threading.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
[SerializableAttribute]
public abstract class ReaderWriterLockAttribute : OnMethodBoundaryAspect
[SerializableAttribute]
public abstract class ReaderWriterLockAttribute : OnMethodBoundaryAspect
See Also
ReaderWriterLockAttribute Members
PostSharp.Patterns.Threading Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


ReaderWriterLockAttribute Members

ReaderWriterLockAttribute Members PostSharp Documentation

The ReaderWriterLockAttribute type exposes the following members.
Methods
 | Name | Description
Public method | CompileTimeInitialize | Method invoked at build time to initialize the instance fields of the current aspect. This method is invoked before any other build-time method. (Inherited from MethodLevelAspect.)
Public method | CompileTimeValidate | Method invoked at build time to ensure that the aspect has been applied to the right target. (Inherited from Aspect.)
Protected method | CreateAspectConfiguration | Method invoked at build time to create a concrete AspectConfiguration instance specifically for the current Aspect type. (Inherited from OnMethodBoundaryAspect.)
Public method | GetAspectConfiguration | Method invoked at build tome to get the imperative configuration of the current Aspect. (Inherited from Aspect.)
Public method | OnEntry | Method executed before the body of methods to which this aspect is applied. (Inherited from OnMethodBoundaryAspect.)
Public method | OnException | Method executed after the body of methods to which this aspect is applied, in case that the method resulted with an exception. (Inherited from OnMethodBoundaryAspect.)
Public method | OnExit | Method executed after the body of methods to which this aspect is applied, even when the method exists with an exception (this method is invoked from the finally block). (Inherited from OnMethodBoundaryAspect.)
Public method | OnSuccess | Method executed after the body of methods to which this aspect is applied, but only when the method successfully returns (i.e. when no exception flies out the method.). (Inherited from OnMethodBoundaryAspect.)
Public method | RuntimeInitialize | Initializes the current aspect. (Inherited from MethodLevelAspect.)
Protected method | SetAspectConfiguration | Method invoked at build time to set up an AspectConfiguration object according to the current Aspect instance and a specified target element of the current aspect. (Inherited from Aspect.)
Back to Top
Properties
 | Name | Description
Public property | AspectPriority | Gets or sets the weaving priority of the aspect. (Inherited from Aspect.)
Public property | AttributeExclude | If true, indicates that this attribute removes all other instances of the same attribute type from the set of elements defined by the current instance. (Inherited from MulticastAttribute.)
Public property | AttributeId | Obsolete. (Inherited from MulticastAttribute.)
Public property | AttributeInheritance | Determines whether this attribute is inherited (Inherited from MulticastAttribute.)
Public property | AttributePriority | Gets or sets the priority of the current attribute in case that multiple instances are defined on the same element (lower values are processed before). (Inherited from MulticastAttribute.)
Public property | AttributeReplace | Determines whether this attribute replaces other attributes found on the target declarations. (Inherited from MulticastAttribute.)
Public property | AttributeTargetAssemblies | Gets or sets the assemblies to which the current attribute apply. (Inherited from MulticastAttribute.)
Public property | AttributeTargetElements | Gets or sets the kind of elements to which this custom attributes applies. (Inherited from MulticastAttribute.)
Public property | AttributeTargetExternalMemberAttributes | Gets or sets the visibilities, scopes, virtualities, and implementation of members to which this attribute applies, when the member is external to the current module. (Inherited from MulticastAttribute.)
Public property | AttributeTargetExternalTypeAttributes | Gets or sets the visibilities of types to which this attribute applies, when this type is external to the current module. (Inherited from MulticastAttribute.)
Public property | AttributeTargetMemberAttributes | Gets or sets the visibilities, scopes, virtualities, and implementation of members to which this attribute applies. (Inherited from MulticastAttribute.)
Public property | AttributeTargetMembers | Gets or sets the expression specifying to which members this instance applies. (Inherited from MulticastAttribute.)
Public property | AttributeTargetParameterAttributes | Gets or sets the passing style (by value, out or ref) of parameters to which this attribute applies. (Inherited from MulticastAttribute.)
Public property | AttributeTargetParameters | Gets or sets the expression specifying to which parameters this instance applies. (Inherited from MulticastAttribute.)
Public property | AttributeTargetTypeAttributes | Gets or sets the visibilities of types to which this attribute applies. (Inherited from MulticastAttribute.)
Public property | AttributeTargetTypes | Gets or sets the expression specifying to which types this instance applies. (Inherited from MulticastAttribute.)
Protected property | SerializerType | Gets or sets the Online Type of the serializer (a type derived from AspectSerializer) used to serialize the aspect instance at build time and deserialize it at runtime. (Inherited from Aspect.)
Back to Top
See Also
ReaderWriterLockAttribute Class
PostSharp.Patterns.Threading Namespace

Online Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


ReaderWriterLockAttribute Methods

ReaderWriterLockAttribute Methods PostSharp Documentation
The ReaderWriterLockAttribute type exposes the following members.
Methods
 | Name | Description
Public method | CompileTimeInitialize | Method invoked at build time to initialize the instance fields of the current aspect. This method is invoked before any other build-time method. (Inherited from MethodLevelAspect.)
Public method | CompileTimeValidate | Method invoked at build time to ensure that the aspect has been applied to the right target. (Inherited from Aspect.)
Protected method | CreateAspectConfiguration | Method invoked at build time to create a concrete AspectConfiguration instance specifically for the current Aspect type. (Inherited from OnMethodBoundaryAspect.)
Public method | GetAspectConfiguration | Method invoked at build tome to get the imperative configuration of the current Aspect. (Inherited from Aspect.)
Public method | OnEntry | Method executed before the body of methods to which this aspect is applied. (Inherited from OnMethodBoundaryAspect.)
Public method | OnException | Method executed after the body of methods to which this aspect is applied, in case that the method resulted with an exception. (Inherited from OnMethodBoundaryAspect.)
Public method | OnExit | Method executed after the body of methods to which this aspect is applied, even when the method exists with an exception (this method is invoked from the finally block). (Inherited from OnMethodBoundaryAspect.)
Public method | OnSuccess | Method executed after the body of methods to which this aspect is applied, but only when the method successfully returns (i.e. when no exception flies out the method.). (Inherited from OnMethodBoundaryAspect.)
Public method | RuntimeInitialize | Initializes the current aspect. (Inherited from MethodLevelAspect.)
Protected method | SetAspectConfiguration | Method invoked at build time to set up an AspectConfiguration object according to the current Aspect instance and a specified target element of the current aspect. (Inherited from Aspect.)
Back to Top
See Also
ReaderWriterLockAttribute Class
PostSharp.Patterns.Threading Namespace

Online Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


ReaderWriterLockAttribute Properties

ReaderWriterLockAttribute Properties PostSharp Documentation
The ReaderWriterLockAttribute type exposes the following members.
Properties
 | Name | Description
Public property | AspectPriority | Gets or sets the weaving priority of the aspect. (Inherited from Aspect.)
Public property | AttributeExclude | If true, indicates that this attribute removes all other instances of the same attribute type from the set of elements defined by the current instance. (Inherited from MulticastAttribute.)
Public property | AttributeId | Obsolete. (Inherited from MulticastAttribute.)
Public property | AttributeInheritance | Determines whether this attribute is inherited (Inherited from MulticastAttribute.)
Public property | AttributePriority | Gets or sets the priority of the current attribute in case that multiple instances are defined on the same element (lower values are processed before). (Inherited from MulticastAttribute.)
Public property | AttributeReplace | Determines whether this attribute replaces other attributes found on the target declarations. (Inherited from MulticastAttribute.)
Public property | AttributeTargetAssemblies | Gets or sets the assemblies to which the current attribute apply. (Inherited from MulticastAttribute.)
Public property | AttributeTargetElements | Gets or sets the kind of elements to which this custom attributes applies. (Inherited from MulticastAttribute.)
Public property | AttributeTargetExternalMemberAttributes | Gets or sets the visibilities, scopes, virtualities, and implementation of members to which this attribute applies, when the member is external to the current module. (Inherited from MulticastAttribute.)
Public property | AttributeTargetExternalTypeAttributes | Gets or sets the visibilities of types to which this attribute applies, when this type is external to the current module. (Inherited from MulticastAttribute.)
Public property | AttributeTargetMemberAttributes | Gets or sets the visibilities, scopes, virtualities, and implementation of members to which this attribute applies. (Inherited from MulticastAttribute.)
Public property | AttributeTargetMembers | Gets or sets the expression specifying to which members this instance applies. (Inherited from MulticastAttribute.)
Public property | AttributeTargetParameterAttributes | Gets or sets the passing style (by value, out or ref) of parameters to which this attribute applies. (Inherited from MulticastAttribute.)
Public property | AttributeTargetParameters | Gets or sets the expression specifying to which parameters this instance applies. (Inherited from MulticastAttribute.)
Public property | AttributeTargetTypeAttributes | Gets or sets the visibilities of types to which this attribute applies. (Inherited from MulticastAttribute.)
Public property | AttributeTargetTypes | Gets or sets the expression specifying to which types this instance applies. (Inherited from MulticastAttribute.)
Protected property | SerializerType | Gets or sets the Online Type of the serializer (a type derived from AspectSerializer) used to serialize the aspect instance at build time and deserialize it at runtime. (Inherited from Aspect.)
Back to Top
See Also
ReaderWriterLockAttribute Class
PostSharp.Patterns.Threading Namespace

Online Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


ReaderWriterSynchronizedAttribute Class

ReaderWriterSynchronizedAttribute Class PostSharp Documentation
Custom attribute that, when applied on a class, applies the reader-writer threading model to this class and all derived class. Members of this class must then be annoted with attributes specifying the required access level (ReaderWriterLockAttribute, WriterLockAttribute, ObserverLockAttribute or UpgradeableReaderLockAttribute), otherwise build-time and run-time errors are emitted.
Inheritance Hierarchy
Online System Object
Online System Attribute
PostSharp.Extensibility MulticastAttribute
PostSharp.Aspects Aspect
PostSharp.Aspects TypeLevelAspect
PostSharp.Aspects InstanceLevelAspect
PostSharp.Patterns.Threading ReaderWriterSynchronizedAttribute

Namespace: PostSharp.Patterns.Threading
Assembly: PostSharp.Patterns.Threading (in PostSharp.Patterns.Threading.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
[SerializableAttribute]
public sealed class ReaderWriterSynchronizedAttribute : InstanceLevelAspect,
    IReaderWriterSynchronized
[SerializableAttribute]
public sealed class ReaderWriterSynchronizedAttribute : InstanceLevelAspect,
    IReaderWriterSynchronized
Remarks
By default, this aspect will associate a new lock to each instance of the target class. If the same lock must be shared by several instances (for instance an order and its order lines),
            the IReaderWriterSynchronized interface must be implemented manually.

The reader-writer-synchronized threading model imposes the following design rules:
  • The class cannot have public, internal or static fields, unless these field are annotated
            with the ExplicitlySynchronizedAttribute custom attribute. In this case, the aspect does not guarantee
            that these fields are properly synchronized.
  • Instance fields cannot be accessed from static methods unless the method or the field is
            annotated with the ExplicitlySynchronizedAttribute custom attribute. In this case, the aspect
            does not guarantee that these fields are properly synchronized.

These rules are enforced at build time.
Additionally, the aspect can enforce the following run-time verifications:
  • Methods must hold a writer lock (WriterLockAttribute) in order to
            set a field, unless the method or the field is annotated with the ExplicitlySynchronizedAttribute.
  • Method must hold a reader lock (ReaderLockAttribute, ObserverLockAttribute
            or UpgradeableReaderLockAttribute) in order to read more than one field, unless the method or the
            fields are annotated with the ExplicitlySynchronizedAttribute custom attribute. Note that, for
            thread safely, it is also required that the field size is lower than a machine word (32 or 64 bit depending
            on the platform). For instance, it is not safe to read a   Online DateTime or   Online Decimal without
            a read lock. However, this rule is not enforced.
The rules above are not enforced during execution of class constructors.
Runtime verification is enabled by default. It can be disabled by setting the RuntimeVerificationEnabled to false.
It is recommended to enable runtime verification for the Debug build and disable them
            for the Release build by making the value of the RuntimeVerificationEnabled property
             dependent on a constant whose value is set differently for each build configuration.
See Also
ReaderWriterSynchronizedAttribute Members
PostSharp.Patterns.Threading Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


ReaderWriterSynchronizedAttribute Members

ReaderWriterSynchronizedAttribute Members PostSharp Documentation

The ReaderWriterSynchronizedAttribute type exposes the following members.
Constructors
 | Name | Description
Public method | ReaderWriterSynchronizedAttribute | Initializes a new instance of the ReaderWriterSynchronizedAttribute class
Back to Top
Methods
 | Name | Description
Public method | CompileTimeInitialize | Method invoked at build time to initialize the instance fields of the current aspect. This method is invoked before any other build-time method. (Inherited from TypeLevelAspect.)
Public method | CompileTimeValidate | Method invoked at build time to ensure that the aspect has been applied to the right target. (Inherited from Aspect.)
Public method | CreateInstance | Creates a new instance of the aspect based on the current instance, serving as a prototype. (Inherited from InstanceLevelAspect.)
Public method | GetAspectConfiguration | Method invoked at build tome to get the imperative configuration of the current Aspect. (Inherited from Aspect.)
Public method | OnCloned | Method called after the an object enhanced by the current aspect has been cloned using Online MemberwiseClone . The this parameter refers to the new aspect instance in the cloned object. (Inherited from InstanceLevelAspect.)
Public method | RuntimeInitialize | Initializes the current aspect. (Inherited from TypeLevelAspect.)
Public method | RuntimeInitializeInstance | Initializes the aspect instance. This method is invoked when all system elements of the aspect (like member imports) have completed. (Inherited from InstanceLevelAspect.)
Back to Top
Properties
 | Name | Description
Public property | AspectPriority | Gets or sets the weaving priority of the aspect. (Inherited from Aspect.)
Public property | AttributeExclude | If true, indicates that this attribute removes all other instances of the same attribute type from the set of elements defined by the current instance. (Inherited from MulticastAttribute.)
Public property | AttributeId | Obsolete. (Inherited from MulticastAttribute.)
Public property | AttributeInheritance | Determines whether this attribute is inherited (Inherited from MulticastAttribute.)
Public property | AttributePriority | Gets or sets the priority of the current attribute in case that multiple instances are defined on the same element (lower values are processed before). (Inherited from MulticastAttribute.)
Public property | AttributeReplace | Determines whether this attribute replaces other attributes found on the target declarations. (Inherited from MulticastAttribute.)
Public property | AttributeTargetAssemblies | Gets or sets the assemblies to which the current attribute apply. (Inherited from MulticastAttribute.)
Public property | AttributeTargetElements | Gets or sets the kind of elements to which this custom attributes applies. (Inherited from MulticastAttribute.)
Public property | AttributeTargetExternalMemberAttributes | Gets or sets the visibilities, scopes, virtualities, and implementation of members to which this attribute applies, when the member is external to the current module. (Inherited from MulticastAttribute.)
Public property | AttributeTargetExternalTypeAttributes | Gets or sets the visibilities of types to which this attribute applies, when this type is external to the current module. (Inherited from MulticastAttribute.)
Public property | AttributeTargetMemberAttributes | Gets or sets the visibilities, scopes, virtualities, and implementation of members to which this attribute applies. (Inherited from MulticastAttribute.)
Public property | AttributeTargetMembers | Gets or sets the expression specifying to which members this instance applies. (Inherited from MulticastAttribute.)
Public property | AttributeTargetParameterAttributes | Gets or sets the passing style (by value, out or ref) of parameters to which this attribute applies. (Inherited from MulticastAttribute.)
Public property | AttributeTargetParameters | Gets or sets the expression specifying to which parameters this instance applies. (Inherited from MulticastAttribute.)
Public property | AttributeTargetTypeAttributes | Gets or sets the visibilities of types to which this attribute applies. (Inherited from MulticastAttribute.)
Public property | AttributeTargetTypes | Gets or sets the expression specifying to which types this instance applies. (Inherited from MulticastAttribute.)
Public property | Instance | Gets the object to which the current aspect has been applied. (Inherited from InstanceLevelAspect.)
Public property | Lock | Gets the Online ReaderWriterLockSlim that has to be used to synchronize access to the current instance.
Public property | RuntimeVerificationEnabled | Determines whether the aspect should generate run-time validation of the threading model.
Back to Top
See Also
ReaderWriterSynchronizedAttribute Class
PostSharp.Patterns.Threading Namespace

Online Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


ReaderWriterSynchronizedAttribute Constructor

ReaderWriterSynchronizedAttribute Constructor PostSharp Documentation
Initializes a new instance of the ReaderWriterSynchronizedAttribute class

Namespace: PostSharp.Patterns.Threading
Assembly: PostSharp.Patterns.Threading (in PostSharp.Patterns.Threading.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
public ReaderWriterSynchronizedAttribute()
public ReaderWriterSynchronizedAttribute()
See Also
ReaderWriterSynchronizedAttribute Class
ReaderWriterSynchronizedAttribute Members
PostSharp.Patterns.Threading Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


ReaderWriterSynchronizedAttribute Methods

ReaderWriterSynchronizedAttribute Methods PostSharp Documentation
The ReaderWriterSynchronizedAttribute type exposes the following members.
Methods
 | Name | Description
Public method | CompileTimeInitialize | Method invoked at build time to initialize the instance fields of the current aspect. This method is invoked before any other build-time method. (Inherited from TypeLevelAspect.)
Public method | CompileTimeValidate | Method invoked at build time to ensure that the aspect has been applied to the right target. (Inherited from Aspect.)
Public method | CreateInstance | Creates a new instance of the aspect based on the current instance, serving as a prototype. (Inherited from InstanceLevelAspect.)
Public method | GetAspectConfiguration | Method invoked at build tome to get the imperative configuration of the current Aspect. (Inherited from Aspect.)
Public method | OnCloned | Method called after the an object enhanced by the current aspect has been cloned using Online MemberwiseClone . The this parameter refers to the new aspect instance in the cloned object. (Inherited from InstanceLevelAspect.)
Public method | RuntimeInitialize | Initializes the current aspect. (Inherited from TypeLevelAspect.)
Public method | RuntimeInitializeInstance | Initializes the aspect instance. This method is invoked when all system elements of the aspect (like member imports) have completed. (Inherited from InstanceLevelAspect.)
Back to Top
See Also
ReaderWriterSynchronizedAttribute Class
PostSharp.Patterns.Threading Namespace

Online Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


ReaderWriterSynchronizedAttribute Properties

ReaderWriterSynchronizedAttribute Properties PostSharp Documentation
The ReaderWriterSynchronizedAttribute type exposes the following members.
Properties
 | Name | Description
Public property | AspectPriority | Gets or sets the weaving priority of the aspect. (Inherited from Aspect.)
Public property | AttributeExclude | If true, indicates that this attribute removes all other instances of the same attribute type from the set of elements defined by the current instance. (Inherited from MulticastAttribute.)
Public property | AttributeId | Obsolete. (Inherited from MulticastAttribute.)
Public property | AttributeInheritance | Determines whether this attribute is inherited (Inherited from MulticastAttribute.)
Public property | AttributePriority | Gets or sets the priority of the current attribute in case that multiple instances are defined on the same element (lower values are processed before). (Inherited from MulticastAttribute.)
Public property | AttributeReplace | Determines whether this attribute replaces other attributes found on the target declarations. (Inherited from MulticastAttribute.)
Public property | AttributeTargetAssemblies | Gets or sets the assemblies to which the current attribute apply. (Inherited from MulticastAttribute.)
Public property | AttributeTargetElements | Gets or sets the kind of elements to which this custom attributes applies. (Inherited from MulticastAttribute.)
Public property | AttributeTargetExternalMemberAttributes | Gets or sets the visibilities, scopes, virtualities, and implementation of members to which this attribute applies, when the member is external to the current module. (Inherited from MulticastAttribute.)
Public property | AttributeTargetExternalTypeAttributes | Gets or sets the visibilities of types to which this attribute applies, when this type is external to the current module. (Inherited from MulticastAttribute.)
Public property | AttributeTargetMemberAttributes | Gets or sets the visibilities, scopes, virtualities, and implementation of members to which this attribute applies. (Inherited from MulticastAttribute.)
Public property | AttributeTargetMembers | Gets or sets the expression specifying to which members this instance applies. (Inherited from MulticastAttribute.)
Public property | AttributeTargetParameterAttributes | Gets or sets the passing style (by value, out or ref) of parameters to which this attribute applies. (Inherited from MulticastAttribute.)
Public property | AttributeTargetParameters | Gets or sets the expression specifying to which parameters this instance applies. (Inherited from MulticastAttribute.)
Public property | AttributeTargetTypeAttributes | Gets or sets the visibilities of types to which this attribute applies. (Inherited from MulticastAttribute.)
Public property | AttributeTargetTypes | Gets or sets the expression specifying to which types this instance applies. (Inherited from MulticastAttribute.)
Public property | Instance | Gets the object to which the current aspect has been applied. (Inherited from InstanceLevelAspect.)
Public property | Lock | Gets the Online ReaderWriterLockSlim that has to be used to synchronize access to the current instance.
Public property | RuntimeVerificationEnabled | Determines whether the aspect should generate run-time validation of the threading model.
Back to Top
See Also
ReaderWriterSynchronizedAttribute Class
PostSharp.Patterns.Threading Namespace

Online Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


ReaderWriterSynchronizedAttribute.Lock Property

ReaderWriterSynchronizedAttribute Lock Property PostSharp Documentation
Gets the Online ReaderWriterLockSlim that has to be used to synchronize access to the current instance.

Namespace: PostSharp.Patterns.Threading
Assembly: PostSharp.Patterns.Threading (in PostSharp.Patterns.Threading.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
public PortableReaderWriterLock Lock { get; }
public PortableReaderWriterLock Lock { get; }
Property Value
Type: PortableReaderWriterLock
Implements
IReaderWriterSynchronized Lock
See Also
ReaderWriterSynchronizedAttribute Class
ReaderWriterSynchronizedAttribute Members
PostSharp.Patterns.Threading Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


ReaderWriterSynchronizedAttribute.RuntimeVerificationEnabled Property

ReaderWriterSynchronizedAttribute RuntimeVerificationEnabled Property PostSharp Documentation
Determines whether the aspect should generate run-time validation of the threading model.

Namespace: PostSharp.Patterns.Threading
Assembly: PostSharp.Patterns.Threading (in PostSharp.Patterns.Threading.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
public bool RuntimeVerificationEnabled { get; set; }
public bool RuntimeVerificationEnabled { get; set; }
Property Value
Type:   Online Boolean
Remarks
It is recommended to enable runtime verification for the Debug build and disable them
            for the Release build by making the value of this property dependent on a constant whose value is set differently for each
            build configuration.
This property is true by default.
See Also
ReaderWriterSynchronizedAttribute Class
ReaderWriterSynchronizedAttribute Members
PostSharp.Patterns.Threading Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


ThreadingException Class

ThreadingException Class PostSharp Documentation
Base class for exceptions thrown by the PostSharp.Patterns.Threading component.
Inheritance Hierarchy
Online System Object
Online System Exception
PostSharp.Patterns.Threading ThreadingException
PostSharp.Patterns.Threading ConcurrentAccessException
PostSharp.Patterns.Threading DeadlockException
PostSharp.Patterns.Threading ThreadMismatchException

Namespace: PostSharp.Patterns.Threading
Assembly: PostSharp.Patterns.Threading (in PostSharp.Patterns.Threading.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
[SerializableAttribute]
public abstract class ThreadingException : Exception
[SerializableAttribute]
public abstract class ThreadingException : Exception
See Also
PostSharp.Patterns.Threading Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


ThreadingPatternsAspectRoles Class

ThreadingPatternsAspectRoles Class PostSharp Documentation
Enumerates the aspect roles (for use with AspectRoleDependencyAttribute) used by the PostSharp.Patterns.Threading component.
Inheritance Hierarchy
Online System Object
PostSharp.Patterns.Threading ThreadingPatternsAspectRoles

Namespace: PostSharp.Patterns.Threading
Assembly: PostSharp.Patterns.Threading (in PostSharp.Patterns.Threading.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
public static class ThreadingPatternsAspectRoles
public static class ThreadingPatternsAspectRoles
See Also
ThreadingPatternsAspectRoles Members
PostSharp.Patterns.Threading Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


ThreadingPatternsAspectRoles Members

ThreadingPatternsAspectRoles Members PostSharp Documentation

The ThreadingPatternsAspectRoles type exposes the following members.
Fields
Name | Description
ThreadingModel | Role of an aspect that provides a threading model.
Back to Top
See Also
ThreadingPatternsAspectRoles Class
PostSharp.Patterns.Threading Namespace

Online Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


ThreadingPatternsAspectRoles Fields

ThreadingPatternsAspectRoles Fields PostSharp Documentation
The ThreadingPatternsAspectRoles type exposes the following members.
Fields
Name | Description
ThreadingModel | Role of an aspect that provides a threading model.
Back to Top
See Also
ThreadingPatternsAspectRoles Class
PostSharp.Patterns.Threading Namespace

Online Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


ThreadingPatternsAspectRoles.ThreadingModel Field

ThreadingPatternsAspectRoles ThreadingModel Field PostSharp Documentation
Role of an aspect that provides a threading model.

Namespace: PostSharp.Patterns.Threading
Assembly: PostSharp.Patterns.Threading (in PostSharp.Patterns.Threading.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
public const string ThreadingModel
public const string ThreadingModel
Field Value
Type:   Online String
See Also
ThreadingPatternsAspectRoles Class
ThreadingPatternsAspectRoles Members
PostSharp.Patterns.Threading Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


ThreadMismatchException Class

ThreadMismatchException Class PostSharp Documentation
Exception thrown when a thread attempts to access an object that is affined to another thread.
Inheritance Hierarchy
Online System Object
Online System Exception
PostSharp.Patterns.Threading ThreadingException
PostSharp.Patterns.Threading ThreadMismatchException

Namespace: PostSharp.Patterns.Threading
Assembly: PostSharp.Patterns.Threading (in PostSharp.Patterns.Threading.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
[SerializableAttribute]
public sealed class ThreadMismatchException : ThreadingException
[SerializableAttribute]
public sealed class ThreadMismatchException : ThreadingException
See Also
ThreadMismatchException Members
PostSharp.Patterns.Threading Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


ThreadMismatchException Members

ThreadMismatchException Members PostSharp Documentation

Constructors
 | Name | Description
Public method | ThreadMismatchException | Initializes a new ThreadMismatchException.
Public method | ThreadMismatchException(String) | Initializes a new ThreadMismatchException and sets the error message.
Public method | ThreadMismatchException(String, Exception) | Initializes a new ThreadMismatchException and sets the error message and the inner exception.
Back to Top
See Also
ThreadMismatchException Class
PostSharp.Patterns.Threading Namespace

Online Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


ThreadMismatchException Constructor

ThreadMismatchException Constructor PostSharp Documentation
Overload List
 | Name | Description
Public method | ThreadMismatchException | Initializes a new ThreadMismatchException.
Public method | ThreadMismatchException(String) | Initializes a new ThreadMismatchException and sets the error message.
Public method | ThreadMismatchException(String, Exception) | Initializes a new ThreadMismatchException and sets the error message and the inner exception.
Back to Top
See Also
ThreadMismatchException Class
ThreadMismatchException Members
PostSharp.Patterns.Threading Namespace

Online Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


ThreadMismatchException Constructor

ThreadMismatchException Constructor PostSharp Documentation
Initializes a new ThreadMismatchException.

Namespace: PostSharp.Patterns.Threading
Assembly: PostSharp.Patterns.Threading (in PostSharp.Patterns.Threading.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
public ThreadMismatchException()
public ThreadMismatchException()
See Also
ThreadMismatchException Class
ThreadMismatchException Members
ThreadMismatchException Overload
PostSharp.Patterns.Threading Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


ThreadMismatchException Constructor (String)

ThreadMismatchException Constructor (String) PostSharp Documentation
Initializes a new ThreadMismatchException and sets the error message.

Namespace: PostSharp.Patterns.Threading
Assembly: PostSharp.Patterns.Threading (in PostSharp.Patterns.Threading.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
public ThreadMismatchException(
    string message
)
public ThreadMismatchException(
    string message
)
Parameters
message
Type:   Online System String
Error message.
See Also
ThreadMismatchException Class
ThreadMismatchException Members
ThreadMismatchException Overload
PostSharp.Patterns.Threading Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


ThreadMismatchException Constructor (String, Exception)

ThreadMismatchException Constructor (String, Exception) PostSharp Documentation
Initializes a new ThreadMismatchException and sets the error message and the inner exception.

Namespace: PostSharp.Patterns.Threading
Assembly: PostSharp.Patterns.Threading (in PostSharp.Patterns.Threading.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
public ThreadMismatchException(
    string message,
    Exception inner
)
public ThreadMismatchException(
    string message,
    Exception inner
)
Parameters
message
Type:   Online System String
Error message.
inner
Type:   Online System Exception
Inner exception.
See Also
ThreadMismatchException Class
ThreadMismatchException Members
ThreadMismatchException Overload
PostSharp.Patterns.Threading Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


ThreadUnsafeAttribute Class

ThreadUnsafeAttribute Class PostSharp Documentation
Custom attribute that, when applied on a type, ensures that only one thread executes in methods of this type. When more than one thread accesses methods of this type, a ConcurrentAccessException exception is thrown.
Inheritance Hierarchy
Online System Object
Online System Attribute
PostSharp.Extensibility MulticastAttribute
PostSharp.Aspects Aspect
PostSharp.Aspects TypeLevelAspect
PostSharp.Patterns.Threading ThreadUnsafeAttribute

Namespace: PostSharp.Patterns.Threading
Assembly: PostSharp.Patterns.Threading (in PostSharp.Patterns.Threading.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
public sealed class ThreadUnsafeAttribute : TypeLevelAspect,
    IAspectProvider, IAspect, IService
public sealed class ThreadUnsafeAttribute : TypeLevelAspect,
    IAspectProvider, IAspect, IService
Remarks
By default, static methods, as well as accesses to static fields, are assumed to be thread-safe. Only instance
            methods are checked for concurrent execution, and the Model of exclusion is the instance itself.

            When the policy is set to Static (using the ThreadUnsafeAttribute(ThreadUnsafePolicy) constructor overload), both static and instance
            methods are checked for concurrent execution, and the Model of exclusion is the type declaring the method. If the declaring
            type is a generic type, the exclusion Model is the generic type instance.

            By default only public methods are verified. VerifyCallingThreadAttribute can be used to mark private methods that should be checked as well.
            ExplicitlySynchronizedAttribute allows exclusion of public methods (marking them as thread-safe).

Runtime verification is enabled by default. It can be disabled by setting the RuntimeVerificationEnabled to false.
It is recommended to enable runtime verification for the Debug build and disable them
            for the Release build by making the value of the RuntimeVerificationEnabled property
             dependent on a constant whose value is set differently for each build configuration.
See Also
ThreadUnsafeAttribute Members
PostSharp.Patterns.Threading Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


ThreadUnsafeAttribute Members

ThreadUnsafeAttribute Members PostSharp Documentation

The ThreadUnsafeAttribute type exposes the following members.
Constructors
 | Name | Description
Public method | ThreadUnsafeAttribute | Initializes a new ThreadUnsafeAttribute with the Instance policy.
Public method | ThreadUnsafeAttribute(ThreadUnsafePolicy) | Initializes a new ThreadUnsafeAttribute and specifies the threading policy.
Back to Top
Methods
 | Name | Description
Public method | CompileTimeInitialize | Method invoked at build time to initialize the instance fields of the current aspect. This method is invoked before any other build-time method. (Inherited from TypeLevelAspect.)
Public method | CompileTimeValidate | Method invoked at build time to ensure that the aspect has been applied to the right target. (Inherited from Aspect.)
Public method | GetAspectConfiguration | Method invoked at build tome to get the imperative configuration of the current Aspect. (Inherited from Aspect.)
Public method | RuntimeInitialize | Initializes the current aspect. (Inherited from TypeLevelAspect.)
Back to Top
Properties
 | Name | Description
Public property | AspectPriority | Gets or sets the weaving priority of the aspect. (Inherited from Aspect.)
Public property | AttributeExclude | If true, indicates that this attribute removes all other instances of the same attribute type from the set of elements defined by the current instance. (Inherited from MulticastAttribute.)
Public property | AttributeId | Obsolete. (Inherited from MulticastAttribute.)
Public property | AttributeInheritance | Determines whether this attribute is inherited (Inherited from MulticastAttribute.)
Public property | AttributePriority | Gets or sets the priority of the current attribute in case that multiple instances are defined on the same element (lower values are processed before). (Inherited from MulticastAttribute.)
Public property | AttributeReplace | Determines whether this attribute replaces other attributes found on the target declarations. (Inherited from MulticastAttribute.)
Public property | AttributeTargetAssemblies | Gets or sets the assemblies to which the current attribute apply. (Inherited from MulticastAttribute.)
Public property | AttributeTargetElements | Gets or sets the kind of elements to which this custom attributes applies. (Inherited from MulticastAttribute.)
Public property | AttributeTargetExternalMemberAttributes | Gets or sets the visibilities, scopes, virtualities, and implementation of members to which this attribute applies, when the member is external to the current module. (Inherited from MulticastAttribute.)
Public property | AttributeTargetExternalTypeAttributes | Gets or sets the visibilities of types to which this attribute applies, when this type is external to the current module. (Inherited from MulticastAttribute.)
Public property | AttributeTargetMemberAttributes | Gets or sets the visibilities, scopes, virtualities, and implementation of members to which this attribute applies. (Inherited from MulticastAttribute.)
Public property | AttributeTargetMembers | Gets or sets the expression specifying to which members this instance applies. (Inherited from MulticastAttribute.)
Public property | AttributeTargetParameterAttributes | Gets or sets the passing style (by value, out or ref) of parameters to which this attribute applies. (Inherited from MulticastAttribute.)
Public property | AttributeTargetParameters | Gets or sets the expression specifying to which parameters this instance applies. (Inherited from MulticastAttribute.)
Public property | AttributeTargetTypeAttributes | Gets or sets the visibilities of types to which this attribute applies. (Inherited from MulticastAttribute.)
Public property | AttributeTargetTypes | Gets or sets the expression specifying to which types this instance applies. (Inherited from MulticastAttribute.)
Public property | Policy | Gets the threading policy.
Public property | RuntimeVerificationEnabled | Determines whether the aspect should generate run-time validation of the threading model.
Back to Top
See Also
ThreadUnsafeAttribute Class
PostSharp.Patterns.Threading Namespace

Online Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


ThreadUnsafeAttribute Constructor

ThreadUnsafeAttribute Constructor PostSharp Documentation
Overload List
 | Name | Description
Public method | ThreadUnsafeAttribute | Initializes a new ThreadUnsafeAttribute with the Instance policy.
Public method | ThreadUnsafeAttribute(ThreadUnsafePolicy) | Initializes a new ThreadUnsafeAttribute and specifies the threading policy.
Back to Top
See Also
ThreadUnsafeAttribute Class
ThreadUnsafeAttribute Members
PostSharp.Patterns.Threading Namespace

Online Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


ThreadUnsafeAttribute Constructor

ThreadUnsafeAttribute Constructor PostSharp Documentation
Initializes a new ThreadUnsafeAttribute with the Instance policy.

Namespace: PostSharp.Patterns.Threading
Assembly: PostSharp.Patterns.Threading (in PostSharp.Patterns.Threading.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
public ThreadUnsafeAttribute()
public ThreadUnsafeAttribute()
See Also
ThreadUnsafeAttribute Class
ThreadUnsafeAttribute Members
ThreadUnsafeAttribute Overload
PostSharp.Patterns.Threading Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


ThreadUnsafeAttribute Constructor (ThreadUnsafePolicy)

ThreadUnsafeAttribute Constructor (ThreadUnsafePolicy) PostSharp Documentation
Initializes a new ThreadUnsafeAttribute and specifies the threading policy.

Namespace: PostSharp.Patterns.Threading
Assembly: PostSharp.Patterns.Threading (in PostSharp.Patterns.Threading.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
public ThreadUnsafeAttribute(
    ThreadUnsafePolicy policy
)
public ThreadUnsafeAttribute(
    ThreadUnsafePolicy policy
)
Parameters
policy
Type: PostSharp.Patterns.Threading ThreadUnsafePolicy
Threading policy.
See Also
ThreadUnsafeAttribute Class
ThreadUnsafeAttribute Members
ThreadUnsafeAttribute Overload
PostSharp.Patterns.Threading Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


ThreadUnsafeAttribute Methods

ThreadUnsafeAttribute Methods PostSharp Documentation
The ThreadUnsafeAttribute type exposes the following members.
Methods
 | Name | Description
Public method | CompileTimeInitialize | Method invoked at build time to initialize the instance fields of the current aspect. This method is invoked before any other build-time method. (Inherited from TypeLevelAspect.)
Public method | CompileTimeValidate | Method invoked at build time to ensure that the aspect has been applied to the right target. (Inherited from Aspect.)
Public method | GetAspectConfiguration | Method invoked at build tome to get the imperative configuration of the current Aspect. (Inherited from Aspect.)
Public method | RuntimeInitialize | Initializes the current aspect. (Inherited from TypeLevelAspect.)
Back to Top
See Also
ThreadUnsafeAttribute Class
PostSharp.Patterns.Threading Namespace

Online Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


ThreadUnsafeAttribute Properties

ThreadUnsafeAttribute Properties PostSharp Documentation
The ThreadUnsafeAttribute type exposes the following members.
Properties
 | Name | Description
Public property | AspectPriority | Gets or sets the weaving priority of the aspect. (Inherited from Aspect.)
Public property | AttributeExclude | If true, indicates that this attribute removes all other instances of the same attribute type from the set of elements defined by the current instance. (Inherited from MulticastAttribute.)
Public property | AttributeId | Obsolete. (Inherited from MulticastAttribute.)
Public property | AttributeInheritance | Determines whether this attribute is inherited (Inherited from MulticastAttribute.)
Public property | AttributePriority | Gets or sets the priority of the current attribute in case that multiple instances are defined on the same element (lower values are processed before). (Inherited from MulticastAttribute.)
Public property | AttributeReplace | Determines whether this attribute replaces other attributes found on the target declarations. (Inherited from MulticastAttribute.)
Public property | AttributeTargetAssemblies | Gets or sets the assemblies to which the current attribute apply. (Inherited from MulticastAttribute.)
Public property | AttributeTargetElements | Gets or sets the kind of elements to which this custom attributes applies. (Inherited from MulticastAttribute.)
Public property | AttributeTargetExternalMemberAttributes | Gets or sets the visibilities, scopes, virtualities, and implementation of members to which this attribute applies, when the member is external to the current module. (Inherited from MulticastAttribute.)
Public property | AttributeTargetExternalTypeAttributes | Gets or sets the visibilities of types to which this attribute applies, when this type is external to the current module. (Inherited from MulticastAttribute.)
Public property | AttributeTargetMemberAttributes | Gets or sets the visibilities, scopes, virtualities, and implementation of members to which this attribute applies. (Inherited from MulticastAttribute.)
Public property | AttributeTargetMembers | Gets or sets the expression specifying to which members this instance applies. (Inherited from MulticastAttribute.)
Public property | AttributeTargetParameterAttributes | Gets or sets the passing style (by value, out or ref) of parameters to which this attribute applies. (Inherited from MulticastAttribute.)
Public property | AttributeTargetParameters | Gets or sets the expression specifying to which parameters this instance applies. (Inherited from MulticastAttribute.)
Public property | AttributeTargetTypeAttributes | Gets or sets the visibilities of types to which this attribute applies. (Inherited from MulticastAttribute.)
Public property | AttributeTargetTypes | Gets or sets the expression specifying to which types this instance applies. (Inherited from MulticastAttribute.)
Public property | Policy | Gets the threading policy.
Public property | RuntimeVerificationEnabled | Determines whether the aspect should generate run-time validation of the threading model.
Back to Top
See Also
ThreadUnsafeAttribute Class
PostSharp.Patterns.Threading Namespace

Online Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


ThreadUnsafeAttribute.Policy Property

ThreadUnsafeAttribute Policy Property PostSharp Documentation
Gets the threading policy.

Namespace: PostSharp.Patterns.Threading
Assembly: PostSharp.Patterns.Threading (in PostSharp.Patterns.Threading.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
public ThreadUnsafePolicy Policy { get; }
public ThreadUnsafePolicy Policy { get; }
Property Value
Type: ThreadUnsafePolicy
See Also
ThreadUnsafeAttribute Class
ThreadUnsafeAttribute Members
PostSharp.Patterns.Threading Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


ThreadUnsafeAttribute.RuntimeVerificationEnabled Property

ThreadUnsafeAttribute RuntimeVerificationEnabled Property PostSharp Documentation
Determines whether the aspect should generate run-time validation of the threading model.

Namespace: PostSharp.Patterns.Threading
Assembly: PostSharp.Patterns.Threading (in PostSharp.Patterns.Threading.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
public bool RuntimeVerificationEnabled { get; set; }
public bool RuntimeVerificationEnabled { get; set; }
Property Value
Type:   Online Boolean
Remarks
It is recommended to enable runtime verification for the Debug build and disable them
            for the Release build by making the value of this property dependent on a constant whose value is set differently for each
            build configuration.
This property is true by default.
See Also
ThreadUnsafeAttribute Class
ThreadUnsafeAttribute Members
PostSharp.Patterns.Threading Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


ThreadUnsafePolicy Enumeration

ThreadUnsafePolicy Enumeration PostSharp Documentation
Enumerates policies of the ThreadUnsafeAttribute aspect.

Namespace: PostSharp.Patterns.Threading
Assembly: PostSharp.Patterns.Threading (in PostSharp.Patterns.Threading.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
public enum ThreadUnsafePolicy
public enum ThreadUnsafePolicy
Members
Member name | Value | Description
Instance | 0 | Instance methods are safe to run concurrently on different instances of the class. Static method are thread-safe.
Static | 1 | Instance methods are not thread-safe, even on different instances of the class. Static methods are not thread-safe as well.
ThreadAffine | 2 | Instance methods should only be run in the thread in which the object was created, static method are thread-safe
See Also
PostSharp.Patterns.Threading Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


UpgradeableReaderLockAttribute Class

UpgradeableReaderLockAttribute Class PostSharp Documentation
Custom attribute that, when applied on a method, specifies that it should be executed in a upgradeable reader lock. This aspect acquires a read lock immediately but reserves the possibility to upgrade to a writer lock later (by calling another method enhanced with the WriterLockAttribute aspect) by preventing other threads to acquire a writer lock. from acquiring a write lock.
Inheritance Hierarchy
Online System Object
Online System Attribute
PostSharp.Extensibility MulticastAttribute
PostSharp.Aspects Aspect
PostSharp.Aspects MethodLevelAspect
PostSharp.Aspects OnMethodBoundaryAspect
PostSharp.Patterns.Threading ReaderWriterLockAttribute
PostSharp.Patterns.Threading UpgradeableReaderLockAttribute

Namespace: PostSharp.Patterns.Threading
Assembly: PostSharp.Patterns.Threading (in PostSharp.Patterns.Threading.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
[SerializableAttribute]
public sealed class UpgradeableReaderLockAttribute : ReaderWriterLockAttribute
[SerializableAttribute]
public sealed class UpgradeableReaderLockAttribute : ReaderWriterLockAttribute
Remarks
The current custom attribute can be applied to instance methods of classes implementing
            the IReaderWriterSynchronized interface.
See Also
UpgradeableReaderLockAttribute Members
PostSharp.Patterns.Threading Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


UpgradeableReaderLockAttribute Members

UpgradeableReaderLockAttribute Members PostSharp Documentation

The UpgradeableReaderLockAttribute type exposes the following members.
Constructors
 | Name | Description
Public method | UpgradeableReaderLockAttribute | Initializes a new instance of the UpgradeableReaderLockAttribute class
Back to Top
Methods
 | Name | Description
Public method | CompileTimeInitialize | Method invoked at build time to initialize the instance fields of the current aspect. This method is invoked before any other build-time method. (Inherited from MethodLevelAspect.)
Public method | CompileTimeValidate | Method invoked at build time to ensure that the aspect has been applied to the right target. (Inherited from Aspect.)
Public method | GetAspectConfiguration | Method invoked at build tome to get the imperative configuration of the current Aspect. (Inherited from Aspect.)
Public method | OnEntry | Handler executed before execution of the method to which the current custom attribute is applied. (Overrides OnMethodBoundaryAspect OnEntry(MethodExecutionArgs).)
Public method | OnException | Method executed after the body of methods to which this aspect is applied, in case that the method resulted with an exception. (Inherited from OnMethodBoundaryAspect.)
Public method | OnExit | Handler executed after execution of the method to which the current custom attribute is applied. (Overrides OnMethodBoundaryAspect OnExit(MethodExecutionArgs).)
Public method | OnSuccess | Method executed after the body of methods to which this aspect is applied, but only when the method successfully returns (i.e. when no exception flies out the method.). (Inherited from OnMethodBoundaryAspect.)
Public method | RuntimeInitialize | Initializes the current aspect. (Inherited from MethodLevelAspect.)
Back to Top
Properties
 | Name | Description
Public property | AspectPriority | Gets or sets the weaving priority of the aspect. (Inherited from Aspect.)
Public property | AttributeExclude | If true, indicates that this attribute removes all other instances of the same attribute type from the set of elements defined by the current instance. (Inherited from MulticastAttribute.)
Public property | AttributeId | Obsolete. (Inherited from MulticastAttribute.)
Public property | AttributeInheritance | Determines whether this attribute is inherited (Inherited from MulticastAttribute.)
Public property | AttributePriority | Gets or sets the priority of the current attribute in case that multiple instances are defined on the same element (lower values are processed before). (Inherited from MulticastAttribute.)
Public property | AttributeReplace | Determines whether this attribute replaces other attributes found on the target declarations. (Inherited from MulticastAttribute.)
Public property | AttributeTargetAssemblies | Gets or sets the assemblies to which the current attribute apply. (Inherited from MulticastAttribute.)
Public property | AttributeTargetElements | Gets or sets the kind of elements to which this custom attributes applies. (Inherited from MulticastAttribute.)
Public property | AttributeTargetExternalMemberAttributes | Gets or sets the visibilities, scopes, virtualities, and implementation of members to which this attribute applies, when the member is external to the current module. (Inherited from MulticastAttribute.)
Public property | AttributeTargetExternalTypeAttributes | Gets or sets the visibilities of types to which this attribute applies, when this type is external to the current module. (Inherited from MulticastAttribute.)
Public property | AttributeTargetMemberAttributes | Gets or sets the visibilities, scopes, virtualities, and implementation of members to which this attribute applies. (Inherited from MulticastAttribute.)
Public property | AttributeTargetMembers | Gets or sets the expression specifying to which members this instance applies. (Inherited from MulticastAttribute.)
Public property | AttributeTargetParameterAttributes | Gets or sets the passing style (by value, out or ref) of parameters to which this attribute applies. (Inherited from MulticastAttribute.)
Public property | AttributeTargetParameters | Gets or sets the expression specifying to which parameters this instance applies. (Inherited from MulticastAttribute.)
Public property | AttributeTargetTypeAttributes | Gets or sets the visibilities of types to which this attribute applies. (Inherited from MulticastAttribute.)
Public property | AttributeTargetTypes | Gets or sets the expression specifying to which types this instance applies. (Inherited from MulticastAttribute.)
Back to Top
See Also
UpgradeableReaderLockAttribute Class
PostSharp.Patterns.Threading Namespace

Online Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


UpgradeableReaderLockAttribute Constructor

UpgradeableReaderLockAttribute Constructor PostSharp Documentation
Initializes a new instance of the UpgradeableReaderLockAttribute class

Namespace: PostSharp.Patterns.Threading
Assembly: PostSharp.Patterns.Threading (in PostSharp.Patterns.Threading.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
public UpgradeableReaderLockAttribute()
public UpgradeableReaderLockAttribute()
See Also
UpgradeableReaderLockAttribute Class
UpgradeableReaderLockAttribute Members
PostSharp.Patterns.Threading Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


UpgradeableReaderLockAttribute Methods

UpgradeableReaderLockAttribute Methods PostSharp Documentation
The UpgradeableReaderLockAttribute type exposes the following members.
Methods
 | Name | Description
Public method | CompileTimeInitialize | Method invoked at build time to initialize the instance fields of the current aspect. This method is invoked before any other build-time method. (Inherited from MethodLevelAspect.)
Public method | CompileTimeValidate | Method invoked at build time to ensure that the aspect has been applied to the right target. (Inherited from Aspect.)
Public method | GetAspectConfiguration | Method invoked at build tome to get the imperative configuration of the current Aspect. (Inherited from Aspect.)
Public method | OnEntry | Handler executed before execution of the method to which the current custom attribute is applied. (Overrides OnMethodBoundaryAspect OnEntry(MethodExecutionArgs).)
Public method | OnException | Method executed after the body of methods to which this aspect is applied, in case that the method resulted with an exception. (Inherited from OnMethodBoundaryAspect.)
Public method | OnExit | Handler executed after execution of the method to which the current custom attribute is applied. (Overrides OnMethodBoundaryAspect OnExit(MethodExecutionArgs).)
Public method | OnSuccess | Method executed after the body of methods to which this aspect is applied, but only when the method successfully returns (i.e. when no exception flies out the method.). (Inherited from OnMethodBoundaryAspect.)
Public method | RuntimeInitialize | Initializes the current aspect. (Inherited from MethodLevelAspect.)
Back to Top
See Also
UpgradeableReaderLockAttribute Class
PostSharp.Patterns.Threading Namespace

Online Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


UpgradeableReaderLockAttribute.OnEntry Method

UpgradeableReaderLockAttribute OnEntry Method PostSharp Documentation
Handler executed before execution of the method to which the current custom attribute is applied.

Namespace: PostSharp.Patterns.Threading
Assembly: PostSharp.Patterns.Threading (in PostSharp.Patterns.Threading.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
public override void OnEntry(
    MethodExecutionArgs eventArgs
)
public override void OnEntry(
    MethodExecutionArgs eventArgs
)
Parameters
eventArgs
Type: PostSharp.Aspects MethodExecutionArgs
[Missing <param name="eventArgs"/> documentation for "M:PostSharp.Patterns.Threading.UpgradeableReaderLockAttribute.OnEntry(PostSharp.Aspects.MethodExecutionArgs)"]
Implements
IOnMethodBoundaryAspect OnEntry(MethodExecutionArgs)
See Also
UpgradeableReaderLockAttribute Class
UpgradeableReaderLockAttribute Members
PostSharp.Patterns.Threading Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


UpgradeableReaderLockAttribute.OnExit Method

UpgradeableReaderLockAttribute OnExit Method PostSharp Documentation
Handler executed after execution of the method to which the current custom attribute is applied.

Namespace: PostSharp.Patterns.Threading
Assembly: PostSharp.Patterns.Threading (in PostSharp.Patterns.Threading.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
public override void OnExit(
    MethodExecutionArgs eventArgs
)
public override void OnExit(
    MethodExecutionArgs eventArgs
)
Parameters
eventArgs
Type: PostSharp.Aspects MethodExecutionArgs
[Missing <param name="eventArgs"/> documentation for "M:PostSharp.Patterns.Threading.UpgradeableReaderLockAttribute.OnExit(PostSharp.Aspects.MethodExecutionArgs)"]
Implements
IOnMethodBoundaryAspect OnExit(MethodExecutionArgs)
See Also
UpgradeableReaderLockAttribute Class
UpgradeableReaderLockAttribute Members
PostSharp.Patterns.Threading Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


UpgradeableReaderLockAttribute Properties

UpgradeableReaderLockAttribute Properties PostSharp Documentation
The UpgradeableReaderLockAttribute type exposes the following members.
Properties
 | Name | Description
Public property | AspectPriority | Gets or sets the weaving priority of the aspect. (Inherited from Aspect.)
Public property | AttributeExclude | If true, indicates that this attribute removes all other instances of the same attribute type from the set of elements defined by the current instance. (Inherited from MulticastAttribute.)
Public property | AttributeId | Obsolete. (Inherited from MulticastAttribute.)
Public property | AttributeInheritance | Determines whether this attribute is inherited (Inherited from MulticastAttribute.)
Public property | AttributePriority | Gets or sets the priority of the current attribute in case that multiple instances are defined on the same element (lower values are processed before). (Inherited from MulticastAttribute.)
Public property | AttributeReplace | Determines whether this attribute replaces other attributes found on the target declarations. (Inherited from MulticastAttribute.)
Public property | AttributeTargetAssemblies | Gets or sets the assemblies to which the current attribute apply. (Inherited from MulticastAttribute.)
Public property | AttributeTargetElements | Gets or sets the kind of elements to which this custom attributes applies. (Inherited from MulticastAttribute.)
Public property | AttributeTargetExternalMemberAttributes | Gets or sets the visibilities, scopes, virtualities, and implementation of members to which this attribute applies, when the member is external to the current module. (Inherited from MulticastAttribute.)
Public property | AttributeTargetExternalTypeAttributes | Gets or sets the visibilities of types to which this attribute applies, when this type is external to the current module. (Inherited from MulticastAttribute.)
Public property | AttributeTargetMemberAttributes | Gets or sets the visibilities, scopes, virtualities, and implementation of members to which this attribute applies. (Inherited from MulticastAttribute.)
Public property | AttributeTargetMembers | Gets or sets the expression specifying to which members this instance applies. (Inherited from MulticastAttribute.)
Public property | AttributeTargetParameterAttributes | Gets or sets the passing style (by value, out or ref) of parameters to which this attribute applies. (Inherited from MulticastAttribute.)
Public property | AttributeTargetParameters | Gets or sets the expression specifying to which parameters this instance applies. (Inherited from MulticastAttribute.)
Public property | AttributeTargetTypeAttributes | Gets or sets the visibilities of types to which this attribute applies. (Inherited from MulticastAttribute.)
Public property | AttributeTargetTypes | Gets or sets the expression specifying to which types this instance applies. (Inherited from MulticastAttribute.)
Back to Top
See Also
UpgradeableReaderLockAttribute Class
PostSharp.Patterns.Threading Namespace

Online Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


VerifyCallingThreadAttribute Class

VerifyCallingThreadAttribute Class PostSharp Documentation
Custom attribute that, when applied to a method or field, causes the ThreadUnsafeAttribute aspect to introduce runtime generation code even if target of the attribute is private or protected.
Inheritance Hierarchy
Online System Object
Online System Attribute
PostSharp.Patterns.Threading VerifyCallingThreadAttribute

Namespace: PostSharp.Patterns.Threading
Assembly: PostSharp.Patterns.Threading (in PostSharp.Patterns.Threading.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
public class VerifyCallingThreadAttribute : Attribute
public class VerifyCallingThreadAttribute : Attribute
See Also
VerifyCallingThreadAttribute Members
PostSharp.Patterns.Threading Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


VerifyCallingThreadAttribute Members

VerifyCallingThreadAttribute Members PostSharp Documentation

The VerifyCallingThreadAttribute type exposes the following members.
Constructors
 | Name | Description
Public method | VerifyCallingThreadAttribute | Initializes a new instance of the VerifyCallingThreadAttribute class
Back to Top
See Also
VerifyCallingThreadAttribute Class
PostSharp.Patterns.Threading Namespace

Online Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


VerifyCallingThreadAttribute Constructor

VerifyCallingThreadAttribute Constructor PostSharp Documentation
Initializes a new instance of the VerifyCallingThreadAttribute class

Namespace: PostSharp.Patterns.Threading
Assembly: PostSharp.Patterns.Threading (in PostSharp.Patterns.Threading.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
public VerifyCallingThreadAttribute()
public VerifyCallingThreadAttribute()
See Also
VerifyCallingThreadAttribute Class
VerifyCallingThreadAttribute Members
PostSharp.Patterns.Threading Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


WriterLockAttribute Class

WriterLockAttribute Class PostSharp Documentation
Custom attribute that, when applied on a method, specifies that it should be executed in a writer lock. This level of lock is required by any method that writes a field.
Inheritance Hierarchy
Online System Object
Online System Attribute
PostSharp.Extensibility MulticastAttribute
PostSharp.Aspects Aspect
PostSharp.Aspects MethodLevelAspect
PostSharp.Aspects OnMethodBoundaryAspect
PostSharp.Patterns.Threading ReaderWriterLockAttribute
PostSharp.Patterns.Threading WriterLockAttribute

Namespace: PostSharp.Patterns.Threading
Assembly: PostSharp.Patterns.Threading (in PostSharp.Patterns.Threading.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
[SerializableAttribute]
public sealed class WriterLockAttribute : ReaderWriterLockAttribute
[SerializableAttribute]
public sealed class WriterLockAttribute : ReaderWriterLockAttribute
Remarks
The current custom attribute can be applied to instance methods of classes enhanced by
            ReaderWriterSynchronizedAttribute or implementing
            the IReaderWriterSynchronized interface.
See Also
WriterLockAttribute Members
PostSharp.Patterns.Threading Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


WriterLockAttribute Members

WriterLockAttribute Members PostSharp Documentation

The WriterLockAttribute type exposes the following members.
Constructors
 | Name | Description
Public method | WriterLockAttribute | Initializes a new instance of the WriterLockAttribute class
Back to Top
Methods
 | Name | Description
Public method | CompileTimeInitialize | Method invoked at build time to initialize the instance fields of the current aspect. This method is invoked before any other build-time method. (Inherited from MethodLevelAspect.)
Public method | CompileTimeValidate | Method invoked at build time to ensure that the aspect has been applied to the right target. (Inherited from Aspect.)
Public method | GetAspectConfiguration | Method invoked at build tome to get the imperative configuration of the current Aspect. (Inherited from Aspect.)
Public method | OnEntry | Handler executed before execution of the method to which the current custom attribute is applied. (Overrides OnMethodBoundaryAspect OnEntry(MethodExecutionArgs).)
Public method | OnException | Method executed after the body of methods to which this aspect is applied, in case that the method resulted with an exception. (Inherited from OnMethodBoundaryAspect.)
Public method | OnExit | Handler executed after execution of the method to which the current custom attribute is applied. (Overrides OnMethodBoundaryAspect OnExit(MethodExecutionArgs).)
Public method | OnSuccess | Method executed after the body of methods to which this aspect is applied, but only when the method successfully returns (i.e. when no exception flies out the method.). (Inherited from OnMethodBoundaryAspect.)
Public method | RuntimeInitialize | Initializes the current aspect. (Inherited from MethodLevelAspect.)
Back to Top
Properties
 | Name | Description
Public property | AspectPriority | Gets or sets the weaving priority of the aspect. (Inherited from Aspect.)
Public property | AttributeExclude | If true, indicates that this attribute removes all other instances of the same attribute type from the set of elements defined by the current instance. (Inherited from MulticastAttribute.)
Public property | AttributeId | Obsolete. (Inherited from MulticastAttribute.)
Public property | AttributeInheritance | Determines whether this attribute is inherited (Inherited from MulticastAttribute.)
Public property | AttributePriority | Gets or sets the priority of the current attribute in case that multiple instances are defined on the same element (lower values are processed before). (Inherited from MulticastAttribute.)
Public property | AttributeReplace | Determines whether this attribute replaces other attributes found on the target declarations. (Inherited from MulticastAttribute.)
Public property | AttributeTargetAssemblies | Gets or sets the assemblies to which the current attribute apply. (Inherited from MulticastAttribute.)
Public property | AttributeTargetElements | Gets or sets the kind of elements to which this custom attributes applies. (Inherited from MulticastAttribute.)
Public property | AttributeTargetExternalMemberAttributes | Gets or sets the visibilities, scopes, virtualities, and implementation of members to which this attribute applies, when the member is external to the current module. (Inherited from MulticastAttribute.)
Public property | AttributeTargetExternalTypeAttributes | Gets or sets the visibilities of types to which this attribute applies, when this type is external to the current module. (Inherited from MulticastAttribute.)
Public property | AttributeTargetMemberAttributes | Gets or sets the visibilities, scopes, virtualities, and implementation of members to which this attribute applies. (Inherited from MulticastAttribute.)
Public property | AttributeTargetMembers | Gets or sets the expression specifying to which members this instance applies. (Inherited from MulticastAttribute.)
Public property | AttributeTargetParameterAttributes | Gets or sets the passing style (by value, out or ref) of parameters to which this attribute applies. (Inherited from MulticastAttribute.)
Public property | AttributeTargetParameters | Gets or sets the expression specifying to which parameters this instance applies. (Inherited from MulticastAttribute.)
Public property | AttributeTargetTypeAttributes | Gets or sets the visibilities of types to which this attribute applies. (Inherited from MulticastAttribute.)
Public property | AttributeTargetTypes | Gets or sets the expression specifying to which types this instance applies. (Inherited from MulticastAttribute.)
Back to Top
See Also
WriterLockAttribute Class
PostSharp.Patterns.Threading Namespace

Online Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


WriterLockAttribute Constructor

WriterLockAttribute Constructor PostSharp Documentation
Initializes a new instance of the WriterLockAttribute class

Namespace: PostSharp.Patterns.Threading
Assembly: PostSharp.Patterns.Threading (in PostSharp.Patterns.Threading.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
public WriterLockAttribute()
public WriterLockAttribute()
See Also
WriterLockAttribute Class
WriterLockAttribute Members
PostSharp.Patterns.Threading Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


WriterLockAttribute Methods

WriterLockAttribute Methods PostSharp Documentation
The WriterLockAttribute type exposes the following members.
Methods
 | Name | Description
Public method | CompileTimeInitialize | Method invoked at build time to initialize the instance fields of the current aspect. This method is invoked before any other build-time method. (Inherited from MethodLevelAspect.)
Public method | CompileTimeValidate | Method invoked at build time to ensure that the aspect has been applied to the right target. (Inherited from Aspect.)
Public method | GetAspectConfiguration | Method invoked at build tome to get the imperative configuration of the current Aspect. (Inherited from Aspect.)
Public method | OnEntry | Handler executed before execution of the method to which the current custom attribute is applied. (Overrides OnMethodBoundaryAspect OnEntry(MethodExecutionArgs).)
Public method | OnException | Method executed after the body of methods to which this aspect is applied, in case that the method resulted with an exception. (Inherited from OnMethodBoundaryAspect.)
Public method | OnExit | Handler executed after execution of the method to which the current custom attribute is applied. (Overrides OnMethodBoundaryAspect OnExit(MethodExecutionArgs).)
Public method | OnSuccess | Method executed after the body of methods to which this aspect is applied, but only when the method successfully returns (i.e. when no exception flies out the method.). (Inherited from OnMethodBoundaryAspect.)
Public method | RuntimeInitialize | Initializes the current aspect. (Inherited from MethodLevelAspect.)
Back to Top
See Also
WriterLockAttribute Class
PostSharp.Patterns.Threading Namespace

Online Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


WriterLockAttribute.OnEntry Method

WriterLockAttribute OnEntry Method PostSharp Documentation
Handler executed before execution of the method to which the current custom attribute is applied.

Namespace: PostSharp.Patterns.Threading
Assembly: PostSharp.Patterns.Threading (in PostSharp.Patterns.Threading.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
public override void OnEntry(
    MethodExecutionArgs eventArgs
)
public override void OnEntry(
    MethodExecutionArgs eventArgs
)
Parameters
eventArgs
Type: PostSharp.Aspects MethodExecutionArgs
[Missing <param name="eventArgs"/> documentation for "M:PostSharp.Patterns.Threading.WriterLockAttribute.OnEntry(PostSharp.Aspects.MethodExecutionArgs)"]
Implements
IOnMethodBoundaryAspect OnEntry(MethodExecutionArgs)
See Also
WriterLockAttribute Class
WriterLockAttribute Members
PostSharp.Patterns.Threading Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


WriterLockAttribute.OnExit Method

WriterLockAttribute OnExit Method PostSharp Documentation
Handler executed after execution of the method to which the current custom attribute is applied.

Namespace: PostSharp.Patterns.Threading
Assembly: PostSharp.Patterns.Threading (in PostSharp.Patterns.Threading.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
public override void OnExit(
    MethodExecutionArgs eventArgs
)
public override void OnExit(
    MethodExecutionArgs eventArgs
)
Parameters
eventArgs
Type: PostSharp.Aspects MethodExecutionArgs
[Missing <param name="eventArgs"/> documentation for "M:PostSharp.Patterns.Threading.WriterLockAttribute.OnExit(PostSharp.Aspects.MethodExecutionArgs)"]
Implements
IOnMethodBoundaryAspect OnExit(MethodExecutionArgs)
See Also
WriterLockAttribute Class
WriterLockAttribute Members
PostSharp.Patterns.Threading Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


WriterLockAttribute Properties

WriterLockAttribute Properties PostSharp Documentation
The WriterLockAttribute type exposes the following members.
Properties
 | Name | Description
Public property | AspectPriority | Gets or sets the weaving priority of the aspect. (Inherited from Aspect.)
Public property | AttributeExclude | If true, indicates that this attribute removes all other instances of the same attribute type from the set of elements defined by the current instance. (Inherited from MulticastAttribute.)
Public property | AttributeId | Obsolete. (Inherited from MulticastAttribute.)
Public property | AttributeInheritance | Determines whether this attribute is inherited (Inherited from MulticastAttribute.)
Public property | AttributePriority | Gets or sets the priority of the current attribute in case that multiple instances are defined on the same element (lower values are processed before). (Inherited from MulticastAttribute.)
Public property | AttributeReplace | Determines whether this attribute replaces other attributes found on the target declarations. (Inherited from MulticastAttribute.)
Public property | AttributeTargetAssemblies | Gets or sets the assemblies to which the current attribute apply. (Inherited from MulticastAttribute.)
Public property | AttributeTargetElements | Gets or sets the kind of elements to which this custom attributes applies. (Inherited from MulticastAttribute.)
Public property | AttributeTargetExternalMemberAttributes | Gets or sets the visibilities, scopes, virtualities, and implementation of members to which this attribute applies, when the member is external to the current module. (Inherited from MulticastAttribute.)
Public property | AttributeTargetExternalTypeAttributes | Gets or sets the visibilities of types to which this attribute applies, when this type is external to the current module. (Inherited from MulticastAttribute.)
Public property | AttributeTargetMemberAttributes | Gets or sets the visibilities, scopes, virtualities, and implementation of members to which this attribute applies. (Inherited from MulticastAttribute.)
Public property | AttributeTargetMembers | Gets or sets the expression specifying to which members this instance applies. (Inherited from MulticastAttribute.)
Public property | AttributeTargetParameterAttributes | Gets or sets the passing style (by value, out or ref) of parameters to which this attribute applies. (Inherited from MulticastAttribute.)
Public property | AttributeTargetParameters | Gets or sets the expression specifying to which parameters this instance applies. (Inherited from MulticastAttribute.)
Public property | AttributeTargetTypeAttributes | Gets or sets the visibilities of types to which this attribute applies. (Inherited from MulticastAttribute.)
Public property | AttributeTargetTypes | Gets or sets the expression specifying to which types this instance applies. (Inherited from MulticastAttribute.)
Back to Top
See Also
WriterLockAttribute Class
PostSharp.Patterns.Threading Namespace

Online Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


PostSharp.Reflection Namespace

PostSharp.Reflection Namespace PostSharp Documentation
The PostSharp.Reflection namespace complements the System.Reflection namespace.
Classes
 | Class | Description
Public class | CustomAttributeInstance | Instance of a custom attribute on a target declaration.
Public class | CustomReflectionBinder | Custom implementation of a reflection Online Binder that select methods based on exact matches using the ReflectionTypeComparer.
Public class | LocationInfo | Represents a Online FieldInfo, Online PropertyInfo or Online ParameterInfo, which all have the semantics of a location (get value, set value).
Public class | MemberTypeCodeReference | Represents a relationship between a type and a member of this type. A member can be a Online FieldInfo, Online PropertyInfo, or Online ParameterInfo.
Public class | MethodUsageCodeReference | Represents a relationship between a declaration ( Online Type, Online FieldInfo, Online MethodInfo or Online ConstructorInfo) and a method whose instructions (method body) use the declaration.
Public class | ObjectConstruction | Specifies how an object should be constructed, i.e. specifies the constructor to be used, the arguments to be passed to this constructor, and the fields or properties to be set.
Public class | ReflectionHelper | Provides helper methods for work with Online System.Reflection.
Public class | ReflectionSearch | Set of static methods providing broader access to assembly metadata than the System.Reflection namespace. These methods are only available at build time.
Public class | ReflectionTypeComparer | Comparer of reflection types ( Online Type) based on content, not reference. Supports the unbound generic parameters derived from the GenericArg class.
Public class | SymbolSequencePoint | Maps a point in IL instructions to location in source code.
Public class | TypeInheritanceCodeReference | Represents a inheritance relationship between two types.
Interfaces
 | Interface | Description
Public interface | IAssemblyName | Defines the semantics of an assembly name.
Public interface | ICodeReference | Represents a reference between two declarations.
Public interface | IMetadataDispenser | Semantics of service that deserializes metadata objects (i.e. reflection objects) that have been serialized by IMetadataEmitter.
Public interface | IMetadataEmitter | Semantics of a service that allows build-time code to serialize references to metadata objects (i.e. reflection objects) in a way that is compatible with obfuscators. References are deserialized at run-time using IMetadataDispenser.
Public interface | ISourceDocument | Represents a file of source code.
Enumerations
 | Enumeration | Description
Public enumeration | CodeReferenceKind | Kinds of code references (ICodeReference).
Public enumeration | LocationKind | Enumerates the kinds of code elements that can be encapsulated by a LocationInfo.
Public enumeration | MethodUsageInstructions | Instructions whose operands can reference a declaration.
Public enumeration | ReflectionSearchOptions |
Public enumeration | Visibility | Visibility of types and type members.

Online Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


CodeReferenceKind Enumeration

CodeReferenceKind Enumeration PostSharp Documentation
Kinds of code references (ICodeReference).

Namespace: PostSharp.Reflection
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
public enum CodeReferenceKind
public enum CodeReferenceKind
Members
Member name | Value | Description
None | 0 | No code reference.
TypeInheritance | 1 | Type inheritance. The base type is the ReferencedDeclaration; the child type is the ReferencingDeclaration. See TypeInheritanceCodeReference.
MemberType | 2 | Member type (field or property type, method return type, or parameter type). The member type is the ReferencedDeclaration. See MemberTypeCodeReference.
MethodUsage | 16 | Operand of an instruction in a method body. The ReferencingDeclaration is the method. See MethodUsageCodeReference.
See Also
PostSharp.Reflection Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


CustomAttributeInstance Class

CustomAttributeInstance Class PostSharp Documentation
Instance of a custom attribute on a target declaration.
Inheritance Hierarchy
Online System Object
PostSharp.Reflection CustomAttributeInstance

Namespace: PostSharp.Reflection
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
public sealed class CustomAttributeInstance
public sealed class CustomAttributeInstance
See Also
CustomAttributeInstance Members
PostSharp.Reflection Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


CustomAttributeInstance Members

CustomAttributeInstance Members PostSharp Documentation

The CustomAttributeInstance type exposes the following members.
Properties
 | Name | Description
Public property | Attribute | Gets the custom attribute.
Public property | Construction | Gets the ObjectConstruction (including given constructor arguments and named arguments) used to construct the Attribute.
Public property | Target | Gets the declaration on which the custom attribute is defined.
Back to Top
See Also
CustomAttributeInstance Class
PostSharp.Reflection Namespace

Online Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


CustomAttributeInstance Properties

CustomAttributeInstance Properties PostSharp Documentation
The CustomAttributeInstance type exposes the following members.
Properties
 | Name | Description
Public property | Attribute | Gets the custom attribute.
Public property | Construction | Gets the ObjectConstruction (including given constructor arguments and named arguments) used to construct the Attribute.
Public property | Target | Gets the declaration on which the custom attribute is defined.
Back to Top
See Also
CustomAttributeInstance Class
PostSharp.Reflection Namespace

Online Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


CustomAttributeInstance.Attribute Property

CustomAttributeInstance Attribute Property PostSharp Documentation
Gets the custom attribute.

Namespace: PostSharp.Reflection
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
public Attribute Attribute { get; }
public Attribute Attribute { get; }
Property Value
Type:   Online Attribute
See Also
CustomAttributeInstance Class
CustomAttributeInstance Members
PostSharp.Reflection Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


CustomAttributeInstance.Construction Property

CustomAttributeInstance Construction Property PostSharp Documentation
Gets the ObjectConstruction (including given constructor arguments and named arguments) used to construct the Attribute.

Namespace: PostSharp.Reflection
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
public ObjectConstruction Construction { get; }
public ObjectConstruction Construction { get; }
Property Value
Type: ObjectConstruction
See Also
CustomAttributeInstance Class
CustomAttributeInstance Members
PostSharp.Reflection Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


CustomAttributeInstance.Target Property

CustomAttributeInstance Target Property PostSharp Documentation
Gets the declaration on which the custom attribute is defined.

Namespace: PostSharp.Reflection
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
public Object Target { get; private set; }
public Object Target { get; private set; }
Property Value
Type:   Online Object

              A reflection object:   Online Assembly,   Online Type,   Online MethodInfo,
                Online ConstructorInfo,   Online ParameterInfo,   Online PropertyInfo,
                Online EventInfo,   Online FieldInfo.

See Also
CustomAttributeInstance Class
CustomAttributeInstance Members
PostSharp.Reflection Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


CustomReflectionBinder Class

CustomReflectionBinder Class PostSharp Documentation
Custom implementation of a reflection Online Binder that select methods based on exact matches using the ReflectionTypeComparer.
Inheritance Hierarchy
Online System Object
Online System.Reflection Binder
PostSharp.Reflection CustomReflectionBinder

Namespace: PostSharp.Reflection
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
public sealed class CustomReflectionBinder : Binder
public sealed class CustomReflectionBinder : Binder
See Also
CustomReflectionBinder Members
PostSharp.Reflection Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


CustomReflectionBinder Members

CustomReflectionBinder Members PostSharp Documentation

The CustomReflectionBinder type exposes the following members.
Methods
 | Name | Description
Public method | BindToField | Selects a field from the given set of fields, based on the specified criteria. (Overrides Online Binder BindToField(BindingFlags, FieldInfo , Object, CultureInfo).)
Public method | BindToMethod | Selects a method to invoke from the given set of methods, based on the supplied arguments. (Overrides Online Binder BindToMethod(BindingFlags, MethodBase , Object , ParameterModifier , CultureInfo, String , Object ).)
Public method | ChangeType | Changes the type of the given Object to the given Type. (Overrides Online Binder ChangeType(Object, Type, CultureInfo).)
Public method | ReorderArgumentArray | Upon returning from Online BindToMethod(BindingFlags, MethodBase , Object , ParameterModifier , CultureInfo, String , Object ), restores the args argument to what it was when it came from BindToMethod. (Overrides Online Binder ReorderArgumentArray( Object , Object).)
Public method | SelectMethod | Selects a method from the given set of methods, based on the argument type. (Overrides Online Binder SelectMethod(BindingFlags, MethodBase , Type , ParameterModifier ).)
Public method | SelectProperty | Selects a property from the given set of properties, based on the specified criteria. (Overrides Online Binder SelectProperty(BindingFlags, PropertyInfo , Type, Type , ParameterModifier ).)
Back to Top
Fields
Name | Description
Instance | Singleton instance.
Back to Top
See Also
CustomReflectionBinder Class
PostSharp.Reflection Namespace

Online Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


CustomReflectionBinder Fields

CustomReflectionBinder Fields PostSharp Documentation
The CustomReflectionBinder type exposes the following members.
Fields
Name | Description
Instance | Singleton instance.
Back to Top
See Also
CustomReflectionBinder Class
PostSharp.Reflection Namespace

Online Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


CustomReflectionBinder.Instance Field

CustomReflectionBinder Instance Field PostSharp Documentation
Singleton instance.

Namespace: PostSharp.Reflection
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
public static readonly CustomReflectionBinder Instance
public static readonly CustomReflectionBinder Instance
Field Value
Type: CustomReflectionBinder
See Also
CustomReflectionBinder Class
CustomReflectionBinder Members
PostSharp.Reflection Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


CustomReflectionBinder Methods

CustomReflectionBinder Methods PostSharp Documentation
The CustomReflectionBinder type exposes the following members.
Methods
 | Name | Description
Public method | BindToField | Selects a field from the given set of fields, based on the specified criteria. (Overrides Online Binder BindToField(BindingFlags, FieldInfo , Object, CultureInfo).)
Public method | BindToMethod | Selects a method to invoke from the given set of methods, based on the supplied arguments. (Overrides Online Binder BindToMethod(BindingFlags, MethodBase , Object , ParameterModifier , CultureInfo, String , Object ).)
Public method | ChangeType | Changes the type of the given Object to the given Type. (Overrides Online Binder ChangeType(Object, Type, CultureInfo).)
Public method | ReorderArgumentArray | Upon returning from Online BindToMethod(BindingFlags, MethodBase , Object , ParameterModifier , CultureInfo, String , Object ), restores the args argument to what it was when it came from BindToMethod. (Overrides Online Binder ReorderArgumentArray( Object , Object).)
Public method | SelectMethod | Selects a method from the given set of methods, based on the argument type. (Overrides Online Binder SelectMethod(BindingFlags, MethodBase , Type , ParameterModifier ).)
Public method | SelectProperty | Selects a property from the given set of properties, based on the specified criteria. (Overrides Online Binder SelectProperty(BindingFlags, PropertyInfo , Type, Type , ParameterModifier ).)
Back to Top
See Also
CustomReflectionBinder Class
PostSharp.Reflection Namespace

Online Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


CustomReflectionBinder.BindToField Method

CustomReflectionBinder BindToField Method PostSharp Documentation
Selects a field from the given set of fields, based on the specified criteria.

Namespace: PostSharp.Reflection
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
public override FieldInfo BindToField(
    BindingFlags bindingFlags,
    FieldInfo[] match,
    Object value,
    CultureInfo culture
)
public override FieldInfo BindToField(
    BindingFlags bindingFlags,
    FieldInfo[] match,
    Object value,
    CultureInfo culture
)
Parameters
bindingFlags
Type:   Online System.Reflection BindingFlags
[Missing <param name="bindingFlags"/> documentation for "M:PostSharp.Reflection.CustomReflectionBinder.BindToField(System.Reflection.BindingFlags,System.Reflection.FieldInfo[],System.Object,System.Globalization.CultureInfo)"]
match
Type:    Online System.Reflection FieldInfo
The set of fields that are candidates for matching. For example, when a   Online Binder object is used by   Online InvokeMember , this parameter specifies the set of fields that reflection has determined to be possible matches, typically because they have the correct member name. The default implementation provided by   Online DefaultBinder changes the order of this array.
value
Type:   Online System Object
The field value used to locate a matching field.
culture
Type:   Online System.Globalization CultureInfo
An instance of   Online CultureInfo that is used to control the coercion of data types, in binder implementations that coerce types. If culture is null, the   Online CultureInfo for the current thread is used.Note   For example, if a binder implementation allows coercion of string values to numeric types, this parameter is necessary to convert a String that represents 1000 to a Double value, because 1000 is represented differently by different cultures. The default binder does not do such string coercions.
Return Value
Type:   Online FieldInfo
The matching field.
Exceptions
Exception | Condition
Online System.Reflection AmbiguousMatchException | For the default binder, bindingAttr includes Online SetField, and match contains multiple fields that are equally good matches for value. For example, value contains a MyClass object that implements the IMyClass interface, and match contains a field of type MyClass and a field of type IMyClass.
Online System MissingFieldException | For the default binder, bindingAttr includes Online SetField, and match contains no fields that can accept value.
Online System NullReferenceException | For the default binder, bindingAttr includes Online SetField, and match is null or an empty array.-or-bindingAttr includes Online SetField, and value is null.
See Also
CustomReflectionBinder Class
CustomReflectionBinder Members
PostSharp.Reflection Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


CustomReflectionBinder.BindToMethod Method

CustomReflectionBinder BindToMethod Method PostSharp Documentation
Selects a method to invoke from the given set of methods, based on the supplied arguments.

Namespace: PostSharp.Reflection
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
public override MethodBase BindToMethod(
    BindingFlags bindingFlags,
    MethodBase[] match,
    ref Object[] args,
    ParameterModifier[] modifiers,
    CultureInfo culture,
    string[] names,
    out Object state
)
public override MethodBase BindToMethod(
    BindingFlags bindingFlags,
    MethodBase[] match,
    ref Object[] args,
    ParameterModifier[] modifiers,
    CultureInfo culture,
    string[] names,
    out Object state
)
Parameters
bindingFlags
Type:   Online System.Reflection BindingFlags
[Missing <param name="bindingFlags"/> documentation for "M:PostSharp.Reflection.CustomReflectionBinder.BindToMethod(System.Reflection.BindingFlags,System.Reflection.MethodBase[],System.Object[]@,System.Reflection.ParameterModifier[],System.Globalization.CultureInfo,System.String[],System.Object@)"]
match
Type:    Online System.Reflection MethodBase
The set of methods that are candidates for matching. For example, when a   Online Binder object is used by   Online InvokeMember , this parameter specifies the set of methods that reflection has determined to be possible matches, typically because they have the correct member name. The default implementation provided by   Online DefaultBinder changes the order of this array.
args
Type:    Online System Object
The arguments that are passed in. The binder can change the order of the arguments in this array; for example, the default binder changes the order of arguments if the names parameter is used to specify an order other than positional order. If a binder implementation coerces argument types, the types and values of the arguments can be changed as well.
modifiers
Type:    Online System.Reflection ParameterModifier
An array of parameter modifiers that enable binding to work with parameter signatures in which the types have been modified. The default binder implementation does not use this parameter.
culture
Type:   Online System.Globalization CultureInfo
An instance of   Online CultureInfo that is used to control the coercion of data types, in binder implementations that coerce types. If culture is null, the   Online CultureInfo for the current thread is used. Note   For example, if a binder implementation allows coercion of string values to numeric types, this parameter is necessary to convert a String that represents 1000 to a Double value, because 1000 is represented differently by different cultures. The default binder does not do such string coercions.
names
Type:    Online System String
The parameter names, if parameter names are to be considered when matching, or null if arguments are to be treated as purely positional. For example, parameter names must be used if arguments are not supplied in positional order.
state
Type:   Online System Object
After the method returns, state contains a binder-provided object that keeps track of argument reordering. The binder creates this object, and the binder is the sole consumer of this object. If state is not null when BindToMethod returns, you must pass state to the   Online ReorderArgumentArray( Object  , Object) method if you want to restore args to its original order, for example, so that you can retrieve the values of ref parameters (ByRef parameters in Visual Basic).
Return Value
Type:   Online MethodBase
The matching method.
Exceptions
Exception | Condition
Online System.Reflection AmbiguousMatchException | For the default binder, match contains multiple methods that are equally good matches for args. For example, args contains a MyClass object that implements the IMyClass interface, and match contains a method that takes MyClass and a method that takes IMyClass.
Online System MissingMethodException | For the default binder, match contains no methods that can accept the arguments supplied in args.
Online System ArgumentException | For the default binder, match is null or an empty array.
See Also
CustomReflectionBinder Class
CustomReflectionBinder Members
PostSharp.Reflection Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


CustomReflectionBinder.ChangeType Method

CustomReflectionBinder ChangeType Method PostSharp Documentation
Changes the type of the given Object to the given Type.

Namespace: PostSharp.Reflection
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
public override Object ChangeType(
    Object value,
    Type type,
    CultureInfo culture
)
public override Object ChangeType(
    Object value,
    Type type,
    CultureInfo culture
)
Parameters
value
Type:   Online System Object
The object to change into a new Type.
type
Type:   Online System Type
The new Type that value will become.
culture
Type:   Online System.Globalization CultureInfo
An instance of   Online CultureInfo that is used to control the coercion of data types. If culture is null, the   Online CultureInfo for the current thread is used.Note   For example, this parameter is necessary to convert a String that represents 1000 to a Double value, because 1000 is represented differently by different cultures.
Return Value
Type:   Online Object
An object that contains the given value as the new type.
See Also
CustomReflectionBinder Class
CustomReflectionBinder Members
PostSharp.Reflection Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


CustomReflectionBinder.ReorderArgumentArray Method

CustomReflectionBinder ReorderArgumentArray Method PostSharp Documentation
Upon returning from Online BindToMethod(BindingFlags, MethodBase , Object , ParameterModifier , CultureInfo, String , Object ), restores the args argument to what it was when it came from BindToMethod.

Namespace: PostSharp.Reflection
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
public override void ReorderArgumentArray(
    ref Object[] args,
    Object state
)
public override void ReorderArgumentArray(
    ref Object[] args,
    Object state
)
Parameters
args
Type:    Online System Object
The actual arguments that are passed in. Both the types and values of the arguments can be changed.
state
Type:   Online System Object
A binder-provided object that keeps track of argument reordering.
See Also
CustomReflectionBinder Class
CustomReflectionBinder Members
PostSharp.Reflection Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


CustomReflectionBinder.SelectMethod Method

CustomReflectionBinder SelectMethod Method PostSharp Documentation
Selects a method from the given set of methods, based on the argument type.

Namespace: PostSharp.Reflection
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
public override MethodBase SelectMethod(
    BindingFlags bindingFlags,
    MethodBase[] match,
    Type[] types,
    ParameterModifier[] modifiers
)
public override MethodBase SelectMethod(
    BindingFlags bindingFlags,
    MethodBase[] match,
    Type[] types,
    ParameterModifier[] modifiers
)
Parameters
bindingFlags
Type:   Online System.Reflection BindingFlags
[Missing <param name="bindingFlags"/> documentation for "M:PostSharp.Reflection.CustomReflectionBinder.SelectMethod(System.Reflection.BindingFlags,System.Reflection.MethodBase[],System.Type[],System.Reflection.ParameterModifier[])"]
match
Type:    Online System.Reflection MethodBase
The set of methods that are candidates for matching. For example, when a   Online Binder object is used by   Online InvokeMember , this parameter specifies the set of methods that reflection has determined to be possible matches, typically because they have the correct member name. The default implementation provided by   Online DefaultBinder changes the order of this array.
types
Type:    Online System Type
The parameter types used to locate a matching method.
modifiers
Type:    Online System.Reflection ParameterModifier
An array of parameter modifiers that enable binding to work with parameter signatures in which the types have been modified.
Return Value
Type:   Online MethodBase
The matching method, if found; otherwise, null.
Exceptions
Exception | Condition
Online System.Reflection AmbiguousMatchException | For the default binder, match contains multiple methods that are equally good matches for the parameter types described by types. For example, the array in types contains a Online Type object for MyClass and the array in match contains a method that takes a base class of MyClass and a method that takes an interface that MyClass implements.
Online System ArgumentException | For the default binder, match is null or an empty array.-or-An element of types derives from Online Type, but is not of type RuntimeType.
See Also
CustomReflectionBinder Class
CustomReflectionBinder Members
PostSharp.Reflection Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


CustomReflectionBinder.SelectProperty Method

CustomReflectionBinder SelectProperty Method PostSharp Documentation
Selects a property from the given set of properties, based on the specified criteria.

Namespace: PostSharp.Reflection
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
public override PropertyInfo SelectProperty(
    BindingFlags bindingFlags,
    PropertyInfo[] match,
    Type returnType,
    Type[] indexes,
    ParameterModifier[] modifiers
)
public override PropertyInfo SelectProperty(
    BindingFlags bindingFlags,
    PropertyInfo[] match,
    Type returnType,
    Type[] indexes,
    ParameterModifier[] modifiers
)
Parameters
bindingFlags
Type:   Online System.Reflection BindingFlags
[Missing <param name="bindingFlags"/> documentation for "M:PostSharp.Reflection.CustomReflectionBinder.SelectProperty(System.Reflection.BindingFlags,System.Reflection.PropertyInfo[],System.Type,System.Type[],System.Reflection.ParameterModifier[])"]
match
Type:    Online System.Reflection PropertyInfo
The set of properties that are candidates for matching. For example, when a   Online Binder object is used by   Online InvokeMember , this parameter specifies the set of properties that reflection has determined to be possible matches, typically because they have the correct member name. The default implementation provided by   Online DefaultBinder changes the order of this array.
returnType
Type:   Online System Type
The return value the matching property must have.
indexes
Type:    Online System Type
The index types of the property being searched for. Used for index properties such as the indexer for a class.
modifiers
Type:    Online System.Reflection ParameterModifier
An array of parameter modifiers that enable binding to work with parameter signatures in which the types have been modified.
Return Value
Type:   Online PropertyInfo
The matching property.
Exceptions
Exception | Condition
Online System.Reflection AmbiguousMatchException | For the default binder, match contains multiple properties that are equally good matches for returnType and indexes.
Online System ArgumentException | For the default binder, match is null or an empty array.
See Also
CustomReflectionBinder Class
CustomReflectionBinder Members
PostSharp.Reflection Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


IAssemblyName Interface

IAssemblyName Interface PostSharp Documentation
Defines the semantics of an assembly name.

Namespace: PostSharp.Reflection
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
public interface IAssemblyName
public interface IAssemblyName
See Also
IAssemblyName Members
PostSharp.Reflection Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


IAssemblyName Members

IAssemblyName Members PostSharp Documentation

The IAssemblyName type exposes the following members.
Methods
 | Name | Description
Public method | GetPublicKey | Gets the assembly public key.
Public method | GetPublicKeyToken | Gets the assembly public key token.
Back to Top
Properties
 | Name | Description
Public property | Culture | Gets the assembly culture name.
Public property | IsMscorlib | Determines whether the current assembly (or assembly reference) is mscorlib.
Public property | IsRetargetable | Determines whether the reference is retargetable by the CLR, i.e. can be accommodated by an assembly whose identity does not match the current assembly reference.
Public property | IsStronglyNamed | Determines whether the current assembly (or assembly reference) contains a strong name signature.
Public property | Name | Gets the assembly friendly name.
Public property | ProcessorArchitecture | Gets the processor architecture that the current assembly targets.
Public property | Version | Gets the assembly version.
Back to Top
See Also
IAssemblyName Interface
PostSharp.Reflection Namespace

Online Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


IAssemblyName Methods

IAssemblyName Methods PostSharp Documentation
The IAssemblyName type exposes the following members.
Methods
 | Name | Description
Public method | GetPublicKey | Gets the assembly public key.
Public method | GetPublicKeyToken | Gets the assembly public key token.
Back to Top
See Also
IAssemblyName Interface
PostSharp.Reflection Namespace

Online Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


IAssemblyName.GetPublicKey Method

IAssemblyName GetPublicKey Method PostSharp Documentation
Gets the assembly public key.

Namespace: PostSharp.Reflection
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
byte[] GetPublicKey()
byte[] GetPublicKey()
Field Value
Type:    Online Byte

              An array of bytes containing the public key,
              or null if no public key is specified (for instance if
              only the public key token is given).

Return Value
Type:    Online Byte
An array of bytes containing the public key,
              or null if no public key is specified.
See Also
IAssemblyName Interface
IAssemblyName Members
PostSharp.Reflection Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


IAssemblyName.GetPublicKeyToken Method

IAssemblyName GetPublicKeyToken Method PostSharp Documentation
Gets the assembly public key token.

Namespace: PostSharp.Reflection
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
byte[] GetPublicKeyToken()
byte[] GetPublicKeyToken()
Return Value
Type:    Online Byte
An array of bytes containing the public key token,
              or null if no public key is specified.
See Also
IAssemblyName Interface
IAssemblyName Members
PostSharp.Reflection Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


IAssemblyName Properties

IAssemblyName Properties PostSharp Documentation
The IAssemblyName type exposes the following members.
Properties
 | Name | Description
Public property | Culture | Gets the assembly culture name.
Public property | IsMscorlib | Determines whether the current assembly (or assembly reference) is mscorlib.
Public property | IsRetargetable | Determines whether the reference is retargetable by the CLR, i.e. can be accommodated by an assembly whose identity does not match the current assembly reference.
Public property | IsStronglyNamed | Determines whether the current assembly (or assembly reference) contains a strong name signature.
Public property | Name | Gets the assembly friendly name.
Public property | ProcessorArchitecture | Gets the processor architecture that the current assembly targets.
Public property | Version | Gets the assembly version.
Back to Top
See Also
IAssemblyName Interface
PostSharp.Reflection Namespace

Online Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


IAssemblyName.Culture Property

IAssemblyName Culture Property PostSharp Documentation
Gets the assembly culture name.

Namespace: PostSharp.Reflection
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
string Culture { get; }
string Culture { get; }
Property Value
Type:   Online String

              The standard assembly culture name, or null if the assembly
              is culture-neutral.

See Also
IAssemblyName Interface
IAssemblyName Members
PostSharp.Reflection Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


IAssemblyName.IsMscorlib Property

IAssemblyName IsMscorlib Property PostSharp Documentation
Determines whether the current assembly (or assembly reference) is mscorlib.

Namespace: PostSharp.Reflection
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
bool IsMscorlib { get; }
bool IsMscorlib { get; }
Property Value
Type:   Online Boolean
See Also
IAssemblyName Interface
IAssemblyName Members
PostSharp.Reflection Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


IAssemblyName.IsRetargetable Property

IAssemblyName IsRetargetable Property PostSharp Documentation
Determines whether the reference is retargetable by the CLR, i.e. can be accommodated by an assembly whose identity does not match the current assembly reference.

Namespace: PostSharp.Reflection
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
bool IsRetargetable { get; }
bool IsRetargetable { get; }
Property Value
Type:   Online Boolean
See Also
IAssemblyName Interface
IAssemblyName Members
PostSharp.Reflection Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


IAssemblyName.IsStronglyNamed Property

IAssemblyName IsStronglyNamed Property PostSharp Documentation
Determines whether the current assembly (or assembly reference) contains a strong name signature.

Namespace: PostSharp.Reflection
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
bool IsStronglyNamed { get; }
bool IsStronglyNamed { get; }
Property Value
Type:   Online Boolean
See Also
IAssemblyName Interface
IAssemblyName Members
PostSharp.Reflection Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


IAssemblyName.Name Property

IAssemblyName Name Property PostSharp Documentation
Gets the assembly friendly name.

Namespace: PostSharp.Reflection
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
string Name { get; }
string Name { get; }
Property Value
Type:   Online String

              The assembly friendly name.

See Also
IAssemblyName Interface
IAssemblyName Members
PostSharp.Reflection Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


IAssemblyName.ProcessorArchitecture Property

IAssemblyName ProcessorArchitecture Property PostSharp Documentation
Gets the processor architecture that the current assembly targets.

Namespace: PostSharp.Reflection
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
ProcessorArchitecture ProcessorArchitecture { get; }
ProcessorArchitecture ProcessorArchitecture { get; }
Property Value
Type:   Online ProcessorArchitecture
See Also
IAssemblyName Interface
IAssemblyName Members
PostSharp.Reflection Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


IAssemblyName.Version Property

IAssemblyName Version Property PostSharp Documentation
Gets the assembly version.

Namespace: PostSharp.Reflection
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
Version Version { get; }
Version Version { get; }
Property Value
Type:   Online Version

              A Version.

See Also
IAssemblyName Interface
IAssemblyName Members
PostSharp.Reflection Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


ICodeReference Interface

ICodeReference Interface PostSharp Documentation
Represents a reference between two declarations.

Namespace: PostSharp.Reflection
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
public interface ICodeReference
public interface ICodeReference
See Also
ICodeReference Members
PostSharp.Reflection Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


ICodeReference Members

ICodeReference Members PostSharp Documentation

The ICodeReference type exposes the following members.
Properties
 | Name | Description
Public property | ReferencedDeclaration | Gets the declaration referenced by the other.
Public property | ReferenceKind | Gets the kind of code reference.
Public property | ReferencingDeclaration | Gets the declaration referencing the other.
Back to Top
See Also
ICodeReference Interface
PostSharp.Reflection Namespace

Online Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


ICodeReference Properties

ICodeReference Properties PostSharp Documentation
The ICodeReference type exposes the following members.
Properties
 | Name | Description
Public property | ReferencedDeclaration | Gets the declaration referenced by the other.
Public property | ReferenceKind | Gets the kind of code reference.
Public property | ReferencingDeclaration | Gets the declaration referencing the other.
Back to Top
See Also
ICodeReference Interface
PostSharp.Reflection Namespace

Online Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


ICodeReference.ReferencedDeclaration Property

ICodeReference ReferencedDeclaration Property PostSharp Documentation
Gets the declaration referenced by the other.

Namespace: PostSharp.Reflection
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
Object ReferencedDeclaration { get; }
Object ReferencedDeclaration { get; }
Property Value
Type:   Online Object
See Also
ICodeReference Interface
ICodeReference Members
PostSharp.Reflection Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


ICodeReference.ReferenceKind Property

ICodeReference ReferenceKind Property PostSharp Documentation
Gets the kind of code reference.

Namespace: PostSharp.Reflection
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
CodeReferenceKind ReferenceKind { get; }
CodeReferenceKind ReferenceKind { get; }
Property Value
Type: CodeReferenceKind
See Also
ICodeReference Interface
ICodeReference Members
PostSharp.Reflection Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


ICodeReference.ReferencingDeclaration Property

ICodeReference ReferencingDeclaration Property PostSharp Documentation
Gets the declaration referencing the other.

Namespace: PostSharp.Reflection
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
Object ReferencingDeclaration { get; }
Object ReferencingDeclaration { get; }
Property Value
Type:   Online Object
See Also
ICodeReference Interface
ICodeReference Members
PostSharp.Reflection Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


IMetadataDispenser Interface

IMetadataDispenser Interface PostSharp Documentation
Semantics of service that deserializes metadata objects (i.e. reflection objects) that have been serialized by IMetadataEmitter.

Namespace: PostSharp.Reflection
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
public interface IMetadataDispenser
public interface IMetadataDispenser
See Also
IMetadataDispenser Members
PostSharp.Reflection Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


IMetadataDispenser Members

IMetadataDispenser Members PostSharp Documentation

The IMetadataDispenser type exposes the following members.
Methods
 | Name | Description
Public method | GetMetadata | Gets the reflection object corresponding to the given index.
Back to Top
See Also
IMetadataDispenser Interface
PostSharp.Reflection Namespace

Online Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


IMetadataDispenser Methods

IMetadataDispenser Methods PostSharp Documentation
The IMetadataDispenser type exposes the following members.
Methods
 | Name | Description
Public method | GetMetadata | Gets the reflection object corresponding to the given index.
Back to Top
See Also
IMetadataDispenser Interface
PostSharp.Reflection Namespace

Online Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


IMetadataDispenser.GetMetadata Method

IMetadataDispenser GetMetadata Method PostSharp Documentation
Gets the reflection object corresponding to the given index.

Namespace: PostSharp.Reflection
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
Object GetMetadata(
    int index
)
Object GetMetadata(
    int index
)
Parameters
index
Type:   Online System Int32
Index returned by GetMetadataIndex(Object)
              at build time.
Return Value
Type:   Online Object
The reflection object corresponding to index.
See Also
IMetadataDispenser Interface
IMetadataDispenser Members
PostSharp.Reflection Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


IMetadataEmitter Interface

IMetadataEmitter Interface PostSharp Documentation
Semantics of a service that allows build-time code to serialize references to metadata objects (i.e. reflection objects) in a way that is compatible with obfuscators. References are deserialized at run-time using IMetadataDispenser.

Namespace: PostSharp.Reflection
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
public interface IMetadataEmitter
public interface IMetadataEmitter
See Also
IMetadataEmitter Members
PostSharp.Reflection Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


IMetadataEmitter Members

IMetadataEmitter Members PostSharp Documentation

The IMetadataEmitter type exposes the following members.
Methods
 | Name | Description
Public method | GetMetadataIndex | Gets the index of a serialized metadata reference.
Back to Top
See Also
IMetadataEmitter Interface
PostSharp.Reflection Namespace

Online Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


IMetadataEmitter Methods

IMetadataEmitter Methods PostSharp Documentation
The IMetadataEmitter type exposes the following members.
Methods
 | Name | Description
Public method | GetMetadataIndex | Gets the index of a serialized metadata reference.
Back to Top
See Also
IMetadataEmitter Interface
PostSharp.Reflection Namespace

Online Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


IMetadataEmitter.GetMetadataIndex Method

IMetadataEmitter GetMetadataIndex Method PostSharp Documentation
Gets the index of a serialized metadata reference.

Namespace: PostSharp.Reflection
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
int GetMetadataIndex(
    Object metadata
)
int GetMetadataIndex(
    Object metadata
)
Parameters
metadata
Type:   Online System Object
A reflection object.
Return Value
Type:   Online Int32
The index of metadata, to be serialized
              and deserialized at runtime with GetMetadata(Int32).
See Also
IMetadataEmitter Interface
IMetadataEmitter Members
PostSharp.Reflection Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


ISourceDocument Interface

ISourceDocument Interface PostSharp Documentation
Represents a file of source code.

Namespace: PostSharp.Reflection
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
public interface ISourceDocument
public interface ISourceDocument
See Also
ISourceDocument Members
PostSharp.Reflection Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


ISourceDocument Members

ISourceDocument Members PostSharp Documentation

The ISourceDocument type exposes the following members.
Properties
 | Name | Description
Public property | DocumentType | Document type ( Online Guid according to Microsoft PDB specification).
Public property | FileName | Full path of the file.
Public property | Language | Language ( Online Guid according to Microsoft PDB specification).
Public property | LanguageVendor | Language vendor ( Online Guid according to Microsoft PDB specification).
Back to Top
See Also
ISourceDocument Interface
PostSharp.Reflection Namespace

Online Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


ISourceDocument Properties

ISourceDocument Properties PostSharp Documentation
The ISourceDocument type exposes the following members.
Properties
 | Name | Description
Public property | DocumentType | Document type ( Online Guid according to Microsoft PDB specification).
Public property | FileName | Full path of the file.
Public property | Language | Language ( Online Guid according to Microsoft PDB specification).
Public property | LanguageVendor | Language vendor ( Online Guid according to Microsoft PDB specification).
Back to Top
See Also
ISourceDocument Interface
PostSharp.Reflection Namespace

Online Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


ISourceDocument.DocumentType Property

ISourceDocument DocumentType Property PostSharp Documentation
Document type ( Online Guid according to Microsoft PDB specification).

Namespace: PostSharp.Reflection
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
Guid DocumentType { get; }
Guid DocumentType { get; }
Property Value
Type:   Online Guid
See Also
ISourceDocument Interface
ISourceDocument Members
PostSharp.Reflection Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


ISourceDocument.FileName Property

ISourceDocument FileName Property PostSharp Documentation
Full path of the file.

Namespace: PostSharp.Reflection
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
string FileName { get; }
string FileName { get; }
Property Value
Type:   Online String
See Also
ISourceDocument Interface
ISourceDocument Members
PostSharp.Reflection Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


ISourceDocument.Language Property

ISourceDocument Language Property PostSharp Documentation
Language ( Online Guid according to Microsoft PDB specification).

Namespace: PostSharp.Reflection
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
Guid Language { get; }
Guid Language { get; }
Property Value
Type:   Online Guid
See Also
ISourceDocument Interface
ISourceDocument Members
PostSharp.Reflection Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


ISourceDocument.LanguageVendor Property

ISourceDocument LanguageVendor Property PostSharp Documentation
Language vendor ( Online Guid according to Microsoft PDB specification).

Namespace: PostSharp.Reflection
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
Guid LanguageVendor { get; }
Guid LanguageVendor { get; }
Property Value
Type:   Online Guid
See Also
ISourceDocument Interface
ISourceDocument Members
PostSharp.Reflection Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


LocationInfo Class

LocationInfo Class PostSharp Documentation
Represents a Online FieldInfo, Online PropertyInfo or Online ParameterInfo, which all have the semantics of a location (get value, set value).
Inheritance Hierarchy
Online System Object
PostSharp.Reflection LocationInfo

Namespace: PostSharp.Reflection
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
[SerializableAttribute]
public sealed class LocationInfo : IEquatable<LocationInfo>
[SerializableAttribute]
public sealed class LocationInfo : IEquatable<LocationInfo>
See Also
LocationInfo Members
PostSharp.Reflection Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


LocationInfo Members

LocationInfo Members PostSharp Documentation

The LocationInfo type exposes the following members.
Constructors
 | Name | Description
Public method | LocationInfo(FieldInfo) | Initializes a new LocationInfo from a Online FieldInfo.
Public method | LocationInfo(ParameterInfo) | Initializes a new LocationInfo from a Online ParameterInfo.
Public method | LocationInfo(PropertyInfo) | Initializes a new LocationInfo from a Online PropertyInfo.
Back to Top
Methods
 | Name | Description
Public method | Equals(Object) | Determines whether the specified Online Object is equal to the current Online Object. (Overrides Online Object Equals(Object).)
Public method | Equals(LocationInfo) | Indicates whether the current object is equal to another object of the same type.
Public method | GetHashCode | Serves as a hash function for a particular type. (Overrides Online Object GetHashCode .)
Public method | GetValue(Object) | Returns the value of the field or property represented by the current object.
Public method | GetValue(Object, Object ) | Returns the value of the field or property represented by the current object with optional index values for indexed properties.
Public method | SetValue(Object, Object) | Sets the value of the field or property represented by the current object to a given value.
Public method | SetValue(Object, Object, Object ) | Sets the value of the field or property represented by the current object to a given value with optional index values for indexed properties.
 | ToLocationInfo | Initializes a new LocationInfo from a Online FieldInfo, Online PropertyInfo, or Online ParameterInfo.
 | ToLocationInfoArray(ICollection FieldInfo ) | Converts a collection of FieldInfo into an array of LocationInfo.
 | ToLocationInfoArray(ICollection ParameterInfo ) | Converts a collection of ParameterInfo into an array of LocationInfo.
 | ToLocationInfoArray(ICollection PropertyInfo ) | Converts a collection of PropertyInfo into an array of LocationInfo.
Public method | ToString | Returns a string that represents the current object. (Overrides Online Object ToString .)
Back to Top
Operators
Name | Description
Equality | Determines whether two instances of LocationInfo represent the same element of code.
Inequality | Determines whether two instances of LocationInfo represent different elements of code.
Back to Top
Properties
 | Name | Description
Public property | DeclaringType | Gets the declaring type of the underlying field, property, parameter, or return value.
Public property | FieldInfo | Gets the underlying Online FieldInfo, or null if the underlying code element is not a property.
Public property | IsStatic | Determines whether the underlying field or property is static.
Public property | LocationKind | Gets the location kind (Field, Property, Parameter or ReturnValue).
Public property | LocationType | Gets the type of values that can be stored in the location.
Public property | Name | Gets the name of the underlying field, property, parameter, or return value.
Public property | ParameterInfo | Gets the underlying Online ParameterInfo, or null if the underlying code element is not a property.
Public property | PropertyInfo | Gets the underlying Online PropertyInfo, or null if the underlying code element is not a property.
Back to Top
See Also
LocationInfo Class
PostSharp.Reflection Namespace

Online Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


LocationInfo Constructor

LocationInfo Constructor PostSharp Documentation
Overload List
 | Name | Description
Public method | LocationInfo(FieldInfo) | Initializes a new LocationInfo from a Online FieldInfo.
Public method | LocationInfo(ParameterInfo) | Initializes a new LocationInfo from a Online ParameterInfo.
Public method | LocationInfo(PropertyInfo) | Initializes a new LocationInfo from a Online PropertyInfo.
Back to Top
See Also
LocationInfo Class
LocationInfo Members
PostSharp.Reflection Namespace

Online Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


LocationInfo Constructor (FieldInfo)

LocationInfo Constructor (FieldInfo) PostSharp Documentation
Initializes a new LocationInfo from a Online FieldInfo.

Namespace: PostSharp.Reflection
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
public LocationInfo(
    FieldInfo fieldInfo
)
public LocationInfo(
    FieldInfo fieldInfo
)
Parameters
fieldInfo
Type:   Online System.Reflection FieldInfo
The field represented by the LocationInfo.
See Also
LocationInfo Class
LocationInfo Members
LocationInfo Overload
PostSharp.Reflection Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


LocationInfo Constructor (ParameterInfo)

LocationInfo Constructor (ParameterInfo) PostSharp Documentation
Initializes a new LocationInfo from a Online ParameterInfo.

Namespace: PostSharp.Reflection
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
public LocationInfo(
    ParameterInfo parameterInfo
)
public LocationInfo(
    ParameterInfo parameterInfo
)
Parameters
parameterInfo
Type:   Online System.Reflection ParameterInfo
The parameter represented by the LocationInfo.
See Also
LocationInfo Class
LocationInfo Members
LocationInfo Overload
PostSharp.Reflection Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


LocationInfo Constructor (PropertyInfo)

LocationInfo Constructor (PropertyInfo) PostSharp Documentation
Initializes a new LocationInfo from a Online PropertyInfo.

Namespace: PostSharp.Reflection
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
public LocationInfo(
    PropertyInfo propertyInfo
)
public LocationInfo(
    PropertyInfo propertyInfo
)
Parameters
propertyInfo
Type:   Online System.Reflection PropertyInfo
The property represented by the LocationInfo.
See Also
LocationInfo Class
LocationInfo Members
LocationInfo Overload
PostSharp.Reflection Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


LocationInfo Methods

LocationInfo Methods PostSharp Documentation
The LocationInfo type exposes the following members.
Methods
 | Name | Description
Public method | Equals(Object) | Determines whether the specified Online Object is equal to the current Online Object. (Overrides Online Object Equals(Object).)
Public method | Equals(LocationInfo) | Indicates whether the current object is equal to another object of the same type.
Public method | GetHashCode | Serves as a hash function for a particular type. (Overrides Online Object GetHashCode .)
Public method | GetValue(Object) | Returns the value of the field or property represented by the current object.
Public method | GetValue(Object, Object ) | Returns the value of the field or property represented by the current object with optional index values for indexed properties.
Public method | SetValue(Object, Object) | Sets the value of the field or property represented by the current object to a given value.
Public method | SetValue(Object, Object, Object ) | Sets the value of the field or property represented by the current object to a given value with optional index values for indexed properties.
 | ToLocationInfo | Initializes a new LocationInfo from a Online FieldInfo, Online PropertyInfo, or Online ParameterInfo.
 | ToLocationInfoArray(ICollection FieldInfo ) | Converts a collection of FieldInfo into an array of LocationInfo.
 | ToLocationInfoArray(ICollection ParameterInfo ) | Converts a collection of ParameterInfo into an array of LocationInfo.
 | ToLocationInfoArray(ICollection PropertyInfo ) | Converts a collection of PropertyInfo into an array of LocationInfo.
Public method | ToString | Returns a string that represents the current object. (Overrides Online Object ToString .)
Back to Top
See Also
LocationInfo Class
PostSharp.Reflection Namespace

Online Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


LocationInfo.Equals Method

LocationInfo Equals Method PostSharp Documentation
Overload List
 | Name | Description
Public method | Equals(Object) | Determines whether the specified Online Object is equal to the current Online Object. (Overrides Online Object Equals(Object).)
Public method | Equals(LocationInfo) | Indicates whether the current object is equal to another object of the same type.
Back to Top
See Also
LocationInfo Class
LocationInfo Members
PostSharp.Reflection Namespace

Online Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


LocationInfo.Equals Method (Object)

LocationInfo Equals Method (Object) PostSharp Documentation
Determines whether the specified Online Object is equal to the current Online Object.

Namespace: PostSharp.Reflection
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
public override bool Equals(
    Object obj
)
public override bool Equals(
    Object obj
)
Parameters
obj
Type:   Online System Object
The object to compare with the current object.
Return Value
Type:   Online Boolean
true if the specified   Online Object is equal to the current   Online Object; otherwise, false.
See Also
LocationInfo Class
LocationInfo Members
Equals Overload
PostSharp.Reflection Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


LocationInfo.Equals Method (LocationInfo)

LocationInfo Equals Method (LocationInfo) PostSharp Documentation
Indicates whether the current object is equal to another object of the same type.

Namespace: PostSharp.Reflection
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
public bool Equals(
    LocationInfo other
)
public bool Equals(
    LocationInfo other
)
Parameters
other
Type: PostSharp.Reflection LocationInfo
An object to compare with this object.
Return Value
Type:   Online Boolean
true if the current object is equal to the other parameter; otherwise, false.
Implements
  Online IEquatable T  Equals(T)
See Also
LocationInfo Class
LocationInfo Members
Equals Overload
PostSharp.Reflection Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


LocationInfo.GetHashCode Method

LocationInfo GetHashCode Method PostSharp Documentation
Serves as a hash function for a particular type.

Namespace: PostSharp.Reflection
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
public override int GetHashCode()
public override int GetHashCode()
Return Value
Type:   Online Int32
A hash code for the current   Online Object.
See Also
LocationInfo Class
LocationInfo Members
PostSharp.Reflection Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


LocationInfo.GetValue Method

LocationInfo GetValue Method PostSharp Documentation
Overload List
 | Name | Description
Public method | GetValue(Object) | Returns the value of the field or property represented by the current object.
Public method | GetValue(Object, Object ) | Returns the value of the field or property represented by the current object with optional index values for indexed properties.
Back to Top
See Also
LocationInfo Class
LocationInfo Members
PostSharp.Reflection Namespace

Online Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


LocationInfo.GetValue Method (Object)

LocationInfo GetValue Method (Object) PostSharp Documentation
Returns the value of the field or property represented by the current object.

Namespace: PostSharp.Reflection
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
public Object GetValue(
    Object instance
)
public Object GetValue(
    Object instance
)
Parameters
instance
Type:   Online System Object
The object whose field  or property value will be returned (null if the
              field or property is static).
Return Value
Type:   Online Object
The value of the field or property.
See Also
LocationInfo Class
LocationInfo Members
GetValue Overload
PostSharp.Reflection Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


LocationInfo.GetValue Method (Object, Object[])

LocationInfo GetValue Method (Object, Object ) PostSharp Documentation
Returns the value of the field or property represented by the current object with optional index values for indexed properties.

Namespace: PostSharp.Reflection
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
public Object GetValue(
    Object instance,
    Object[] index
)
public Object GetValue(
    Object instance,
    Object[] index
)
Parameters
instance
Type:   Online System Object
The object whose field  or property value will be returned (null if the
              field or property is static).
index
Type:    Online System Object
Optional index values for indexed properties. null for fields or non-index
              properties.
Return Value
Type:   Online Object
The value of the field or property.
See Also
LocationInfo Class
LocationInfo Members
GetValue Overload
PostSharp.Reflection Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


LocationInfo.SetValue Method

LocationInfo SetValue Method PostSharp Documentation
Overload List
 | Name | Description
Public method | SetValue(Object, Object) | Sets the value of the field or property represented by the current object to a given value.
Public method | SetValue(Object, Object, Object ) | Sets the value of the field or property represented by the current object to a given value with optional index values for indexed properties.
Back to Top
See Also
LocationInfo Class
LocationInfo Members
PostSharp.Reflection Namespace

Online Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


LocationInfo.SetValue Method (Object, Object)

LocationInfo SetValue Method (Object, Object) PostSharp Documentation
Sets the value of the field or property represented by the current object to a given value.

Namespace: PostSharp.Reflection
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
public void SetValue(
    Object instance,
    Object value
)
public void SetValue(
    Object instance,
    Object value
)
Parameters
instance
Type:   Online System Object
The object whose field  or property value will be changed (null if the
              field or property is static).
value
Type:   Online System Object
New value.
See Also
LocationInfo Class
LocationInfo Members
SetValue Overload
PostSharp.Reflection Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


LocationInfo.SetValue Method (Object, Object, Object[])

LocationInfo SetValue Method (Object, Object, Object ) PostSharp Documentation
Sets the value of the field or property represented by the current object to a given value with optional index values for indexed properties.

Namespace: PostSharp.Reflection
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
public void SetValue(
    Object instance,
    Object value,
    Object[] index
)
public void SetValue(
    Object instance,
    Object value,
    Object[] index
)
Parameters
instance
Type:   Online System Object
The object whose field  or property value will be changed (null if the
              field or property is static).
value
Type:   Online System Object
New value.
index
Type:    Online System Object
Optional index values for indexed properties. null for fields or non-index
              properties.
See Also
LocationInfo Class
LocationInfo Members
SetValue Overload
PostSharp.Reflection Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


LocationInfo.ToLocationInfo Method

LocationInfo ToLocationInfo Method PostSharp Documentation
Initializes a new LocationInfo from a Online FieldInfo, Online PropertyInfo, or Online ParameterInfo.

Namespace: PostSharp.Reflection
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
public static LocationInfo ToLocationInfo(
    Object reflectionInfo
)
public static LocationInfo ToLocationInfo(
    Object reflectionInfo
)
Parameters
reflectionInfo
Type:   Online System Object
[Missing <param name="reflectionInfo"/> documentation for "M:PostSharp.Reflection.LocationInfo.ToLocationInfo(System.Object)"]
Return Value
Type: LocationInfo
[Missing <returns> documentation for "M:PostSharp.Reflection.LocationInfo.ToLocationInfo(System.Object)"]
See Also
LocationInfo Class
LocationInfo Members
PostSharp.Reflection Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


LocationInfo.ToLocationInfoArray Method

LocationInfo ToLocationInfoArray Method PostSharp Documentation
Overload List
Name | Description
ToLocationInfoArray(ICollection FieldInfo ) | Converts a collection of FieldInfo into an array of LocationInfo.
ToLocationInfoArray(ICollection ParameterInfo ) | Converts a collection of ParameterInfo into an array of LocationInfo.
ToLocationInfoArray(ICollection PropertyInfo ) | Converts a collection of PropertyInfo into an array of LocationInfo.
Back to Top
See Also
LocationInfo Class
LocationInfo Members
PostSharp.Reflection Namespace

Online Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


LocationInfo.ToLocationInfoArray Method (ICollection(FieldInfo))

LocationInfo ToLocationInfoArray Method (ICollection FieldInfo ) PostSharp Documentation
Converts a collection of FieldInfo into an array of LocationInfo.

Namespace: PostSharp.Reflection
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
public static LocationInfo[] ToLocationInfoArray(
    ICollection<FieldInfo> fields
)
public static LocationInfo[] ToLocationInfoArray(
    ICollection<FieldInfo> fields
)
Parameters
fields
Type:   Online System.Collections.Generic ICollection    Online FieldInfo
A collection of FieldInfo.
Return Value
Type:  LocationInfo
An array of LocationInfo.
See Also
LocationInfo Class
LocationInfo Members
ToLocationInfoArray Overload
PostSharp.Reflection Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


LocationInfo.ToLocationInfoArray Method (ICollection(ParameterInfo))

LocationInfo ToLocationInfoArray Method (ICollection ParameterInfo ) PostSharp Documentation
Converts a collection of ParameterInfo into an array of LocationInfo.

Namespace: PostSharp.Reflection
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
public static LocationInfo[] ToLocationInfoArray(
    ICollection<ParameterInfo> parameters
)
public static LocationInfo[] ToLocationInfoArray(
    ICollection<ParameterInfo> parameters
)
Parameters
parameters
Type:   Online System.Collections.Generic ICollection    Online ParameterInfo
A collection of ParameterInfo.
Return Value
Type:  LocationInfo
An array of LocationInfo.
See Also
LocationInfo Class
LocationInfo Members
ToLocationInfoArray Overload
PostSharp.Reflection Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


LocationInfo.ToLocationInfoArray Method (ICollection(PropertyInfo))

LocationInfo ToLocationInfoArray Method (ICollection PropertyInfo ) PostSharp Documentation
Converts a collection of PropertyInfo into an array of LocationInfo.

Namespace: PostSharp.Reflection
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
public static LocationInfo[] ToLocationInfoArray(
    ICollection<PropertyInfo> properties
)
public static LocationInfo[] ToLocationInfoArray(
    ICollection<PropertyInfo> properties
)
Parameters
properties
Type:   Online System.Collections.Generic ICollection    Online PropertyInfo
A collection of PropertyInfo.
Return Value
Type:  LocationInfo
An array of LocationInfo.
See Also
LocationInfo Class
LocationInfo Members
ToLocationInfoArray Overload
PostSharp.Reflection Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


LocationInfo.ToString Method

LocationInfo ToString Method PostSharp Documentation
Returns a string that represents the current object.

Namespace: PostSharp.Reflection
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
public override string ToString()
public override string ToString()
Return Value
Type:   Online String
A string that represents the current object.
See Also
LocationInfo Class
LocationInfo Members
PostSharp.Reflection Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


LocationInfo Operators

LocationInfo Operators PostSharp Documentation
The LocationInfo type exposes the following members.
Operators
Name | Description
Equality | Determines whether two instances of LocationInfo represent the same element of code.
Inequality | Determines whether two instances of LocationInfo represent different elements of code.
Back to Top
See Also
LocationInfo Class
PostSharp.Reflection Namespace

Online Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


LocationInfo.Equality Operator

LocationInfo Equality Operator PostSharp Documentation
Determines whether two instances of LocationInfo represent the same element of code.

Namespace: PostSharp.Reflection
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
public static bool operator ==(
    LocationInfo left,
    LocationInfo right
)
public static bool operator ==(
    LocationInfo left,
    LocationInfo right
)
Parameters
left
Type: PostSharp.Reflection LocationInfo
A LocationInfo.
right
Type: PostSharp.Reflection LocationInfo
A LocationInfo.
Return Value
Type:   Online Boolean
true if left and right are equal, otherwise false.
See Also
LocationInfo Class
LocationInfo Members
PostSharp.Reflection Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


LocationInfo.Inequality Operator

LocationInfo Inequality Operator PostSharp Documentation
Determines whether two instances of LocationInfo represent different elements of code.

Namespace: PostSharp.Reflection
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
public static bool operator !=(
    LocationInfo left,
    LocationInfo right
)
public static bool operator !=(
    LocationInfo left,
    LocationInfo right
)
Parameters
left
Type: PostSharp.Reflection LocationInfo
A LocationInfo.
right
Type: PostSharp.Reflection LocationInfo
A LocationInfo.
Return Value
Type:   Online Boolean
true if left and right are different, otherwise false.
See Also
LocationInfo Class
LocationInfo Members
PostSharp.Reflection Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


LocationInfo Properties

LocationInfo Properties PostSharp Documentation
The LocationInfo type exposes the following members.
Properties
 | Name | Description
Public property | DeclaringType | Gets the declaring type of the underlying field, property, parameter, or return value.
Public property | FieldInfo | Gets the underlying Online FieldInfo, or null if the underlying code element is not a property.
Public property | IsStatic | Determines whether the underlying field or property is static.
Public property | LocationKind | Gets the location kind (Field, Property, Parameter or ReturnValue).
Public property | LocationType | Gets the type of values that can be stored in the location.
Public property | Name | Gets the name of the underlying field, property, parameter, or return value.
Public property | ParameterInfo | Gets the underlying Online ParameterInfo, or null if the underlying code element is not a property.
Public property | PropertyInfo | Gets the underlying Online PropertyInfo, or null if the underlying code element is not a property.
Back to Top
See Also
LocationInfo Class
PostSharp.Reflection Namespace

Online Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


LocationInfo.DeclaringType Property

LocationInfo DeclaringType Property PostSharp Documentation
Gets the declaring type of the underlying field, property, parameter, or return value.

Namespace: PostSharp.Reflection
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
public Type DeclaringType { get; }
public Type DeclaringType { get; }
Property Value
Type:   Online Type
See Also
LocationInfo Class
LocationInfo Members
PostSharp.Reflection Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


LocationInfo.FieldInfo Property

LocationInfo FieldInfo Property PostSharp Documentation
Gets the underlying Online FieldInfo, or null if the underlying code element is not a property.

Namespace: PostSharp.Reflection
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
public FieldInfo FieldInfo { get; }
public FieldInfo FieldInfo { get; }
Property Value
Type:   Online FieldInfo
See Also
LocationInfo Class
LocationInfo Members
PostSharp.Reflection Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


LocationInfo.IsStatic Property

LocationInfo IsStatic Property PostSharp Documentation
Determines whether the underlying field or property is static.

Namespace: PostSharp.Reflection
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
public bool IsStatic { get; }
public bool IsStatic { get; }
Property Value
Type:   Online Boolean
See Also
LocationInfo Class
LocationInfo Members
PostSharp.Reflection Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


LocationInfo.LocationKind Property

LocationInfo LocationKind Property PostSharp Documentation
Gets the location kind (Field, Property, Parameter or ReturnValue).

Namespace: PostSharp.Reflection
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
public LocationKind LocationKind { get; private set; }
public LocationKind LocationKind { get; private set; }
Property Value
Type: LocationKind
See Also
LocationInfo Class
LocationInfo Members
PostSharp.Reflection Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


LocationInfo.LocationType Property

LocationInfo LocationType Property PostSharp Documentation
Gets the type of values that can be stored in the location.

Namespace: PostSharp.Reflection
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
public Type LocationType { get; private set; }
public Type LocationType { get; private set; }
Property Value
Type:   Online Type
See Also
LocationInfo Class
LocationInfo Members
PostSharp.Reflection Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


LocationInfo.Name Property

LocationInfo Name Property PostSharp Documentation
Gets the name of the underlying field, property, parameter, or return value.

Namespace: PostSharp.Reflection
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
public string Name { get; }
public string Name { get; }
Property Value
Type:   Online String
See Also
LocationInfo Class
LocationInfo Members
PostSharp.Reflection Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


LocationInfo.ParameterInfo Property

LocationInfo ParameterInfo Property PostSharp Documentation
Gets the underlying Online ParameterInfo, or null if the underlying code element is not a property.

Namespace: PostSharp.Reflection
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
public ParameterInfo ParameterInfo { get; }
public ParameterInfo ParameterInfo { get; }
Property Value
Type:   Online ParameterInfo
See Also
LocationInfo Class
LocationInfo Members
PostSharp.Reflection Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


LocationInfo.PropertyInfo Property

LocationInfo PropertyInfo Property PostSharp Documentation
Gets the underlying Online PropertyInfo, or null if the underlying code element is not a property.

Namespace: PostSharp.Reflection
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
public PropertyInfo PropertyInfo { get; }
public PropertyInfo PropertyInfo { get; }
Property Value
Type:   Online PropertyInfo
See Also
LocationInfo Class
LocationInfo Members
PostSharp.Reflection Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


LocationKind Enumeration

LocationKind Enumeration PostSharp Documentation
Enumerates the kinds of code elements that can be encapsulated by a LocationInfo.

Namespace: PostSharp.Reflection
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
public enum LocationKind
public enum LocationKind
Members
Member name | Value | Description
Field | 0 | Online FieldInfo.
Property | 1 | Online PropertyInfo.
Parameter | 2 | A Online ParameterInfo representing a parameter (not a ReturnValue).
ReturnValue | 3 | A Online ParameterInfo representing a return value.
See Also
PostSharp.Reflection Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


MemberTypeCodeReference Class

MemberTypeCodeReference Class PostSharp Documentation
Represents a relationship between a type and a member of this type. A member can be a Online FieldInfo, Online PropertyInfo, or Online ParameterInfo.
Inheritance Hierarchy
Online System Object
PostSharp.Reflection MemberTypeCodeReference

Namespace: PostSharp.Reflection
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
public sealed class MemberTypeCodeReference : ICodeReference
public sealed class MemberTypeCodeReference : ICodeReference
See Also
MemberTypeCodeReference Members
PostSharp.Reflection Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


MemberTypeCodeReference Members

MemberTypeCodeReference Members PostSharp Documentation

The MemberTypeCodeReference type exposes the following members.
Properties
 | Name | Description
Public property | Member | Gets the member ( Online FieldInfo, Online PropertyInfo, or Online ParameterInfo).
Public property | Type | Gets the member type.
Back to Top
See Also
MemberTypeCodeReference Class
PostSharp.Reflection Namespace

Online Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


MemberTypeCodeReference Properties

MemberTypeCodeReference Properties PostSharp Documentation
The MemberTypeCodeReference type exposes the following members.
Properties
 | Name | Description
Public property | Member | Gets the member ( Online FieldInfo, Online PropertyInfo, or Online ParameterInfo).
Public property | Type | Gets the member type.
Back to Top
See Also
MemberTypeCodeReference Class
PostSharp.Reflection Namespace

Online Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


MemberTypeCodeReference.Member Property

MemberTypeCodeReference Member Property PostSharp Documentation
Gets the member ( Online FieldInfo, Online PropertyInfo, or Online ParameterInfo).

Namespace: PostSharp.Reflection
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
public Object Member { get; private set; }
public Object Member { get; private set; }
Property Value
Type:   Online Object
See Also
MemberTypeCodeReference Class
MemberTypeCodeReference Members
PostSharp.Reflection Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


MemberTypeCodeReference.Type Property

MemberTypeCodeReference Type Property PostSharp Documentation
Gets the member type.

Namespace: PostSharp.Reflection
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
public Type Type { get; private set; }
public Type Type { get; private set; }
Property Value
Type:   Online Type
See Also
MemberTypeCodeReference Class
MemberTypeCodeReference Members
PostSharp.Reflection Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


MethodUsageCodeReference Class

MethodUsageCodeReference Class PostSharp Documentation
Represents a relationship between a declaration ( Online Type, Online FieldInfo, Online MethodInfo or Online ConstructorInfo) and a method whose instructions (method body) use the declaration.
Inheritance Hierarchy
Online System Object
PostSharp.Reflection MethodUsageCodeReference

Namespace: PostSharp.Reflection
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
public sealed class MethodUsageCodeReference : ICodeReference
public sealed class MethodUsageCodeReference : ICodeReference
See Also
MethodUsageCodeReference Members
PostSharp.Reflection Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


MethodUsageCodeReference Members

MethodUsageCodeReference Members PostSharp Documentation

The MethodUsageCodeReference type exposes the following members.
Properties
 | Name | Description
Public property | Instructions | Gets the instructions that reference UsedDeclaration.
Public property | UsedDeclaration | Gets the declaration ( Online Type, Online MethodInfo or Online ConstructorInfo) used by the method.
Public property | UsedType | Gets the Online Type used by the method. If the current object represents a reference to a Online MethodInfo or Online ConstructorInfo, this property returns the declaring type of the method or constructor.
Public property | UsingMethod | Gets the method ( Online MethodInfo or Online ConstructorInfo) whose body uses the declaration.
Back to Top
See Also
MethodUsageCodeReference Class
PostSharp.Reflection Namespace

Online Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


MethodUsageCodeReference Properties

MethodUsageCodeReference Properties PostSharp Documentation
The MethodUsageCodeReference type exposes the following members.
Properties
 | Name | Description
Public property | Instructions | Gets the instructions that reference UsedDeclaration.
Public property | UsedDeclaration | Gets the declaration ( Online Type, Online MethodInfo or Online ConstructorInfo) used by the method.
Public property | UsedType | Gets the Online Type used by the method. If the current object represents a reference to a Online MethodInfo or Online ConstructorInfo, this property returns the declaring type of the method or constructor.
Public property | UsingMethod | Gets the method ( Online MethodInfo or Online ConstructorInfo) whose body uses the declaration.
Back to Top
See Also
MethodUsageCodeReference Class
PostSharp.Reflection Namespace

Online Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


MethodUsageCodeReference.Instructions Property

MethodUsageCodeReference Instructions Property PostSharp Documentation
Gets the instructions that reference UsedDeclaration.

Namespace: PostSharp.Reflection
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
public MethodUsageInstructions Instructions { get; private set; }
public MethodUsageInstructions Instructions { get; private set; }
Property Value
Type: MethodUsageInstructions
See Also
MethodUsageCodeReference Class
MethodUsageCodeReference Members
PostSharp.Reflection Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


MethodUsageCodeReference.UsedDeclaration Property

MethodUsageCodeReference UsedDeclaration Property PostSharp Documentation
Gets the declaration ( Online Type, Online MethodInfo or Online ConstructorInfo) used by the method.

Namespace: PostSharp.Reflection
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
public MemberInfo UsedDeclaration { get; private set; }
public MemberInfo UsedDeclaration { get; private set; }
Property Value
Type:   Online MemberInfo
See Also
MethodUsageCodeReference Class
MethodUsageCodeReference Members
PostSharp.Reflection Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


MethodUsageCodeReference.UsedType Property

MethodUsageCodeReference UsedType Property PostSharp Documentation
Gets the Online Type used by the method. If the current object represents a reference to a Online MethodInfo or Online ConstructorInfo, this property returns the declaring type of the method or constructor.

Namespace: PostSharp.Reflection
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
public Type UsedType { get; }
public Type UsedType { get; }
Property Value
Type:   Online Type
See Also
MethodUsageCodeReference Class
MethodUsageCodeReference Members
PostSharp.Reflection Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


MethodUsageCodeReference.UsingMethod Property

MethodUsageCodeReference UsingMethod Property PostSharp Documentation
Gets the method ( Online MethodInfo or Online ConstructorInfo) whose body uses the declaration.

Namespace: PostSharp.Reflection
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
public MethodBase UsingMethod { get; private set; }
public MethodBase UsingMethod { get; private set; }
Property Value
Type:   Online MethodBase
See Also
MethodUsageCodeReference Class
MethodUsageCodeReference Members
PostSharp.Reflection Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


MethodUsageInstructions Enumeration

MethodUsageInstructions Enumeration PostSharp Documentation
Instructions whose operands can reference a declaration.

Namespace: PostSharp.Reflection
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
[FlagsAttribute]
public enum MethodUsageInstructions
[FlagsAttribute]
public enum MethodUsageInstructions
Members
Member name | Value | Description
None | 0 | No instruction.
LoadField | 1 | Get field value.
StoreField | 2 | Set field value.
Call | 4 | Call to a static or sealed method.
CallVirtual | 8 | Call to a virtual method.
NewObject | 16 | Creation of a new instance (invoke the constructor).
LoadFieldAddress | 32 | Get field address.
LoadMetadata | 64 | Load the metadata token (for instance typeof).
LoadMethodAddress | 128 | Load the address of a static or sealed method (delegate instantiation).
LoadMethodAddressVirtual | 256 | Load the address of a virtual method (delegate instantiation).
Cast | 512 | Type casting.
IsInstance | 1024 | "Safe" type casting (as or is in C#).
SizeOf | 2048 | Get the size of a value type (sizeof in C#).
NewArray | 4096 | Create a new array of a type.
See Also
PostSharp.Reflection Namespace
PostSharp.Reflection MethodUsageCodeReference
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


ObjectConstruction Class

ObjectConstruction Class PostSharp Documentation
Specifies how an object should be constructed, i.e. specifies the constructor to be used, the arguments to be passed to this constructor, and the fields or properties to be set.
Inheritance Hierarchy
Online System Object
PostSharp.Reflection ObjectConstruction

Namespace: PostSharp.Reflection
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
public sealed class ObjectConstruction
public sealed class ObjectConstruction
See Also
ObjectConstruction Members
PostSharp.Reflection Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


ObjectConstruction Members

ObjectConstruction Members PostSharp Documentation

The ObjectConstruction type exposes the following members.
Constructors
 | Name | Description
Public method | ObjectConstruction(CustomAttributeData) | Initializes a new type-safe ObjectConstruction from a Online CustomAttributeData
Public method | ObjectConstruction(ConstructorInfo, Object ) | Initializes a new type-safe ObjectConstruction from a Online ConstructorInfo.
Public method | ObjectConstruction(String, Object ) | Initializes a new ObjectConstruction by specifying a type name and a list of constructor arguments.
Public method | ObjectConstruction(Type, Object ) | Initializes a new ObjectConstruction by specifying a type name and a list of constructor arguments.
Back to Top
Properties
 | Name | Description
Public property | Constructor | Gets the custom attribute constructor.
Public property | ConstructorArguments | Gets the arguments passed to the custom attribute constructor.
Public property | NamedArguments | Gets the collection of named arguments.
Public property | TypeName | Gets the assembly-qualified type name of the object.
Back to Top
See Also
ObjectConstruction Class
PostSharp.Reflection Namespace

Online Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


ObjectConstruction Constructor

ObjectConstruction Constructor PostSharp Documentation
Overload List
 | Name | Description
Public method | ObjectConstruction(CustomAttributeData) | Initializes a new type-safe ObjectConstruction from a Online CustomAttributeData
Public method | ObjectConstruction(ConstructorInfo, Object ) | Initializes a new type-safe ObjectConstruction from a Online ConstructorInfo.
Public method | ObjectConstruction(String, Object ) | Initializes a new ObjectConstruction by specifying a type name and a list of constructor arguments.
Public method | ObjectConstruction(Type, Object ) | Initializes a new ObjectConstruction by specifying a type name and a list of constructor arguments.
Back to Top
See Also
ObjectConstruction Class
ObjectConstruction Members
PostSharp.Reflection Namespace

Online Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


ObjectConstruction Constructor (CustomAttributeData)

ObjectConstruction Constructor (CustomAttributeData) PostSharp Documentation
Initializes a new type-safe ObjectConstruction from a Online CustomAttributeData

Namespace: PostSharp.Reflection
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
public ObjectConstruction(
    CustomAttributeData customAttributeData
)
public ObjectConstruction(
    CustomAttributeData customAttributeData
)
Parameters
customAttributeData
Type:   Online System.Reflection CustomAttributeData
A   Online CustomAttributeData
See Also
ObjectConstruction Class
ObjectConstruction Members
ObjectConstruction Overload
PostSharp.Reflection Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


ObjectConstruction Constructor (ConstructorInfo, Object[])

ObjectConstruction Constructor (ConstructorInfo, Object ) PostSharp Documentation
Initializes a new type-safe ObjectConstruction from a Online ConstructorInfo.

Namespace: PostSharp.Reflection
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
public ObjectConstruction(
    ConstructorInfo constructor,
    params Object[] constructorArguments
)
public ObjectConstruction(
    ConstructorInfo constructor,
    params Object[] constructorArguments
)
Parameters
constructor
Type:   Online System.Reflection ConstructorInfo
Constructor.
constructorArguments
Type:    Online System Object
Arguments passed to the constructor.
See Also
ObjectConstruction Class
ObjectConstruction Members
ObjectConstruction Overload
PostSharp.Reflection Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


ObjectConstruction Constructor (String, Object[])

ObjectConstruction Constructor (String, Object ) PostSharp Documentation
Initializes a new ObjectConstruction by specifying a type name and a list of constructor arguments.

Namespace: PostSharp.Reflection
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
public ObjectConstruction(
    string typeName,
    params Object[] constructorArguments
)
public ObjectConstruction(
    string typeName,
    params Object[] constructorArguments
)
Parameters
typeName
Type:   Online System String
Name of the object type.
constructorArguments
Type:    Online System Object
Arguments passed to the constructor.
See Also
ObjectConstruction Class
ObjectConstruction Members
ObjectConstruction Overload
PostSharp.Reflection Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


ObjectConstruction Constructor (Type, Object[])

ObjectConstruction Constructor (Type, Object ) PostSharp Documentation
Initializes a new ObjectConstruction by specifying a type name and a list of constructor arguments.

Namespace: PostSharp.Reflection
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
public ObjectConstruction(
    Type type,
    params Object[] constructorArguments
)
public ObjectConstruction(
    Type type,
    params Object[] constructorArguments
)
Parameters
type
Type:   Online System Type
Object type.
constructorArguments
Type:    Online System Object
Arguments passed to the constructor.
See Also
ObjectConstruction Class
ObjectConstruction Members
ObjectConstruction Overload
PostSharp.Reflection Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


ObjectConstruction Properties

ObjectConstruction Properties PostSharp Documentation
The ObjectConstruction type exposes the following members.
Properties
 | Name | Description
Public property | Constructor | Gets the custom attribute constructor.
Public property | ConstructorArguments | Gets the arguments passed to the custom attribute constructor.
Public property | NamedArguments | Gets the collection of named arguments.
Public property | TypeName | Gets the assembly-qualified type name of the object.
Back to Top
See Also
ObjectConstruction Class
PostSharp.Reflection Namespace

Online Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


ObjectConstruction.Constructor Property

ObjectConstruction Constructor Property PostSharp Documentation
Gets the custom attribute constructor.

Namespace: PostSharp.Reflection
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
public ConstructorInfo Constructor { get; }
public ConstructorInfo Constructor { get; }
Property Value
Type:   Online ConstructorInfo
See Also
ObjectConstruction Class
ObjectConstruction Members
PostSharp.Reflection Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


ObjectConstruction.ConstructorArguments Property

ObjectConstruction ConstructorArguments Property PostSharp Documentation
Gets the arguments passed to the custom attribute constructor.

Namespace: PostSharp.Reflection
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
public IList<Object> ConstructorArguments { get; }
public IList<Object> ConstructorArguments { get; }
Property Value
Type:   Online IList    Online Object
See Also
ObjectConstruction Class
ObjectConstruction Members
PostSharp.Reflection Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


ObjectConstruction.NamedArguments Property

ObjectConstruction NamedArguments Property PostSharp Documentation
Gets the collection of named arguments.

Namespace: PostSharp.Reflection
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
public IDictionary<string, Object> NamedArguments { get; }
public IDictionary<string, Object> NamedArguments { get; }
Property Value
Type:   Online IDictionary    Online String,   Online Object
Remarks

              This collection is a dictionary associating the name of public a field or property of the
              custom attributes to the value that should be assigned to it.

See Also
ObjectConstruction Class
ObjectConstruction Members
PostSharp.Reflection Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


ObjectConstruction.TypeName Property

ObjectConstruction TypeName Property PostSharp Documentation
Gets the assembly-qualified type name of the object.

Namespace: PostSharp.Reflection
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
public string TypeName { get; }
public string TypeName { get; }
Property Value
Type:   Online String
See Also
ObjectConstruction Class
ObjectConstruction Members
PostSharp.Reflection Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


ReflectionHelper Class

ReflectionHelper Class PostSharp Documentation
Provides helper methods for work with Online System.Reflection.
Inheritance Hierarchy
Online System Object
PostSharp.Reflection ReflectionHelper

Namespace: PostSharp.Reflection
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
public static class ReflectionHelper
public static class ReflectionHelper
See Also
ReflectionHelper Members
PostSharp.Reflection Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


ReflectionHelper Members

ReflectionHelper Members PostSharp Documentation

The ReflectionHelper type exposes the following members.
Methods
Name | Description
GetEvent |
GetLocation |
GetProperty(Type, MethodInfo, MethodInfo) |
GetProperty(Type, MethodInfo, MethodInfo, Boolean) |
Back to Top
See Also
ReflectionHelper Class
PostSharp.Reflection Namespace

Online Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


ReflectionHelper Methods

ReflectionHelper Methods PostSharp Documentation
The ReflectionHelper type exposes the following members.
Methods
Name | Description
GetEvent |
GetLocation |
GetProperty(Type, MethodInfo, MethodInfo) |
GetProperty(Type, MethodInfo, MethodInfo, Boolean) |
Back to Top
See Also
ReflectionHelper Class
PostSharp.Reflection Namespace

Online Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


ReflectionHelper.GetEvent Method

ReflectionHelper GetEvent Method PostSharp Documentation

[Missing <summary> documentation for "M:PostSharp.Reflection.ReflectionHelper.GetEvent(System.Type,System.Reflection.MethodInfo,System.Reflection.MethodInfo,System.Reflection.MethodInfo)"]

Namespace: PostSharp.Reflection
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
public static EventInfo GetEvent(
    Type declaringType,
    MethodInfo addMethod,
    MethodInfo removeMethod,
    MethodInfo raiseMethod
)
public static EventInfo GetEvent(
    Type declaringType,
    MethodInfo addMethod,
    MethodInfo removeMethod,
    MethodInfo raiseMethod
)
Parameters
declaringType
Type:   Online System Type
[Missing <param name="declaringType"/> documentation for "M:PostSharp.Reflection.ReflectionHelper.GetEvent(System.Type,System.Reflection.MethodInfo,System.Reflection.MethodInfo,System.Reflection.MethodInfo)"]
addMethod
Type:   Online System.Reflection MethodInfo
[Missing <param name="addMethod"/> documentation for "M:PostSharp.Reflection.ReflectionHelper.GetEvent(System.Type,System.Reflection.MethodInfo,System.Reflection.MethodInfo,System.Reflection.MethodInfo)"]
removeMethod
Type:   Online System.Reflection MethodInfo
[Missing <param name="removeMethod"/> documentation for "M:PostSharp.Reflection.ReflectionHelper.GetEvent(System.Type,System.Reflection.MethodInfo,System.Reflection.MethodInfo,System.Reflection.MethodInfo)"]
raiseMethod
Type:   Online System.Reflection MethodInfo
[Missing <param name="raiseMethod"/> documentation for "M:PostSharp.Reflection.ReflectionHelper.GetEvent(System.Type,System.Reflection.MethodInfo,System.Reflection.MethodInfo,System.Reflection.MethodInfo)"]
Return Value
Type:   Online EventInfo
[Missing <returns> documentation for "M:PostSharp.Reflection.ReflectionHelper.GetEvent(System.Type,System.Reflection.MethodInfo,System.Reflection.MethodInfo,System.Reflection.MethodInfo)"]
See Also
ReflectionHelper Class
ReflectionHelper Members
PostSharp.Reflection Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


ReflectionHelper.GetLocation Method

ReflectionHelper GetLocation Method PostSharp Documentation

[Missing <summary> documentation for "M:PostSharp.Reflection.ReflectionHelper.GetLocation(System.Type,System.Reflection.MethodInfo,System.Reflection.MethodInfo)"]

Namespace: PostSharp.Reflection
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
public static LocationInfo GetLocation(
    Type declaringType,
    MethodInfo getter,
    MethodInfo setter
)
public static LocationInfo GetLocation(
    Type declaringType,
    MethodInfo getter,
    MethodInfo setter
)
Parameters
declaringType
Type:   Online System Type
[Missing <param name="declaringType"/> documentation for "M:PostSharp.Reflection.ReflectionHelper.GetLocation(System.Type,System.Reflection.MethodInfo,System.Reflection.MethodInfo)"]
getter
Type:   Online System.Reflection MethodInfo
[Missing <param name="getter"/> documentation for "M:PostSharp.Reflection.ReflectionHelper.GetLocation(System.Type,System.Reflection.MethodInfo,System.Reflection.MethodInfo)"]
setter
Type:   Online System.Reflection MethodInfo
[Missing <param name="setter"/> documentation for "M:PostSharp.Reflection.ReflectionHelper.GetLocation(System.Type,System.Reflection.MethodInfo,System.Reflection.MethodInfo)"]
Return Value
Type: LocationInfo
[Missing <returns> documentation for "M:PostSharp.Reflection.ReflectionHelper.GetLocation(System.Type,System.Reflection.MethodInfo,System.Reflection.MethodInfo)"]
See Also
ReflectionHelper Class
ReflectionHelper Members
PostSharp.Reflection Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


ReflectionHelper.GetProperty Method

ReflectionHelper GetProperty Method PostSharp Documentation
Overload List
Name | Description
GetProperty(Type, MethodInfo, MethodInfo) |
GetProperty(Type, MethodInfo, MethodInfo, Boolean) |
Back to Top
See Also
ReflectionHelper Class
ReflectionHelper Members
PostSharp.Reflection Namespace

Online Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


ReflectionHelper.GetProperty Method (Type, MethodInfo, MethodInfo)

ReflectionHelper GetProperty Method (Type, MethodInfo, MethodInfo) PostSharp Documentation

[Missing <summary> documentation for "M:PostSharp.Reflection.ReflectionHelper.GetProperty(System.Type,System.Reflection.MethodInfo,System.Reflection.MethodInfo)"]

Namespace: PostSharp.Reflection
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
public static PropertyInfo GetProperty(
    Type declaringType,
    MethodInfo getter,
    MethodInfo setter
)
public static PropertyInfo GetProperty(
    Type declaringType,
    MethodInfo getter,
    MethodInfo setter
)
Parameters
declaringType
Type:   Online System Type
[Missing <param name="declaringType"/> documentation for "M:PostSharp.Reflection.ReflectionHelper.GetProperty(System.Type,System.Reflection.MethodInfo,System.Reflection.MethodInfo)"]
getter
Type:   Online System.Reflection MethodInfo
[Missing <param name="getter"/> documentation for "M:PostSharp.Reflection.ReflectionHelper.GetProperty(System.Type,System.Reflection.MethodInfo,System.Reflection.MethodInfo)"]
setter
Type:   Online System.Reflection MethodInfo
[Missing <param name="setter"/> documentation for "M:PostSharp.Reflection.ReflectionHelper.GetProperty(System.Type,System.Reflection.MethodInfo,System.Reflection.MethodInfo)"]
Return Value
Type:   Online PropertyInfo
[Missing <returns> documentation for "M:PostSharp.Reflection.ReflectionHelper.GetProperty(System.Type,System.Reflection.MethodInfo,System.Reflection.MethodInfo)"]
See Also
ReflectionHelper Class
ReflectionHelper Members
GetProperty Overload
PostSharp.Reflection Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


ReflectionHelper.GetProperty Method (Type, MethodInfo, MethodInfo, Boolean)

ReflectionHelper GetProperty Method (Type, MethodInfo, MethodInfo, Boolean) PostSharp Documentation

[Missing <summary> documentation for "M:PostSharp.Reflection.ReflectionHelper.GetProperty(System.Type,System.Reflection.MethodInfo,System.Reflection.MethodInfo,System.Boolean)"]

Namespace: PostSharp.Reflection
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
public static PropertyInfo GetProperty(
    Type declaringType,
    MethodInfo getter,
    MethodInfo setter,
    bool throwOnMissingMember
)
public static PropertyInfo GetProperty(
    Type declaringType,
    MethodInfo getter,
    MethodInfo setter,
    bool throwOnMissingMember
)
Parameters
declaringType
Type:   Online System Type
[Missing <param name="declaringType"/> documentation for "M:PostSharp.Reflection.ReflectionHelper.GetProperty(System.Type,System.Reflection.MethodInfo,System.Reflection.MethodInfo,System.Boolean)"]
getter
Type:   Online System.Reflection MethodInfo
[Missing <param name="getter"/> documentation for "M:PostSharp.Reflection.ReflectionHelper.GetProperty(System.Type,System.Reflection.MethodInfo,System.Reflection.MethodInfo,System.Boolean)"]
setter
Type:   Online System.Reflection MethodInfo
[Missing <param name="setter"/> documentation for "M:PostSharp.Reflection.ReflectionHelper.GetProperty(System.Type,System.Reflection.MethodInfo,System.Reflection.MethodInfo,System.Boolean)"]
throwOnMissingMember
Type:   Online System Boolean
[Missing <param name="throwOnMissingMember"/> documentation for "M:PostSharp.Reflection.ReflectionHelper.GetProperty(System.Type,System.Reflection.MethodInfo,System.Reflection.MethodInfo,System.Boolean)"]
Return Value
Type:   Online PropertyInfo
[Missing <returns> documentation for "M:PostSharp.Reflection.ReflectionHelper.GetProperty(System.Type,System.Reflection.MethodInfo,System.Reflection.MethodInfo,System.Boolean)"]
See Also
ReflectionHelper Class
ReflectionHelper Members
GetProperty Overload
PostSharp.Reflection Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


ReflectionSearch Class

ReflectionSearch Class PostSharp Documentation
Set of static methods providing broader access to assembly metadata than the System.Reflection namespace. These methods are only available at build time.
Inheritance Hierarchy
Online System Object
PostSharp.Reflection ReflectionSearch

Namespace: PostSharp.Reflection
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
public static class ReflectionSearch
public static class ReflectionSearch
Remarks
  Note  Note

        This feature is available only at build time.

  Note  Note

      PostSharp Professional Edition is required for this feature.

See Also
ReflectionSearch Members
PostSharp.Reflection Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


ReflectionSearch Members

ReflectionSearch Members PostSharp Documentation

Methods
Name | Description
GetCustomAttributesOfType(Type) | Gets all custom attributes of a given type in the assembly being currently processed.
GetCustomAttributesOfType(Type, ReflectionSearchOptions) | Gets all custom attributes of a given type in the assembly being currently processed and specifies additional options.
GetCustomAttributesOnTarget(Object) | Gets all custom attributes on a given element of code, including those who have beed added indirectly, for instance through MulticastAttribute.
GetCustomAttributesOnTarget(Object, ReflectionSearchOptions) | Gets all custom attributes on a given element of code, including those who have beed added indirectly, for instance through MulticastAttribute and specifies additional options.
GetDeclarationsUsedByMethod(MethodBase) | Gets all declarations ( Online Type, Online FieldInfo, Online MethodInfo or Online ConstructorInfo) used by the body of a given method or constructor.
GetDeclarationsUsedByMethod(MethodBase, ReflectionSearchOptions) | Gets all declarations ( Online Type, Online FieldInfo, Online MethodInfo or Online ConstructorInfo) used by the body of a given method or constructor and specifies additional options.
GetDerivedTypes(Type) | Gets the set of types derived from a given class or implementing a given interface.
GetDerivedTypes(Type, ReflectionSearchOptions) | Gets the set of types derived from a given class or implementing a given interface. and specifies aditional options.
GetMembersOfType(Type) | Gets all members ( Online FieldInfo, Online PropertyInfo, or Online ParameterInfo) of the assembly being processed of a given type.
GetMembersOfType(Type, ReflectionSearchOptions) | Gets all members ( Online FieldInfo, Online PropertyInfo, or Online ParameterInfo) of the assembly being processed of a given type and specifies additional options.
GetMethodsUsingDeclaration(MemberInfo) | Gets the set of methods and constructors whose body references a given ( Online Type, Online FieldInfo, Online MethodInfo or Online ConstructorInfo).
GetMethodsUsingDeclaration(MemberInfo, ReflectionSearchOptions) | Gets the set of methods and constructors whose body references a given ( Online Type, Online FieldInfo, Online MethodInfo or Online ConstructorInfo) and specifies whether reflection wrappers should be used instead of runtime reflection objects.
Back to Top
See Also
ReflectionSearch Class
PostSharp.Reflection Namespace

Online Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


ReflectionSearch Methods

ReflectionSearch Methods PostSharp Documentation
Methods
Name | Description
GetCustomAttributesOfType(Type) | Gets all custom attributes of a given type in the assembly being currently processed.
GetCustomAttributesOfType(Type, ReflectionSearchOptions) | Gets all custom attributes of a given type in the assembly being currently processed and specifies additional options.
GetCustomAttributesOnTarget(Object) | Gets all custom attributes on a given element of code, including those who have beed added indirectly, for instance through MulticastAttribute.
GetCustomAttributesOnTarget(Object, ReflectionSearchOptions) | Gets all custom attributes on a given element of code, including those who have beed added indirectly, for instance through MulticastAttribute and specifies additional options.
GetDeclarationsUsedByMethod(MethodBase) | Gets all declarations ( Online Type, Online FieldInfo, Online MethodInfo or Online ConstructorInfo) used by the body of a given method or constructor.
GetDeclarationsUsedByMethod(MethodBase, ReflectionSearchOptions) | Gets all declarations ( Online Type, Online FieldInfo, Online MethodInfo or Online ConstructorInfo) used by the body of a given method or constructor and specifies additional options.
GetDerivedTypes(Type) | Gets the set of types derived from a given class or implementing a given interface.
GetDerivedTypes(Type, ReflectionSearchOptions) | Gets the set of types derived from a given class or implementing a given interface. and specifies aditional options.
GetMembersOfType(Type) | Gets all members ( Online FieldInfo, Online PropertyInfo, or Online ParameterInfo) of the assembly being processed of a given type.
GetMembersOfType(Type, ReflectionSearchOptions) | Gets all members ( Online FieldInfo, Online PropertyInfo, or Online ParameterInfo) of the assembly being processed of a given type and specifies additional options.
GetMethodsUsingDeclaration(MemberInfo) | Gets the set of methods and constructors whose body references a given ( Online Type, Online FieldInfo, Online MethodInfo or Online ConstructorInfo).
GetMethodsUsingDeclaration(MemberInfo, ReflectionSearchOptions) | Gets the set of methods and constructors whose body references a given ( Online Type, Online FieldInfo, Online MethodInfo or Online ConstructorInfo) and specifies whether reflection wrappers should be used instead of runtime reflection objects.
Back to Top
See Also
ReflectionSearch Class
PostSharp.Reflection Namespace

Online Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


ReflectionSearch.GetCustomAttributesOfType Method

ReflectionSearch GetCustomAttributesOfType Method PostSharp Documentation
Overload List
Name | Description
GetCustomAttributesOfType(Type) | Gets all custom attributes of a given type in the assembly being currently processed.
GetCustomAttributesOfType(Type, ReflectionSearchOptions) | Gets all custom attributes of a given type in the assembly being currently processed and specifies additional options.
Back to Top
See Also
ReflectionSearch Class
ReflectionSearch Members
PostSharp.Reflection Namespace

Online Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


ReflectionSearch.GetCustomAttributesOfType Method (Type)

ReflectionSearch GetCustomAttributesOfType Method (Type) PostSharp Documentation
Gets all custom attributes of a given type in the assembly being currently processed.

Namespace: PostSharp.Reflection
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
public static CustomAttributeInstance[] GetCustomAttributesOfType(
    Type customAttributeType
)
public static CustomAttributeInstance[] GetCustomAttributesOfType(
    Type customAttributeType
)
Parameters
customAttributeType
Type:   Online System Type
  Online Type of the custom attribute.
Return Value
Type:  CustomAttributeInstance
The set of all custom attributes of type customAttributeType
              defined in  the assembly being currently processed.
Remarks
  Note  Note

        This method returns custom attributes from the internal annotation repository of PostSharp. This repository contains more
        than only custom attributes added in source code. For instance, if you use
        MulticastAttribute
        to add a custom attribute to several elements of code in a single line of code, this method will return
        one custom attribute instance for every target of the
        MulticastAttribute
        .

  Note  Note

        This feature is available only at build time.

  Note  Note

      PostSharp Professional Edition is required for this feature.

See Also
ReflectionSearch Class
ReflectionSearch Members
GetCustomAttributesOfType Overload
PostSharp.Reflection Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


ReflectionSearch.GetCustomAttributesOfType Method (Type, ReflectionSearchOptions)

ReflectionSearch GetCustomAttributesOfType Method (Type, ReflectionSearchOptions) PostSharp Documentation
Gets all custom attributes of a given type in the assembly being currently processed and specifies additional options.

Namespace: PostSharp.Reflection
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
public static CustomAttributeInstance[] GetCustomAttributesOfType(
    Type customAttributeType,
    ReflectionSearchOptions options
)
public static CustomAttributeInstance[] GetCustomAttributesOfType(
    Type customAttributeType,
    ReflectionSearchOptions options
)
Parameters
customAttributeType
Type:   Online System Type
  Online Type of the custom attribute.
options
Type: PostSharp.Reflection ReflectionSearchOptions
Any combination of options IncludeDerivedTypes  and
            UseReflectionWrappers.
Return Value
Type:  CustomAttributeInstance
The set of all custom attributes of type customAttributeType (or any type derived
              from customAttributeType, if the option IncludeDerivedTypes
              is true) defined in  the assembly being currently processed.
Remarks
  Note  Note

        This method returns custom attributes from the internal annotation repository of PostSharp. This repository contains more
        than only custom attributes added in source code. For instance, if you use
        MulticastAttribute
        to add a custom attribute to several elements of code in a single line of code, this method will return
        one custom attribute instance for every target of the
        MulticastAttribute
        .

  Note  Note

        This feature is available only at build time.

  Note  Note

      PostSharp Professional Edition is required for this feature.

See Also
ReflectionSearch Class
ReflectionSearch Members
GetCustomAttributesOfType Overload
PostSharp.Reflection Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


ReflectionSearch.GetCustomAttributesOnTarget Method

ReflectionSearch GetCustomAttributesOnTarget Method PostSharp Documentation
Overload List
Name | Description
GetCustomAttributesOnTarget(Object) | Gets all custom attributes on a given element of code, including those who have beed added indirectly, for instance through MulticastAttribute.
GetCustomAttributesOnTarget(Object, ReflectionSearchOptions) | Gets all custom attributes on a given element of code, including those who have beed added indirectly, for instance through MulticastAttribute and specifies additional options.
Back to Top
See Also
ReflectionSearch Class
ReflectionSearch Members
PostSharp.Reflection Namespace

Online Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


ReflectionSearch.GetCustomAttributesOnTarget Method (Object)

ReflectionSearch GetCustomAttributesOnTarget Method (Object) PostSharp Documentation
Gets all custom attributes on a given element of code, including those who have beed added indirectly, for instance through MulticastAttribute.

Namespace: PostSharp.Reflection
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
public static CustomAttributeInstance[] GetCustomAttributesOnTarget(
    Object target
)
public static CustomAttributeInstance[] GetCustomAttributesOnTarget(
    Object target
)
Parameters
target
Type:   Online System Object
Element of code (  Online Type,   Online MethodInfo, ...) whose
              custom attributes are requested.
Return Value
Type:  CustomAttributeInstance
The set of all custom attributes added, directly or indirectly, to target.
Remarks
  Note  Note

        This method returns custom attributes from the internal annotation repository of PostSharp. This repository contains more
        than only custom attributes added in source code. For instance, if you use
        MulticastAttribute
        to add a custom attribute to several elements of code in a single line of code, this method will return
        one custom attribute instance for every target of the
        MulticastAttribute
        .

  Note  Note

        This feature is available only at build time.

  Note  Note

      PostSharp Professional Edition is required for this feature.

See Also
ReflectionSearch Class
ReflectionSearch Members
GetCustomAttributesOnTarget Overload
PostSharp.Reflection Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


ReflectionSearch.GetCustomAttributesOnTarget Method (Object, ReflectionSearchOptions)

ReflectionSearch GetCustomAttributesOnTarget Method (Object, ReflectionSearchOptions) PostSharp Documentation
Gets all custom attributes on a given element of code, including those who have beed added indirectly, for instance through MulticastAttribute and specifies additional options.

Namespace: PostSharp.Reflection
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
public static CustomAttributeInstance[] GetCustomAttributesOnTarget(
    Object target,
    ReflectionSearchOptions options
)
public static CustomAttributeInstance[] GetCustomAttributesOnTarget(
    Object target,
    ReflectionSearchOptions options
)
Parameters
target
Type:   Online System Object
Element of code (  Online Type,   Online MethodInfo, ...) whose
              custom attributes are requested.
options
Type: PostSharp.Reflection ReflectionSearchOptions
UseReflectionWrappers or None.
Return Value
Type:  CustomAttributeInstance
The set of all custom attributes added, directly or indirectly, to target.
Remarks
  Note  Note

        This method returns custom attributes from the internal annotation repository of PostSharp. This repository contains more
        than only custom attributes added in source code. For instance, if you use
        MulticastAttribute
        to add a custom attribute to several elements of code in a single line of code, this method will return
        one custom attribute instance for every target of the
        MulticastAttribute
        .

  Note  Note

        This feature is available only at build time.

  Note  Note

      PostSharp Professional Edition is required for this feature.

See Also
ReflectionSearch Class
ReflectionSearch Members
GetCustomAttributesOnTarget Overload
PostSharp.Reflection Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


ReflectionSearch.GetDeclarationsUsedByMethod Method

ReflectionSearch GetDeclarationsUsedByMethod Method PostSharp Documentation
Overload List
Name | Description
GetDeclarationsUsedByMethod(MethodBase) | Gets all declarations ( Online Type, Online FieldInfo, Online MethodInfo or Online ConstructorInfo) used by the body of a given method or constructor.
GetDeclarationsUsedByMethod(MethodBase, ReflectionSearchOptions) | Gets all declarations ( Online Type, Online FieldInfo, Online MethodInfo or Online ConstructorInfo) used by the body of a given method or constructor and specifies additional options.
Back to Top
See Also
ReflectionSearch Class
ReflectionSearch Members
PostSharp.Reflection Namespace

Online Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


ReflectionSearch.GetDeclarationsUsedByMethod Method (MethodBase)

ReflectionSearch GetDeclarationsUsedByMethod Method (MethodBase) PostSharp Documentation
Gets all declarations ( Online Type, Online FieldInfo, Online MethodInfo or Online ConstructorInfo) used by the body of a given method or constructor.

Namespace: PostSharp.Reflection
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
public static MethodUsageCodeReference[] GetDeclarationsUsedByMethod(
    MethodBase method
)
public static MethodUsageCodeReference[] GetDeclarationsUsedByMethod(
    MethodBase method
)
Parameters
method
Type:   Online System.Reflection MethodBase
A   Online MethodInfo or   Online ConstructorInfo.
Return Value
Type:  MethodUsageCodeReference
An array of MethodUsageCodeReference containing one
              item for each declaration used by the body of method.
Remarks
  Note  Note

        This feature is available only at build time.

  Note  Note

      PostSharp Professional Edition is required for this feature.

See Also
ReflectionSearch Class
ReflectionSearch Members
GetDeclarationsUsedByMethod Overload
PostSharp.Reflection Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


ReflectionSearch.GetDeclarationsUsedByMethod Method (MethodBase, ReflectionSearchOptions)

ReflectionSearch GetDeclarationsUsedByMethod Method (MethodBase, ReflectionSearchOptions) PostSharp Documentation
Gets all declarations ( Online Type, Online FieldInfo, Online MethodInfo or Online ConstructorInfo) used by the body of a given method or constructor and specifies additional options.

Namespace: PostSharp.Reflection
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
public static MethodUsageCodeReference[] GetDeclarationsUsedByMethod(
    MethodBase method,
    ReflectionSearchOptions options
)
public static MethodUsageCodeReference[] GetDeclarationsUsedByMethod(
    MethodBase method,
    ReflectionSearchOptions options
)
Parameters
method
Type:   Online System.Reflection MethodBase
A   Online MethodInfo or   Online ConstructorInfo.
options
Type: PostSharp.Reflection ReflectionSearchOptions
UseReflectionWrappers or None.
Return Value
Type:  MethodUsageCodeReference
An array of MethodUsageCodeReference containing one
              item for each declaration used by the body of method.

Remarks
  Note  Note

  Note  Note

        This feature is available only at build time.

  Note  Note

      PostSharp Professional Edition is required for this feature.

See Also
ReflectionSearch Class
ReflectionSearch Members
GetDeclarationsUsedByMethod Overload
PostSharp.Reflection Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


ReflectionSearch.GetDerivedTypes Method

ReflectionSearch GetDerivedTypes Method PostSharp Documentation
Overload List
Name | Description
GetDerivedTypes(Type) | Gets the set of types derived from a given class or implementing a given interface.
GetDerivedTypes(Type, ReflectionSearchOptions) | Gets the set of types derived from a given class or implementing a given interface. and specifies aditional options.
Back to Top
See Also
ReflectionSearch Class
ReflectionSearch Members
PostSharp.Reflection Namespace

Online Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


ReflectionSearch.GetDerivedTypes Method (Type)

ReflectionSearch GetDerivedTypes Method (Type) PostSharp Documentation
Gets the set of types derived from a given class or implementing a given interface.

Namespace: PostSharp.Reflection
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
public static TypeInheritanceCodeReference[] GetDerivedTypes(
    Type baseType
)
public static TypeInheritanceCodeReference[] GetDerivedTypes(
    Type baseType
)
Parameters
baseType
Type:   Online System Type
A class or interface.
Return Value
Type:  TypeInheritanceCodeReference
The set of types derived from or implementing baseType.
Remarks
This method returns only types defined in the assembly being currently processed.
  Note  Note

        This feature is available only at build time.

  Note  Note

      PostSharp Professional Edition is required for this feature.

See Also
ReflectionSearch Class
ReflectionSearch Members
GetDerivedTypes Overload
PostSharp.Reflection Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


ReflectionSearch.GetDerivedTypes Method (Type, ReflectionSearchOptions)

ReflectionSearch GetDerivedTypes Method (Type, ReflectionSearchOptions) PostSharp Documentation
Gets the set of types derived from a given class or implementing a given interface. and specifies aditional options.

Namespace: PostSharp.Reflection
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
public static TypeInheritanceCodeReference[] GetDerivedTypes(
    Type baseType,
    ReflectionSearchOptions options
)
public static TypeInheritanceCodeReference[] GetDerivedTypes(
    Type baseType,
    ReflectionSearchOptions options
)
Parameters
baseType
Type:   Online System Type
A class or interface.
options
Type: PostSharp.Reflection ReflectionSearchOptions
Any valid combination of the options UseReflectionWrappers,
            IncludeTypeElement (partial type match), and
            IncludeDerivedTypes (deep search).
            IncludeTypeElement and IncludeDerivedTypes
            cannot be used together.
Return Value
Type:  TypeInheritanceCodeReference
The set of types derived from or implementing baseType.
Remarks
This method returns only types defined in the assembly being currently processed.
  Note  Note

  Note  Note

        This feature is available only at build time.

  Note  Note

      PostSharp Professional Edition is required for this feature.

See Also
ReflectionSearch Class
ReflectionSearch Members
GetDerivedTypes Overload
PostSharp.Reflection Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


ReflectionSearch.GetMembersOfType Method

ReflectionSearch GetMembersOfType Method PostSharp Documentation
Overload List
Name | Description
GetMembersOfType(Type) | Gets all members ( Online FieldInfo, Online PropertyInfo, or Online ParameterInfo) of the assembly being processed of a given type.
GetMembersOfType(Type, ReflectionSearchOptions) | Gets all members ( Online FieldInfo, Online PropertyInfo, or Online ParameterInfo) of the assembly being processed of a given type and specifies additional options.
Back to Top
See Also
ReflectionSearch Class
ReflectionSearch Members
PostSharp.Reflection Namespace

Online Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


ReflectionSearch.GetMembersOfType Method (Type)

ReflectionSearch GetMembersOfType Method (Type) PostSharp Documentation
Gets all members ( Online FieldInfo, Online PropertyInfo, or Online ParameterInfo) of the assembly being processed of a given type.

Namespace: PostSharp.Reflection
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
public static MemberTypeCodeReference[] GetMembersOfType(
    Type memberType
)
public static MemberTypeCodeReference[] GetMembersOfType(
    Type memberType
)
Parameters
memberType
Type:   Online System Type
Member type.
Return Value
Type:  MemberTypeCodeReference
The set of all members of type memberType in the assembly being processed
See Also
ReflectionSearch Class
ReflectionSearch Members
GetMembersOfType Overload
PostSharp.Reflection Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


ReflectionSearch.GetMembersOfType Method (Type, ReflectionSearchOptions)

ReflectionSearch GetMembersOfType Method (Type, ReflectionSearchOptions) PostSharp Documentation
Gets all members ( Online FieldInfo, Online PropertyInfo, or Online ParameterInfo) of the assembly being processed of a given type and specifies additional options.

Namespace: PostSharp.Reflection
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
public static MemberTypeCodeReference[] GetMembersOfType(
    Type memberType,
    ReflectionSearchOptions options
)
public static MemberTypeCodeReference[] GetMembersOfType(
    Type memberType,
    ReflectionSearchOptions options
)
Parameters
memberType
Type:   Online System Type
Member type.
options
Type: PostSharp.Reflection ReflectionSearchOptions
Any combination of the options UseReflectionWrappers and
            IncludeTypeElement (partial type match).

Return Value
Type:  MemberTypeCodeReference
The set of all members of type memberType in the assembly being processed
Remarks
  Note  Note

  Note  Note

        This feature is available only at build time.

  Note  Note

      PostSharp Professional Edition is required for this feature.

See Also
ReflectionSearch Class
ReflectionSearch Members
GetMembersOfType Overload
PostSharp.Reflection Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


ReflectionSearch.GetMethodsUsingDeclaration Method

ReflectionSearch GetMethodsUsingDeclaration Method PostSharp Documentation
Overload List
Name | Description
GetMethodsUsingDeclaration(MemberInfo) | Gets the set of methods and constructors whose body references a given ( Online Type, Online FieldInfo, Online MethodInfo or Online ConstructorInfo).
GetMethodsUsingDeclaration(MemberInfo, ReflectionSearchOptions) | Gets the set of methods and constructors whose body references a given ( Online Type, Online FieldInfo, Online MethodInfo or Online ConstructorInfo) and specifies whether reflection wrappers should be used instead of runtime reflection objects.
Back to Top
See Also
ReflectionSearch Class
ReflectionSearch Members
PostSharp.Reflection Namespace

Online Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


ReflectionSearch.GetMethodsUsingDeclaration Method (MemberInfo)

ReflectionSearch GetMethodsUsingDeclaration Method (MemberInfo) PostSharp Documentation
Gets the set of methods and constructors whose body references a given ( Online Type, Online FieldInfo, Online MethodInfo or Online ConstructorInfo).

Namespace: PostSharp.Reflection
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
public static MethodUsageCodeReference[] GetMethodsUsingDeclaration(
    MemberInfo declaration
)
public static MethodUsageCodeReference[] GetMethodsUsingDeclaration(
    MemberInfo declaration
)
Parameters
declaration
Type:   Online System.Reflection MemberInfo
The   Online Type,
                Online FieldInfo,   Online MethodInfo or   Online ConstructorInfo
              whose references are requested.
Return Value
Type:  MethodUsageCodeReference
An array of MethodUsageCodeReference containing one
              item for each method or constructor whose body references declaration.

Remarks
  Note  Note

        This feature is available only at build time.

  Note  Note

      PostSharp Professional Edition is required for this feature.

See Also
ReflectionSearch Class
ReflectionSearch Members
GetMethodsUsingDeclaration Overload
PostSharp.Reflection Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


ReflectionSearch.GetMethodsUsingDeclaration Method (MemberInfo, ReflectionSearchOptions)

ReflectionSearch GetMethodsUsingDeclaration Method (MemberInfo, ReflectionSearchOptions) PostSharp Documentation
Gets the set of methods and constructors whose body references a given ( Online Type, Online FieldInfo, Online MethodInfo or Online ConstructorInfo) and specifies whether reflection wrappers should be used instead of runtime reflection objects.

Namespace: PostSharp.Reflection
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
public static MethodUsageCodeReference[] GetMethodsUsingDeclaration(
    MemberInfo declaration,
    ReflectionSearchOptions options
)
public static MethodUsageCodeReference[] GetMethodsUsingDeclaration(
    MemberInfo declaration,
    ReflectionSearchOptions options
)
Parameters
declaration
Type:   Online System.Reflection MemberInfo
The   Online Type,
                Online FieldInfo,   Online MethodInfo or   Online ConstructorInfo
              whose references are requested.
options
Type: PostSharp.Reflection ReflectionSearchOptions
Any combination of the options UseReflectionWrappers
            and IncludeTypeElement (partial type match).
Return Value
Type:  MethodUsageCodeReference
An array of MethodUsageCodeReference containing one
              item for each method or constructor whose body references declaration.

Remarks
  Note  Note

  Note  Note

        This feature is available only at build time.

  Note  Note

      PostSharp Professional Edition is required for this feature.

See Also
ReflectionSearch Class
ReflectionSearch Members
GetMethodsUsingDeclaration Overload
PostSharp.Reflection Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


ReflectionSearchOptions Enumeration

ReflectionSearchOptions Enumeration PostSharp Documentation

[Missing <summary> documentation for "T:PostSharp.Reflection.ReflectionSearchOptions"]

Namespace: PostSharp.Reflection
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
[FlagsAttribute]
public enum ReflectionSearchOptions
[FlagsAttribute]
public enum ReflectionSearchOptions
Members
Member name | Value | Description
None | 0 | No option.
IncludeDerivedTypes | 1 | Include relationships referencing a derived type (instead of exactly that type).
IncludeTypeElement | 2 | Include relationships referencing a type signature including the given type (instead of only the given type).
UseReflectionWrappers | 4 | Use reflection wrappers instead of runtime reflection objects. Reflection wrappers implement standard reflection classes ( Online Type, Online MethodInfo, ...), but do not require the CLR to load the type. Reflection wrappers should be used only when the CLR is not able to load the type, for instance because the type is not valid for runtime execution. This happens for instance when the type has an extern method implemented after compilation by PostSharp.
Remarks
See Also
PostSharp.Reflection Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


ReflectionTypeComparer Class

ReflectionTypeComparer Class PostSharp Documentation
Comparer of reflection types ( Online Type) based on content, not reference. Supports the unbound generic parameters derived from the GenericArg class.
Inheritance Hierarchy
Online System Object
PostSharp.Reflection ReflectionTypeComparer

Namespace: PostSharp.Reflection
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
public sealed class ReflectionTypeComparer : IEqualityComparer<Type>,
    IEqualityComparer<Type[]>
public sealed class ReflectionTypeComparer : IEqualityComparer<Type>,
    IEqualityComparer<Type[]>
Remarks

              Used by the CustomReflectionBinder class.

See Also
ReflectionTypeComparer Members
PostSharp.Reflection Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


ReflectionTypeComparer Members

ReflectionTypeComparer Members PostSharp Documentation

Methods
 | Name | Description
Public method | Equals(Type, Type) | Determines whether the specified objects are equal.
Public method | Equals( Type , Type ) | Determines whether the specified objects are equal.
Public method | GetHashCode(Type) | Returns a hash code for the specified object.
Public method | GetHashCode( Type ) | Returns a hash code for the specified object.
 | GetInstance | Gets an instance of ReflectionTypeComparer that does not perform substitution of generic parameters.
 | GetInstance( Type , Type , Type , Type ) | Gets an instance of ReflectionTypeComparer that performs substitution of generic parameters.
Back to Top
See Also
ReflectionTypeComparer Class
PostSharp.Reflection Namespace

Online Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


ReflectionTypeComparer Methods

ReflectionTypeComparer Methods PostSharp Documentation
Methods
 | Name | Description
Public method | Equals(Type, Type) | Determines whether the specified objects are equal.
Public method | Equals( Type , Type ) | Determines whether the specified objects are equal.
Public method | GetHashCode(Type) | Returns a hash code for the specified object.
Public method | GetHashCode( Type ) | Returns a hash code for the specified object.
 | GetInstance | Gets an instance of ReflectionTypeComparer that does not perform substitution of generic parameters.
 | GetInstance( Type , Type , Type , Type ) | Gets an instance of ReflectionTypeComparer that performs substitution of generic parameters.
Back to Top
See Also
ReflectionTypeComparer Class
PostSharp.Reflection Namespace

Online Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


ReflectionTypeComparer.Equals Method

ReflectionTypeComparer Equals Method PostSharp Documentation
Overload List
 | Name | Description
Public method | Equals(Type, Type) | Determines whether the specified objects are equal.
Public method | Equals( Type , Type ) | Determines whether the specified objects are equal.
Back to Top
See Also
ReflectionTypeComparer Class
ReflectionTypeComparer Members
PostSharp.Reflection Namespace

Online Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


ReflectionTypeComparer.Equals Method (Type, Type)

ReflectionTypeComparer Equals Method (Type, Type) PostSharp Documentation
Determines whether the specified objects are equal.

Namespace: PostSharp.Reflection
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
public bool Equals(
    Type x,
    Type y
)
public bool Equals(
    Type x,
    Type y
)
Parameters
x
Type:   Online System Type
The first object of type T to compare.
y
Type:   Online System Type
The second object of type T to compare.
Return Value
Type:   Online Boolean
true if the specified objects are equal; otherwise, false.
Implements
  Online IEqualityComparer T  Equals(T, T)
See Also
ReflectionTypeComparer Class
ReflectionTypeComparer Members
Equals Overload
PostSharp.Reflection Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


ReflectionTypeComparer.Equals Method (Type[], Type[])

ReflectionTypeComparer Equals Method ( Type , Type ) PostSharp Documentation
Determines whether the specified objects are equal.

Namespace: PostSharp.Reflection
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
public bool Equals(
    Type[] x,
    Type[] y
)
public bool Equals(
    Type[] x,
    Type[] y
)
Parameters
x
Type:    Online System Type
The first object of type T to compare.
y
Type:    Online System Type
The second object of type T to compare.
Return Value
Type:   Online Boolean
true if the specified objects are equal; otherwise, false.
Implements
  Online IEqualityComparer T  Equals(T, T)
See Also
ReflectionTypeComparer Class
ReflectionTypeComparer Members
Equals Overload
PostSharp.Reflection Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


ReflectionTypeComparer.GetHashCode Method

ReflectionTypeComparer GetHashCode Method PostSharp Documentation
Overload List
 | Name | Description
Public method | GetHashCode(Type) | Returns a hash code for the specified object.
Public method | GetHashCode( Type ) | Returns a hash code for the specified object.
Back to Top
See Also
ReflectionTypeComparer Class
ReflectionTypeComparer Members
PostSharp.Reflection Namespace

Online Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


ReflectionTypeComparer.GetHashCode Method (Type)

ReflectionTypeComparer GetHashCode Method (Type) PostSharp Documentation
Returns a hash code for the specified object.

Namespace: PostSharp.Reflection
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
public int GetHashCode(
    Type obj
)
public int GetHashCode(
    Type obj
)
Parameters
obj
Type:   Online System Type
The   Online Object for which a hash code is to be returned.
Return Value
Type:   Online Int32
A hash code for the specified object.
Implements
  Online IEqualityComparer T  GetHashCode(T)
Exceptions
Exception | Condition
Online System ArgumentNullException | The type of obj is a reference type and obj is null.
See Also
ReflectionTypeComparer Class
ReflectionTypeComparer Members
GetHashCode Overload
PostSharp.Reflection Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


ReflectionTypeComparer.GetHashCode Method (Type[])

ReflectionTypeComparer GetHashCode Method ( Type ) PostSharp Documentation
Returns a hash code for the specified object.

Namespace: PostSharp.Reflection
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
public int GetHashCode(
    Type[] types
)
public int GetHashCode(
    Type[] types
)
Parameters
types
Type:    Online System Type
[Missing <param name="types"/> documentation for "M:PostSharp.Reflection.ReflectionTypeComparer.GetHashCode(System.Type[])"]
Return Value
Type:   Online Int32
A hash code for the specified object.
Implements
  Online IEqualityComparer T  GetHashCode(T)
Exceptions
Exception | Condition
Online System ArgumentNullException | The type of obj is a reference type and obj is null.
See Also
ReflectionTypeComparer Class
ReflectionTypeComparer Members
GetHashCode Overload
PostSharp.Reflection Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


ReflectionTypeComparer.GetInstance Method

ReflectionTypeComparer GetInstance Method PostSharp Documentation
Overload List
Name | Description
GetInstance | Gets an instance of ReflectionTypeComparer that does not perform substitution of generic parameters.
GetInstance( Type , Type , Type , Type ) | Gets an instance of ReflectionTypeComparer that performs substitution of generic parameters.
Back to Top
See Also
ReflectionTypeComparer Class
ReflectionTypeComparer Members
PostSharp.Reflection Namespace

Online Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


ReflectionTypeComparer.GetInstance Method

ReflectionTypeComparer GetInstance Method PostSharp Documentation
Gets an instance of ReflectionTypeComparer that does not perform substitution of generic parameters.

Namespace: PostSharp.Reflection
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
public static ReflectionTypeComparer GetInstance()
public static ReflectionTypeComparer GetInstance()
Return Value
Type: ReflectionTypeComparer
An instance of ReflectionTypeComparer.
See Also
ReflectionTypeComparer Class
ReflectionTypeComparer Members
GetInstance Overload
PostSharp.Reflection Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


ReflectionTypeComparer.GetInstance Method (Type[], Type[], Type[], Type[])

ReflectionTypeComparer GetInstance Method ( Type , Type , Type , Type ) PostSharp Documentation
Gets an instance of ReflectionTypeComparer that performs substitution of generic parameters.

Namespace: PostSharp.Reflection
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
public static ReflectionTypeComparer GetInstance(
    Type[] leftGenericTypeParameters,
    Type[] leftGenericMethodParameters,
    Type[] rightGenericTypeParameters,
    Type[] rightGenericMethodParameters
)
public static ReflectionTypeComparer GetInstance(
    Type[] leftGenericTypeParameters,
    Type[] leftGenericMethodParameters,
    Type[] rightGenericTypeParameters,
    Type[] rightGenericMethodParameters
)
Parameters
leftGenericTypeParameters
Type:    Online System Type
Array of types to be substituted to the
              generic type parameters of the left member.
leftGenericMethodParameters
Type:    Online System Type
Array of types to be substituted to the
              generic method parameters of the left member.
rightGenericTypeParameters
Type:    Online System Type
Array of types to be substituted to the
              generic type parameters of the right member.
rightGenericMethodParameters
Type:    Online System Type
Array of types to be substituted to the
              generic method parameters of the right member.
Return Value
Type: ReflectionTypeComparer
An instance of ReflectionTypeComparer.
See Also
ReflectionTypeComparer Class
ReflectionTypeComparer Members
GetInstance Overload
PostSharp.Reflection Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


SymbolSequencePoint Class

SymbolSequencePoint Class PostSharp Documentation
Maps a point in IL instructions to location in source code.
Inheritance Hierarchy
Online System Object
PostSharp.Reflection SymbolSequencePoint

Namespace: PostSharp.Reflection
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
public sealed class SymbolSequencePoint : IComparable<SymbolSequencePoint>,
    IEquatable<SymbolSequencePoint>
public sealed class SymbolSequencePoint : IComparable<SymbolSequencePoint>,
    IEquatable<SymbolSequencePoint>
Remarks

              This class implements the   Online IComparable T  interface.
              This allows sorting sequence points according to their IL offsets and performing
              binary searches in sorted arrays.

See Also
SymbolSequencePoint Members
PostSharp.Reflection Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


SymbolSequencePoint Members

SymbolSequencePoint Members PostSharp Documentation

The SymbolSequencePoint type exposes the following members.
Constructors
 | Name | Description
Public method | SymbolSequencePoint | Initializes a new SymbolSequencePoint.
Back to Top
Methods
 | Name | Description
Public method | Equals(Object) | Determines whether the specified Online Object is equal to the current Online Object. (Overrides Online Object Equals(Object).)
Public method | Equals(SymbolSequencePoint) | Indicates whether the current object is equal to another object of the same type.
Public method | GetHashCode | Serves as a hash function for a particular type. (Overrides Online Object GetHashCode .)
Public method | ToString | Returns a string that represents the current object. (Overrides Online Object ToString .)
Back to Top
Operators
Name | Description
Equality | Determines whether two sequence points are equal.
Inequality | Determines whether two sequence points are different.
Back to Top
Fields
Name | Description
Hidden | Gets a symbol meaning that the associated instructions have no source code.
Back to Top
Properties
 | Name | Description
Public property | Document | Obsolete.
Public property | EndColumn | Gets the end column in the source file.
Public property | EndLine | Gets the end line in the source file.
Public property | IsHidden | Determines whether the current symbol means that the associated instructions have no source code..
Public property | SourceDocument | Document (file of source code) containing the current sequence point.
Public property | StartColumn | Gets the start column in the source file.
Public property | StartLine | Gets the start line in the source file.
Back to Top
See Also
SymbolSequencePoint Class
PostSharp.Reflection Namespace

Online Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


SymbolSequencePoint Constructor

SymbolSequencePoint Constructor PostSharp Documentation
Initializes a new SymbolSequencePoint.

Namespace: PostSharp.Reflection
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
public SymbolSequencePoint(
    int startLine,
    int startColumn,
    int endLine,
    int endColumn,
    ISourceDocument document
)
public SymbolSequencePoint(
    int startLine,
    int startColumn,
    int endLine,
    int endColumn,
    ISourceDocument document
)
Parameters
startLine
Type:   Online System Int32
The start line in the source file.
startColumn
Type:   Online System Int32
The start column in the source file.
endLine
Type:   Online System Int32
The end line in the source file.
endColumn
Type:   Online System Int32
The end column in the source file.
document
Type: PostSharp.Reflection ISourceDocument
Source file
See Also
SymbolSequencePoint Class
SymbolSequencePoint Members
PostSharp.Reflection Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


SymbolSequencePoint Fields

SymbolSequencePoint Fields PostSharp Documentation
The SymbolSequencePoint type exposes the following members.
Fields
Name | Description
Hidden | Gets a symbol meaning that the associated instructions have no source code.
Back to Top
See Also
SymbolSequencePoint Class
PostSharp.Reflection Namespace

Online Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


SymbolSequencePoint.Hidden Field

SymbolSequencePoint Hidden Field PostSharp Documentation
Gets a symbol meaning that the associated instructions have no source code.

Namespace: PostSharp.Reflection
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
public static readonly SymbolSequencePoint Hidden
public static readonly SymbolSequencePoint Hidden
Field Value
Type: SymbolSequencePoint
See Also
SymbolSequencePoint Class
SymbolSequencePoint Members
PostSharp.Reflection Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


SymbolSequencePoint Methods

SymbolSequencePoint Methods PostSharp Documentation
The SymbolSequencePoint type exposes the following members.
Methods
 | Name | Description
Public method | Equals(Object) | Determines whether the specified Online Object is equal to the current Online Object. (Overrides Online Object Equals(Object).)
Public method | Equals(SymbolSequencePoint) | Indicates whether the current object is equal to another object of the same type.
Public method | GetHashCode | Serves as a hash function for a particular type. (Overrides Online Object GetHashCode .)
Public method | ToString | Returns a string that represents the current object. (Overrides Online Object ToString .)
Back to Top
See Also
SymbolSequencePoint Class
PostSharp.Reflection Namespace

Online Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


SymbolSequencePoint.Equals Method

SymbolSequencePoint Equals Method PostSharp Documentation
Overload List
 | Name | Description
Public method | Equals(Object) | Determines whether the specified Online Object is equal to the current Online Object. (Overrides Online Object Equals(Object).)
Public method | Equals(SymbolSequencePoint) | Indicates whether the current object is equal to another object of the same type.
Back to Top
See Also
SymbolSequencePoint Class
SymbolSequencePoint Members
PostSharp.Reflection Namespace

Online Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


SymbolSequencePoint.Equals Method (Object)

SymbolSequencePoint Equals Method (Object) PostSharp Documentation
Determines whether the specified Online Object is equal to the current Online Object.

Namespace: PostSharp.Reflection
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
public override bool Equals(
    Object obj
)
public override bool Equals(
    Object obj
)
Parameters
obj
Type:   Online System Object
The object to compare with the current object.
Return Value
Type:   Online Boolean
true if the specified   Online Object is equal to the current   Online Object; otherwise, false.
See Also
SymbolSequencePoint Class
SymbolSequencePoint Members
Equals Overload
PostSharp.Reflection Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


SymbolSequencePoint.Equals Method (SymbolSequencePoint)

SymbolSequencePoint Equals Method (SymbolSequencePoint) PostSharp Documentation
Indicates whether the current object is equal to another object of the same type.

Namespace: PostSharp.Reflection
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
public bool Equals(
    SymbolSequencePoint other
)
public bool Equals(
    SymbolSequencePoint other
)
Parameters
other
Type: PostSharp.Reflection SymbolSequencePoint
An object to compare with this object.
Return Value
Type:   Online Boolean
true if the current object is equal to the other parameter; otherwise, false.
Implements
  Online IEquatable T  Equals(T)
See Also
SymbolSequencePoint Class
SymbolSequencePoint Members
Equals Overload
PostSharp.Reflection Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


SymbolSequencePoint.GetHashCode Method

SymbolSequencePoint GetHashCode Method PostSharp Documentation
Serves as a hash function for a particular type.

Namespace: PostSharp.Reflection
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
public override int GetHashCode()
public override int GetHashCode()
Return Value
Type:   Online Int32
A hash code for the current   Online Object.
See Also
SymbolSequencePoint Class
SymbolSequencePoint Members
PostSharp.Reflection Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


SymbolSequencePoint.ToString Method

SymbolSequencePoint ToString Method PostSharp Documentation
Returns a string that represents the current object.

Namespace: PostSharp.Reflection
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
public override string ToString()
public override string ToString()
Return Value
Type:   Online String
A string that represents the current object.
See Also
SymbolSequencePoint Class
SymbolSequencePoint Members
PostSharp.Reflection Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


SymbolSequencePoint Operators

SymbolSequencePoint Operators PostSharp Documentation
The SymbolSequencePoint type exposes the following members.
Operators
Name | Description
Equality | Determines whether two sequence points are equal.
Inequality | Determines whether two sequence points are different.
Back to Top
See Also
SymbolSequencePoint Class
PostSharp.Reflection Namespace

Online Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


SymbolSequencePoint.Equality Operator

SymbolSequencePoint Equality Operator PostSharp Documentation
Determines whether two sequence points are equal.

Namespace: PostSharp.Reflection
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
public static bool operator ==(
    SymbolSequencePoint left,
    SymbolSequencePoint right
)
public static bool operator ==(
    SymbolSequencePoint left,
    SymbolSequencePoint right
)
Parameters
left
Type: PostSharp.Reflection SymbolSequencePoint
A SymbolSequencePoint.
right
Type: PostSharp.Reflection SymbolSequencePoint
A SymbolSequencePoint.
Return Value
Type:   Online Boolean
true if both sequence points are equal, otherwise false.
See Also
SymbolSequencePoint Class
SymbolSequencePoint Members
PostSharp.Reflection Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


SymbolSequencePoint.Inequality Operator

SymbolSequencePoint Inequality Operator PostSharp Documentation
Determines whether two sequence points are different.

Namespace: PostSharp.Reflection
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
public static bool operator !=(
    SymbolSequencePoint left,
    SymbolSequencePoint right
)
public static bool operator !=(
    SymbolSequencePoint left,
    SymbolSequencePoint right
)
Parameters
left
Type: PostSharp.Reflection SymbolSequencePoint
A SymbolSequencePoint.
right
Type: PostSharp.Reflection SymbolSequencePoint
A SymbolSequencePoint.
Return Value
Type:   Online Boolean
true if both sequence points are different, otherwise false.
See Also
SymbolSequencePoint Class
SymbolSequencePoint Members
PostSharp.Reflection Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


SymbolSequencePoint Properties

SymbolSequencePoint Properties PostSharp Documentation
The SymbolSequencePoint type exposes the following members.
Properties
 | Name | Description
Public property | Document | Obsolete.
Public property | EndColumn | Gets the end column in the source file.
Public property | EndLine | Gets the end line in the source file.
Public property | IsHidden | Determines whether the current symbol means that the associated instructions have no source code..
Public property | SourceDocument | Document (file of source code) containing the current sequence point.
Public property | StartColumn | Gets the start column in the source file.
Public property | StartLine | Gets the start line in the source file.
Back to Top
See Also
SymbolSequencePoint Class
PostSharp.Reflection Namespace

Online Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


SymbolSequencePoint.Document Property

SymbolSequencePoint Document Property PostSharp Documentation

[Missing <summary> documentation for "P:PostSharp.Reflection.SymbolSequencePoint.Document"]

Namespace: PostSharp.Reflection
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
[ObsoleteAttribute("Use SourceDocument.")]
public ISymbolDocument Document { get; }
[ObsoleteAttribute("Use SourceDocument.")]
public ISymbolDocument Document { get; }
Property Value
Type:   Online ISymbolDocument
See Also
SymbolSequencePoint Class
SymbolSequencePoint Members
PostSharp.Reflection Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


SymbolSequencePoint.EndColumn Property

SymbolSequencePoint EndColumn Property PostSharp Documentation
Gets the end column in the source file.

Namespace: PostSharp.Reflection
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
public int EndColumn { get; }
public int EndColumn { get; }
Property Value
Type:   Online Int32
See Also
SymbolSequencePoint Class
SymbolSequencePoint Members
PostSharp.Reflection Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


SymbolSequencePoint.EndLine Property

SymbolSequencePoint EndLine Property PostSharp Documentation
Gets the end line in the source file.

Namespace: PostSharp.Reflection
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
public int EndLine { get; }
public int EndLine { get; }
Property Value
Type:   Online Int32
See Also
SymbolSequencePoint Class
SymbolSequencePoint Members
PostSharp.Reflection Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


SymbolSequencePoint.IsHidden Property

SymbolSequencePoint IsHidden Property PostSharp Documentation
Determines whether the current symbol means that the associated instructions have no source code..

Namespace: PostSharp.Reflection
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
public bool IsHidden { get; }
public bool IsHidden { get; }
Property Value
Type:   Online Boolean
See Also
SymbolSequencePoint Class
SymbolSequencePoint Members
PostSharp.Reflection Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


SymbolSequencePoint.SourceDocument Property

SymbolSequencePoint SourceDocument Property PostSharp Documentation
Document (file of source code) containing the current sequence point.

Namespace: PostSharp.Reflection
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
public ISourceDocument SourceDocument { get; }
public ISourceDocument SourceDocument { get; }
Property Value
Type: ISourceDocument
See Also
SymbolSequencePoint Class
SymbolSequencePoint Members
PostSharp.Reflection Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


SymbolSequencePoint.StartColumn Property

SymbolSequencePoint StartColumn Property PostSharp Documentation
Gets the start column in the source file.

Namespace: PostSharp.Reflection
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
public int StartColumn { get; }
public int StartColumn { get; }
Property Value
Type:   Online Int32
See Also
SymbolSequencePoint Class
SymbolSequencePoint Members
PostSharp.Reflection Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


SymbolSequencePoint.StartLine Property

SymbolSequencePoint StartLine Property PostSharp Documentation
Gets the start line in the source file.

Namespace: PostSharp.Reflection
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
public int StartLine { get; }
public int StartLine { get; }
Property Value
Type:   Online Int32
See Also
SymbolSequencePoint Class
SymbolSequencePoint Members
PostSharp.Reflection Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


TypeInheritanceCodeReference Class

TypeInheritanceCodeReference Class PostSharp Documentation
Represents a inheritance relationship between two types.
Inheritance Hierarchy
Online System Object
PostSharp.Reflection TypeInheritanceCodeReference

Namespace: PostSharp.Reflection
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
public sealed class TypeInheritanceCodeReference : ICodeReference
public sealed class TypeInheritanceCodeReference : ICodeReference
See Also
TypeInheritanceCodeReference Members
PostSharp.Reflection Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


TypeInheritanceCodeReference Members

TypeInheritanceCodeReference Members PostSharp Documentation

The TypeInheritanceCodeReference type exposes the following members.
Properties
 | Name | Description
Public property | BaseType | Gets the base type. If the base type is a generic type, this property contains a generic type instance.
Public property | DerivedType | Gets the derived type.
Back to Top
See Also
TypeInheritanceCodeReference Class
PostSharp.Reflection Namespace

Online Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


TypeInheritanceCodeReference Properties

TypeInheritanceCodeReference Properties PostSharp Documentation
The TypeInheritanceCodeReference type exposes the following members.
Properties
 | Name | Description
Public property | BaseType | Gets the base type. If the base type is a generic type, this property contains a generic type instance.
Public property | DerivedType | Gets the derived type.
Back to Top
See Also
TypeInheritanceCodeReference Class
PostSharp.Reflection Namespace

Online Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


TypeInheritanceCodeReference.BaseType Property

TypeInheritanceCodeReference BaseType Property PostSharp Documentation
Gets the base type. If the base type is a generic type, this property contains a generic type instance.

Namespace: PostSharp.Reflection
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
public Type BaseType { get; private set; }
public Type BaseType { get; private set; }
Property Value
Type:   Online Type
See Also
TypeInheritanceCodeReference Class
TypeInheritanceCodeReference Members
PostSharp.Reflection Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


TypeInheritanceCodeReference.DerivedType Property

TypeInheritanceCodeReference DerivedType Property PostSharp Documentation
Gets the derived type.

Namespace: PostSharp.Reflection
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
public Type DerivedType { get; private set; }
public Type DerivedType { get; private set; }
Property Value
Type:   Online Type
See Also
TypeInheritanceCodeReference Class
TypeInheritanceCodeReference Members
PostSharp.Reflection Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


Visibility Enumeration

Visibility Enumeration PostSharp Documentation
Visibility of types and type members.

Namespace: PostSharp.Reflection
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
public enum Visibility
public enum Visibility
Members
Member name | Value | Description
Public | 0 | Public.
Family | 1 | Family (protected).
Assembly | 2 | Assembly (internal).
FamilyOrAssembly | 3 | Family or assembly (protected internal).
FamilyAndAssembly | 4 | Family and assembly (no C# equivalent: protected types inside the current assembly).
Private | 5 | Private.
See Also
PostSharp.Reflection Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


PostSharp.Reflection.Syntax Namespace

PostSharp.Reflection.Syntax Namespace PostSharp Documentation
The PostSharp.Reflection.Syntax namespace contains classes and interfaces that can represent the decompiled abstract syntax tree of method bodies.
Classes
 | Class | Description
Public class | SyntaxTreeFormatter | Formats an ISyntaxElement to a textual representation, for debugging purposes.
Public class | SyntaxTreeVisitor | Abstract implementation of a visitor of method bodies (ISyntaxMethodBody and IExpression).
Interfaces
 | Interface | Description
Public interface | IAddressOfExpression | Expression that takes the address of the operand. Equivalent to the C# operator &.
Public interface | IBinaryExpression | Expression that has two operands, Left and Right.
Public interface | IBlockExpression | Block containing other instructions.
Public interface | IConditionalExpression | Conditional expression, corresponding to the if keyword in C#.
Public interface | IConstantExpression | Expression representing a build-time constant.
Public interface | ICopyBufferExpression | Expression equivalent to the Online Cpblk instruction.
Public interface | IExpression | Represents an expression or an instruction.
Public interface | IFieldExpression | Expression that represents a field.
Public interface | IGotoExpression | Unconditional branching instruction.
Public interface | IInitBufferExpression | Expression equivalent to the Online Initblk instruction.
Public interface | ILocalVariableExpression | Expression that represents a local variable.
Public interface | IMetadataExpression | Expression that depends on a metadata declaration. This expression is used when compiling the typeof, sizeof or default keywords of C#, among others.
Public interface | IMethodCallExpression | Expression representing a method call.
Public interface | IMethodPointerExpression | Expression that represents a C-like pointer to a method.
Public interface | INewArrayExpression | Expression that returns a new array.
Public interface | INewObjectExpression | Expression that creates a new object by invoking a constructor.
Public interface | IParameterExpression | Expression that represents a method parameter.
Public interface | ISwitchExpression | Expression that represent a switch (conditional statement with multiple branches).
Public interface | ISyntaxElement | Represents an element of the syntax tree representing a method body.
Public interface | ISyntaxExceptionHandler | Represents an exception handler (either catch, finally or filter) attached to a block.
Public interface | ISyntaxLocalVariable | Expression that represents a local variable.
Public interface | ISyntaxMethodBody | Represents the body of a method.
Public interface | ISyntaxReflectionService | Service that exposes the method GetMethodBody(MethodBase, SyntaxAbstractionLevel), which allows to decompile a method and get a AST representation.
Public interface | IUnaryExpression | Represents an expression with a single operand.
Public interface | IValueOfExpression | Expression that returns the value stored at an address. Equivalent to the C# keyword *.
Public interface | IZeroaryExpression | Expression with no operand.
Enumerations
 | Enumeration | Description
Public enumeration | AddressAlignment | Enumeration of address alignments for access to unmanaged memory represented by ICopyBufferExpression, IFieldExpression or IValueOfExpression.
Public enumeration | SyntaxAbstractionLevel | Enumerates the level of abstraction and the level of details produced by the AST decompiler.
Public enumeration | SyntaxElementKind | Enumeration of kinds of syntax elements (ISyntaxElement).

Online Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


AddressAlignment Enumeration

AddressAlignment Enumeration PostSharp Documentation
Enumeration of address alignments for access to unmanaged memory represented by ICopyBufferExpression, IFieldExpression or IValueOfExpression.

Namespace: PostSharp.Reflection.Syntax
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
public enum AddressAlignment
public enum AddressAlignment
Members
Member name | Value | Description
Default | 0 | Default alignment (machine word).
Unaligned1 | 1 | 1-byte alignment.
Unaligned2 | 2 | 2-byte alignment.
Unaligned4 | 3 | 4-byte alignment.
See Also
PostSharp.Reflection.Syntax Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


IAddressOfExpression Interface

IAddressOfExpression Interface PostSharp Documentation
Expression that takes the address of the operand. Equivalent to the C# operator &.

Namespace: PostSharp.Reflection.Syntax
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
public interface IAddressOfExpression : IUnaryExpression,
    IExpression, ISyntaxElement
public interface IAddressOfExpression : IUnaryExpression,
    IExpression, ISyntaxElement
See Also
IAddressOfExpression Members
PostSharp.Reflection.Syntax Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


IAddressOfExpression Members

IAddressOfExpression Members PostSharp Documentation

The IAddressOfExpression type exposes the following members.
Properties
 | Name | Description
Public property | IsReadOnly | Determines whether the returned pointer is a read-only pointer.
Public property | ParentElement | Gets the parent element in the tree. (Inherited from ISyntaxElement.)
Public property | ParentMethodBody | Gets the parent method body. (Inherited from ISyntaxElement.)
Public property | ReturnType | Gets the type of the return value of the current expression, or Online Void if the expression does not return anything (i.e. for pure instructions, for instance a goto or throw instruction). (Inherited from IExpression.)
Public property | SyntaxElementKind | Gets the kind of syntax element. (Inherited from ISyntaxElement.)
Public property | Value | Operand of the unary expression. (Inherited from IUnaryExpression.)
Back to Top
See Also
IAddressOfExpression Interface
PostSharp.Reflection.Syntax Namespace

Online Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


IAddressOfExpression Properties

IAddressOfExpression Properties PostSharp Documentation
The IAddressOfExpression type exposes the following members.
Properties
 | Name | Description
Public property | IsReadOnly | Determines whether the returned pointer is a read-only pointer.
Public property | ParentElement | Gets the parent element in the tree. (Inherited from ISyntaxElement.)
Public property | ParentMethodBody | Gets the parent method body. (Inherited from ISyntaxElement.)
Public property | ReturnType | Gets the type of the return value of the current expression, or Online Void if the expression does not return anything (i.e. for pure instructions, for instance a goto or throw instruction). (Inherited from IExpression.)
Public property | SyntaxElementKind | Gets the kind of syntax element. (Inherited from ISyntaxElement.)
Public property | Value | Operand of the unary expression. (Inherited from IUnaryExpression.)
Back to Top
See Also
IAddressOfExpression Interface
PostSharp.Reflection.Syntax Namespace

Online Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


IAddressOfExpression.IsReadOnly Property

IAddressOfExpression IsReadOnly Property PostSharp Documentation
Determines whether the returned pointer is a read-only pointer.

Namespace: PostSharp.Reflection.Syntax
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
bool IsReadOnly { get; }
bool IsReadOnly { get; }
Property Value
Type:   Online Boolean
See Also
IAddressOfExpression Interface
IAddressOfExpression Members
PostSharp.Reflection.Syntax Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


IBinaryExpression Interface

IBinaryExpression Interface PostSharp Documentation
Expression that has two operands, Left and Right.

Namespace: PostSharp.Reflection.Syntax
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
public interface IBinaryExpression : IExpression,
    ISyntaxElement
public interface IBinaryExpression : IExpression,
    ISyntaxElement
See Also
IBinaryExpression Members
PostSharp.Reflection.Syntax Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


IBinaryExpression Members

IBinaryExpression Members PostSharp Documentation

The IBinaryExpression type exposes the following members.
Properties
 | Name | Description
Public property | Left | Gets the left operand.
Public property | ParentElement | Gets the parent element in the tree. (Inherited from ISyntaxElement.)
Public property | ParentMethodBody | Gets the parent method body. (Inherited from ISyntaxElement.)
Public property | ReturnType | Gets the type of the return value of the current expression, or Online Void if the expression does not return anything (i.e. for pure instructions, for instance a goto or throw instruction). (Inherited from IExpression.)
Public property | Right | Gets the right operand.
Public property | SyntaxElementKind | Gets the kind of syntax element. (Inherited from ISyntaxElement.)
Back to Top
See Also
IBinaryExpression Interface
PostSharp.Reflection.Syntax Namespace

Online Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


IBinaryExpression Properties

IBinaryExpression Properties PostSharp Documentation
The IBinaryExpression type exposes the following members.
Properties
 | Name | Description
Public property | Left | Gets the left operand.
Public property | ParentElement | Gets the parent element in the tree. (Inherited from ISyntaxElement.)
Public property | ParentMethodBody | Gets the parent method body. (Inherited from ISyntaxElement.)
Public property | ReturnType | Gets the type of the return value of the current expression, or Online Void if the expression does not return anything (i.e. for pure instructions, for instance a goto or throw instruction). (Inherited from IExpression.)
Public property | Right | Gets the right operand.
Public property | SyntaxElementKind | Gets the kind of syntax element. (Inherited from ISyntaxElement.)
Back to Top
See Also
IBinaryExpression Interface
PostSharp.Reflection.Syntax Namespace

Online Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


IBinaryExpression.Left Property

IBinaryExpression Left Property PostSharp Documentation
Gets the left operand.

Namespace: PostSharp.Reflection.Syntax
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
IExpression Left { get; }
IExpression Left { get; }
Property Value
Type: IExpression
See Also
IBinaryExpression Interface
IBinaryExpression Members
PostSharp.Reflection.Syntax Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


IBinaryExpression.Right Property

IBinaryExpression Right Property PostSharp Documentation
Gets the right operand.

Namespace: PostSharp.Reflection.Syntax
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
IExpression Right { get; }
IExpression Right { get; }
Property Value
Type: IExpression
See Also
IBinaryExpression Interface
IBinaryExpression Members
PostSharp.Reflection.Syntax Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


IBlockExpression Interface

IBlockExpression Interface PostSharp Documentation
Block containing other instructions.

Namespace: PostSharp.Reflection.Syntax
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
public interface IBlockExpression : IExpression,
    ISyntaxElement
public interface IBlockExpression : IExpression,
    ISyntaxElement
See Also
IBlockExpression Members
PostSharp.Reflection.Syntax Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


IBlockExpression Members

IBlockExpression Members PostSharp Documentation

The IBlockExpression type exposes the following members.
Properties
 | Name | Description
Public property | ExceptionHandlers | Gets the collection of exception handlers that protect the block.
Public property | Items | Gets the collection of items in the block.
Public property | Label | Gets a string that uniquely identifies the block (inside the current method body) as a possible branching target.
Public property | LocalVariables | Gets the collection of local variables defined for the current block.
Public property | ParentElement | Gets the parent element in the tree. (Inherited from ISyntaxElement.)
Public property | ParentMethodBody | Gets the parent method body. (Inherited from ISyntaxElement.)
Public property | ReturnType | Gets the type of the return value of the current expression, or Online Void if the expression does not return anything (i.e. for pure instructions, for instance a goto or throw instruction). (Inherited from IExpression.)
Public property | SyntaxElementKind | Gets the kind of syntax element. (Inherited from ISyntaxElement.)
Back to Top
See Also
IBlockExpression Interface
PostSharp.Reflection.Syntax Namespace

Online Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


IBlockExpression Properties

IBlockExpression Properties PostSharp Documentation
The IBlockExpression type exposes the following members.
Properties
 | Name | Description
Public property | ExceptionHandlers | Gets the collection of exception handlers that protect the block.
Public property | Items | Gets the collection of items in the block.
Public property | Label | Gets a string that uniquely identifies the block (inside the current method body) as a possible branching target.
Public property | LocalVariables | Gets the collection of local variables defined for the current block.
Public property | ParentElement | Gets the parent element in the tree. (Inherited from ISyntaxElement.)
Public property | ParentMethodBody | Gets the parent method body. (Inherited from ISyntaxElement.)
Public property | ReturnType | Gets the type of the return value of the current expression, or Online Void if the expression does not return anything (i.e. for pure instructions, for instance a goto or throw instruction). (Inherited from IExpression.)
Public property | SyntaxElementKind | Gets the kind of syntax element. (Inherited from ISyntaxElement.)
Back to Top
See Also
IBlockExpression Interface
PostSharp.Reflection.Syntax Namespace

Online Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


IBlockExpression.ExceptionHandlers Property

IBlockExpression ExceptionHandlers Property PostSharp Documentation
Gets the collection of exception handlers that protect the block.

Namespace: PostSharp.Reflection.Syntax
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
IReadOnlyLinkedList<ISyntaxExceptionHandler> ExceptionHandlers { get; }
IReadOnlyLinkedList<ISyntaxExceptionHandler> ExceptionHandlers { get; }
Property Value
Type: IReadOnlyLinkedList  ISyntaxExceptionHandler
See Also
IBlockExpression Interface
IBlockExpression Members
PostSharp.Reflection.Syntax Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


IBlockExpression.Items Property

IBlockExpression Items Property PostSharp Documentation
Gets the collection of items in the block.

Namespace: PostSharp.Reflection.Syntax
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
IReadOnlyLinkedList<IExpression> Items { get; }
IReadOnlyLinkedList<IExpression> Items { get; }
Property Value
Type: IReadOnlyLinkedList  IExpression
See Also
IBlockExpression Interface
IBlockExpression Members
PostSharp.Reflection.Syntax Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


IBlockExpression.Label Property

IBlockExpression Label Property PostSharp Documentation
Gets a string that uniquely identifies the block (inside the current method body) as a possible branching target.

Namespace: PostSharp.Reflection.Syntax
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
string Label { get; }
string Label { get; }
Property Value
Type:   Online String
See Also
IBlockExpression Interface
IBlockExpression Members
PostSharp.Reflection.Syntax Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


IBlockExpression.LocalVariables Property

IBlockExpression LocalVariables Property PostSharp Documentation
Gets the collection of local variables defined for the current block.

Namespace: PostSharp.Reflection.Syntax
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
IList<ISyntaxLocalVariable> LocalVariables { get; }
IList<ISyntaxLocalVariable> LocalVariables { get; }
Property Value
Type:   Online IList  ISyntaxLocalVariable
See Also
IBlockExpression Interface
IBlockExpression Members
PostSharp.Reflection.Syntax Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


IConditionalExpression Interface

IConditionalExpression Interface PostSharp Documentation
Conditional expression, corresponding to the if keyword in C#.

Namespace: PostSharp.Reflection.Syntax
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
public interface IConditionalExpression : IExpression,
    ISyntaxElement
public interface IConditionalExpression : IExpression,
    ISyntaxElement
See Also
IConditionalExpression Members
PostSharp.Reflection.Syntax Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


IConditionalExpression Members

IConditionalExpression Members PostSharp Documentation

The IConditionalExpression type exposes the following members.
Properties
 | Name | Description
Public property | Condition | Gets the condition expression (the return type does not need to be bool. Zero and null values are considered false).
Public property | IfFalse | Gets the expression executed when Condition evaluates to false, zero, or null.
Public property | IfTrue | Gets the expression executed when Condition evaluates to true or a non-null and non-zero vale.
Public property | ParentElement | Gets the parent element in the tree. (Inherited from ISyntaxElement.)
Public property | ParentMethodBody | Gets the parent method body. (Inherited from ISyntaxElement.)
Public property | ReturnType | Gets the type of the return value of the current expression, or Online Void if the expression does not return anything (i.e. for pure instructions, for instance a goto or throw instruction). (Inherited from IExpression.)
Public property | SyntaxElementKind | Gets the kind of syntax element. (Inherited from ISyntaxElement.)
Back to Top
See Also
IConditionalExpression Interface
PostSharp.Reflection.Syntax Namespace

Online Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


IConditionalExpression Properties

IConditionalExpression Properties PostSharp Documentation
The IConditionalExpression type exposes the following members.
Properties
 | Name | Description
Public property | Condition | Gets the condition expression (the return type does not need to be bool. Zero and null values are considered false).
Public property | IfFalse | Gets the expression executed when Condition evaluates to false, zero, or null.
Public property | IfTrue | Gets the expression executed when Condition evaluates to true or a non-null and non-zero vale.
Public property | ParentElement | Gets the parent element in the tree. (Inherited from ISyntaxElement.)
Public property | ParentMethodBody | Gets the parent method body. (Inherited from ISyntaxElement.)
Public property | ReturnType | Gets the type of the return value of the current expression, or Online Void if the expression does not return anything (i.e. for pure instructions, for instance a goto or throw instruction). (Inherited from IExpression.)
Public property | SyntaxElementKind | Gets the kind of syntax element. (Inherited from ISyntaxElement.)
Back to Top
See Also
IConditionalExpression Interface
PostSharp.Reflection.Syntax Namespace

Online Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


IConditionalExpression.Condition Property

IConditionalExpression Condition Property PostSharp Documentation
Gets the condition expression (the return type does not need to be bool. Zero and null values are considered false).

Namespace: PostSharp.Reflection.Syntax
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
IExpression Condition { get; }
IExpression Condition { get; }
Property Value
Type: IExpression
See Also
IConditionalExpression Interface
IConditionalExpression Members
PostSharp.Reflection.Syntax Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


IConditionalExpression.IfFalse Property

IConditionalExpression IfFalse Property PostSharp Documentation
Gets the expression executed when Condition evaluates to false, zero, or null.

Namespace: PostSharp.Reflection.Syntax
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
IExpression IfFalse { get; }
IExpression IfFalse { get; }
Property Value
Type: IExpression
See Also
IConditionalExpression Interface
IConditionalExpression Members
PostSharp.Reflection.Syntax Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


IConditionalExpression.IfTrue Property

IConditionalExpression IfTrue Property PostSharp Documentation
Gets the expression executed when Condition evaluates to true or a non-null and non-zero vale.

Namespace: PostSharp.Reflection.Syntax
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
IExpression IfTrue { get; }
IExpression IfTrue { get; }
Property Value
Type: IExpression
See Also
IConditionalExpression Interface
IConditionalExpression Members
PostSharp.Reflection.Syntax Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


IConstantExpression Interface

IConstantExpression Interface PostSharp Documentation
Expression representing a build-time constant.

Namespace: PostSharp.Reflection.Syntax
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
public interface IConstantExpression : IExpression,
    ISyntaxElement
public interface IConstantExpression : IExpression,
    ISyntaxElement
See Also
IConstantExpression Members
PostSharp.Reflection.Syntax Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


IConstantExpression Members

IConstantExpression Members PostSharp Documentation

The IConstantExpression type exposes the following members.
Properties
 | Name | Description
Public property | ParentElement | Gets the parent element in the tree. (Inherited from ISyntaxElement.)
Public property | ParentMethodBody | Gets the parent method body. (Inherited from ISyntaxElement.)
Public property | ReturnType | Gets the type of the return value of the current expression, or Online Void if the expression does not return anything (i.e. for pure instructions, for instance a goto or throw instruction). (Inherited from IExpression.)
Public property | SyntaxElementKind | Gets the kind of syntax element. (Inherited from ISyntaxElement.)
Public property | Value | Gets the constant value.
Back to Top
See Also
IConstantExpression Interface
PostSharp.Reflection.Syntax Namespace

Online Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


IConstantExpression Properties

IConstantExpression Properties PostSharp Documentation
The IConstantExpression type exposes the following members.
Properties
 | Name | Description
Public property | ParentElement | Gets the parent element in the tree. (Inherited from ISyntaxElement.)
Public property | ParentMethodBody | Gets the parent method body. (Inherited from ISyntaxElement.)
Public property | ReturnType | Gets the type of the return value of the current expression, or Online Void if the expression does not return anything (i.e. for pure instructions, for instance a goto or throw instruction). (Inherited from IExpression.)
Public property | SyntaxElementKind | Gets the kind of syntax element. (Inherited from ISyntaxElement.)
Public property | Value | Gets the constant value.
Back to Top
See Also
IConstantExpression Interface
PostSharp.Reflection.Syntax Namespace

Online Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


IConstantExpression.Value Property

IConstantExpression Value Property PostSharp Documentation
Gets the constant value.

Namespace: PostSharp.Reflection.Syntax
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
Object Value { get; }
Object Value { get; }
Property Value
Type:   Online Object
See Also
IConstantExpression Interface
IConstantExpression Members
PostSharp.Reflection.Syntax Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


ICopyBufferExpression Interface

ICopyBufferExpression Interface PostSharp Documentation
Expression equivalent to the Online Cpblk instruction.

Namespace: PostSharp.Reflection.Syntax
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
public interface ICopyBufferExpression : IExpression,
    ISyntaxElement
public interface ICopyBufferExpression : IExpression,
    ISyntaxElement
Remarks
This expression type has no equivalent in C#.
See Also
ICopyBufferExpression Members
PostSharp.Reflection.Syntax Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


ICopyBufferExpression Members

ICopyBufferExpression Members PostSharp Documentation

The ICopyBufferExpression type exposes the following members.
Properties
 | Name | Description
Public property | Alignment | Gets the alignment of source and destination buffers.
Public property | Destination | Gets the destination address.
Public property | IsVolatile | Determines whether the buffers can be modified from a different thread.
Public property | Length | Gets the number of bytes to be copied.
Public property | ParentElement | Gets the parent element in the tree. (Inherited from ISyntaxElement.)
Public property | ParentMethodBody | Gets the parent method body. (Inherited from ISyntaxElement.)
Public property | ReturnType | Gets the type of the return value of the current expression, or Online Void if the expression does not return anything (i.e. for pure instructions, for instance a goto or throw instruction). (Inherited from IExpression.)
Public property | Source | Gets the source address.
Public property | SyntaxElementKind | Gets the kind of syntax element. (Inherited from ISyntaxElement.)
Back to Top
See Also
ICopyBufferExpression Interface
PostSharp.Reflection.Syntax Namespace

Online Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


ICopyBufferExpression Properties

ICopyBufferExpression Properties PostSharp Documentation
The ICopyBufferExpression type exposes the following members.
Properties
 | Name | Description
Public property | Alignment | Gets the alignment of source and destination buffers.
Public property | Destination | Gets the destination address.
Public property | IsVolatile | Determines whether the buffers can be modified from a different thread.
Public property | Length | Gets the number of bytes to be copied.
Public property | ParentElement | Gets the parent element in the tree. (Inherited from ISyntaxElement.)
Public property | ParentMethodBody | Gets the parent method body. (Inherited from ISyntaxElement.)
Public property | ReturnType | Gets the type of the return value of the current expression, or Online Void if the expression does not return anything (i.e. for pure instructions, for instance a goto or throw instruction). (Inherited from IExpression.)
Public property | Source | Gets the source address.
Public property | SyntaxElementKind | Gets the kind of syntax element. (Inherited from ISyntaxElement.)
Back to Top
See Also
ICopyBufferExpression Interface
PostSharp.Reflection.Syntax Namespace

Online Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


ICopyBufferExpression.Alignment Property

ICopyBufferExpression Alignment Property PostSharp Documentation
Gets the alignment of source and destination buffers.

Namespace: PostSharp.Reflection.Syntax
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
AddressAlignment Alignment { get; }
AddressAlignment Alignment { get; }
Property Value
Type: AddressAlignment
See Also
ICopyBufferExpression Interface
ICopyBufferExpression Members
PostSharp.Reflection.Syntax Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


ICopyBufferExpression.Destination Property

ICopyBufferExpression Destination Property PostSharp Documentation
Gets the destination address.

Namespace: PostSharp.Reflection.Syntax
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
IExpression Destination { get; }
IExpression Destination { get; }
Property Value
Type: IExpression
See Also
ICopyBufferExpression Interface
ICopyBufferExpression Members
PostSharp.Reflection.Syntax Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


ICopyBufferExpression.IsVolatile Property

ICopyBufferExpression IsVolatile Property PostSharp Documentation
Determines whether the buffers can be modified from a different thread.

Namespace: PostSharp.Reflection.Syntax
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
bool IsVolatile { get; }
bool IsVolatile { get; }
Property Value
Type:   Online Boolean
See Also
ICopyBufferExpression Interface
ICopyBufferExpression Members
PostSharp.Reflection.Syntax Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


ICopyBufferExpression.Length Property

ICopyBufferExpression Length Property PostSharp Documentation
Gets the number of bytes to be copied.

Namespace: PostSharp.Reflection.Syntax
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
IExpression Length { get; }
IExpression Length { get; }
Property Value
Type: IExpression
See Also
ICopyBufferExpression Interface
ICopyBufferExpression Members
PostSharp.Reflection.Syntax Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


ICopyBufferExpression.Source Property

ICopyBufferExpression Source Property PostSharp Documentation
Gets the source address.

Namespace: PostSharp.Reflection.Syntax
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
IExpression Source { get; }
IExpression Source { get; }
Property Value
Type: IExpression
See Also
ICopyBufferExpression Interface
ICopyBufferExpression Members
PostSharp.Reflection.Syntax Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


IExpression Interface

IExpression Interface PostSharp Documentation
Represents an expression or an instruction.

Namespace: PostSharp.Reflection.Syntax
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
public interface IExpression : ISyntaxElement
public interface IExpression : ISyntaxElement
See Also
IExpression Members
PostSharp.Reflection.Syntax Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


IExpression Members

IExpression Members PostSharp Documentation

The IExpression type exposes the following members.
Properties
 | Name | Description
Public property | ParentElement | Gets the parent element in the tree. (Inherited from ISyntaxElement.)
Public property | ParentMethodBody | Gets the parent method body. (Inherited from ISyntaxElement.)
Public property | ReturnType | Gets the type of the return value of the current expression, or Online Void if the expression does not return anything (i.e. for pure instructions, for instance a goto or throw instruction).
Public property | SyntaxElementKind | Gets the kind of syntax element. (Inherited from ISyntaxElement.)
Back to Top
See Also
IExpression Interface
PostSharp.Reflection.Syntax Namespace

Online Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


IExpression Properties

IExpression Properties PostSharp Documentation
The IExpression type exposes the following members.
Properties
 | Name | Description
Public property | ParentElement | Gets the parent element in the tree. (Inherited from ISyntaxElement.)
Public property | ParentMethodBody | Gets the parent method body. (Inherited from ISyntaxElement.)
Public property | ReturnType | Gets the type of the return value of the current expression, or Online Void if the expression does not return anything (i.e. for pure instructions, for instance a goto or throw instruction).
Public property | SyntaxElementKind | Gets the kind of syntax element. (Inherited from ISyntaxElement.)
Back to Top
See Also
IExpression Interface
PostSharp.Reflection.Syntax Namespace

Online Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


IExpression.ReturnType Property

IExpression ReturnType Property PostSharp Documentation
Gets the type of the return value of the current expression, or Online Void if the expression does not return anything (i.e. for pure instructions, for instance a goto or throw instruction).

Namespace: PostSharp.Reflection.Syntax
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
Type ReturnType { get; }
Type ReturnType { get; }
Property Value
Type:   Online Type
See Also
IExpression Interface
IExpression Members
PostSharp.Reflection.Syntax Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


IFieldExpression Interface

IFieldExpression Interface PostSharp Documentation
Expression that represents a field.

Namespace: PostSharp.Reflection.Syntax
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
public interface IFieldExpression : IExpression,
    ISyntaxElement
public interface IFieldExpression : IExpression,
    ISyntaxElement
See Also
IFieldExpression Members
PostSharp.Reflection.Syntax Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


IFieldExpression Members

IFieldExpression Members PostSharp Documentation

The IFieldExpression type exposes the following members.
Properties
 | Name | Description
Public property | Alignment | Gets the field alignment.
Public property | Field | Gets the field.
Public property | Instance | Gets the object containing the field, or null if the field is static.
Public property | IsVolatile | Determine whether the field is can be written by a different thread than the current one.
Public property | ParentElement | Gets the parent element in the tree. (Inherited from ISyntaxElement.)
Public property | ParentMethodBody | Gets the parent method body. (Inherited from ISyntaxElement.)
Public property | ReturnType | Gets the type of the return value of the current expression, or Online Void if the expression does not return anything (i.e. for pure instructions, for instance a goto or throw instruction). (Inherited from IExpression.)
Public property | SyntaxElementKind | Gets the kind of syntax element. (Inherited from ISyntaxElement.)
Back to Top
See Also
IFieldExpression Interface
PostSharp.Reflection.Syntax Namespace

Online Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


IFieldExpression Properties

IFieldExpression Properties PostSharp Documentation
The IFieldExpression type exposes the following members.
Properties
 | Name | Description
Public property | Alignment | Gets the field alignment.
Public property | Field | Gets the field.
Public property | Instance | Gets the object containing the field, or null if the field is static.
Public property | IsVolatile | Determine whether the field is can be written by a different thread than the current one.
Public property | ParentElement | Gets the parent element in the tree. (Inherited from ISyntaxElement.)
Public property | ParentMethodBody | Gets the parent method body. (Inherited from ISyntaxElement.)
Public property | ReturnType | Gets the type of the return value of the current expression, or Online Void if the expression does not return anything (i.e. for pure instructions, for instance a goto or throw instruction). (Inherited from IExpression.)
Public property | SyntaxElementKind | Gets the kind of syntax element. (Inherited from ISyntaxElement.)
Back to Top
See Also
IFieldExpression Interface
PostSharp.Reflection.Syntax Namespace

Online Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


IFieldExpression.Alignment Property

IFieldExpression Alignment Property PostSharp Documentation
Gets the field alignment.

Namespace: PostSharp.Reflection.Syntax
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
AddressAlignment Alignment { get; }
AddressAlignment Alignment { get; }
Property Value
Type: AddressAlignment
See Also
IFieldExpression Interface
IFieldExpression Members
PostSharp.Reflection.Syntax Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


IFieldExpression.Field Property

IFieldExpression Field Property PostSharp Documentation
Gets the field.

Namespace: PostSharp.Reflection.Syntax
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
FieldInfo Field { get; }
FieldInfo Field { get; }
Property Value
Type:   Online FieldInfo
See Also
IFieldExpression Interface
IFieldExpression Members
PostSharp.Reflection.Syntax Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


IFieldExpression.Instance Property

IFieldExpression Instance Property PostSharp Documentation
Gets the object containing the field, or null if the field is static.

Namespace: PostSharp.Reflection.Syntax
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
IExpression Instance { get; }
IExpression Instance { get; }
Property Value
Type: IExpression
See Also
IFieldExpression Interface
IFieldExpression Members
PostSharp.Reflection.Syntax Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


IFieldExpression.IsVolatile Property

IFieldExpression IsVolatile Property PostSharp Documentation
Determine whether the field is can be written by a different thread than the current one.

Namespace: PostSharp.Reflection.Syntax
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
bool IsVolatile { get; }
bool IsVolatile { get; }
Property Value
Type:   Online Boolean
See Also
IFieldExpression Interface
IFieldExpression Members
PostSharp.Reflection.Syntax Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


IGotoExpression Interface

IGotoExpression Interface PostSharp Documentation
Unconditional branching instruction.

Namespace: PostSharp.Reflection.Syntax
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
public interface IGotoExpression : IExpression,
    ISyntaxElement
public interface IGotoExpression : IExpression,
    ISyntaxElement
See Also
IGotoExpression Members
PostSharp.Reflection.Syntax Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


IGotoExpression Members

IGotoExpression Members PostSharp Documentation

The IGotoExpression type exposes the following members.
Properties
 | Name | Description
Public property | ParentElement | Gets the parent element in the tree. (Inherited from ISyntaxElement.)
Public property | ParentMethodBody | Gets the parent method body. (Inherited from ISyntaxElement.)
Public property | ReturnType | Gets the type of the return value of the current expression, or Online Void if the expression does not return anything (i.e. for pure instructions, for instance a goto or throw instruction). (Inherited from IExpression.)
Public property | SyntaxElementKind | Gets the kind of syntax element. (Inherited from ISyntaxElement.)
Public property | Target | Instruction block that must receive control.
Back to Top
See Also
IGotoExpression Interface
PostSharp.Reflection.Syntax Namespace

Online Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


IGotoExpression Properties

IGotoExpression Properties PostSharp Documentation
The IGotoExpression type exposes the following members.
Properties
 | Name | Description
Public property | ParentElement | Gets the parent element in the tree. (Inherited from ISyntaxElement.)
Public property | ParentMethodBody | Gets the parent method body. (Inherited from ISyntaxElement.)
Public property | ReturnType | Gets the type of the return value of the current expression, or Online Void if the expression does not return anything (i.e. for pure instructions, for instance a goto or throw instruction). (Inherited from IExpression.)
Public property | SyntaxElementKind | Gets the kind of syntax element. (Inherited from ISyntaxElement.)
Public property | Target | Instruction block that must receive control.
Back to Top
See Also
IGotoExpression Interface
PostSharp.Reflection.Syntax Namespace

Online Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


IGotoExpression.Target Property

IGotoExpression Target Property PostSharp Documentation
Instruction block that must receive control.

Namespace: PostSharp.Reflection.Syntax
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
IBlockExpression Target { get; }
IBlockExpression Target { get; }
Property Value
Type: IBlockExpression
See Also
IGotoExpression Interface
IGotoExpression Members
PostSharp.Reflection.Syntax Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


IInitBufferExpression Interface

IInitBufferExpression Interface PostSharp Documentation
Expression equivalent to the Online Initblk instruction.

Namespace: PostSharp.Reflection.Syntax
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
public interface IInitBufferExpression : IExpression,
    ISyntaxElement
public interface IInitBufferExpression : IExpression,
    ISyntaxElement
Remarks
This expression type has no equivalent in C#.
See Also
IInitBufferExpression Members
PostSharp.Reflection.Syntax Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


IInitBufferExpression Members

IInitBufferExpression Members PostSharp Documentation

The IInitBufferExpression type exposes the following members.
Properties
 | Name | Description
Public property | Alignment | Gets the alignment of the buffers.
Public property | Buffer | Gets the address of the buffer to be initialized.
Public property | IsVolatile | Determines whether the buffers can be modified from a different thread.
Public property | Length | Gets the number of bytes to be initialized.
Public property | ParentElement | Gets the parent element in the tree. (Inherited from ISyntaxElement.)
Public property | ParentMethodBody | Gets the parent method body. (Inherited from ISyntaxElement.)
Public property | ReturnType | Gets the type of the return value of the current expression, or Online Void if the expression does not return anything (i.e. for pure instructions, for instance a goto or throw instruction). (Inherited from IExpression.)
Public property | SyntaxElementKind | Gets the kind of syntax element. (Inherited from ISyntaxElement.)
Back to Top
See Also
IInitBufferExpression Interface
PostSharp.Reflection.Syntax Namespace

Online Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


IInitBufferExpression Properties

IInitBufferExpression Properties PostSharp Documentation
The IInitBufferExpression type exposes the following members.
Properties
 | Name | Description
Public property | Alignment | Gets the alignment of the buffers.
Public property | Buffer | Gets the address of the buffer to be initialized.
Public property | IsVolatile | Determines whether the buffers can be modified from a different thread.
Public property | Length | Gets the number of bytes to be initialized.
Public property | ParentElement | Gets the parent element in the tree. (Inherited from ISyntaxElement.)
Public property | ParentMethodBody | Gets the parent method body. (Inherited from ISyntaxElement.)
Public property | ReturnType | Gets the type of the return value of the current expression, or Online Void if the expression does not return anything (i.e. for pure instructions, for instance a goto or throw instruction). (Inherited from IExpression.)
Public property | SyntaxElementKind | Gets the kind of syntax element. (Inherited from ISyntaxElement.)
Back to Top
See Also
IInitBufferExpression Interface
PostSharp.Reflection.Syntax Namespace

Online Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


IInitBufferExpression.Alignment Property

IInitBufferExpression Alignment Property PostSharp Documentation
Gets the alignment of the buffers.

Namespace: PostSharp.Reflection.Syntax
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
AddressAlignment Alignment { get; }
AddressAlignment Alignment { get; }
Property Value
Type: AddressAlignment
See Also
IInitBufferExpression Interface
IInitBufferExpression Members
PostSharp.Reflection.Syntax Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


IInitBufferExpression.Buffer Property

IInitBufferExpression Buffer Property PostSharp Documentation
Gets the address of the buffer to be initialized.

Namespace: PostSharp.Reflection.Syntax
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
IExpression Buffer { get; }
IExpression Buffer { get; }
Property Value
Type: IExpression
See Also
IInitBufferExpression Interface
IInitBufferExpression Members
PostSharp.Reflection.Syntax Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


IInitBufferExpression.IsVolatile Property

IInitBufferExpression IsVolatile Property PostSharp Documentation
Determines whether the buffers can be modified from a different thread.

Namespace: PostSharp.Reflection.Syntax
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
bool IsVolatile { get; }
bool IsVolatile { get; }
Property Value
Type:   Online Boolean
See Also
IInitBufferExpression Interface
IInitBufferExpression Members
PostSharp.Reflection.Syntax Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


IInitBufferExpression.Length Property

IInitBufferExpression Length Property PostSharp Documentation
Gets the number of bytes to be initialized.

Namespace: PostSharp.Reflection.Syntax
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
IExpression Length { get; }
IExpression Length { get; }
Property Value
Type: IExpression
See Also
IInitBufferExpression Interface
IInitBufferExpression Members
PostSharp.Reflection.Syntax Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


ILocalVariableExpression Interface

ILocalVariableExpression Interface PostSharp Documentation
Expression that represents a local variable.

Namespace: PostSharp.Reflection.Syntax
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
public interface ILocalVariableExpression : IExpression,
    ISyntaxElement
public interface ILocalVariableExpression : IExpression,
    ISyntaxElement
See Also
ILocalVariableExpression Members
PostSharp.Reflection.Syntax Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


ILocalVariableExpression Members

ILocalVariableExpression Members PostSharp Documentation

The ILocalVariableExpression type exposes the following members.
Properties
 | Name | Description
Public property | LocalVariable | Gets the local variable.
Public property | ParentElement | Gets the parent element in the tree. (Inherited from ISyntaxElement.)
Public property | ParentMethodBody | Gets the parent method body. (Inherited from ISyntaxElement.)
Public property | ReturnType | Gets the type of the return value of the current expression, or Online Void if the expression does not return anything (i.e. for pure instructions, for instance a goto or throw instruction). (Inherited from IExpression.)
Public property | SyntaxElementKind | Gets the kind of syntax element. (Inherited from ISyntaxElement.)
Back to Top
See Also
ILocalVariableExpression Interface
PostSharp.Reflection.Syntax Namespace

Online Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


ILocalVariableExpression Properties

ILocalVariableExpression Properties PostSharp Documentation
The ILocalVariableExpression type exposes the following members.
Properties
 | Name | Description
Public property | LocalVariable | Gets the local variable.
Public property | ParentElement | Gets the parent element in the tree. (Inherited from ISyntaxElement.)
Public property | ParentMethodBody | Gets the parent method body. (Inherited from ISyntaxElement.)
Public property | ReturnType | Gets the type of the return value of the current expression, or Online Void if the expression does not return anything (i.e. for pure instructions, for instance a goto or throw instruction). (Inherited from IExpression.)
Public property | SyntaxElementKind | Gets the kind of syntax element. (Inherited from ISyntaxElement.)
Back to Top
See Also
ILocalVariableExpression Interface
PostSharp.Reflection.Syntax Namespace

Online Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


ILocalVariableExpression.LocalVariable Property

ILocalVariableExpression LocalVariable Property PostSharp Documentation
Gets the local variable.

Namespace: PostSharp.Reflection.Syntax
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
ISyntaxLocalVariable LocalVariable { get; }
ISyntaxLocalVariable LocalVariable { get; }
Property Value
Type: ISyntaxLocalVariable
See Also
ILocalVariableExpression Interface
ILocalVariableExpression Members
PostSharp.Reflection.Syntax Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


IMetadataExpression Interface

IMetadataExpression Interface PostSharp Documentation
Expression that depends on a metadata declaration. This expression is used when compiling the typeof, sizeof or default keywords of C#, among others.

Namespace: PostSharp.Reflection.Syntax
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
public interface IMetadataExpression : IExpression,
    ISyntaxElement
public interface IMetadataExpression : IExpression,
    ISyntaxElement
See Also
IMetadataExpression Members
PostSharp.Reflection.Syntax Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


IMetadataExpression Members

IMetadataExpression Members PostSharp Documentation

The IMetadataExpression type exposes the following members.
Properties
 | Name | Description
Public property | Declaration | Gets the declaration ( Online Type, Online FieldInfo, Online MethodInfo, Online ConstructorInfo).
Public property | ParentElement | Gets the parent element in the tree. (Inherited from ISyntaxElement.)
Public property | ParentMethodBody | Gets the parent method body. (Inherited from ISyntaxElement.)
Public property | ReturnType | Gets the type of the return value of the current expression, or Online Void if the expression does not return anything (i.e. for pure instructions, for instance a goto or throw instruction). (Inherited from IExpression.)
Public property | SyntaxElementKind | Gets the kind of syntax element. (Inherited from ISyntaxElement.)
Back to Top
See Also
IMetadataExpression Interface
PostSharp.Reflection.Syntax Namespace

Online Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


IMetadataExpression Properties

IMetadataExpression Properties PostSharp Documentation
The IMetadataExpression type exposes the following members.
Properties
 | Name | Description
Public property | Declaration | Gets the declaration ( Online Type, Online FieldInfo, Online MethodInfo, Online ConstructorInfo).
Public property | ParentElement | Gets the parent element in the tree. (Inherited from ISyntaxElement.)
Public property | ParentMethodBody | Gets the parent method body. (Inherited from ISyntaxElement.)
Public property | ReturnType | Gets the type of the return value of the current expression, or Online Void if the expression does not return anything (i.e. for pure instructions, for instance a goto or throw instruction). (Inherited from IExpression.)
Public property | SyntaxElementKind | Gets the kind of syntax element. (Inherited from ISyntaxElement.)
Back to Top
See Also
IMetadataExpression Interface
PostSharp.Reflection.Syntax Namespace

Online Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


IMetadataExpression.Declaration Property

IMetadataExpression Declaration Property PostSharp Documentation
Gets the declaration ( Online Type, Online FieldInfo, Online MethodInfo, Online ConstructorInfo).

Namespace: PostSharp.Reflection.Syntax
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
MemberInfo Declaration { get; }
MemberInfo Declaration { get; }
Property Value
Type:   Online MemberInfo
See Also
IMetadataExpression Interface
IMetadataExpression Members
PostSharp.Reflection.Syntax Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


IMethodCallExpression Interface

IMethodCallExpression Interface PostSharp Documentation
Expression representing a method call.

Namespace: PostSharp.Reflection.Syntax
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
public interface IMethodCallExpression : IExpression,
    ISyntaxElement
public interface IMethodCallExpression : IExpression,
    ISyntaxElement
See Also
IMethodCallExpression Members
PostSharp.Reflection.Syntax Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


IMethodCallExpression Members

IMethodCallExpression Members PostSharp Documentation

The IMethodCallExpression type exposes the following members.
Properties
 | Name | Description
Public property | Arguments | Gets the method arguments.
Public property | ConstrainedType | Gets the type to which the virtual method call is constrained to (see Online Constrained).
Public property | Instance | Gets the instance on which the method is called, or null if the method is static.
Public property | IsTail | Determines whether the call is a tail call (see Online Tailcall).
Public property | IsVirtual | Determines whether the call is a virtual call.
Public property | Method | Gets the called method.
Public property | ParentElement | Gets the parent element in the tree. (Inherited from ISyntaxElement.)
Public property | ParentMethodBody | Gets the parent method body. (Inherited from ISyntaxElement.)
Public property | ReturnType | Gets the type of the return value of the current expression, or Online Void if the expression does not return anything (i.e. for pure instructions, for instance a goto or throw instruction). (Inherited from IExpression.)
Public property | SyntaxElementKind | Gets the kind of syntax element. (Inherited from ISyntaxElement.)
Back to Top
See Also
IMethodCallExpression Interface
PostSharp.Reflection.Syntax Namespace

Online Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


IMethodCallExpression Properties

IMethodCallExpression Properties PostSharp Documentation
The IMethodCallExpression type exposes the following members.
Properties
 | Name | Description
Public property | Arguments | Gets the method arguments.
Public property | ConstrainedType | Gets the type to which the virtual method call is constrained to (see Online Constrained).
Public property | Instance | Gets the instance on which the method is called, or null if the method is static.
Public property | IsTail | Determines whether the call is a tail call (see Online Tailcall).
Public property | IsVirtual | Determines whether the call is a virtual call.
Public property | Method | Gets the called method.
Public property | ParentElement | Gets the parent element in the tree. (Inherited from ISyntaxElement.)
Public property | ParentMethodBody | Gets the parent method body. (Inherited from ISyntaxElement.)
Public property | ReturnType | Gets the type of the return value of the current expression, or Online Void if the expression does not return anything (i.e. for pure instructions, for instance a goto or throw instruction). (Inherited from IExpression.)
Public property | SyntaxElementKind | Gets the kind of syntax element. (Inherited from ISyntaxElement.)
Back to Top
See Also
IMethodCallExpression Interface
PostSharp.Reflection.Syntax Namespace

Online Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


IMethodCallExpression.Arguments Property

IMethodCallExpression Arguments Property PostSharp Documentation
Gets the method arguments.

Namespace: PostSharp.Reflection.Syntax
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
IList<IExpression> Arguments { get; }
IList<IExpression> Arguments { get; }
Property Value
Type:   Online IList  IExpression
See Also
IMethodCallExpression Interface
IMethodCallExpression Members
PostSharp.Reflection.Syntax Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


IMethodCallExpression.ConstrainedType Property

IMethodCallExpression ConstrainedType Property PostSharp Documentation
Gets the type to which the virtual method call is constrained to (see Online Constrained).

Namespace: PostSharp.Reflection.Syntax
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
Type ConstrainedType { get; }
Type ConstrainedType { get; }
Property Value
Type:   Online Type
See Also
IMethodCallExpression Interface
IMethodCallExpression Members
PostSharp.Reflection.Syntax Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


IMethodCallExpression.Instance Property

IMethodCallExpression Instance Property PostSharp Documentation
Gets the instance on which the method is called, or null if the method is static.

Namespace: PostSharp.Reflection.Syntax
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
IExpression Instance { get; }
IExpression Instance { get; }
Property Value
Type: IExpression
See Also
IMethodCallExpression Interface
IMethodCallExpression Members
PostSharp.Reflection.Syntax Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


IMethodCallExpression.IsTail Property

IMethodCallExpression IsTail Property PostSharp Documentation
Determines whether the call is a tail call (see Online Tailcall).

Namespace: PostSharp.Reflection.Syntax
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
bool IsTail { get; }
bool IsTail { get; }
Property Value
Type:   Online Boolean
See Also
IMethodCallExpression Interface
IMethodCallExpression Members
PostSharp.Reflection.Syntax Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


IMethodCallExpression.IsVirtual Property

IMethodCallExpression IsVirtual Property PostSharp Documentation
Determines whether the call is a virtual call.

Namespace: PostSharp.Reflection.Syntax
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
bool IsVirtual { get; }
bool IsVirtual { get; }
Property Value
Type:   Online Boolean
See Also
IMethodCallExpression Interface
IMethodCallExpression Members
PostSharp.Reflection.Syntax Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


IMethodCallExpression.Method Property

IMethodCallExpression Method Property PostSharp Documentation
Gets the called method.

Namespace: PostSharp.Reflection.Syntax
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
MethodBase Method { get; }
MethodBase Method { get; }
Property Value
Type:   Online MethodBase
See Also
IMethodCallExpression Interface
IMethodCallExpression Members
PostSharp.Reflection.Syntax Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


IMethodPointerExpression Interface

IMethodPointerExpression Interface PostSharp Documentation
Expression that represents a C-like pointer to a method.

Namespace: PostSharp.Reflection.Syntax
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
public interface IMethodPointerExpression : IExpression,
    ISyntaxElement
public interface IMethodPointerExpression : IExpression,
    ISyntaxElement
See Also
IMethodPointerExpression Members
PostSharp.Reflection.Syntax Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


IMethodPointerExpression Members

IMethodPointerExpression Members PostSharp Documentation

The IMethodPointerExpression type exposes the following members.
Properties
 | Name | Description
Public property | Instance | Gets the instance on which the method is defined, or null if the method is static.
Public property | Method | Gets the method.
Public property | ParentElement | Gets the parent element in the tree. (Inherited from ISyntaxElement.)
Public property | ParentMethodBody | Gets the parent method body. (Inherited from ISyntaxElement.)
Public property | ReturnType | Gets the type of the return value of the current expression, or Online Void if the expression does not return anything (i.e. for pure instructions, for instance a goto or throw instruction). (Inherited from IExpression.)
Public property | SyntaxElementKind | Gets the kind of syntax element. (Inherited from ISyntaxElement.)
Back to Top
See Also
IMethodPointerExpression Interface
PostSharp.Reflection.Syntax Namespace

Online Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


IMethodPointerExpression Properties

IMethodPointerExpression Properties PostSharp Documentation
The IMethodPointerExpression type exposes the following members.
Properties
 | Name | Description
Public property | Instance | Gets the instance on which the method is defined, or null if the method is static.
Public property | Method | Gets the method.
Public property | ParentElement | Gets the parent element in the tree. (Inherited from ISyntaxElement.)
Public property | ParentMethodBody | Gets the parent method body. (Inherited from ISyntaxElement.)
Public property | ReturnType | Gets the type of the return value of the current expression, or Online Void if the expression does not return anything (i.e. for pure instructions, for instance a goto or throw instruction). (Inherited from IExpression.)
Public property | SyntaxElementKind | Gets the kind of syntax element. (Inherited from ISyntaxElement.)
Back to Top
See Also
IMethodPointerExpression Interface
PostSharp.Reflection.Syntax Namespace

Online Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


IMethodPointerExpression.Instance Property

IMethodPointerExpression Instance Property PostSharp Documentation
Gets the instance on which the method is defined, or null if the method is static.

Namespace: PostSharp.Reflection.Syntax
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
IExpression Instance { get; }
IExpression Instance { get; }
Property Value
Type: IExpression
See Also
IMethodPointerExpression Interface
IMethodPointerExpression Members
PostSharp.Reflection.Syntax Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


IMethodPointerExpression.Method Property

IMethodPointerExpression Method Property PostSharp Documentation
Gets the method.

Namespace: PostSharp.Reflection.Syntax
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
MethodBase Method { get; }
MethodBase Method { get; }
Property Value
Type:   Online MethodBase
See Also
IMethodPointerExpression Interface
IMethodPointerExpression Members
PostSharp.Reflection.Syntax Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


INewArrayExpression Interface

INewArrayExpression Interface PostSharp Documentation
Expression that returns a new array.

Namespace: PostSharp.Reflection.Syntax
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
public interface INewArrayExpression : IExpression,
    ISyntaxElement
public interface INewArrayExpression : IExpression,
    ISyntaxElement
See Also
INewArrayExpression Members
PostSharp.Reflection.Syntax Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


INewArrayExpression Members

INewArrayExpression Members PostSharp Documentation

The INewArrayExpression type exposes the following members.
Properties
 | Name | Description
Public property | ElementType | Gets the type of elements of the array.
Public property | Length | Gets the number of elements in the array.
Public property | ParentElement | Gets the parent element in the tree. (Inherited from ISyntaxElement.)
Public property | ParentMethodBody | Gets the parent method body. (Inherited from ISyntaxElement.)
Public property | ReturnType | Gets the type of the return value of the current expression, or Online Void if the expression does not return anything (i.e. for pure instructions, for instance a goto or throw instruction). (Inherited from IExpression.)
Public property | SyntaxElementKind | Gets the kind of syntax element. (Inherited from ISyntaxElement.)
Back to Top
See Also
INewArrayExpression Interface
PostSharp.Reflection.Syntax Namespace

Online Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


INewArrayExpression Properties

INewArrayExpression Properties PostSharp Documentation
The INewArrayExpression type exposes the following members.
Properties
 | Name | Description
Public property | ElementType | Gets the type of elements of the array.
Public property | Length | Gets the number of elements in the array.
Public property | ParentElement | Gets the parent element in the tree. (Inherited from ISyntaxElement.)
Public property | ParentMethodBody | Gets the parent method body. (Inherited from ISyntaxElement.)
Public property | ReturnType | Gets the type of the return value of the current expression, or Online Void if the expression does not return anything (i.e. for pure instructions, for instance a goto or throw instruction). (Inherited from IExpression.)
Public property | SyntaxElementKind | Gets the kind of syntax element. (Inherited from ISyntaxElement.)
Back to Top
See Also
INewArrayExpression Interface
PostSharp.Reflection.Syntax Namespace

Online Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


INewArrayExpression.ElementType Property

INewArrayExpression ElementType Property PostSharp Documentation
Gets the type of elements of the array.

Namespace: PostSharp.Reflection.Syntax
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
Type ElementType { get; }
Type ElementType { get; }
Property Value
Type:   Online Type
See Also
INewArrayExpression Interface
INewArrayExpression Members
PostSharp.Reflection.Syntax Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


INewArrayExpression.Length Property

INewArrayExpression Length Property PostSharp Documentation
Gets the number of elements in the array.

Namespace: PostSharp.Reflection.Syntax
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
IExpression Length { get; }
IExpression Length { get; }
Property Value
Type: IExpression
See Also
INewArrayExpression Interface
INewArrayExpression Members
PostSharp.Reflection.Syntax Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


INewObjectExpression Interface

INewObjectExpression Interface PostSharp Documentation
Expression that creates a new object by invoking a constructor.

Namespace: PostSharp.Reflection.Syntax
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
public interface INewObjectExpression : IExpression,
    ISyntaxElement
public interface INewObjectExpression : IExpression,
    ISyntaxElement
See Also
INewObjectExpression Members
PostSharp.Reflection.Syntax Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


INewObjectExpression Members

INewObjectExpression Members PostSharp Documentation

The INewObjectExpression type exposes the following members.
Properties
 | Name | Description
Public property | Arguments | Gets the arguments passed to the constructor.
Public property | Constructor | Gets the constructor.
Public property | ParentElement | Gets the parent element in the tree. (Inherited from ISyntaxElement.)
Public property | ParentMethodBody | Gets the parent method body. (Inherited from ISyntaxElement.)
Public property | ReturnType | Gets the type of the return value of the current expression, or Online Void if the expression does not return anything (i.e. for pure instructions, for instance a goto or throw instruction). (Inherited from IExpression.)
Public property | SyntaxElementKind | Gets the kind of syntax element. (Inherited from ISyntaxElement.)
Back to Top
See Also
INewObjectExpression Interface
PostSharp.Reflection.Syntax Namespace

Online Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


INewObjectExpression Properties

INewObjectExpression Properties PostSharp Documentation
The INewObjectExpression type exposes the following members.
Properties
 | Name | Description
Public property | Arguments | Gets the arguments passed to the constructor.
Public property | Constructor | Gets the constructor.
Public property | ParentElement | Gets the parent element in the tree. (Inherited from ISyntaxElement.)
Public property | ParentMethodBody | Gets the parent method body. (Inherited from ISyntaxElement.)
Public property | ReturnType | Gets the type of the return value of the current expression, or Online Void if the expression does not return anything (i.e. for pure instructions, for instance a goto or throw instruction). (Inherited from IExpression.)
Public property | SyntaxElementKind | Gets the kind of syntax element. (Inherited from ISyntaxElement.)
Back to Top
See Also
INewObjectExpression Interface
PostSharp.Reflection.Syntax Namespace

Online Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


INewObjectExpression.Arguments Property

INewObjectExpression Arguments Property PostSharp Documentation
Gets the arguments passed to the constructor.

Namespace: PostSharp.Reflection.Syntax
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
IList<IExpression> Arguments { get; }
IList<IExpression> Arguments { get; }
Property Value
Type:   Online IList  IExpression
See Also
INewObjectExpression Interface
INewObjectExpression Members
PostSharp.Reflection.Syntax Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


INewObjectExpression.Constructor Property

INewObjectExpression Constructor Property PostSharp Documentation
Gets the constructor.

Namespace: PostSharp.Reflection.Syntax
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
ConstructorInfo Constructor { get; }
ConstructorInfo Constructor { get; }
Property Value
Type:   Online ConstructorInfo
See Also
INewObjectExpression Interface
INewObjectExpression Members
PostSharp.Reflection.Syntax Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


IParameterExpression Interface

IParameterExpression Interface PostSharp Documentation
Expression that represents a method parameter.

Namespace: PostSharp.Reflection.Syntax
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
public interface IParameterExpression : IExpression,
    ISyntaxElement
public interface IParameterExpression : IExpression,
    ISyntaxElement
See Also
IParameterExpression Members
PostSharp.Reflection.Syntax Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


IParameterExpression Members

IParameterExpression Members PostSharp Documentation

The IParameterExpression type exposes the following members.
Properties
 | Name | Description
Public property | Parameter | Gets the parameter.
Public property | ParentElement | Gets the parent element in the tree. (Inherited from ISyntaxElement.)
Public property | ParentMethodBody | Gets the parent method body. (Inherited from ISyntaxElement.)
Public property | ReturnType | Gets the type of the return value of the current expression, or Online Void if the expression does not return anything (i.e. for pure instructions, for instance a goto or throw instruction). (Inherited from IExpression.)
Public property | SyntaxElementKind | Gets the kind of syntax element. (Inherited from ISyntaxElement.)
Back to Top
See Also
IParameterExpression Interface
PostSharp.Reflection.Syntax Namespace

Online Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


IParameterExpression Properties

IParameterExpression Properties PostSharp Documentation
The IParameterExpression type exposes the following members.
Properties
 | Name | Description
Public property | Parameter | Gets the parameter.
Public property | ParentElement | Gets the parent element in the tree. (Inherited from ISyntaxElement.)
Public property | ParentMethodBody | Gets the parent method body. (Inherited from ISyntaxElement.)
Public property | ReturnType | Gets the type of the return value of the current expression, or Online Void if the expression does not return anything (i.e. for pure instructions, for instance a goto or throw instruction). (Inherited from IExpression.)
Public property | SyntaxElementKind | Gets the kind of syntax element. (Inherited from ISyntaxElement.)
Back to Top
See Also
IParameterExpression Interface
PostSharp.Reflection.Syntax Namespace

Online Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


IParameterExpression.Parameter Property

IParameterExpression Parameter Property PostSharp Documentation
Gets the parameter.

Namespace: PostSharp.Reflection.Syntax
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
ParameterInfo Parameter { get; }
ParameterInfo Parameter { get; }
Property Value
Type:   Online ParameterInfo
See Also
IParameterExpression Interface
IParameterExpression Members
PostSharp.Reflection.Syntax Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


ISwitchExpression Interface

ISwitchExpression Interface PostSharp Documentation
Expression that represent a switch (conditional statement with multiple branches).

Namespace: PostSharp.Reflection.Syntax
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
public interface ISwitchExpression : IExpression,
    ISyntaxElement
public interface ISwitchExpression : IExpression,
    ISyntaxElement
Remarks
This interface represents the MSIL switch statement (see   Online Switch), not the C#
                      statement. The main difference is that switch cases have no value: the value of a switch case is equal to
                      its position in the list of Targets.

See Also
ISwitchExpression Members
PostSharp.Reflection.Syntax Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


ISwitchExpression Members

ISwitchExpression Members PostSharp Documentation

The ISwitchExpression type exposes the following members.
Properties
 | Name | Description
Public property | Condition | Gets the condition expression.
Public property | ParentElement | Gets the parent element in the tree. (Inherited from ISyntaxElement.)
Public property | ParentMethodBody | Gets the parent method body. (Inherited from ISyntaxElement.)
Public property | ReturnType | Gets the type of the return value of the current expression, or Online Void if the expression does not return anything (i.e. for pure instructions, for instance a goto or throw instruction). (Inherited from IExpression.)
Public property | SyntaxElementKind | Gets the kind of syntax element. (Inherited from ISyntaxElement.)
Public property | Targets | Gets the list of target blocks.
Back to Top
See Also
ISwitchExpression Interface
PostSharp.Reflection.Syntax Namespace

Online Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


ISwitchExpression Properties

ISwitchExpression Properties PostSharp Documentation
The ISwitchExpression type exposes the following members.
Properties
 | Name | Description
Public property | Condition | Gets the condition expression.
Public property | ParentElement | Gets the parent element in the tree. (Inherited from ISyntaxElement.)
Public property | ParentMethodBody | Gets the parent method body. (Inherited from ISyntaxElement.)
Public property | ReturnType | Gets the type of the return value of the current expression, or Online Void if the expression does not return anything (i.e. for pure instructions, for instance a goto or throw instruction). (Inherited from IExpression.)
Public property | SyntaxElementKind | Gets the kind of syntax element. (Inherited from ISyntaxElement.)
Public property | Targets | Gets the list of target blocks.
Back to Top
See Also
ISwitchExpression Interface
PostSharp.Reflection.Syntax Namespace

Online Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


ISwitchExpression.Condition Property

ISwitchExpression Condition Property PostSharp Documentation
Gets the condition expression.

Namespace: PostSharp.Reflection.Syntax
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
IExpression Condition { get; }
IExpression Condition { get; }
Property Value
Type: IExpression
See Also
ISwitchExpression Interface
ISwitchExpression Members
PostSharp.Reflection.Syntax Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


ISwitchExpression.Targets Property

ISwitchExpression Targets Property PostSharp Documentation
Gets the list of target blocks.

Namespace: PostSharp.Reflection.Syntax
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
IList<IExpression> Targets { get; }
IList<IExpression> Targets { get; }
Property Value
Type:   Online IList  IExpression
See Also
ISwitchExpression Interface
ISwitchExpression Members
PostSharp.Reflection.Syntax Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


ISyntaxElement Interface

ISyntaxElement Interface PostSharp Documentation
Represents an element of the syntax tree representing a method body.

Namespace: PostSharp.Reflection.Syntax
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
public interface ISyntaxElement
public interface ISyntaxElement
See Also
ISyntaxElement Members
PostSharp.Reflection.Syntax Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


ISyntaxElement Members

ISyntaxElement Members PostSharp Documentation

The ISyntaxElement type exposes the following members.
Properties
 | Name | Description
Public property | ParentElement | Gets the parent element in the tree.
Public property | ParentMethodBody | Gets the parent method body.
Public property | SyntaxElementKind | Gets the kind of syntax element.
Back to Top
See Also
ISyntaxElement Interface
PostSharp.Reflection.Syntax Namespace

Online Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


ISyntaxElement Properties

ISyntaxElement Properties PostSharp Documentation
The ISyntaxElement type exposes the following members.
Properties
 | Name | Description
Public property | ParentElement | Gets the parent element in the tree.
Public property | ParentMethodBody | Gets the parent method body.
Public property | SyntaxElementKind | Gets the kind of syntax element.
Back to Top
See Also
ISyntaxElement Interface
PostSharp.Reflection.Syntax Namespace

Online Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


ISyntaxElement.ParentElement Property

ISyntaxElement ParentElement Property PostSharp Documentation
Gets the parent element in the tree.

Namespace: PostSharp.Reflection.Syntax
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
ISyntaxElement ParentElement { get; }
ISyntaxElement ParentElement { get; }
Property Value
Type: ISyntaxElement
See Also
ISyntaxElement Interface
ISyntaxElement Members
PostSharp.Reflection.Syntax Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


ISyntaxElement.ParentMethodBody Property

ISyntaxElement ParentMethodBody Property PostSharp Documentation
Gets the parent method body.

Namespace: PostSharp.Reflection.Syntax
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
ISyntaxMethodBody ParentMethodBody { get; }
ISyntaxMethodBody ParentMethodBody { get; }
Property Value
Type: ISyntaxMethodBody
See Also
ISyntaxElement Interface
ISyntaxElement Members
PostSharp.Reflection.Syntax Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


ISyntaxElement.SyntaxElementKind Property

ISyntaxElement SyntaxElementKind Property PostSharp Documentation
Gets the kind of syntax element.

Namespace: PostSharp.Reflection.Syntax
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
SyntaxElementKind SyntaxElementKind { get; }
SyntaxElementKind SyntaxElementKind { get; }
Property Value
Type: SyntaxElementKind
See Also
ISyntaxElement Interface
ISyntaxElement Members
PostSharp.Reflection.Syntax Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


ISyntaxExceptionHandler Interface

ISyntaxExceptionHandler Interface PostSharp Documentation
Represents an exception handler (either catch, finally or filter) attached to a block.

Namespace: PostSharp.Reflection.Syntax
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
public interface ISyntaxExceptionHandler : ISyntaxElement
public interface ISyntaxExceptionHandler : ISyntaxElement
See Also
ISyntaxExceptionHandler Members
PostSharp.Reflection.Syntax Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


ISyntaxExceptionHandler Members

ISyntaxExceptionHandler Members PostSharp Documentation

The ISyntaxExceptionHandler type exposes the following members.
Properties
 | Name | Description
Public property | ExceptionType | Gets the type of handled exception, or null if all exceptions are handled.
Public property | FilterBlock | Gets the exception filtering block, or null if all exceptions are handled.
Public property | FilterLocalVariable | Gets the local variable containing the exception in the FilterBlock.
Public property | HandlerBlock | Gets the exception handling block.
Public property | HandlerLocalVariable | Gets the local variable containing the exception in the HandlerBlock.
Public property | ParentElement | Gets the parent element in the tree. (Inherited from ISyntaxElement.)
Public property | ParentMethodBody | Gets the parent method body. (Inherited from ISyntaxElement.)
Public property | SyntaxElementKind | Gets the kind of syntax element. (Inherited from ISyntaxElement.)
Back to Top
See Also
ISyntaxExceptionHandler Interface
PostSharp.Reflection.Syntax Namespace

Online Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


ISyntaxExceptionHandler Properties

ISyntaxExceptionHandler Properties PostSharp Documentation
The ISyntaxExceptionHandler type exposes the following members.
Properties
 | Name | Description
Public property | ExceptionType | Gets the type of handled exception, or null if all exceptions are handled.
Public property | FilterBlock | Gets the exception filtering block, or null if all exceptions are handled.
Public property | FilterLocalVariable | Gets the local variable containing the exception in the FilterBlock.
Public property | HandlerBlock | Gets the exception handling block.
Public property | HandlerLocalVariable | Gets the local variable containing the exception in the HandlerBlock.
Public property | ParentElement | Gets the parent element in the tree. (Inherited from ISyntaxElement.)
Public property | ParentMethodBody | Gets the parent method body. (Inherited from ISyntaxElement.)
Public property | SyntaxElementKind | Gets the kind of syntax element. (Inherited from ISyntaxElement.)
Back to Top
See Also
ISyntaxExceptionHandler Interface
PostSharp.Reflection.Syntax Namespace

Online Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


ISyntaxExceptionHandler.ExceptionType Property

ISyntaxExceptionHandler ExceptionType Property PostSharp Documentation
Gets the type of handled exception, or null if all exceptions are handled.

Namespace: PostSharp.Reflection.Syntax
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
Type ExceptionType { get; }
Type ExceptionType { get; }
Property Value
Type:   Online Type
See Also
ISyntaxExceptionHandler Interface
ISyntaxExceptionHandler Members
PostSharp.Reflection.Syntax Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


ISyntaxExceptionHandler.FilterBlock Property

ISyntaxExceptionHandler FilterBlock Property PostSharp Documentation
Gets the exception filtering block, or null if all exceptions are handled.

Namespace: PostSharp.Reflection.Syntax
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
IBlockExpression FilterBlock { get; }
IBlockExpression FilterBlock { get; }
Property Value
Type: IBlockExpression
See Also
ISyntaxExceptionHandler Interface
ISyntaxExceptionHandler Members
PostSharp.Reflection.Syntax Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


ISyntaxExceptionHandler.FilterLocalVariable Property

ISyntaxExceptionHandler FilterLocalVariable Property PostSharp Documentation
Gets the local variable containing the exception in the FilterBlock.

Namespace: PostSharp.Reflection.Syntax
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
ISyntaxLocalVariable FilterLocalVariable { get; }
ISyntaxLocalVariable FilterLocalVariable { get; }
Property Value
Type: ISyntaxLocalVariable
See Also
ISyntaxExceptionHandler Interface
ISyntaxExceptionHandler Members
PostSharp.Reflection.Syntax Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


ISyntaxExceptionHandler.HandlerBlock Property

ISyntaxExceptionHandler HandlerBlock Property PostSharp Documentation
Gets the exception handling block.

Namespace: PostSharp.Reflection.Syntax
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
IBlockExpression HandlerBlock { get; }
IBlockExpression HandlerBlock { get; }
Property Value
Type: IBlockExpression
See Also
ISyntaxExceptionHandler Interface
ISyntaxExceptionHandler Members
PostSharp.Reflection.Syntax Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


ISyntaxExceptionHandler.HandlerLocalVariable Property

ISyntaxExceptionHandler HandlerLocalVariable Property PostSharp Documentation
Gets the local variable containing the exception in the HandlerBlock.

Namespace: PostSharp.Reflection.Syntax
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
ISyntaxLocalVariable HandlerLocalVariable { get; }
ISyntaxLocalVariable HandlerLocalVariable { get; }
Property Value
Type: ISyntaxLocalVariable
See Also
ISyntaxExceptionHandler Interface
ISyntaxExceptionHandler Members
PostSharp.Reflection.Syntax Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


ISyntaxLocalVariable Interface

ISyntaxLocalVariable Interface PostSharp Documentation
Expression that represents a local variable.

Namespace: PostSharp.Reflection.Syntax
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
public interface ISyntaxLocalVariable : ISyntaxElement
public interface ISyntaxLocalVariable : ISyntaxElement
Remarks
There are three kind of local variable, but consumers of this class should be oblivious to these kinds:
            local variables defined in user code, local variables introduced by the compiler, and pseudo-variables introduced
            by the AST decompiler to emulate the stack.
See Also
ISyntaxLocalVariable Members
PostSharp.Reflection.Syntax Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


ISyntaxLocalVariable Members

ISyntaxLocalVariable Members PostSharp Documentation

The ISyntaxLocalVariable type exposes the following members.
Properties
 | Name | Description
Public property | Name | Gets the name of the local variable.
Public property | ParentElement | Gets the parent element in the tree. (Inherited from ISyntaxElement.)
Public property | ParentMethodBody | Gets the parent method body. (Inherited from ISyntaxElement.)
Public property | Slot | Gets the ordinal of the local variable.
Public property | SyntaxElementKind | Gets the kind of syntax element. (Inherited from ISyntaxElement.)
Public property | VariableType | Gets the type of the local variable.
Back to Top
See Also
ISyntaxLocalVariable Interface
PostSharp.Reflection.Syntax Namespace

Online Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


ISyntaxLocalVariable Properties

ISyntaxLocalVariable Properties PostSharp Documentation
The ISyntaxLocalVariable type exposes the following members.
Properties
 | Name | Description
Public property | Name | Gets the name of the local variable.
Public property | ParentElement | Gets the parent element in the tree. (Inherited from ISyntaxElement.)
Public property | ParentMethodBody | Gets the parent method body. (Inherited from ISyntaxElement.)
Public property | Slot | Gets the ordinal of the local variable.
Public property | SyntaxElementKind | Gets the kind of syntax element. (Inherited from ISyntaxElement.)
Public property | VariableType | Gets the type of the local variable.
Back to Top
See Also
ISyntaxLocalVariable Interface
PostSharp.Reflection.Syntax Namespace

Online Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


ISyntaxLocalVariable.Name Property

ISyntaxLocalVariable Name Property PostSharp Documentation
Gets the name of the local variable.

Namespace: PostSharp.Reflection.Syntax
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
string Name { get; }
string Name { get; }
Property Value
Type:   Online String
See Also
ISyntaxLocalVariable Interface
ISyntaxLocalVariable Members
PostSharp.Reflection.Syntax Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


ISyntaxLocalVariable.Slot Property

ISyntaxLocalVariable Slot Property PostSharp Documentation
Gets the ordinal of the local variable.

Namespace: PostSharp.Reflection.Syntax
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
Nullable<int> Slot { get; }
Nullable<int> Slot { get; }
Property Value
Type:   Online Nullable    Online Int32
Remarks

            Several local variables may be assigned the same slot if they are used in different scopes.

See Also
ISyntaxLocalVariable Interface
ISyntaxLocalVariable Members
PostSharp.Reflection.Syntax Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


ISyntaxLocalVariable.VariableType Property

ISyntaxLocalVariable VariableType Property PostSharp Documentation
Gets the type of the local variable.

Namespace: PostSharp.Reflection.Syntax
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
Type VariableType { get; }
Type VariableType { get; }
Property Value
Type:   Online Type
See Also
ISyntaxLocalVariable Interface
ISyntaxLocalVariable Members
PostSharp.Reflection.Syntax Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


ISyntaxMethodBody Interface

ISyntaxMethodBody Interface PostSharp Documentation
Represents the body of a method.

Namespace: PostSharp.Reflection.Syntax
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
public interface ISyntaxMethodBody : ISyntaxElement
public interface ISyntaxMethodBody : ISyntaxElement
See Also
ISyntaxMethodBody Members
PostSharp.Reflection.Syntax Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


ISyntaxMethodBody Members

ISyntaxMethodBody Members PostSharp Documentation

The ISyntaxMethodBody type exposes the following members.
Properties
 | Name | Description
Public property | Method | Gets the method whose body is represented by the current object.
Public property | ParentElement | Gets the parent element in the tree. (Inherited from ISyntaxElement.)
Public property | ParentMethodBody | Gets the parent method body. (Inherited from ISyntaxElement.)
Public property | RootBlock | Gets the root instruction block of the method.
Public property | SyntaxElementKind | Gets the kind of syntax element. (Inherited from ISyntaxElement.)
Back to Top
See Also
ISyntaxMethodBody Interface
PostSharp.Reflection.Syntax Namespace

Online Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


ISyntaxMethodBody Properties

ISyntaxMethodBody Properties PostSharp Documentation
The ISyntaxMethodBody type exposes the following members.
Properties
 | Name | Description
Public property | Method | Gets the method whose body is represented by the current object.
Public property | ParentElement | Gets the parent element in the tree. (Inherited from ISyntaxElement.)
Public property | ParentMethodBody | Gets the parent method body. (Inherited from ISyntaxElement.)
Public property | RootBlock | Gets the root instruction block of the method.
Public property | SyntaxElementKind | Gets the kind of syntax element. (Inherited from ISyntaxElement.)
Back to Top
See Also
ISyntaxMethodBody Interface
PostSharp.Reflection.Syntax Namespace

Online Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


ISyntaxMethodBody.Method Property

ISyntaxMethodBody Method Property PostSharp Documentation
Gets the method whose body is represented by the current object.

Namespace: PostSharp.Reflection.Syntax
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
MethodBase Method { get; }
MethodBase Method { get; }
Property Value
Type:   Online MethodBase
See Also
ISyntaxMethodBody Interface
ISyntaxMethodBody Members
PostSharp.Reflection.Syntax Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


ISyntaxMethodBody.RootBlock Property

ISyntaxMethodBody RootBlock Property PostSharp Documentation
Gets the root instruction block of the method.

Namespace: PostSharp.Reflection.Syntax
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
IBlockExpression RootBlock { get; }
IBlockExpression RootBlock { get; }
Property Value
Type: IBlockExpression
See Also
ISyntaxMethodBody Interface
ISyntaxMethodBody Members
PostSharp.Reflection.Syntax Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


ISyntaxReflectionService Interface

ISyntaxReflectionService Interface PostSharp Documentation
Service that exposes the method GetMethodBody(MethodBase, SyntaxAbstractionLevel), which allows to decompile a method and get a AST representation.

Namespace: PostSharp.Reflection.Syntax
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
public interface ISyntaxReflectionService : IService
public interface ISyntaxReflectionService : IService
See Also
ISyntaxReflectionService Members
PostSharp.Reflection.Syntax Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


ISyntaxReflectionService Members

ISyntaxReflectionService Members PostSharp Documentation

The ISyntaxReflectionService type exposes the following members.
Methods
 | Name | Description
Public method | GetMethodBody | Decompiles a method and gets an AST representation of it.
Back to Top
See Also
ISyntaxReflectionService Interface
PostSharp.Reflection.Syntax Namespace

Online Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


ISyntaxReflectionService Methods

ISyntaxReflectionService Methods PostSharp Documentation
The ISyntaxReflectionService type exposes the following members.
Methods
 | Name | Description
Public method | GetMethodBody | Decompiles a method and gets an AST representation of it.
Back to Top
See Also
ISyntaxReflectionService Interface
PostSharp.Reflection.Syntax Namespace

Online Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


ISyntaxReflectionService.GetMethodBody Method

ISyntaxReflectionService GetMethodBody Method PostSharp Documentation
Decompiles a method and gets an AST representation of it.

Namespace: PostSharp.Reflection.Syntax
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
ISyntaxMethodBody GetMethodBody(
    MethodBase method,
    SyntaxAbstractionLevel abstractionLevel
)
ISyntaxMethodBody GetMethodBody(
    MethodBase method,
    SyntaxAbstractionLevel abstractionLevel
)
Parameters
method
Type:   Online System.Reflection MethodBase
The method to decompile.
abstractionLevel
Type: PostSharp.Reflection.Syntax SyntaxAbstractionLevel
The required level of abstraction and detail.
Return Value
Type: ISyntaxMethodBody
AST representing the method at the required level of abstraction and detail.
See Also
ISyntaxReflectionService Interface
ISyntaxReflectionService Members
PostSharp.Reflection.Syntax Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


IUnaryExpression Interface

IUnaryExpression Interface PostSharp Documentation
Represents an expression with a single operand.

Namespace: PostSharp.Reflection.Syntax
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
public interface IUnaryExpression : IExpression,
    ISyntaxElement
public interface IUnaryExpression : IExpression,
    ISyntaxElement
See Also
IUnaryExpression Members
PostSharp.Reflection.Syntax Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


IUnaryExpression Members

IUnaryExpression Members PostSharp Documentation

The IUnaryExpression type exposes the following members.
Properties
 | Name | Description
Public property | ParentElement | Gets the parent element in the tree. (Inherited from ISyntaxElement.)
Public property | ParentMethodBody | Gets the parent method body. (Inherited from ISyntaxElement.)
Public property | ReturnType | Gets the type of the return value of the current expression, or Online Void if the expression does not return anything (i.e. for pure instructions, for instance a goto or throw instruction). (Inherited from IExpression.)
Public property | SyntaxElementKind | Gets the kind of syntax element. (Inherited from ISyntaxElement.)
Public property | Value | Operand of the unary expression.
Back to Top
See Also
IUnaryExpression Interface
PostSharp.Reflection.Syntax Namespace

Online Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


IUnaryExpression Properties

IUnaryExpression Properties PostSharp Documentation
The IUnaryExpression type exposes the following members.
Properties
 | Name | Description
Public property | ParentElement | Gets the parent element in the tree. (Inherited from ISyntaxElement.)
Public property | ParentMethodBody | Gets the parent method body. (Inherited from ISyntaxElement.)
Public property | ReturnType | Gets the type of the return value of the current expression, or Online Void if the expression does not return anything (i.e. for pure instructions, for instance a goto or throw instruction). (Inherited from IExpression.)
Public property | SyntaxElementKind | Gets the kind of syntax element. (Inherited from ISyntaxElement.)
Public property | Value | Operand of the unary expression.
Back to Top
See Also
IUnaryExpression Interface
PostSharp.Reflection.Syntax Namespace

Online Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


IUnaryExpression.Value Property

IUnaryExpression Value Property PostSharp Documentation
Operand of the unary expression.

Namespace: PostSharp.Reflection.Syntax
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
IExpression Value { get; }
IExpression Value { get; }
Property Value
Type: IExpression
See Also
IUnaryExpression Interface
IUnaryExpression Members
PostSharp.Reflection.Syntax Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


IValueOfExpression Interface

IValueOfExpression Interface PostSharp Documentation
Expression that returns the value stored at an address. Equivalent to the C# keyword *.

Namespace: PostSharp.Reflection.Syntax
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
public interface IValueOfExpression : IUnaryExpression,
    IExpression, ISyntaxElement
public interface IValueOfExpression : IUnaryExpression,
    IExpression, ISyntaxElement
See Also
IValueOfExpression Members
PostSharp.Reflection.Syntax Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


IValueOfExpression Members

IValueOfExpression Members PostSharp Documentation

The IValueOfExpression type exposes the following members.
Properties
 | Name | Description
Public property | Alignment | Gets the alignment of the value at the address.
Public property | IsVolatile | Determines whether if the location at the address is volatile, i.e. if it can be changed by a different thread than the current one.
Public property | ParentElement | Gets the parent element in the tree. (Inherited from ISyntaxElement.)
Public property | ParentMethodBody | Gets the parent method body. (Inherited from ISyntaxElement.)
Public property | ReturnType | Gets the type of the return value of the current expression, or Online Void if the expression does not return anything (i.e. for pure instructions, for instance a goto or throw instruction). (Inherited from IExpression.)
Public property | SyntaxElementKind | Gets the kind of syntax element. (Inherited from ISyntaxElement.)
Public property | Value | Operand of the unary expression. (Inherited from IUnaryExpression.)
Back to Top
See Also
IValueOfExpression Interface
PostSharp.Reflection.Syntax Namespace

Online Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


IValueOfExpression Properties

IValueOfExpression Properties PostSharp Documentation
The IValueOfExpression type exposes the following members.
Properties
 | Name | Description
Public property | Alignment | Gets the alignment of the value at the address.
Public property | IsVolatile | Determines whether if the location at the address is volatile, i.e. if it can be changed by a different thread than the current one.
Public property | ParentElement | Gets the parent element in the tree. (Inherited from ISyntaxElement.)
Public property | ParentMethodBody | Gets the parent method body. (Inherited from ISyntaxElement.)
Public property | ReturnType | Gets the type of the return value of the current expression, or Online Void if the expression does not return anything (i.e. for pure instructions, for instance a goto or throw instruction). (Inherited from IExpression.)
Public property | SyntaxElementKind | Gets the kind of syntax element. (Inherited from ISyntaxElement.)
Public property | Value | Operand of the unary expression. (Inherited from IUnaryExpression.)
Back to Top
See Also
IValueOfExpression Interface
PostSharp.Reflection.Syntax Namespace

Online Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


IValueOfExpression.Alignment Property

IValueOfExpression Alignment Property PostSharp Documentation
Gets the alignment of the value at the address.

Namespace: PostSharp.Reflection.Syntax
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
AddressAlignment Alignment { get; }
AddressAlignment Alignment { get; }
Property Value
Type: AddressAlignment
See Also
IValueOfExpression Interface
IValueOfExpression Members
PostSharp.Reflection.Syntax Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


IValueOfExpression.IsVolatile Property

IValueOfExpression IsVolatile Property PostSharp Documentation
Determines whether if the location at the address is volatile, i.e. if it can be changed by a different thread than the current one.

Namespace: PostSharp.Reflection.Syntax
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
bool IsVolatile { get; }
bool IsVolatile { get; }
Property Value
Type:   Online Boolean
See Also
IValueOfExpression Interface
IValueOfExpression Members
PostSharp.Reflection.Syntax Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


IZeroaryExpression Interface

IZeroaryExpression Interface PostSharp Documentation
Expression with no operand.

Namespace: PostSharp.Reflection.Syntax
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
public interface IZeroaryExpression : IExpression,
    ISyntaxElement
public interface IZeroaryExpression : IExpression,
    ISyntaxElement
See Also
IZeroaryExpression Members
PostSharp.Reflection.Syntax Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


IZeroaryExpression Members

IZeroaryExpression Members PostSharp Documentation

The IZeroaryExpression type exposes the following members.
Properties
 | Name | Description
Public property | ParentElement | Gets the parent element in the tree. (Inherited from ISyntaxElement.)
Public property | ParentMethodBody | Gets the parent method body. (Inherited from ISyntaxElement.)
Public property | ReturnType | Gets the type of the return value of the current expression, or Online Void if the expression does not return anything (i.e. for pure instructions, for instance a goto or throw instruction). (Inherited from IExpression.)
Public property | SyntaxElementKind | Gets the kind of syntax element. (Inherited from ISyntaxElement.)
Back to Top
See Also
IZeroaryExpression Interface
PostSharp.Reflection.Syntax Namespace

Online Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


IZeroaryExpression Properties

IZeroaryExpression Properties PostSharp Documentation
The IZeroaryExpression type exposes the following members.
Properties
 | Name | Description
Public property | ParentElement | Gets the parent element in the tree. (Inherited from ISyntaxElement.)
Public property | ParentMethodBody | Gets the parent method body. (Inherited from ISyntaxElement.)
Public property | ReturnType | Gets the type of the return value of the current expression, or Online Void if the expression does not return anything (i.e. for pure instructions, for instance a goto or throw instruction). (Inherited from IExpression.)
Public property | SyntaxElementKind | Gets the kind of syntax element. (Inherited from ISyntaxElement.)
Back to Top
See Also
IZeroaryExpression Interface
PostSharp.Reflection.Syntax Namespace

Online Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


SyntaxAbstractionLevel Enumeration

SyntaxAbstractionLevel Enumeration PostSharp Documentation
Enumerates the level of abstraction and the level of details produced by the AST decompiler.

Namespace: PostSharp.Reflection.Syntax
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
public enum SyntaxAbstractionLevel
public enum SyntaxAbstractionLevel
Members
Member name | Value | Description
Structure | 0 | Returns only the block structure (exception handlers).
ExpressionTree | 1 | Returns the expression tree.
See Also
PostSharp.Reflection.Syntax Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


SyntaxElementKind Enumeration

SyntaxElementKind Enumeration PostSharp Documentation
Enumeration of kinds of syntax elements (ISyntaxElement).

Namespace: PostSharp.Reflection.Syntax
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
public enum SyntaxElementKind
public enum SyntaxElementKind
Members
Member name | Value | Description
Add | 0 | Addition (IBinaryExpression).
AddChecked | 1 | Addition with overflow checking (IBinaryExpression).
And | 2 | Bitwise And (IBinaryExpression).
ArrayIndex | 3 | Element of an array (IBinaryExpression where Left is the array and Right is the index).
ArrayLength | 4 | Lenght of an array (IUnaryExpression).
Assign | 5 | Assignment (IBinaryExpression).
Goto | 6 | Unconditional branch (IGotoExpression).
Variable | 7 | Local variable expression (ILocalVariableExpression).
Conditional | 8 | Conditional expression (IConditionalExpression).
Cast | 9 | Cast (IUnaryExpression where ReturnType is the destination type).
Divide | 10 | Division (IBinaryExpression).
LessThan | 11 | Less than (IBinaryExpression).
LessThanOrEqual | 12 | Less than or equal (IBinaryExpression).
Modulo | 13 | Modulo (IBinaryExpression).
MultiplyChecked | 14 | Multiply with overflow checking (IBinaryExpression).
Multiply | 15 | Multiply (IBinaryExpression).
GreaterThan | 16 | Greater than (IBinaryExpression).
GreaterThanOrEqual | 17 | Greated than (IBinaryExpression).
Substract | 18 | Substract (IBinaryExpression).
SubstractChecked | 19 | Substract with overflow checking (IBinaryExpression).
Parameter | 20 | Parameter (IParameterExpression).
This | 21 | Current object (this keyword in C#, IZeroaryExpression).
AddressOf | 22 | Referencing operator (& in C#, see IUnaryExpression).
Constant | 23 | Constant (IConstantExpression).
Equal | 24 | Equal (IBinaryExpression).
Not | 25 | Logical negation (IUnaryExpression).
Different | 26 | Different (IBinaryExpression).
ValueOf | 27 | Dereferencing operator (* in C#, see IUnaryExpression).
Or | 28 | Bitwise Or (IBinaryExpression).
Xor | 29 | Bitwise And (IBinaryExpression).
ShiftLeft | 30 | Bitwise shift to left (IBinaryExpression).
ShiftRight | 31 | Bitwise shit to right (IBinaryExpression).
Negate | 32 | Bitwise negation (IUnaryExpression).
SafeCast | 33 | Safe cast (IUnaryExpression where ReturnType is the destination type).
Unbox | 34 | Unbox (IUnaryExpression).
Throw | 35 | Throw exception (IUnaryExpression).
Field | 36 | Field (IFieldExpression).
Box | 37 | Box (IUnaryExpression).
NewArray | 38 | Create new array (INewArrayExpression).
TypedReferenceValue | 39 | Get value of typed reference (IUnaryExpression).
CheckFinite | 40 | Check that the value is finite (IUnaryExpression).
MakeTypedReference | 41 | Make typed reference (IUnaryExpression).
ArgumentList | 42 | Get argument list (IZeroaryExpression).
MethodPointer | 43 | Get pointer of method (IMethodPointerExpression).
LocalAlloc | 44 | Allocate on local stack (IUnaryExpression).
DefaultValue | 45 | Default value for given type (IMetadataExpression).
CopyBuffer | 46 | Copy buffer (ICopyBufferExpression).
InitBuffer | 47 | Initialize buffer (IInitBufferExpression).
LoadToken | 48 | Load metadata token (IMetadataExpression).
SizeOf | 49 | Size of type (IMetadataExpression).
TypedReferenceType | 50 | Get type of typed reference (IUnaryExpression).
ConvertChecked | 51 | Convert to integral type with overflow check (IUnaryExpression).
Convert | 52 | Convert to integral type (IUnaryExpression).
MethodCall | 53 | Method call (IMethodCallExpression).
Return | 54 | Return (IUnaryExpression).
NewObject | 55 | Creates new object (INewObjectExpression).
Switch | 56 | Switch (ISwitchExpression).
Block | 57 | Instruction block (IBlockExpression).
CatchHandler | 58 | Catch exception handler (ISyntaxExceptionHandler).
FilterHandler | 59 | Filter exception handler (ISyntaxExceptionHandler).
FinallyHandler | 60 | Finally exception handler (ISyntaxExceptionHandler).
MethodBody | 61 | Method body (ISyntaxMethodBody).
LocalVariableDefinition | 62 | Local variable definition (ISyntaxLocalVariable).
See Also
PostSharp.Reflection.Syntax Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


SyntaxTreeFormatter Class

SyntaxTreeFormatter Class PostSharp Documentation
Formats an ISyntaxElement to a textual representation, for debugging purposes.
Inheritance Hierarchy
Online System Object
PostSharp.Reflection.Syntax SyntaxTreeVisitor
PostSharp.Reflection.Syntax SyntaxTreeFormatter

Namespace: PostSharp.Reflection.Syntax
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
public class SyntaxTreeFormatter : SyntaxTreeVisitor
public class SyntaxTreeFormatter : SyntaxTreeVisitor
See Also
SyntaxTreeFormatter Members
PostSharp.Reflection.Syntax Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


SyntaxTreeFormatter Members

SyntaxTreeFormatter Members PostSharp Documentation

The SyntaxTreeFormatter type exposes the following members.
Constructors
 | Name | Description
Public method | SyntaxTreeFormatter | Initializes a new SyntaxTreeFormatter.
Back to Top
Methods
 | Name | Description
Public method | VisitAddressOfExpression | Visits an expression of type IAddressOfExpression and, recursively, all children elements. (Inherited from SyntaxTreeVisitor.)
Public method | VisitBinaryExpression | Visits an expression of type IBinaryExpression and, recursively, all children elements. (Overrides SyntaxTreeVisitor VisitBinaryExpression(IBinaryExpression).)
Public method | VisitBlockExpression | Visits an instruction block and, recursively, all syntax nodes. (Overrides SyntaxTreeVisitor VisitBlockExpression(IBlockExpression).)
Public method | VisitConditionalExpression | Visits an expression of type IUnaryExpression and, recursively, all children elements. (Overrides SyntaxTreeVisitor VisitConditionalExpression(IConditionalExpression).)
Public method | VisitConstantExpression | Visits an expression of type IGotoExpression. (Overrides SyntaxTreeVisitor VisitConstantExpression(IConstantExpression).)
Public method | VisitCopyBufferExpression | Visits an expression of type ICopyBufferExpression and, recursively, all children elements. (Overrides SyntaxTreeVisitor VisitCopyBufferExpression(ICopyBufferExpression).)
Public method | VisitExceptionHandler | Visits an exception handler and, recursively, the HandlerBlock and FilterBlock (if any). (Overrides SyntaxTreeVisitor VisitExceptionHandler(ISyntaxExceptionHandler).)
Public method | VisitFieldExpression | Visits an expression of type IFieldExpression. (Overrides SyntaxTreeVisitor VisitFieldExpression(IFieldExpression).)
Public method | VisitGotoExpression | Visits an expression of type IGotoExpression. (Overrides SyntaxTreeVisitor VisitGotoExpression(IGotoExpression).)
Public method | VisitInitBufferExpression | Visits an expression of type IInitBufferExpression and, recursively, all children elements. (Overrides SyntaxTreeVisitor VisitInitBufferExpression(IInitBufferExpression).)
Public method | VisitLocalVariable | Visits a local variable definition. (Inherited from SyntaxTreeVisitor.)
Public method | VisitMetadataExpression | Visits an expression of type IMetadataExpression. (Overrides SyntaxTreeVisitor VisitMetadataExpression(IMetadataExpression).)
Public method | VisitMethodBody | Visits a method body and, recursively, all syntax nodes. (Inherited from SyntaxTreeVisitor.)
Public method | VisitMethodCallExpression | Visits an expression of type IMethodCallExpression and, recursively, all children elements. (Overrides SyntaxTreeVisitor VisitMethodCallExpression(IMethodCallExpression).)
Public method | VisitMethodPointerExpression | Visits an expression of type IMethodPointerExpression and, recursively, all children elements. (Inherited from SyntaxTreeVisitor.)
Public method | VisitNewArrayExpression | Visits an expression of type INewArrayExpression and, recursively, all children elements. (Overrides SyntaxTreeVisitor VisitNewArrayExpression(INewArrayExpression).)
Public method | VisitNewObjectExpression | Visits an expression of type INewObjectExpression and, recursively, all children elements. (Inherited from SyntaxTreeVisitor.)
Public method | VisitParameterExpression | Visits an expression of type IParameterExpression. (Overrides SyntaxTreeVisitor VisitParameterExpression(IParameterExpression).)
Public method | VisitSwitchExpression | Visits an expression of type ISwitchExpression and, recursively, all children elements. (Overrides SyntaxTreeVisitor VisitSwitchExpression(ISwitchExpression).)
Public method | VisitSyntaxElement | Visits a syntax element and, recursively, all children elements. (Inherited from SyntaxTreeVisitor.)
Public method | VisitUnaryExpression | Visits an expression of type IUnaryExpression and, recursively, all children elements. (Overrides SyntaxTreeVisitor VisitUnaryExpression(IUnaryExpression).)
Public method | VisitValueOfExpression | Visits an expression of type IValueOfExpression and, recursively, all children elements. (Inherited from SyntaxTreeVisitor.)
Public method | VisitVariableExpression | Visits an expression of type ILocalVariableExpression. (Overrides SyntaxTreeVisitor VisitVariableExpression(ILocalVariableExpression).)
Public method | VisitZeroaryExpression | Visits an expression of type IZeroaryExpression. (Overrides SyntaxTreeVisitor VisitZeroaryExpression(IZeroaryExpression).)
Back to Top
See Also
SyntaxTreeFormatter Class
PostSharp.Reflection.Syntax Namespace

Online Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


SyntaxTreeFormatter Constructor

SyntaxTreeFormatter Constructor PostSharp Documentation
Initializes a new SyntaxTreeFormatter.

Namespace: PostSharp.Reflection.Syntax
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
public SyntaxTreeFormatter(
    TextWriter writer
)
public SyntaxTreeFormatter(
    TextWriter writer
)
Parameters
writer
Type:   Online System.IO TextWriter
A    Online TextWriter where the textual representation will be written.
See Also
SyntaxTreeFormatter Class
SyntaxTreeFormatter Members
PostSharp.Reflection.Syntax Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


SyntaxTreeFormatter Methods

SyntaxTreeFormatter Methods PostSharp Documentation
The SyntaxTreeFormatter type exposes the following members.
Methods
 | Name | Description
Public method | VisitAddressOfExpression | Visits an expression of type IAddressOfExpression and, recursively, all children elements. (Inherited from SyntaxTreeVisitor.)
Public method | VisitBinaryExpression | Visits an expression of type IBinaryExpression and, recursively, all children elements. (Overrides SyntaxTreeVisitor VisitBinaryExpression(IBinaryExpression).)
Public method | VisitBlockExpression | Visits an instruction block and, recursively, all syntax nodes. (Overrides SyntaxTreeVisitor VisitBlockExpression(IBlockExpression).)
Public method | VisitConditionalExpression | Visits an expression of type IUnaryExpression and, recursively, all children elements. (Overrides SyntaxTreeVisitor VisitConditionalExpression(IConditionalExpression).)
Public method | VisitConstantExpression | Visits an expression of type IGotoExpression. (Overrides SyntaxTreeVisitor VisitConstantExpression(IConstantExpression).)
Public method | VisitCopyBufferExpression | Visits an expression of type ICopyBufferExpression and, recursively, all children elements. (Overrides SyntaxTreeVisitor VisitCopyBufferExpression(ICopyBufferExpression).)
Public method | VisitExceptionHandler | Visits an exception handler and, recursively, the HandlerBlock and FilterBlock (if any). (Overrides SyntaxTreeVisitor VisitExceptionHandler(ISyntaxExceptionHandler).)
Public method | VisitFieldExpression | Visits an expression of type IFieldExpression. (Overrides SyntaxTreeVisitor VisitFieldExpression(IFieldExpression).)
Public method | VisitGotoExpression | Visits an expression of type IGotoExpression. (Overrides SyntaxTreeVisitor VisitGotoExpression(IGotoExpression).)
Public method | VisitInitBufferExpression | Visits an expression of type IInitBufferExpression and, recursively, all children elements. (Overrides SyntaxTreeVisitor VisitInitBufferExpression(IInitBufferExpression).)
Public method | VisitLocalVariable | Visits a local variable definition. (Inherited from SyntaxTreeVisitor.)
Public method | VisitMetadataExpression | Visits an expression of type IMetadataExpression. (Overrides SyntaxTreeVisitor VisitMetadataExpression(IMetadataExpression).)
Public method | VisitMethodBody | Visits a method body and, recursively, all syntax nodes. (Inherited from SyntaxTreeVisitor.)
Public method | VisitMethodCallExpression | Visits an expression of type IMethodCallExpression and, recursively, all children elements. (Overrides SyntaxTreeVisitor VisitMethodCallExpression(IMethodCallExpression).)
Public method | VisitMethodPointerExpression | Visits an expression of type IMethodPointerExpression and, recursively, all children elements. (Inherited from SyntaxTreeVisitor.)
Public method | VisitNewArrayExpression | Visits an expression of type INewArrayExpression and, recursively, all children elements. (Overrides SyntaxTreeVisitor VisitNewArrayExpression(INewArrayExpression).)
Public method | VisitNewObjectExpression | Visits an expression of type INewObjectExpression and, recursively, all children elements. (Inherited from SyntaxTreeVisitor.)
Public method | VisitParameterExpression | Visits an expression of type IParameterExpression. (Overrides SyntaxTreeVisitor VisitParameterExpression(IParameterExpression).)
Public method | VisitSwitchExpression | Visits an expression of type ISwitchExpression and, recursively, all children elements. (Overrides SyntaxTreeVisitor VisitSwitchExpression(ISwitchExpression).)
Public method | VisitSyntaxElement | Visits a syntax element and, recursively, all children elements. (Inherited from SyntaxTreeVisitor.)
Public method | VisitUnaryExpression | Visits an expression of type IUnaryExpression and, recursively, all children elements. (Overrides SyntaxTreeVisitor VisitUnaryExpression(IUnaryExpression).)
Public method | VisitValueOfExpression | Visits an expression of type IValueOfExpression and, recursively, all children elements. (Inherited from SyntaxTreeVisitor.)
Public method | VisitVariableExpression | Visits an expression of type ILocalVariableExpression. (Overrides SyntaxTreeVisitor VisitVariableExpression(ILocalVariableExpression).)
Public method | VisitZeroaryExpression | Visits an expression of type IZeroaryExpression. (Overrides SyntaxTreeVisitor VisitZeroaryExpression(IZeroaryExpression).)
Back to Top
See Also
SyntaxTreeFormatter Class
PostSharp.Reflection.Syntax Namespace

Online Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


SyntaxTreeFormatter.VisitBinaryExpression Method

SyntaxTreeFormatter VisitBinaryExpression Method PostSharp Documentation
Visits an expression of type IBinaryExpression and, recursively, all children elements.

Namespace: PostSharp.Reflection.Syntax
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
public override Object VisitBinaryExpression(
    IBinaryExpression expression
)
public override Object VisitBinaryExpression(
    IBinaryExpression expression
)
Parameters
expression
Type: PostSharp.Reflection.Syntax IBinaryExpression
The element to be visited.
Return Value
Type:   Online Object
[Missing <returns> documentation for "M:PostSharp.Reflection.Syntax.SyntaxTreeFormatter.VisitBinaryExpression(PostSharp.Reflection.Syntax.IBinaryExpression)"]
See Also
SyntaxTreeFormatter Class
SyntaxTreeFormatter Members
PostSharp.Reflection.Syntax Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


SyntaxTreeFormatter.VisitBlockExpression Method

SyntaxTreeFormatter VisitBlockExpression Method PostSharp Documentation
Visits an instruction block and, recursively, all syntax nodes.

Namespace: PostSharp.Reflection.Syntax
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
public override Object VisitBlockExpression(
    IBlockExpression instructionBlock
)
public override Object VisitBlockExpression(
    IBlockExpression instructionBlock
)
Parameters
instructionBlock
Type: PostSharp.Reflection.Syntax IBlockExpression
The method body to be visited.
Return Value
Type:   Online Object
instructionBlock, unless the override returns something else.
See Also
SyntaxTreeFormatter Class
SyntaxTreeFormatter Members
PostSharp.Reflection.Syntax Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


SyntaxTreeFormatter.VisitConditionalExpression Method

SyntaxTreeFormatter VisitConditionalExpression Method PostSharp Documentation
Visits an expression of type IUnaryExpression and, recursively, all children elements.

Namespace: PostSharp.Reflection.Syntax
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
public override Object VisitConditionalExpression(
    IConditionalExpression expression
)
public override Object VisitConditionalExpression(
    IConditionalExpression expression
)
Parameters
expression
Type: PostSharp.Reflection.Syntax IConditionalExpression
The element to be visited.
Return Value
Type:   Online Object
[Missing <returns> documentation for "M:PostSharp.Reflection.Syntax.SyntaxTreeFormatter.VisitConditionalExpression(PostSharp.Reflection.Syntax.IConditionalExpression)"]
See Also
SyntaxTreeFormatter Class
SyntaxTreeFormatter Members
PostSharp.Reflection.Syntax Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


SyntaxTreeFormatter.VisitConstantExpression Method

SyntaxTreeFormatter VisitConstantExpression Method PostSharp Documentation
Visits an expression of type IGotoExpression.

Namespace: PostSharp.Reflection.Syntax
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
public override Object VisitConstantExpression(
    IConstantExpression expression
)
public override Object VisitConstantExpression(
    IConstantExpression expression
)
Parameters
expression
Type: PostSharp.Reflection.Syntax IConstantExpression
The element to be visited.
Return Value
Type:   Online Object
[Missing <returns> documentation for "M:PostSharp.Reflection.Syntax.SyntaxTreeFormatter.VisitConstantExpression(PostSharp.Reflection.Syntax.IConstantExpression)"]
See Also
SyntaxTreeFormatter Class
SyntaxTreeFormatter Members
PostSharp.Reflection.Syntax Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


SyntaxTreeFormatter.VisitCopyBufferExpression Method

SyntaxTreeFormatter VisitCopyBufferExpression Method PostSharp Documentation
Visits an expression of type ICopyBufferExpression and, recursively, all children elements.

Namespace: PostSharp.Reflection.Syntax
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
public override Object VisitCopyBufferExpression(
    ICopyBufferExpression expression
)
public override Object VisitCopyBufferExpression(
    ICopyBufferExpression expression
)
Parameters
expression
Type: PostSharp.Reflection.Syntax ICopyBufferExpression
The element to be visited.
Return Value
Type:   Online Object
[Missing <returns> documentation for "M:PostSharp.Reflection.Syntax.SyntaxTreeFormatter.VisitCopyBufferExpression(PostSharp.Reflection.Syntax.ICopyBufferExpression)"]
See Also
SyntaxTreeFormatter Class
SyntaxTreeFormatter Members
PostSharp.Reflection.Syntax Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


SyntaxTreeFormatter.VisitExceptionHandler Method

SyntaxTreeFormatter VisitExceptionHandler Method PostSharp Documentation
Visits an exception handler and, recursively, the HandlerBlock and FilterBlock (if any).

Namespace: PostSharp.Reflection.Syntax
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
public override Object VisitExceptionHandler(
    ISyntaxExceptionHandler exceptionHandler
)
public override Object VisitExceptionHandler(
    ISyntaxExceptionHandler exceptionHandler
)
Parameters
exceptionHandler
Type: PostSharp.Reflection.Syntax ISyntaxExceptionHandler
The exception handler to be visited.
Return Value
Type:   Online Object
exceptionHandler, unless the override returns something else.
See Also
SyntaxTreeFormatter Class
SyntaxTreeFormatter Members
PostSharp.Reflection.Syntax Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


SyntaxTreeFormatter.VisitFieldExpression Method

SyntaxTreeFormatter VisitFieldExpression Method PostSharp Documentation
Visits an expression of type IFieldExpression.

Namespace: PostSharp.Reflection.Syntax
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
public override Object VisitFieldExpression(
    IFieldExpression expression
)
public override Object VisitFieldExpression(
    IFieldExpression expression
)
Parameters
expression
Type: PostSharp.Reflection.Syntax IFieldExpression
The element to be visited.
Return Value
Type:   Online Object
[Missing <returns> documentation for "M:PostSharp.Reflection.Syntax.SyntaxTreeFormatter.VisitFieldExpression(PostSharp.Reflection.Syntax.IFieldExpression)"]
See Also
SyntaxTreeFormatter Class
SyntaxTreeFormatter Members
PostSharp.Reflection.Syntax Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


SyntaxTreeFormatter.VisitGotoExpression Method

SyntaxTreeFormatter VisitGotoExpression Method PostSharp Documentation
Visits an expression of type IGotoExpression.

Namespace: PostSharp.Reflection.Syntax
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
public override Object VisitGotoExpression(
    IGotoExpression expression
)
public override Object VisitGotoExpression(
    IGotoExpression expression
)
Parameters
expression
Type: PostSharp.Reflection.Syntax IGotoExpression
The element to be visited.
Return Value
Type:   Online Object
expression, unless the override returns something else.
See Also
SyntaxTreeFormatter Class
SyntaxTreeFormatter Members
PostSharp.Reflection.Syntax Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


SyntaxTreeFormatter.VisitInitBufferExpression Method

SyntaxTreeFormatter VisitInitBufferExpression Method PostSharp Documentation
Visits an expression of type IInitBufferExpression and, recursively, all children elements.

Namespace: PostSharp.Reflection.Syntax
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
public override Object VisitInitBufferExpression(
    IInitBufferExpression expression
)
public override Object VisitInitBufferExpression(
    IInitBufferExpression expression
)
Parameters
expression
Type: PostSharp.Reflection.Syntax IInitBufferExpression
The element to be visited.
Return Value
Type:   Online Object
expression, unless the override returns something else.
See Also
SyntaxTreeFormatter Class
SyntaxTreeFormatter Members
PostSharp.Reflection.Syntax Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


SyntaxTreeFormatter.VisitMetadataExpression Method

SyntaxTreeFormatter VisitMetadataExpression Method PostSharp Documentation
Visits an expression of type IMetadataExpression.

Namespace: PostSharp.Reflection.Syntax
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
public override Object VisitMetadataExpression(
    IMetadataExpression expression
)
public override Object VisitMetadataExpression(
    IMetadataExpression expression
)
Parameters
expression
Type: PostSharp.Reflection.Syntax IMetadataExpression
The element to be visited.
Return Value
Type:   Online Object
expression, unless the override returns something else.
See Also
SyntaxTreeFormatter Class
SyntaxTreeFormatter Members
PostSharp.Reflection.Syntax Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


SyntaxTreeFormatter.VisitMethodCallExpression Method

SyntaxTreeFormatter VisitMethodCallExpression Method PostSharp Documentation
Visits an expression of type IMethodCallExpression and, recursively, all children elements.

Namespace: PostSharp.Reflection.Syntax
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
public override Object VisitMethodCallExpression(
    IMethodCallExpression expression
)
public override Object VisitMethodCallExpression(
    IMethodCallExpression expression
)
Parameters
expression
Type: PostSharp.Reflection.Syntax IMethodCallExpression
The element to be visited.
Return Value
Type:   Online Object
expression, unless the override returns something else.
See Also
SyntaxTreeFormatter Class
SyntaxTreeFormatter Members
PostSharp.Reflection.Syntax Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


SyntaxTreeFormatter.VisitNewArrayExpression Method

SyntaxTreeFormatter VisitNewArrayExpression Method PostSharp Documentation
Visits an expression of type INewArrayExpression and, recursively, all children elements.

Namespace: PostSharp.Reflection.Syntax
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
public override Object VisitNewArrayExpression(
    INewArrayExpression expression
)
public override Object VisitNewArrayExpression(
    INewArrayExpression expression
)
Parameters
expression
Type: PostSharp.Reflection.Syntax INewArrayExpression
The element to be visited.
Return Value
Type:   Online Object
expression, unless the override returns something else.
See Also
SyntaxTreeFormatter Class
SyntaxTreeFormatter Members
PostSharp.Reflection.Syntax Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


SyntaxTreeFormatter.VisitParameterExpression Method

SyntaxTreeFormatter VisitParameterExpression Method PostSharp Documentation
Visits an expression of type IParameterExpression.

Namespace: PostSharp.Reflection.Syntax
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
public override Object VisitParameterExpression(
    IParameterExpression expression
)
public override Object VisitParameterExpression(
    IParameterExpression expression
)
Parameters
expression
Type: PostSharp.Reflection.Syntax IParameterExpression
The element to be visited.
Return Value
Type:   Online Object
expression, unless the override returns something else.
See Also
SyntaxTreeFormatter Class
SyntaxTreeFormatter Members
PostSharp.Reflection.Syntax Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


SyntaxTreeFormatter.VisitSwitchExpression Method

SyntaxTreeFormatter VisitSwitchExpression Method PostSharp Documentation
Visits an expression of type ISwitchExpression and, recursively, all children elements.

Namespace: PostSharp.Reflection.Syntax
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
public override Object VisitSwitchExpression(
    ISwitchExpression expression
)
public override Object VisitSwitchExpression(
    ISwitchExpression expression
)
Parameters
expression
Type: PostSharp.Reflection.Syntax ISwitchExpression
The element to be visited.
Return Value
Type:   Online Object
expression, unless the override returns something else.
See Also
SyntaxTreeFormatter Class
SyntaxTreeFormatter Members
PostSharp.Reflection.Syntax Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


SyntaxTreeFormatter.VisitUnaryExpression Method

SyntaxTreeFormatter VisitUnaryExpression Method PostSharp Documentation
Visits an expression of type IUnaryExpression and, recursively, all children elements.

Namespace: PostSharp.Reflection.Syntax
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
public override Object VisitUnaryExpression(
    IUnaryExpression expression
)
public override Object VisitUnaryExpression(
    IUnaryExpression expression
)
Parameters
expression
Type: PostSharp.Reflection.Syntax IUnaryExpression
The element to be visited.
Return Value
Type:   Online Object
[Missing <returns> documentation for "M:PostSharp.Reflection.Syntax.SyntaxTreeFormatter.VisitUnaryExpression(PostSharp.Reflection.Syntax.IUnaryExpression)"]
See Also
SyntaxTreeFormatter Class
SyntaxTreeFormatter Members
PostSharp.Reflection.Syntax Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


SyntaxTreeFormatter.VisitVariableExpression Method

SyntaxTreeFormatter VisitVariableExpression Method PostSharp Documentation
Visits an expression of type ILocalVariableExpression.

Namespace: PostSharp.Reflection.Syntax
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
public override Object VisitVariableExpression(
    ILocalVariableExpression expression
)
public override Object VisitVariableExpression(
    ILocalVariableExpression expression
)
Parameters
expression
Type: PostSharp.Reflection.Syntax ILocalVariableExpression
The element to be visited.
Return Value
Type:   Online Object
expression, unless the override returns something else.
See Also
SyntaxTreeFormatter Class
SyntaxTreeFormatter Members
PostSharp.Reflection.Syntax Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


SyntaxTreeFormatter.VisitZeroaryExpression Method

SyntaxTreeFormatter VisitZeroaryExpression Method PostSharp Documentation
Visits an expression of type IZeroaryExpression.

Namespace: PostSharp.Reflection.Syntax
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
public override Object VisitZeroaryExpression(
    IZeroaryExpression expression
)
public override Object VisitZeroaryExpression(
    IZeroaryExpression expression
)
Parameters
expression
Type: PostSharp.Reflection.Syntax IZeroaryExpression
The element to be visited.
Return Value
Type:   Online Object
expression, unless the override returns something else.
See Also
SyntaxTreeFormatter Class
SyntaxTreeFormatter Members
PostSharp.Reflection.Syntax Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


SyntaxTreeVisitor Class

SyntaxTreeVisitor Class PostSharp Documentation
Abstract implementation of a visitor of method bodies (ISyntaxMethodBody and IExpression).
Inheritance Hierarchy
Online System Object
PostSharp.Reflection.Syntax SyntaxTreeVisitor
PostSharp.Reflection.Syntax SyntaxTreeFormatter

Namespace: PostSharp.Reflection.Syntax
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
public abstract class SyntaxTreeVisitor
public abstract class SyntaxTreeVisitor
Remarks

                    This class provides an abstract implementation, which only ensures that the proper visiting method
                    gets called for every node of the tree, without any other effect. Concrete implementations typically
                    override specific visiting methods, and call the base implementation to ensure that children nodes
                    are being processed too.

See Also
SyntaxTreeVisitor Members
PostSharp.Reflection.Syntax Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


SyntaxTreeVisitor Members

SyntaxTreeVisitor Members PostSharp Documentation

The SyntaxTreeVisitor type exposes the following members.
Constructors
 | Name | Description
Protected method | SyntaxTreeVisitor | Initializes a new instance of the SyntaxTreeVisitor class
Back to Top
Methods
 | Name | Description
Public method | VisitAddressOfExpression | Visits an expression of type IAddressOfExpression and, recursively, all children elements.
Public method | VisitBinaryExpression | Visits an expression of type IBinaryExpression and, recursively, all children elements.
Public method | VisitBlockExpression | Visits an instruction block and, recursively, all syntax nodes.
Public method | VisitConditionalExpression | Visits an expression of type IUnaryExpression and, recursively, all children elements.
Public method | VisitConstantExpression | Visits an expression of type IGotoExpression.
Public method | VisitCopyBufferExpression | Visits an expression of type ICopyBufferExpression and, recursively, all children elements.
Public method | VisitExceptionHandler | Visits an exception handler and, recursively, the HandlerBlock and FilterBlock (if any).
Public method | VisitFieldExpression | Visits an expression of type IFieldExpression.
Public method | VisitGotoExpression | Visits an expression of type IGotoExpression.
Public method | VisitInitBufferExpression | Visits an expression of type IInitBufferExpression and, recursively, all children elements.
Public method | VisitLocalVariable | Visits a local variable definition.
Public method | VisitMetadataExpression | Visits an expression of type IMetadataExpression.
Public method | VisitMethodBody | Visits a method body and, recursively, all syntax nodes.
Public method | VisitMethodCallExpression | Visits an expression of type IMethodCallExpression and, recursively, all children elements.
Public method | VisitMethodPointerExpression | Visits an expression of type IMethodPointerExpression and, recursively, all children elements.
Public method | VisitNewArrayExpression | Visits an expression of type INewArrayExpression and, recursively, all children elements.
Public method | VisitNewObjectExpression | Visits an expression of type INewObjectExpression and, recursively, all children elements.
Public method | VisitParameterExpression | Visits an expression of type IParameterExpression.
Public method | VisitSwitchExpression | Visits an expression of type ISwitchExpression and, recursively, all children elements.
Public method | VisitSyntaxElement | Visits a syntax element and, recursively, all children elements.
Public method | VisitUnaryExpression | Visits an expression of type IUnaryExpression and, recursively, all children elements.
Public method | VisitValueOfExpression | Visits an expression of type IValueOfExpression and, recursively, all children elements.
Public method | VisitVariableExpression | Visits an expression of type ILocalVariableExpression.
Public method | VisitZeroaryExpression | Visits an expression of type IZeroaryExpression.
Back to Top
See Also
SyntaxTreeVisitor Class
PostSharp.Reflection.Syntax Namespace

Online Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


SyntaxTreeVisitor Constructor

SyntaxTreeVisitor Constructor PostSharp Documentation
Initializes a new instance of the SyntaxTreeVisitor class

Namespace: PostSharp.Reflection.Syntax
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
protected SyntaxTreeVisitor()
protected SyntaxTreeVisitor()
See Also
SyntaxTreeVisitor Class
SyntaxTreeVisitor Members
PostSharp.Reflection.Syntax Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


SyntaxTreeVisitor Methods

SyntaxTreeVisitor Methods PostSharp Documentation
The SyntaxTreeVisitor type exposes the following members.
Methods
 | Name | Description
Public method | VisitAddressOfExpression | Visits an expression of type IAddressOfExpression and, recursively, all children elements.
Public method | VisitBinaryExpression | Visits an expression of type IBinaryExpression and, recursively, all children elements.
Public method | VisitBlockExpression | Visits an instruction block and, recursively, all syntax nodes.
Public method | VisitConditionalExpression | Visits an expression of type IUnaryExpression and, recursively, all children elements.
Public method | VisitConstantExpression | Visits an expression of type IGotoExpression.
Public method | VisitCopyBufferExpression | Visits an expression of type ICopyBufferExpression and, recursively, all children elements.
Public method | VisitExceptionHandler | Visits an exception handler and, recursively, the HandlerBlock and FilterBlock (if any).
Public method | VisitFieldExpression | Visits an expression of type IFieldExpression.
Public method | VisitGotoExpression | Visits an expression of type IGotoExpression.
Public method | VisitInitBufferExpression | Visits an expression of type IInitBufferExpression and, recursively, all children elements.
Public method | VisitLocalVariable | Visits a local variable definition.
Public method | VisitMetadataExpression | Visits an expression of type IMetadataExpression.
Public method | VisitMethodBody | Visits a method body and, recursively, all syntax nodes.
Public method | VisitMethodCallExpression | Visits an expression of type IMethodCallExpression and, recursively, all children elements.
Public method | VisitMethodPointerExpression | Visits an expression of type IMethodPointerExpression and, recursively, all children elements.
Public method | VisitNewArrayExpression | Visits an expression of type INewArrayExpression and, recursively, all children elements.
Public method | VisitNewObjectExpression | Visits an expression of type INewObjectExpression and, recursively, all children elements.
Public method | VisitParameterExpression | Visits an expression of type IParameterExpression.
Public method | VisitSwitchExpression | Visits an expression of type ISwitchExpression and, recursively, all children elements.
Public method | VisitSyntaxElement | Visits a syntax element and, recursively, all children elements.
Public method | VisitUnaryExpression | Visits an expression of type IUnaryExpression and, recursively, all children elements.
Public method | VisitValueOfExpression | Visits an expression of type IValueOfExpression and, recursively, all children elements.
Public method | VisitVariableExpression | Visits an expression of type ILocalVariableExpression.
Public method | VisitZeroaryExpression | Visits an expression of type IZeroaryExpression.
Back to Top
See Also
SyntaxTreeVisitor Class
PostSharp.Reflection.Syntax Namespace

Online Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


SyntaxTreeVisitor.VisitAddressOfExpression Method

SyntaxTreeVisitor VisitAddressOfExpression Method PostSharp Documentation
Visits an expression of type IAddressOfExpression and, recursively, all children elements.

Namespace: PostSharp.Reflection.Syntax
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
public virtual Object VisitAddressOfExpression(
    IAddressOfExpression expression
)
public virtual Object VisitAddressOfExpression(
    IAddressOfExpression expression
)
Parameters
expression
Type: PostSharp.Reflection.Syntax IAddressOfExpression
The element to be visited.
Return Value
Type:   Online Object
expression, unless the override returns something else.
See Also
SyntaxTreeVisitor Class
SyntaxTreeVisitor Members
PostSharp.Reflection.Syntax Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


SyntaxTreeVisitor.VisitBinaryExpression Method

SyntaxTreeVisitor VisitBinaryExpression Method PostSharp Documentation
Visits an expression of type IBinaryExpression and, recursively, all children elements.

Namespace: PostSharp.Reflection.Syntax
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
public virtual Object VisitBinaryExpression(
    IBinaryExpression expression
)
public virtual Object VisitBinaryExpression(
    IBinaryExpression expression
)
Parameters
expression
Type: PostSharp.Reflection.Syntax IBinaryExpression
The element to be visited.
Return Value
Type:   Online Object
[Missing <returns> documentation for "M:PostSharp.Reflection.Syntax.SyntaxTreeVisitor.VisitBinaryExpression(PostSharp.Reflection.Syntax.IBinaryExpression)"]
See Also
SyntaxTreeVisitor Class
SyntaxTreeVisitor Members
PostSharp.Reflection.Syntax Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


SyntaxTreeVisitor.VisitBlockExpression Method

SyntaxTreeVisitor VisitBlockExpression Method PostSharp Documentation
Visits an instruction block and, recursively, all syntax nodes.

Namespace: PostSharp.Reflection.Syntax
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
public virtual Object VisitBlockExpression(
    IBlockExpression instructionBlock
)
public virtual Object VisitBlockExpression(
    IBlockExpression instructionBlock
)
Parameters
instructionBlock
Type: PostSharp.Reflection.Syntax IBlockExpression
The method body to be visited.
Return Value
Type:   Online Object
instructionBlock, unless the override returns something else.
See Also
SyntaxTreeVisitor Class
SyntaxTreeVisitor Members
PostSharp.Reflection.Syntax Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


SyntaxTreeVisitor.VisitConditionalExpression Method

SyntaxTreeVisitor VisitConditionalExpression Method PostSharp Documentation
Visits an expression of type IUnaryExpression and, recursively, all children elements.

Namespace: PostSharp.Reflection.Syntax
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
public virtual Object VisitConditionalExpression(
    IConditionalExpression expression
)
public virtual Object VisitConditionalExpression(
    IConditionalExpression expression
)
Parameters
expression
Type: PostSharp.Reflection.Syntax IConditionalExpression
The element to be visited.
Return Value
Type:   Online Object
[Missing <returns> documentation for "M:PostSharp.Reflection.Syntax.SyntaxTreeVisitor.VisitConditionalExpression(PostSharp.Reflection.Syntax.IConditionalExpression)"]
See Also
SyntaxTreeVisitor Class
SyntaxTreeVisitor Members
PostSharp.Reflection.Syntax Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


SyntaxTreeVisitor.VisitConstantExpression Method

SyntaxTreeVisitor VisitConstantExpression Method PostSharp Documentation
Visits an expression of type IGotoExpression.

Namespace: PostSharp.Reflection.Syntax
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
public virtual Object VisitConstantExpression(
    IConstantExpression expression
)
public virtual Object VisitConstantExpression(
    IConstantExpression expression
)
Parameters
expression
Type: PostSharp.Reflection.Syntax IConstantExpression
The element to be visited.
Return Value
Type:   Online Object
[Missing <returns> documentation for "M:PostSharp.Reflection.Syntax.SyntaxTreeVisitor.VisitConstantExpression(PostSharp.Reflection.Syntax.IConstantExpression)"]
See Also
SyntaxTreeVisitor Class
SyntaxTreeVisitor Members
PostSharp.Reflection.Syntax Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


SyntaxTreeVisitor.VisitCopyBufferExpression Method

SyntaxTreeVisitor VisitCopyBufferExpression Method PostSharp Documentation
Visits an expression of type ICopyBufferExpression and, recursively, all children elements.

Namespace: PostSharp.Reflection.Syntax
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
public virtual Object VisitCopyBufferExpression(
    ICopyBufferExpression expression
)
public virtual Object VisitCopyBufferExpression(
    ICopyBufferExpression expression
)
Parameters
expression
Type: PostSharp.Reflection.Syntax ICopyBufferExpression
The element to be visited.
Return Value
Type:   Online Object
[Missing <returns> documentation for "M:PostSharp.Reflection.Syntax.SyntaxTreeVisitor.VisitCopyBufferExpression(PostSharp.Reflection.Syntax.ICopyBufferExpression)"]
See Also
SyntaxTreeVisitor Class
SyntaxTreeVisitor Members
PostSharp.Reflection.Syntax Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


SyntaxTreeVisitor.VisitExceptionHandler Method

SyntaxTreeVisitor VisitExceptionHandler Method PostSharp Documentation
Visits an exception handler and, recursively, the HandlerBlock and FilterBlock (if any).

Namespace: PostSharp.Reflection.Syntax
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
public virtual Object VisitExceptionHandler(
    ISyntaxExceptionHandler exceptionHandler
)
public virtual Object VisitExceptionHandler(
    ISyntaxExceptionHandler exceptionHandler
)
Parameters
exceptionHandler
Type: PostSharp.Reflection.Syntax ISyntaxExceptionHandler
The exception handler to be visited.
Return Value
Type:   Online Object
exceptionHandler, unless the override returns something else.
See Also
SyntaxTreeVisitor Class
SyntaxTreeVisitor Members
PostSharp.Reflection.Syntax Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


SyntaxTreeVisitor.VisitFieldExpression Method

SyntaxTreeVisitor VisitFieldExpression Method PostSharp Documentation
Visits an expression of type IFieldExpression.

Namespace: PostSharp.Reflection.Syntax
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
public virtual Object VisitFieldExpression(
    IFieldExpression expression
)
public virtual Object VisitFieldExpression(
    IFieldExpression expression
)
Parameters
expression
Type: PostSharp.Reflection.Syntax IFieldExpression
The element to be visited.
Return Value
Type:   Online Object
[Missing <returns> documentation for "M:PostSharp.Reflection.Syntax.SyntaxTreeVisitor.VisitFieldExpression(PostSharp.Reflection.Syntax.IFieldExpression)"]
See Also
SyntaxTreeVisitor Class
SyntaxTreeVisitor Members
PostSharp.Reflection.Syntax Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


SyntaxTreeVisitor.VisitGotoExpression Method

SyntaxTreeVisitor VisitGotoExpression Method PostSharp Documentation
Visits an expression of type IGotoExpression.

Namespace: PostSharp.Reflection.Syntax
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
public virtual Object VisitGotoExpression(
    IGotoExpression expression
)
public virtual Object VisitGotoExpression(
    IGotoExpression expression
)
Parameters
expression
Type: PostSharp.Reflection.Syntax IGotoExpression
The element to be visited.
Return Value
Type:   Online Object
expression, unless the override returns something else.
See Also
SyntaxTreeVisitor Class
SyntaxTreeVisitor Members
PostSharp.Reflection.Syntax Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


SyntaxTreeVisitor.VisitInitBufferExpression Method

SyntaxTreeVisitor VisitInitBufferExpression Method PostSharp Documentation
Visits an expression of type IInitBufferExpression and, recursively, all children elements.

Namespace: PostSharp.Reflection.Syntax
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
public virtual Object VisitInitBufferExpression(
    IInitBufferExpression expression
)
public virtual Object VisitInitBufferExpression(
    IInitBufferExpression expression
)
Parameters
expression
Type: PostSharp.Reflection.Syntax IInitBufferExpression
The element to be visited.
Return Value
Type:   Online Object
expression, unless the override returns something else.
See Also
SyntaxTreeVisitor Class
SyntaxTreeVisitor Members
PostSharp.Reflection.Syntax Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


SyntaxTreeVisitor.VisitLocalVariable Method

SyntaxTreeVisitor VisitLocalVariable Method PostSharp Documentation
Visits a local variable definition.

Namespace: PostSharp.Reflection.Syntax
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
public virtual Object VisitLocalVariable(
    ISyntaxLocalVariable localVariable
)
public virtual Object VisitLocalVariable(
    ISyntaxLocalVariable localVariable
)
Parameters
localVariable
Type: PostSharp.Reflection.Syntax ISyntaxLocalVariable
The local variavle to be visited.
Return Value
Type:   Online Object
localVariable, unless the override returns something else.
See Also
SyntaxTreeVisitor Class
SyntaxTreeVisitor Members
PostSharp.Reflection.Syntax Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


SyntaxTreeVisitor.VisitMetadataExpression Method

SyntaxTreeVisitor VisitMetadataExpression Method PostSharp Documentation
Visits an expression of type IMetadataExpression.

Namespace: PostSharp.Reflection.Syntax
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
public virtual Object VisitMetadataExpression(
    IMetadataExpression expression
)
public virtual Object VisitMetadataExpression(
    IMetadataExpression expression
)
Parameters
expression
Type: PostSharp.Reflection.Syntax IMetadataExpression
The element to be visited.
Return Value
Type:   Online Object
expression, unless the override returns something else.
See Also
SyntaxTreeVisitor Class
SyntaxTreeVisitor Members
PostSharp.Reflection.Syntax Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


SyntaxTreeVisitor.VisitMethodBody Method

SyntaxTreeVisitor VisitMethodBody Method PostSharp Documentation
Visits a method body and, recursively, all syntax nodes.

Namespace: PostSharp.Reflection.Syntax
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
public virtual Object VisitMethodBody(
    ISyntaxMethodBody methodBody
)
public virtual Object VisitMethodBody(
    ISyntaxMethodBody methodBody
)
Parameters
methodBody
Type: PostSharp.Reflection.Syntax ISyntaxMethodBody
The method body to be visited.
Return Value
Type:   Online Object
methodBody, unless the override returns something else.
See Also
SyntaxTreeVisitor Class
SyntaxTreeVisitor Members
PostSharp.Reflection.Syntax Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


SyntaxTreeVisitor.VisitMethodCallExpression Method

SyntaxTreeVisitor VisitMethodCallExpression Method PostSharp Documentation
Visits an expression of type IMethodCallExpression and, recursively, all children elements.

Namespace: PostSharp.Reflection.Syntax
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
public virtual Object VisitMethodCallExpression(
    IMethodCallExpression expression
)
public virtual Object VisitMethodCallExpression(
    IMethodCallExpression expression
)
Parameters
expression
Type: PostSharp.Reflection.Syntax IMethodCallExpression
The element to be visited.
Return Value
Type:   Online Object
expression, unless the override returns something else.
See Also
SyntaxTreeVisitor Class
SyntaxTreeVisitor Members
PostSharp.Reflection.Syntax Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


SyntaxTreeVisitor.VisitMethodPointerExpression Method

SyntaxTreeVisitor VisitMethodPointerExpression Method PostSharp Documentation
Visits an expression of type IMethodPointerExpression and, recursively, all children elements.

Namespace: PostSharp.Reflection.Syntax
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
public virtual Object VisitMethodPointerExpression(
    IMethodPointerExpression expression
)
public virtual Object VisitMethodPointerExpression(
    IMethodPointerExpression expression
)
Parameters
expression
Type: PostSharp.Reflection.Syntax IMethodPointerExpression
The element to be visited.
Return Value
Type:   Online Object
expression, unless the override returns something else.
See Also
SyntaxTreeVisitor Class
SyntaxTreeVisitor Members
PostSharp.Reflection.Syntax Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


SyntaxTreeVisitor.VisitNewArrayExpression Method

SyntaxTreeVisitor VisitNewArrayExpression Method PostSharp Documentation
Visits an expression of type INewArrayExpression and, recursively, all children elements.

Namespace: PostSharp.Reflection.Syntax
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
public virtual Object VisitNewArrayExpression(
    INewArrayExpression expression
)
public virtual Object VisitNewArrayExpression(
    INewArrayExpression expression
)
Parameters
expression
Type: PostSharp.Reflection.Syntax INewArrayExpression
The element to be visited.
Return Value
Type:   Online Object
expression, unless the override returns something else.
See Also
SyntaxTreeVisitor Class
SyntaxTreeVisitor Members
PostSharp.Reflection.Syntax Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


SyntaxTreeVisitor.VisitNewObjectExpression Method

SyntaxTreeVisitor VisitNewObjectExpression Method PostSharp Documentation
Visits an expression of type INewObjectExpression and, recursively, all children elements.

Namespace: PostSharp.Reflection.Syntax
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
public virtual Object VisitNewObjectExpression(
    INewObjectExpression expression
)
public virtual Object VisitNewObjectExpression(
    INewObjectExpression expression
)
Parameters
expression
Type: PostSharp.Reflection.Syntax INewObjectExpression
The element to be visited.
Return Value
Type:   Online Object
expression, unless the override returns something else.
See Also
SyntaxTreeVisitor Class
SyntaxTreeVisitor Members
PostSharp.Reflection.Syntax Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


SyntaxTreeVisitor.VisitParameterExpression Method

SyntaxTreeVisitor VisitParameterExpression Method PostSharp Documentation
Visits an expression of type IParameterExpression.

Namespace: PostSharp.Reflection.Syntax
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
public virtual Object VisitParameterExpression(
    IParameterExpression expression
)
public virtual Object VisitParameterExpression(
    IParameterExpression expression
)
Parameters
expression
Type: PostSharp.Reflection.Syntax IParameterExpression
The element to be visited.
Return Value
Type:   Online Object
expression, unless the override returns something else.
See Also
SyntaxTreeVisitor Class
SyntaxTreeVisitor Members
PostSharp.Reflection.Syntax Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


SyntaxTreeVisitor.VisitSwitchExpression Method

SyntaxTreeVisitor VisitSwitchExpression Method PostSharp Documentation
Visits an expression of type ISwitchExpression and, recursively, all children elements.

Namespace: PostSharp.Reflection.Syntax
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
public virtual Object VisitSwitchExpression(
    ISwitchExpression expression
)
public virtual Object VisitSwitchExpression(
    ISwitchExpression expression
)
Parameters
expression
Type: PostSharp.Reflection.Syntax ISwitchExpression
The element to be visited.
Return Value
Type:   Online Object
expression, unless the override returns something else.
See Also
SyntaxTreeVisitor Class
SyntaxTreeVisitor Members
PostSharp.Reflection.Syntax Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


SyntaxTreeVisitor.VisitSyntaxElement Method

SyntaxTreeVisitor VisitSyntaxElement Method PostSharp Documentation
Visits a syntax element and, recursively, all children elements.

Namespace: PostSharp.Reflection.Syntax
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
public virtual Object VisitSyntaxElement(
    ISyntaxElement syntaxElement
)
public virtual Object VisitSyntaxElement(
    ISyntaxElement syntaxElement
)
Parameters
syntaxElement
Type: PostSharp.Reflection.Syntax ISyntaxElement
The element to be visited.
Return Value
Type:   Online Object
syntaxElement, unless the override returns something else.
See Also
SyntaxTreeVisitor Class
SyntaxTreeVisitor Members
PostSharp.Reflection.Syntax Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


SyntaxTreeVisitor.VisitUnaryExpression Method

SyntaxTreeVisitor VisitUnaryExpression Method PostSharp Documentation
Visits an expression of type IUnaryExpression and, recursively, all children elements.

Namespace: PostSharp.Reflection.Syntax
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
public virtual Object VisitUnaryExpression(
    IUnaryExpression expression
)
public virtual Object VisitUnaryExpression(
    IUnaryExpression expression
)
Parameters
expression
Type: PostSharp.Reflection.Syntax IUnaryExpression
The element to be visited.
Return Value
Type:   Online Object
[Missing <returns> documentation for "M:PostSharp.Reflection.Syntax.SyntaxTreeVisitor.VisitUnaryExpression(PostSharp.Reflection.Syntax.IUnaryExpression)"]
See Also
SyntaxTreeVisitor Class
SyntaxTreeVisitor Members
PostSharp.Reflection.Syntax Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


SyntaxTreeVisitor.VisitValueOfExpression Method

SyntaxTreeVisitor VisitValueOfExpression Method PostSharp Documentation
Visits an expression of type IValueOfExpression and, recursively, all children elements.

Namespace: PostSharp.Reflection.Syntax
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
public virtual Object VisitValueOfExpression(
    IValueOfExpression expression
)
public virtual Object VisitValueOfExpression(
    IValueOfExpression expression
)
Parameters
expression
Type: PostSharp.Reflection.Syntax IValueOfExpression
The element to be visited.
Return Value
Type:   Online Object
expression, unless the override returns something else.
See Also
SyntaxTreeVisitor Class
SyntaxTreeVisitor Members
PostSharp.Reflection.Syntax Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


SyntaxTreeVisitor.VisitVariableExpression Method

SyntaxTreeVisitor VisitVariableExpression Method PostSharp Documentation
Visits an expression of type ILocalVariableExpression.

Namespace: PostSharp.Reflection.Syntax
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
public virtual Object VisitVariableExpression(
    ILocalVariableExpression expression
)
public virtual Object VisitVariableExpression(
    ILocalVariableExpression expression
)
Parameters
expression
Type: PostSharp.Reflection.Syntax ILocalVariableExpression
The element to be visited.
Return Value
Type:   Online Object
expression, unless the override returns something else.
See Also
SyntaxTreeVisitor Class
SyntaxTreeVisitor Members
PostSharp.Reflection.Syntax Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


SyntaxTreeVisitor.VisitZeroaryExpression Method

SyntaxTreeVisitor VisitZeroaryExpression Method PostSharp Documentation
Visits an expression of type IZeroaryExpression.

Namespace: PostSharp.Reflection.Syntax
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
public virtual Object VisitZeroaryExpression(
    IZeroaryExpression expression
)
public virtual Object VisitZeroaryExpression(
    IZeroaryExpression expression
)
Parameters
expression
Type: PostSharp.Reflection.Syntax IZeroaryExpression
The element to be visited.
Return Value
Type:   Online Object
expression, unless the override returns something else.
See Also
SyntaxTreeVisitor Class
SyntaxTreeVisitor Members
PostSharp.Reflection.Syntax Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


PostSharp.Serialization Namespace

PostSharp.Serialization Namespace PostSharp Documentation
The PostSharp.Serialization namespace implements a portable serializer.
Classes
 | Class | Description
Public class | ActivatorProvider |
Public class | ActivatorSecurityToken | Security token passed to the CreateInstance(Type, ActivatorSecurityToken) method of the IActivator interface.
Public class | ActivatorTypeAttribute | Custom attribute that, when applied to an assembly, points to a type in the assembly implementing IActivator.
Public class | ImportSerializerAttribute | Custom attribute that, when applied to a serializable type, specifies that the serializer of this type has a dependency on another serializer. The custom attribute can be applied at assembly level; it then applies to all serializable types in this assembly.
Public class | PNonSerializedAttribute | Custom attribute that, when applied to a field of a class annotated with PSerializableAttribute, specifies that this field should not be serialized.
Public class | PortableFormatter | A serializer designed to serialize the internal structure of types with support for cyclic object graphs. The PortableFormatter is very similar in function and design to the Online BinaryFormatter, but is supported on most platforms and does not require full trust. Both formatters have similar usage: Online SerializableAttribute is replaced by PSerializableAttribute and Online NonSerializedAttribute by PNonSerializedAttribute.
Public class | PortableSerializationBinder |
Public class | PortableSerializationException | Exception thrown by the PortableFormatter.
Public class | PSerializableAttribute | Custom attribute that, when applied to a type, causes PostSharp to generate a serializer for use by the PortableFormatter.
Public class | ReferenceTypeSerializer | Base serializer for all reference types.
Public class | SerializationServices | Provides some utility method for the current namespace.
Public class | SerializerAttribute | Custom attribute that, when applied to a type, specifies its serializer for use by the PortableFormatter.
Public class | SerializerFactoryProvider | Provides instances of the ISerializerFactory interface for object types that have been previously registered using AddSerializer(Type, Type).
Public class | ValueTypeSerializer T | Base serializer for all value types.
Structures
 | Structure | Description
Public structure | DottedString | Encapsulates dotted strings such as namespaces and type names, so their serialization by PortableFormatter can be optimized.
Interfaces
 | Interface | Description
Public interface | IActivator | Exposes a method CreateInstance(Type, ActivatorSecurityToken), which allows to create an instance of a type using the Online Activator facility.
Public interface | IArgumentsReader | Provides read access to the collection of deserialized arguments.
Public interface | IArgumentsWriter | Provides write access to a collection of arguments that need to be serialized.
Public interface | ISerializationCallback | Interface that can be implemented by serializable classes. It defines methos OnDeserialized and OnSerializing called during serialization.
Public interface | ISerializer | Defines the semantics of an object serializer.
Public interface | ISerializerFactory | Defines a method CreateSerializer(Type), which creates instances of the ISerializer interface for given object types.
Public interface | ISerializerFactoryProvider | Provides instances of the ISerializerFactory interface given the object type.

Online Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


ActivatorProvider Class

ActivatorProvider Class PostSharp Documentation

[Missing <summary> documentation for "T:PostSharp.Serialization.ActivatorProvider"]

Inheritance Hierarchy
Online System Object
PostSharp.Serialization ActivatorProvider

Namespace: PostSharp.Serialization
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
public sealed class ActivatorProvider
public sealed class ActivatorProvider
See Also
ActivatorProvider Members
PostSharp.Serialization Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


ActivatorProvider Members

ActivatorProvider Members PostSharp Documentation

The ActivatorProvider type exposes the following members.
Methods
 | Name | Description
Public method | GetActivator |
Back to Top
See Also
ActivatorProvider Class
PostSharp.Serialization Namespace

Online Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


ActivatorProvider Methods

ActivatorProvider Methods PostSharp Documentation
The ActivatorProvider type exposes the following members.
Methods
 | Name | Description
Public method | GetActivator |
Back to Top
See Also
ActivatorProvider Class
PostSharp.Serialization Namespace

Online Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


ActivatorProvider.GetActivator Method

ActivatorProvider GetActivator Method PostSharp Documentation

[Missing <summary> documentation for "M:PostSharp.Serialization.ActivatorProvider.GetActivator(System.Type)"]

Namespace: PostSharp.Serialization
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
public IActivator GetActivator(
    Type type
)
public IActivator GetActivator(
    Type type
)
Parameters
type
Type:   Online System Type
[Missing <param name="type"/> documentation for "M:PostSharp.Serialization.ActivatorProvider.GetActivator(System.Type)"]
Return Value
Type: IActivator
[Missing <returns> documentation for "M:PostSharp.Serialization.ActivatorProvider.GetActivator(System.Type)"]
See Also
ActivatorProvider Class
ActivatorProvider Members
PostSharp.Serialization Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


ActivatorSecurityToken Class

ActivatorSecurityToken Class PostSharp Documentation
Security token passed to the CreateInstance(Type, ActivatorSecurityToken) method of the IActivator interface.
Inheritance Hierarchy
Online System Object
PostSharp.Serialization ActivatorSecurityToken

Namespace: PostSharp.Serialization
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
public sealed class ActivatorSecurityToken
public sealed class ActivatorSecurityToken
See Also
PostSharp.Serialization Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


ActivatorTypeAttribute Class

ActivatorTypeAttribute Class PostSharp Documentation
Custom attribute that, when applied to an assembly, points to a type in the assembly implementing IActivator.
Inheritance Hierarchy
Online System Object
Online System Attribute
PostSharp.Serialization ActivatorTypeAttribute

Namespace: PostSharp.Serialization
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
public sealed class ActivatorTypeAttribute : Attribute
public sealed class ActivatorTypeAttribute : Attribute
See Also
ActivatorTypeAttribute Members
PostSharp.Serialization Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


ActivatorTypeAttribute Members

ActivatorTypeAttribute Members PostSharp Documentation

The ActivatorTypeAttribute type exposes the following members.
Constructors
 | Name | Description
Public method | ActivatorTypeAttribute | Initializes a new ActivatorTypeAttribute.
Back to Top
Properties
 | Name | Description
Public property | ActivatorType | Gets the activator type.
Back to Top
See Also
ActivatorTypeAttribute Class
PostSharp.Serialization Namespace

Online Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


ActivatorTypeAttribute Constructor

ActivatorTypeAttribute Constructor PostSharp Documentation
Initializes a new ActivatorTypeAttribute.

Namespace: PostSharp.Serialization
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
public ActivatorTypeAttribute(
    Type activatorType
)
public ActivatorTypeAttribute(
    Type activatorType
)
Parameters
activatorType
Type:   Online System Type
A type derived from IActivator in the current assembly. This type must be public and have
            a default constructor.
See Also
ActivatorTypeAttribute Class
ActivatorTypeAttribute Members
PostSharp.Serialization Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


ActivatorTypeAttribute Properties

ActivatorTypeAttribute Properties PostSharp Documentation
The ActivatorTypeAttribute type exposes the following members.
Properties
 | Name | Description
Public property | ActivatorType | Gets the activator type.
Back to Top
See Also
ActivatorTypeAttribute Class
PostSharp.Serialization Namespace

Online Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


ActivatorTypeAttribute.ActivatorType Property

ActivatorTypeAttribute ActivatorType Property PostSharp Documentation
Gets the activator type.

Namespace: PostSharp.Serialization
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
public Type ActivatorType { get; private set; }
public Type ActivatorType { get; private set; }
Property Value
Type:   Online Type
See Also
ActivatorTypeAttribute Class
ActivatorTypeAttribute Members
PostSharp.Serialization Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


DottedString Structure

DottedString Structure PostSharp Documentation
Encapsulates dotted strings such as namespaces and type names, so their serialization by PortableFormatter can be optimized.

Namespace: PostSharp.Serialization
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
public struct DottedString : IEquatable<DottedString>
public struct DottedString : IEquatable<DottedString>
See Also
DottedString Members
PostSharp.Serialization Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


DottedString Members

DottedString Members PostSharp Documentation

The DottedString type exposes the following members.
Constructors
 | Name | Description
Public method | DottedString | Initializes a new DottedString.
Back to Top
Methods
 | Name | Description
Public method | Equals(Object) | Indicates whether this instance and a specified object are equal. (Overrides Online ValueType Equals(Object).)
Public method | Equals(DottedString) | Determines whether the currentDottedString is equal to another one.
Public method | GetHashCode | Returns the hash code for this instance. (Overrides Online ValueType GetHashCode .)
Public method | ToString | Returns the fully qualified type name of this instance. (Overrides Online ValueType ToString .)
Back to Top
Operators
Name | Description
(String to DottedString) | Converts a Online String into a DottedString.
(DottedString to String) | Converts a DottedString into a Online String.
Back to Top
Fields
Name | Description
Null | Gets an instance of DottedString representing a null string.
Back to Top
Properties
 | Name | Description
Public property | IsNull | Determines whether the current DottedString represents a null string.
Public property | Value | Gets the string encapsulated by the current DottedString.
Back to Top
See Also
DottedString Structure
PostSharp.Serialization Namespace

Online Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


DottedString Constructor

DottedString Constructor PostSharp Documentation
Initializes a new DottedString.

Namespace: PostSharp.Serialization
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
public DottedString(
    string value
)
public DottedString(
    string value
)
Parameters
value
Type:   Online System String
Value.
See Also
DottedString Structure
DottedString Members
PostSharp.Serialization Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


DottedString Fields

DottedString Fields PostSharp Documentation
The DottedString type exposes the following members.
Fields
Name | Description
Null | Gets an instance of DottedString representing a null string.
Back to Top
See Also
DottedString Structure
PostSharp.Serialization Namespace

Online Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


DottedString.Null Field

DottedString Null Field PostSharp Documentation
Gets an instance of DottedString representing a null string.

Namespace: PostSharp.Serialization
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
public static readonly DottedString Null
public static readonly DottedString Null
Field Value
Type: DottedString
See Also
DottedString Structure
DottedString Members
PostSharp.Serialization Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


DottedString Methods

DottedString Methods PostSharp Documentation
The DottedString type exposes the following members.
Methods
 | Name | Description
Public method | Equals(Object) | Indicates whether this instance and a specified object are equal. (Overrides Online ValueType Equals(Object).)
Public method | Equals(DottedString) | Determines whether the currentDottedString is equal to another one.
Public method | GetHashCode | Returns the hash code for this instance. (Overrides Online ValueType GetHashCode .)
Public method | ToString | Returns the fully qualified type name of this instance. (Overrides Online ValueType ToString .)
Back to Top
See Also
DottedString Structure
PostSharp.Serialization Namespace

Online Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


DottedString.Equals Method

DottedString Equals Method PostSharp Documentation
Overload List
 | Name | Description
Public method | Equals(Object) | Indicates whether this instance and a specified object are equal. (Overrides Online ValueType Equals(Object).)
Public method | Equals(DottedString) | Determines whether the currentDottedString is equal to another one.
Back to Top
See Also
DottedString Structure
DottedString Members
PostSharp.Serialization Namespace

Online Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


DottedString.Equals Method (Object)

DottedString Equals Method (Object) PostSharp Documentation
Indicates whether this instance and a specified object are equal.

Namespace: PostSharp.Serialization
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
public override bool Equals(
    Object obj
)
public override bool Equals(
    Object obj
)
Parameters
obj
Type:   Online System Object
Another object to compare to.
Return Value
Type:   Online Boolean
true if obj and this instance are the same type and represent the same value; otherwise, false.
See Also
DottedString Structure
DottedString Members
Equals Overload
PostSharp.Serialization Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


DottedString.Equals Method (DottedString)

DottedString Equals Method (DottedString) PostSharp Documentation
Determines whether the currentDottedString is equal to another one.

Namespace: PostSharp.Serialization
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
public bool Equals(
    DottedString other
)
public bool Equals(
    DottedString other
)
Parameters
other
Type: PostSharp.Serialization DottedString
Another [!:other].
Return Value
Type:   Online Boolean
true if the current DottedString equals other, otherwise false.
Implements
  Online IEquatable T  Equals(T)
See Also
DottedString Structure
DottedString Members
Equals Overload
PostSharp.Serialization Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


DottedString.GetHashCode Method

DottedString GetHashCode Method PostSharp Documentation
Returns the hash code for this instance.

Namespace: PostSharp.Serialization
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
public override int GetHashCode()
public override int GetHashCode()
Return Value
Type:   Online Int32
A 32-bit signed integer that is the hash code for this instance.
See Also
DottedString Structure
DottedString Members
PostSharp.Serialization Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


DottedString.ToString Method

DottedString ToString Method PostSharp Documentation
Returns the fully qualified type name of this instance.

Namespace: PostSharp.Serialization
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
public override string ToString()
public override string ToString()
Return Value
Type:   Online String
A   Online String containing a fully qualified type name.
See Also
DottedString Structure
DottedString Members
PostSharp.Serialization Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


DottedString Type Conversions

DottedString Type Conversions PostSharp Documentation
Operators
Name | Description
(String to DottedString) | Converts a Online String into a DottedString.
(DottedString to String) | Converts a DottedString into a Online String.
Back to Top
See Also
DottedString Structure
PostSharp.Serialization Namespace

Online Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


DottedString Implicit Conversion Operators

DottedString Conversion Operators PostSharp Documentation
Overload List
Name | Description
(String to DottedString) | Converts a Online String into a DottedString.
(DottedString to String) | Converts a DottedString into a Online String.
Back to Top
See Also
DottedString Structure
DottedString Members
PostSharp.Serialization Namespace

Online Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


DottedString Implicit Conversion (String to DottedString)

DottedString Conversion (String to DottedString) PostSharp Documentation
Converts a Online String into a DottedString.

Namespace: PostSharp.Serialization
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
public static implicit operator DottedString (
    string str
)
public static implicit operator DottedString (
    string str
)
Parameters
str
Type:   Online System String
A   Online String.
Return Value
Type: DottedString
A DottedString encapsulating str.
See Also
DottedString Structure
DottedString Members
  Overload
PostSharp.Serialization Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


DottedString Implicit Conversion (DottedString to String)

DottedString Conversion (DottedString to String) PostSharp Documentation
Converts a DottedString into a Online String.

Namespace: PostSharp.Serialization
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
public static implicit operator string (
    DottedString dottedString
)
public static implicit operator string (
    DottedString dottedString
)
Parameters
dottedString
Type: PostSharp.Serialization DottedString
A DottedString.
Return Value
Type:   Online String
The   Online String encapsulated by dottedString.
See Also
DottedString Structure
DottedString Members
  Overload
PostSharp.Serialization Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


DottedString Properties

DottedString Properties PostSharp Documentation
The DottedString type exposes the following members.
Properties
 | Name | Description
Public property | IsNull | Determines whether the current DottedString represents a null string.
Public property | Value | Gets the string encapsulated by the current DottedString.
Back to Top
See Also
DottedString Structure
PostSharp.Serialization Namespace

Online Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


DottedString.IsNull Property

DottedString IsNull Property PostSharp Documentation
Determines whether the current DottedString represents a null string.

Namespace: PostSharp.Serialization
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
public bool IsNull { get; }
public bool IsNull { get; }
Property Value
Type:   Online Boolean
See Also
DottedString Structure
DottedString Members
PostSharp.Serialization Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


DottedString.Value Property

DottedString Value Property PostSharp Documentation
Gets the string encapsulated by the current DottedString.

Namespace: PostSharp.Serialization
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
public string Value { get; }
public string Value { get; }
Property Value
Type:   Online String
See Also
DottedString Structure
DottedString Members
PostSharp.Serialization Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


IActivator Interface

IActivator Interface PostSharp Documentation
Exposes a method CreateInstance(Type, ActivatorSecurityToken), which allows to create an instance of a type using the Online Activator facility.

Namespace: PostSharp.Serialization
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
public interface IActivator
public interface IActivator
Remarks
PostSharp generates implementations of this interface in each assembly that contains serializable classes. It allows
            to create objects in the security context of this assembly (instead of from the security context of PostSharp.dll).
See Also
IActivator Members
PostSharp.Serialization Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


IActivator Members

IActivator Members PostSharp Documentation

The IActivator type exposes the following members.
Methods
 | Name | Description
Public method | CreateInstance | Creates an instance of a give type.
Back to Top
See Also
IActivator Interface
PostSharp.Serialization Namespace

Online Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


IActivator Methods

IActivator Methods PostSharp Documentation
The IActivator type exposes the following members.
Methods
 | Name | Description
Public method | CreateInstance | Creates an instance of a give type.
Back to Top
See Also
IActivator Interface
PostSharp.Serialization Namespace

Online Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


IActivator.CreateInstance Method

IActivator CreateInstance Method PostSharp Documentation
Creates an instance of a give type.

Namespace: PostSharp.Serialization
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
Object CreateInstance(
    Type objectType,
    ActivatorSecurityToken securityToken
)
Object CreateInstance(
    Type objectType,
    ActivatorSecurityToken securityToken
)
Parameters
objectType
Type:   Online System Type
Type of object whose an instance is requested.
securityToken
Type: PostSharp.Serialization ActivatorSecurityToken
A security token.
Return Value
Type:   Online Object
A new instance of type objectType.
Remarks
For security reasons, implementations should throw an exception or return null if securityToken is nuill.
See Also
IActivator Interface
IActivator Members
PostSharp.Serialization Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


IArgumentsReader Interface

IArgumentsReader Interface PostSharp Documentation
Provides read access to the collection of deserialized arguments.

Namespace: PostSharp.Serialization
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
public interface IArgumentsReader
public interface IArgumentsReader
See Also
IArgumentsReader Members
PostSharp.Serialization Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


IArgumentsReader Members

IArgumentsReader Members PostSharp Documentation

The IArgumentsReader type exposes the following members.
Methods
 | Name | Description
Public method | GetValue T | Reads a value from the collection, and throws an exception if the value does not exist.
Public method | TryGetValue T | Attempts to read a value from the collection, and does not throw an exception if the value does not exist.
Back to Top
Properties
 | Name | Description
Public property | MetadataDispenser | When deserializing PostSharp aspects, gets the IMetadataDispenser corresponding to the MetadataEmitter used at build time.
Back to Top
See Also
IArgumentsReader Interface
PostSharp.Serialization Namespace

Online Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


IArgumentsReader Methods

IArgumentsReader Methods PostSharp Documentation
The IArgumentsReader type exposes the following members.
Methods
 | Name | Description
Public method | GetValue T | Reads a value from the collection, and throws an exception if the value does not exist.
Public method | TryGetValue T | Attempts to read a value from the collection, and does not throw an exception if the value does not exist.
Back to Top
See Also
IArgumentsReader Interface
PostSharp.Serialization Namespace

Online Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


IArgumentsReader.GetValue(T) Method

IArgumentsReader GetValue T Method PostSharp Documentation
Reads a value from the collection, and throws an exception if the value does not exist.

Namespace: PostSharp.Serialization
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
T GetValue<T>(
    string name,
    string scope = null
)
T GetValue<T>(
    string name,
    string scope = null
)
Parameters
name
Type:   Online System String
Argument name.
scope (Optional)
Type:   Online System String
An optional prefix of name, similar to a namespace.
Type Parameters
T
Value type.
Return Value
Type: T
The value of the argument named name in the given optional [!:scope].
See Also
IArgumentsReader Interface
IArgumentsReader Members
PostSharp.Serialization Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


IArgumentsReader.TryGetValue(T) Method

IArgumentsReader TryGetValue T Method PostSharp Documentation
Attempts to read a value from the collection, and does not throw an exception if the value does not exist.

Namespace: PostSharp.Serialization
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
bool TryGetValue<T>(
    string name,
    out T value,
    string scope = null
)
bool TryGetValue<T>(
    string name,
    out T value,
    string scope = null
)
Parameters
name
Type:   Online System String
Argument name.
value
Type: T
At output, set to the value of the argument named name in the given optional [!:scope].
scope (Optional)
Type:   Online System String
An optional prefix of name, similar to a namespace.
Type Parameters
T
Value type.
Return Value
Type:   Online Boolean
true if the value is defined, otherwise false.
See Also
IArgumentsReader Interface
IArgumentsReader Members
PostSharp.Serialization Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


IArgumentsReader Properties

IArgumentsReader Properties PostSharp Documentation
The IArgumentsReader type exposes the following members.
Properties
 | Name | Description
Public property | MetadataDispenser | When deserializing PostSharp aspects, gets the IMetadataDispenser corresponding to the MetadataEmitter used at build time.
Back to Top
See Also
IArgumentsReader Interface
PostSharp.Serialization Namespace

Online Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


IArgumentsReader.MetadataDispenser Property

IArgumentsReader MetadataDispenser Property PostSharp Documentation
When deserializing PostSharp aspects, gets the IMetadataDispenser corresponding to the MetadataEmitter used at build time.

Namespace: PostSharp.Serialization
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
IMetadataDispenser MetadataDispenser { get; }
IMetadataDispenser MetadataDispenser { get; }
Property Value
Type: IMetadataDispenser
See Also
IArgumentsReader Interface
IArgumentsReader Members
PostSharp.Serialization Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


IArgumentsWriter Interface

IArgumentsWriter Interface PostSharp Documentation
Provides write access to a collection of arguments that need to be serialized.

Namespace: PostSharp.Serialization
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
public interface IArgumentsWriter
public interface IArgumentsWriter
See Also
IArgumentsWriter Members
PostSharp.Serialization Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


IArgumentsWriter Members

IArgumentsWriter Members PostSharp Documentation

The IArgumentsWriter type exposes the following members.
Methods
 | Name | Description
Public method | SetValue | Sets the value of an argument.
Back to Top
Properties
 | Name | Description
Public property | MetadataEmitter | When serializing PostSharp access, gets a facility that can be used to serialize metadata (System.Reflection) objects as MSIL, therefore making them transparent to obfuscation.
Back to Top
See Also
IArgumentsWriter Interface
PostSharp.Serialization Namespace

Online Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


IArgumentsWriter Methods

IArgumentsWriter Methods PostSharp Documentation
The IArgumentsWriter type exposes the following members.
Methods
 | Name | Description
Public method | SetValue | Sets the value of an argument.
Back to Top
See Also
IArgumentsWriter Interface
PostSharp.Serialization Namespace

Online Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


IArgumentsWriter.SetValue Method

IArgumentsWriter SetValue Method PostSharp Documentation
Sets the value of an argument.

Namespace: PostSharp.Serialization
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
void SetValue(
    string name,
    Object value,
    string scope = null
)
void SetValue(
    string name,
    Object value,
    string scope = null
)
Parameters
name
Type:   Online System String
Argument name.
value
Type:   Online System Object
Argument value. The value can be null or must be serializable.
scope (Optional)
Type:   Online System String
An optional prefix of name, similar to a namespace.
See Also
IArgumentsWriter Interface
IArgumentsWriter Members
PostSharp.Serialization Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


IArgumentsWriter Properties

IArgumentsWriter Properties PostSharp Documentation
The IArgumentsWriter type exposes the following members.
Properties
 | Name | Description
Public property | MetadataEmitter | When serializing PostSharp access, gets a facility that can be used to serialize metadata (System.Reflection) objects as MSIL, therefore making them transparent to obfuscation.
Back to Top
See Also
IArgumentsWriter Interface
PostSharp.Serialization Namespace

Online Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


IArgumentsWriter.MetadataEmitter Property

IArgumentsWriter MetadataEmitter Property PostSharp Documentation
When serializing PostSharp access, gets a facility that can be used to serialize metadata (System.Reflection) objects as MSIL, therefore making them transparent to obfuscation.

Namespace: PostSharp.Serialization
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
IMetadataEmitter MetadataEmitter { get; }
IMetadataEmitter MetadataEmitter { get; }
Property Value
Type: IMetadataEmitter
See Also
IArgumentsWriter Interface
IArgumentsWriter Members
PostSharp.Serialization Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


ImportSerializerAttribute Class

ImportSerializerAttribute Class PostSharp Documentation
Custom attribute that, when applied to a serializable type, specifies that the serializer of this type has a dependency on another serializer. The custom attribute can be applied at assembly level; it then applies to all serializable types in this assembly.
Inheritance Hierarchy
Online System Object
Online System Attribute
PostSharp.Serialization ImportSerializerAttribute

Namespace: PostSharp.Serialization
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
public sealed class ImportSerializerAttribute : Attribute
public sealed class ImportSerializerAttribute : Attribute
Remarks
This custom attribute is useful to add serializers to types of third-party assemblies.
            For types whose you can modify the source code, it is preferable to use PSerializableAttribute or SerializerAttribute.

See Also
ImportSerializerAttribute Members
PostSharp.Serialization Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


ImportSerializerAttribute Members

ImportSerializerAttribute Members PostSharp Documentation

The ImportSerializerAttribute type exposes the following members.
Constructors
 | Name | Description
Public method | ImportSerializerAttribute | Initializes a new ImportSerializerAttribute.
Back to Top
Properties
 | Name | Description
Public property | ObjectType | Gets the type of the object to be made serializable
Public property | SerializerType | Gets the serializer type.
Back to Top
See Also
ImportSerializerAttribute Class
PostSharp.Serialization Namespace

Online Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


ImportSerializerAttribute Constructor

ImportSerializerAttribute Constructor PostSharp Documentation
Initializes a new ImportSerializerAttribute.

Namespace: PostSharp.Serialization
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
public ImportSerializerAttribute(
    Type objectType,
    Type serializerType
)
public ImportSerializerAttribute(
    Type objectType,
    Type serializerType
)
Parameters
objectType
Type:   Online System Type
Type of the object to be made serializable.
serializerType
Type:   Online System Type
Serializer type. This type must implement ISerializer or ISerializerFactory,
            and must have a public default constructor. If serializerType is a generic type, if must have the same number
            of generic type parameters as objectType, and have a compatible set of constraints.
See Also
ImportSerializerAttribute Class
ImportSerializerAttribute Members
PostSharp.Serialization Namespace
PostSharp.Serialization SerializerAttribute
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


ImportSerializerAttribute Properties

ImportSerializerAttribute Properties PostSharp Documentation
The ImportSerializerAttribute type exposes the following members.
Properties
 | Name | Description
Public property | ObjectType | Gets the type of the object to be made serializable
Public property | SerializerType | Gets the serializer type.
Back to Top
See Also
ImportSerializerAttribute Class
PostSharp.Serialization Namespace

Online Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


ImportSerializerAttribute.ObjectType Property

ImportSerializerAttribute ObjectType Property PostSharp Documentation
Gets the type of the object to be made serializable

Namespace: PostSharp.Serialization
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
public Type ObjectType { get; private set; }
public Type ObjectType { get; private set; }
Property Value
Type:   Online Type
See Also
ImportSerializerAttribute Class
ImportSerializerAttribute Members
PostSharp.Serialization Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


ImportSerializerAttribute.SerializerType Property

ImportSerializerAttribute SerializerType Property PostSharp Documentation
Gets the serializer type.

Namespace: PostSharp.Serialization
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
public Type SerializerType { get; private set; }
public Type SerializerType { get; private set; }
Property Value
Type:   Online Type
Remarks

            This type must implement ISerializer or ISerializerFactory,
            and must have a public default constructor. If SerializerType is a generic type, if must have the same number
            of generic type parameters as ObjectType, and have a compatible set of constraints.

See Also
ImportSerializerAttribute Class
ImportSerializerAttribute Members
PostSharp.Serialization Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


ISerializationCallback Interface

ISerializationCallback Interface PostSharp Documentation
Interface that can be implemented by serializable classes. It defines methos OnDeserialized and OnSerializing called during serialization.

Namespace: PostSharp.Serialization
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
public interface ISerializationCallback
public interface ISerializationCallback
See Also
ISerializationCallback Members
PostSharp.Serialization Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


ISerializationCallback Members

ISerializationCallback Members PostSharp Documentation

The ISerializationCallback type exposes the following members.
Methods
 | Name | Description
Public method | OnDeserialized | Method called after the object has been deserialized.
Public method | OnSerializing | Method called before the object is being serialized.
Back to Top
See Also
ISerializationCallback Interface
PostSharp.Serialization Namespace

Online Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


ISerializationCallback Methods

ISerializationCallback Methods PostSharp Documentation
The ISerializationCallback type exposes the following members.
Methods
 | Name | Description
Public method | OnDeserialized | Method called after the object has been deserialized.
Public method | OnSerializing | Method called before the object is being serialized.
Back to Top
See Also
ISerializationCallback Interface
PostSharp.Serialization Namespace

Online Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


ISerializationCallback.OnDeserialized Method

ISerializationCallback OnDeserialized Method PostSharp Documentation
Method called after the object has been deserialized.

Namespace: PostSharp.Serialization
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
void OnDeserialized()
void OnDeserialized()
See Also
ISerializationCallback Interface
ISerializationCallback Members
PostSharp.Serialization Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


ISerializationCallback.OnSerializing Method

ISerializationCallback OnSerializing Method PostSharp Documentation
Method called before the object is being serialized.

Namespace: PostSharp.Serialization
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
void OnSerializing()
void OnSerializing()
See Also
ISerializationCallback Interface
ISerializationCallback Members
PostSharp.Serialization Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


ISerializer Interface

ISerializer Interface PostSharp Documentation
Defines the semantics of an object serializer.

Namespace: PostSharp.Serialization
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
public interface ISerializer
public interface ISerializer
See Also
ISerializer Members
PostSharp.Serialization Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


ISerializer Members

ISerializer Members PostSharp Documentation

The ISerializer type exposes the following members.
Methods
 | Name | Description
Public method | Convert | Converts a value into a given target type.
Public method | CreateInstance | Creates an instance of the given type.
Public method | DeserializeFields | Completes the second phase of deserialization by setting fields and other properties.
Public method | SerializeObject | Serializes an object
Back to Top
Properties
 | Name | Description
Public property | IsTwoPhase | Determines whether DeserializeFields(Object , IArgumentsReader) should be invoked during deserialization. The value is false if CreateInstance(Type, IArgumentsReader) return fully created object, true otherwise.
Back to Top
See Also
ISerializer Interface
PostSharp.Serialization Namespace

Online Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


ISerializer Methods

ISerializer Methods PostSharp Documentation
The ISerializer type exposes the following members.
Methods
 | Name | Description
Public method | Convert | Converts a value into a given target type.
Public method | CreateInstance | Creates an instance of the given type.
Public method | DeserializeFields | Completes the second phase of deserialization by setting fields and other properties.
Public method | SerializeObject | Serializes an object
Back to Top
See Also
ISerializer Interface
PostSharp.Serialization Namespace

Online Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


ISerializer.Convert Method

ISerializer Convert Method PostSharp Documentation
Converts a value into a given target type.

Namespace: PostSharp.Serialization
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
Object Convert(
    Object value,
    Type targetType
)
Object Convert(
    Object value,
    Type targetType
)
Parameters
value
Type:   Online System Object
Value to be converted.
targetType
Type:   Online System Type
target type.
Return Value
Type:   Online Object
The value converted to targetType.
Remarks
This method allows for additional flexibility if the serialization-time type is
                        not equal to the deserialization-time time. The current method is invoked
            at deserialization time to perform the conversion.
See Also
ISerializer Interface
ISerializer Members
PostSharp.Serialization Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


ISerializer.CreateInstance Method

ISerializer CreateInstance Method PostSharp Documentation
Creates an instance of the given type.

Namespace: PostSharp.Serialization
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
Object CreateInstance(
    Type type,
    IArgumentsReader constructorArguments
)
Object CreateInstance(
    Type type,
    IArgumentsReader constructorArguments
)
Parameters
type
Type:   Online System Type
Type of the instance to be created.
constructorArguments
Type: PostSharp.Serialization IArgumentsReader
Gives access to arguments required to create the instance.
Return Value
Type:   Online Object
An instance of type type initialized using constructorArguments.
Remarks
This method is invoked during deserialization. If IsTwoPhase is true, the DeserializeFields(Object , IArgumentsReader)
                method is called later to complete deserialization.
See Also
ISerializer Interface
ISerializer Members
PostSharp.Serialization Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


ISerializer.DeserializeFields Method

ISerializer DeserializeFields Method PostSharp Documentation
Completes the second phase of deserialization by setting fields and other properties.

Namespace: PostSharp.Serialization
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
void DeserializeFields(
    ref Object obj,
    IArgumentsReader initializationArguments
)
void DeserializeFields(
    ref Object obj,
    IArgumentsReader initializationArguments
)
Parameters
obj
Type:   Online System Object
The object being deserialized.
initializationArguments
Type: PostSharp.Serialization IArgumentsReader
Gives access to field values.
Remarks
This method is only invoked if IsTwoPhase is true.
See Also
ISerializer Interface
ISerializer Members
PostSharp.Serialization Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


ISerializer.SerializeObject Method

ISerializer SerializeObject Method PostSharp Documentation
Serializes an object

Namespace: PostSharp.Serialization
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
void SerializeObject(
    Object obj,
    IArgumentsWriter constructorArguments,
    IArgumentsWriter initializationArguments
)
void SerializeObject(
    Object obj,
    IArgumentsWriter constructorArguments,
    IArgumentsWriter initializationArguments
)
Parameters
obj
Type:   Online System Object
[Missing <param name="obj"/> documentation for "M:PostSharp.Serialization.ISerializer.SerializeObject(System.Object,PostSharp.Serialization.IArgumentsWriter,PostSharp.Serialization.IArgumentsWriter)"]
constructorArguments
Type: PostSharp.Serialization IArgumentsWriter
Gives access to arguments that will be passed to the CreateInstance(Type, IArgumentsReader) method during deserialization.
initializationArguments
Type: PostSharp.Serialization IArgumentsWriter
Gives access to arguments that will be passed to the DeserializeFields(Object , IArgumentsReader) method during deserialization.
See Also
ISerializer Interface
ISerializer Members
PostSharp.Serialization Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


ISerializer Properties

ISerializer Properties PostSharp Documentation
The ISerializer type exposes the following members.
Properties
 | Name | Description
Public property | IsTwoPhase | Determines whether DeserializeFields(Object , IArgumentsReader) should be invoked during deserialization. The value is false if CreateInstance(Type, IArgumentsReader) return fully created object, true otherwise.
Back to Top
See Also
ISerializer Interface
PostSharp.Serialization Namespace

Online Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


ISerializer.IsTwoPhase Property

ISerializer IsTwoPhase Property PostSharp Documentation
Determines whether DeserializeFields(Object , IArgumentsReader) should be invoked during deserialization. The value is false if CreateInstance(Type, IArgumentsReader) return fully created object, true otherwise.

Namespace: PostSharp.Serialization
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
bool IsTwoPhase { get; }
bool IsTwoPhase { get; }
Property Value
Type:   Online Boolean
See Also
ISerializer Interface
ISerializer Members
PostSharp.Serialization Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


ISerializerFactory Interface

ISerializerFactory Interface PostSharp Documentation
Defines a method CreateSerializer(Type), which creates instances of the ISerializer interface for given object types.

Namespace: PostSharp.Serialization
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
public interface ISerializerFactory
public interface ISerializerFactory
See Also
ISerializerFactory Members
PostSharp.Serialization Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


ISerializerFactory Members

ISerializerFactory Members PostSharp Documentation

The ISerializerFactory type exposes the following members.
Methods
 | Name | Description
Public method | CreateSerializer | Creates an instance of the ISerializer interface for a given object type.
Back to Top
See Also
ISerializerFactory Interface
PostSharp.Serialization Namespace

Online Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


ISerializerFactory Methods

ISerializerFactory Methods PostSharp Documentation
The ISerializerFactory type exposes the following members.
Methods
 | Name | Description
Public method | CreateSerializer | Creates an instance of the ISerializer interface for a given object type.
Back to Top
See Also
ISerializerFactory Interface
PostSharp.Serialization Namespace

Online Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


ISerializerFactory.CreateSerializer Method

ISerializerFactory CreateSerializer Method PostSharp Documentation
Creates an instance of the ISerializer interface for a given object type.

Namespace: PostSharp.Serialization
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
ISerializer CreateSerializer(
    Type objectType
)
ISerializer CreateSerializer(
    Type objectType
)
Parameters
objectType
Type:   Online System Type
Type of object being serialized or deserialized.
Return Value
Type: ISerializer
A new instance implementing the ISerializer interface.
See Also
ISerializerFactory Interface
ISerializerFactory Members
PostSharp.Serialization Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


ISerializerFactoryProvider Interface

ISerializerFactoryProvider Interface PostSharp Documentation
Provides instances of the ISerializerFactory interface given the object type.

Namespace: PostSharp.Serialization
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
public interface ISerializerFactoryProvider
public interface ISerializerFactoryProvider
See Also
ISerializerFactoryProvider Members
PostSharp.Serialization Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


ISerializerFactoryProvider Members

ISerializerFactoryProvider Members PostSharp Documentation

The ISerializerFactoryProvider type exposes the following members.
Methods
 | Name | Description
Public method | GetSerializerFactory | Gets the instance of ISerializerFactory
Public method | GetSurrogateType | Gets the surrogate type for a given object type.
Back to Top
Properties
 | Name | Description
Public property | NextProvider | Gets the next provider in the chain.
Back to Top
See Also
ISerializerFactoryProvider Interface
PostSharp.Serialization Namespace

Online Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


ISerializerFactoryProvider Methods

ISerializerFactoryProvider Methods PostSharp Documentation
The ISerializerFactoryProvider type exposes the following members.
Methods
 | Name | Description
Public method | GetSerializerFactory | Gets the instance of ISerializerFactory
Public method | GetSurrogateType | Gets the surrogate type for a given object type.
Back to Top
See Also
ISerializerFactoryProvider Interface
PostSharp.Serialization Namespace

Online Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


ISerializerFactoryProvider.GetSerializerFactory Method

ISerializerFactoryProvider GetSerializerFactory Method PostSharp Documentation
Gets the instance of ISerializerFactory

Namespace: PostSharp.Serialization
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
ISerializerFactory GetSerializerFactory(
    Type objectType
)
ISerializerFactory GetSerializerFactory(
    Type objectType
)
Parameters
objectType
Type:   Online System Type
Type of object being serialized or deserialized. If a surrogate type has been specified during serialization,
            this parameter is set to the surrogate type during deserialization.
Return Value
Type: ISerializerFactory
An instance of ISerializerFactory able to serialize or deserialize objectType, or null
            if there is no known serializer factory for this object.
Remarks
It is not the reponsibility of this class to call the next provider (NextProvider).
See Also
ISerializerFactoryProvider Interface
ISerializerFactoryProvider Members
PostSharp.Serialization Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


ISerializerFactoryProvider.GetSurrogateType Method

ISerializerFactoryProvider GetSurrogateType Method PostSharp Documentation
Gets the surrogate type for a given object type.

Namespace: PostSharp.Serialization
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
Type GetSurrogateType(
    Type objectType
)
Type GetSurrogateType(
    Type objectType
)
Parameters
objectType
Type:   Online System Type
Type of the object being serialized.
Return Value
Type:   Online Type
The surrogate type for objectType, or null (or objectType) is objectType
            does not require a surrogate type.
Remarks
This method is called only during serialization. The surrogate type is the type whose name will be serialized; therefore, it will also
                        be the type that will be deserialized.
It is not the reponsibility of this class to call the next provider (NextProvider).
See Also
ISerializerFactoryProvider Interface
ISerializerFactoryProvider Members
PostSharp.Serialization Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


ISerializerFactoryProvider Properties

ISerializerFactoryProvider Properties PostSharp Documentation
The ISerializerFactoryProvider type exposes the following members.
Properties
 | Name | Description
Public property | NextProvider | Gets the next provider in the chain.
Back to Top
See Also
ISerializerFactoryProvider Interface
PostSharp.Serialization Namespace

Online Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


ISerializerFactoryProvider.NextProvider Property

ISerializerFactoryProvider NextProvider Property PostSharp Documentation
Gets the next provider in the chain.

Namespace: PostSharp.Serialization
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
ISerializerFactoryProvider NextProvider { get; }
ISerializerFactoryProvider NextProvider { get; }
Property Value
Type: ISerializerFactoryProvider
See Also
ISerializerFactoryProvider Interface
ISerializerFactoryProvider Members
PostSharp.Serialization Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


PNonSerializedAttribute Class

PNonSerializedAttribute Class PostSharp Documentation
Custom attribute that, when applied to a field of a class annotated with PSerializableAttribute, specifies that this field should not be serialized.
Inheritance Hierarchy
Online System Object
Online System Attribute
PostSharp.Serialization PNonSerializedAttribute

Namespace: PostSharp.Serialization
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
public sealed class PNonSerializedAttribute : Attribute
public sealed class PNonSerializedAttribute : Attribute
See Also
PNonSerializedAttribute Members
PostSharp.Serialization Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


PNonSerializedAttribute Members

PNonSerializedAttribute Members PostSharp Documentation

The PNonSerializedAttribute type exposes the following members.
Constructors
 | Name | Description
Public method | PNonSerializedAttribute | Initializes a new instance of the PNonSerializedAttribute class
Back to Top
See Also
PNonSerializedAttribute Class
PostSharp.Serialization Namespace

Online Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


PNonSerializedAttribute Constructor

PNonSerializedAttribute Constructor PostSharp Documentation
Initializes a new instance of the PNonSerializedAttribute class

Namespace: PostSharp.Serialization
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
public PNonSerializedAttribute()
public PNonSerializedAttribute()
See Also
PNonSerializedAttribute Class
PNonSerializedAttribute Members
PostSharp.Serialization Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


PortableFormatter Class

PortableFormatter Class PostSharp Documentation
A serializer designed to serialize the internal structure of types with support for cyclic object graphs. The PortableFormatter is very similar in function and design to the Online BinaryFormatter, but is supported on most platforms and does not require full trust. Both formatters have similar usage: Online SerializableAttribute is replaced by PSerializableAttribute and Online NonSerializedAttribute by PNonSerializedAttribute.
Inheritance Hierarchy
Online System Object
PostSharp.Serialization PortableFormatter

Namespace: PostSharp.Serialization
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
public sealed class PortableFormatter
public sealed class PortableFormatter
See Also
PortableFormatter Members
PostSharp.Serialization Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


PortableFormatter Members

PortableFormatter Members PostSharp Documentation

The PortableFormatter type exposes the following members.
Constructors
 | Name | Description
Public method | PortableFormatter | Initializes a new PortableFormatter.
Back to Top
Methods
 | Name | Description
Public method | Deserialize | Deserializes a stream.
Public method | Serialize | Serializes an object (and the complete graph whose this object is the root) into a Online Stream.
Back to Top
Properties
 | Name | Description
Public property | MetadataDispenser | When deserializing PostSharp aspects, gets the IMetadataDispenser corresponding to the MetadataEmitter used at build time.
Public property | MetadataEmitter | When serializing PostSharp access, gets or sets a facility that can be used to serialize metadata (System.Reflection) objects as MSIL, therefore making them transparent to obfuscation.
Back to Top
See Also
PortableFormatter Class
PostSharp.Serialization Namespace

Online Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


PortableFormatter Constructor

PortableFormatter Constructor PostSharp Documentation
Initializes a new PortableFormatter.

Namespace: PostSharp.Serialization
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
public PortableFormatter(
    PortableSerializationBinder binder = null,
    ISerializerFactoryProvider serializerProvider = null
)
public PortableFormatter(
    PortableSerializationBinder binder = null,
    ISerializerFactoryProvider serializerProvider = null
)
Parameters
binder (Optional)
Type: PostSharp.Serialization PortableSerializationBinder
A PortableSerializationBinder customizing bindings between types and type names, or null to use the default implementation.
serializerProvider (Optional)
Type: PostSharp.Serialization ISerializerFactoryProvider
A custom implementation of ISerializerFactoryProvider, or null to use the default implementaiton.
See Also
PortableFormatter Class
PortableFormatter Members
PostSharp.Serialization Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


PortableFormatter Methods

PortableFormatter Methods PostSharp Documentation
The PortableFormatter type exposes the following members.
Methods
 | Name | Description
Public method | Deserialize | Deserializes a stream.
Public method | Serialize | Serializes an object (and the complete graph whose this object is the root) into a Online Stream.
Back to Top
See Also
PortableFormatter Class
PostSharp.Serialization Namespace

Online Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


PortableFormatter.Deserialize Method

PortableFormatter Deserialize Method PostSharp Documentation
Deserializes a stream.

Namespace: PostSharp.Serialization
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
public Object Deserialize(
    Stream stream
)
public Object Deserialize(
    Stream stream
)
Parameters
stream
Type:   Online System.IO Stream
A   Online Stream containing a serialized object graph.
Return Value
Type:   Online Object
The root object of the object graph serialized in stream.
See Also
PortableFormatter Class
PortableFormatter Members
PostSharp.Serialization Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


PortableFormatter.Serialize Method

PortableFormatter Serialize Method PostSharp Documentation
Serializes an object (and the complete graph whose this object is the root) into a Online Stream.

Namespace: PostSharp.Serialization
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
public void Serialize(
    Object obj,
    Stream stream
)
public void Serialize(
    Object obj,
    Stream stream
)
Parameters
obj
Type:   Online System Object
The object to serialize.
stream
Type:   Online System.IO Stream
The stream where obj needs to be serialized.
See Also
PortableFormatter Class
PortableFormatter Members
PostSharp.Serialization Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


PortableFormatter Properties

PortableFormatter Properties PostSharp Documentation
The PortableFormatter type exposes the following members.
Properties
 | Name | Description
Public property | MetadataDispenser | When deserializing PostSharp aspects, gets the IMetadataDispenser corresponding to the MetadataEmitter used at build time.
Public property | MetadataEmitter | When serializing PostSharp access, gets or sets a facility that can be used to serialize metadata (System.Reflection) objects as MSIL, therefore making them transparent to obfuscation.
Back to Top
See Also
PortableFormatter Class
PostSharp.Serialization Namespace

Online Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


PortableFormatter.MetadataDispenser Property

PortableFormatter MetadataDispenser Property PostSharp Documentation
When deserializing PostSharp aspects, gets the IMetadataDispenser corresponding to the MetadataEmitter used at build time.

Namespace: PostSharp.Serialization
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
public IMetadataDispenser MetadataDispenser { get; set; }
public IMetadataDispenser MetadataDispenser { get; set; }
Property Value
Type: IMetadataDispenser
See Also
PortableFormatter Class
PortableFormatter Members
PostSharp.Serialization Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


PortableFormatter.MetadataEmitter Property

PortableFormatter MetadataEmitter Property PostSharp Documentation
When serializing PostSharp access, gets or sets a facility that can be used to serialize metadata (System.Reflection) objects as MSIL, therefore making them transparent to obfuscation.

Namespace: PostSharp.Serialization
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
public IMetadataEmitter MetadataEmitter { get; set; }
public IMetadataEmitter MetadataEmitter { get; set; }
Property Value
Type: IMetadataEmitter
See Also
PortableFormatter Class
PortableFormatter Members
PostSharp.Serialization Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


PortableSerializationBinder Class

PortableSerializationBinder Class PostSharp Documentation

[Missing <summary> documentation for "T:PostSharp.Serialization.PortableSerializationBinder"]

Inheritance Hierarchy
Online System Object
PostSharp.Serialization PortableSerializationBinder

Namespace: PostSharp.Serialization
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
public class PortableSerializationBinder
public class PortableSerializationBinder
See Also
PortableSerializationBinder Members
PostSharp.Serialization Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


PortableSerializationBinder Members

PortableSerializationBinder Members PostSharp Documentation

The PortableSerializationBinder type exposes the following members.
Constructors
 | Name | Description
Public method | PortableSerializationBinder | Initializes a new instance of the PortableSerializationBinder class
Back to Top
Methods
 | Name | Description
Public method | BindToName |
Public method | BindToType |
Back to Top
See Also
PortableSerializationBinder Class
PostSharp.Serialization Namespace

Online Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


PortableSerializationBinder Constructor

PortableSerializationBinder Constructor PostSharp Documentation
Initializes a new instance of the PortableSerializationBinder class

Namespace: PostSharp.Serialization
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
public PortableSerializationBinder()
public PortableSerializationBinder()
See Also
PortableSerializationBinder Class
PortableSerializationBinder Members
PostSharp.Serialization Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


PortableSerializationBinder Methods

PortableSerializationBinder Methods PostSharp Documentation
The PortableSerializationBinder type exposes the following members.
Methods
 | Name | Description
Public method | BindToName |
Public method | BindToType |
Back to Top
See Also
PortableSerializationBinder Class
PostSharp.Serialization Namespace

Online Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


PortableSerializationBinder.BindToName Method

PortableSerializationBinder BindToName Method PostSharp Documentation

[Missing <summary> documentation for "M:PostSharp.Serialization.PortableSerializationBinder.BindToName(System.Type,System.String@,System.String@)"]

Namespace: PostSharp.Serialization
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
public virtual void BindToName(
    Type type,
    out string typeName,
    out string assemblyName
)
public virtual void BindToName(
    Type type,
    out string typeName,
    out string assemblyName
)
Parameters
type
Type:   Online System Type
[Missing <param name="type"/> documentation for "M:PostSharp.Serialization.PortableSerializationBinder.BindToName(System.Type,System.String@,System.String@)"]
typeName
Type:   Online System String
[Missing <param name="typeName"/> documentation for "M:PostSharp.Serialization.PortableSerializationBinder.BindToName(System.Type,System.String@,System.String@)"]
assemblyName
Type:   Online System String
[Missing <param name="assemblyName"/> documentation for "M:PostSharp.Serialization.PortableSerializationBinder.BindToName(System.Type,System.String@,System.String@)"]
See Also
PortableSerializationBinder Class
PortableSerializationBinder Members
PostSharp.Serialization Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


PortableSerializationBinder.BindToType Method

PortableSerializationBinder BindToType Method PostSharp Documentation

[Missing <summary> documentation for "M:PostSharp.Serialization.PortableSerializationBinder.BindToType(System.String,System.String)"]

Namespace: PostSharp.Serialization
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
public virtual Type BindToType(
    string typeName,
    string assemblyName
)
public virtual Type BindToType(
    string typeName,
    string assemblyName
)
Parameters
typeName
Type:   Online System String
[Missing <param name="typeName"/> documentation for "M:PostSharp.Serialization.PortableSerializationBinder.BindToType(System.String,System.String)"]
assemblyName
Type:   Online System String
[Missing <param name="assemblyName"/> documentation for "M:PostSharp.Serialization.PortableSerializationBinder.BindToType(System.String,System.String)"]
Return Value
Type:   Online Type
[Missing <returns> documentation for "M:PostSharp.Serialization.PortableSerializationBinder.BindToType(System.String,System.String)"]
See Also
PortableSerializationBinder Class
PortableSerializationBinder Members
PostSharp.Serialization Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


PortableSerializationException Class

PortableSerializationException Class PostSharp Documentation
Exception thrown by the PortableFormatter.
Inheritance Hierarchy
Online System Object
Online System Exception
PostSharp.Serialization PortableSerializationException

Namespace: PostSharp.Serialization
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
[SerializableAttribute]
public class PortableSerializationException : Exception
[SerializableAttribute]
public class PortableSerializationException : Exception
See Also
PortableSerializationException Members
PostSharp.Serialization Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


PortableSerializationException Members

PortableSerializationException Members PostSharp Documentation

Constructors
 | Name | Description
Public method | PortableSerializationException | Initializes a new PortableSerializationException.
Public method | PortableSerializationException(String) | Initializes a new PortableSerializationException and specifies the message.
Protected method | PortableSerializationException(SerializationInfo, StreamingContext) | Deserialization constructor.
Public method | PortableSerializationException(String, Exception) | Initializes a new PortableSerializationException and specifies the message and inner exception.
Back to Top
See Also
PortableSerializationException Class
PostSharp.Serialization Namespace

Online Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


PortableSerializationException Constructor

PortableSerializationException Constructor PostSharp Documentation
Overload List
 | Name | Description
Public method | PortableSerializationException | Initializes a new PortableSerializationException.
Public method | PortableSerializationException(String) | Initializes a new PortableSerializationException and specifies the message.
Protected method | PortableSerializationException(SerializationInfo, StreamingContext) | Deserialization constructor.
Public method | PortableSerializationException(String, Exception) | Initializes a new PortableSerializationException and specifies the message and inner exception.
Back to Top
See Also
PortableSerializationException Class
PortableSerializationException Members
PostSharp.Serialization Namespace

Online Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


PortableSerializationException Constructor

PortableSerializationException Constructor PostSharp Documentation
Initializes a new PortableSerializationException.

Namespace: PostSharp.Serialization
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
public PortableSerializationException()
public PortableSerializationException()
See Also
PortableSerializationException Class
PortableSerializationException Members
PortableSerializationException Overload
PostSharp.Serialization Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


PortableSerializationException Constructor (String)

PortableSerializationException Constructor (String) PostSharp Documentation
Initializes a new PortableSerializationException and specifies the message.

Namespace: PostSharp.Serialization
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
public PortableSerializationException(
    string message
)
public PortableSerializationException(
    string message
)
Parameters
message
Type:   Online System String
Message.
See Also
PortableSerializationException Class
PortableSerializationException Members
PortableSerializationException Overload
PostSharp.Serialization Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


PortableSerializationException Constructor (SerializationInfo, StreamingContext)

PortableSerializationException Constructor (SerializationInfo, StreamingContext) PostSharp Documentation
Deserialization constructor.

Namespace: PostSharp.Serialization
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
protected PortableSerializationException(
    SerializationInfo info,
    StreamingContext context
)
protected PortableSerializationException(
    SerializationInfo info,
    StreamingContext context
)
Parameters
info
Type:   Online System.Runtime.Serialization SerializationInfo
[Missing <param name="info"/> documentation for "M:PostSharp.Serialization.PortableSerializationException.#ctor(System.Runtime.Serialization.SerializationInfo,System.Runtime.Serialization.StreamingContext)"]
context
Type:   Online System.Runtime.Serialization StreamingContext
[Missing <param name="context"/> documentation for "M:PostSharp.Serialization.PortableSerializationException.#ctor(System.Runtime.Serialization.SerializationInfo,System.Runtime.Serialization.StreamingContext)"]
See Also
PortableSerializationException Class
PortableSerializationException Members
PortableSerializationException Overload
PostSharp.Serialization Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


PortableSerializationException Constructor (String, Exception)

PortableSerializationException Constructor (String, Exception) PostSharp Documentation
Initializes a new PortableSerializationException and specifies the message and inner exception.

Namespace: PostSharp.Serialization
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
public PortableSerializationException(
    string message,
    Exception inner
)
public PortableSerializationException(
    string message,
    Exception inner
)
Parameters
message
Type:   Online System String
Message.
inner
Type:   Online System Exception
Inner exception.
See Also
PortableSerializationException Class
PortableSerializationException Members
PortableSerializationException Overload
PostSharp.Serialization Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


PSerializableAttribute Class

PSerializableAttribute Class PostSharp Documentation
Custom attribute that, when applied to a type, causes PostSharp to generate a serializer for use by the PortableFormatter.
Inheritance Hierarchy
Online System Object
Online System Attribute
PostSharp.Extensibility MulticastAttribute
PostSharp.Serialization PSerializableAttribute

Namespace: PostSharp.Serialization
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
public sealed class PSerializableAttribute : MulticastAttribute,
    IAspect
public sealed class PSerializableAttribute : MulticastAttribute,
    IAspect
Remarks
Fields that should not be serialized must be annotated with PNonSerializedAttribute.
This class inherits from MulticastAttribute, so it is possible to use multicasting to
            add this aspect to several classes using a single line, or to add this aspect to derived classes through inheritance.
See Also
PSerializableAttribute Members
PostSharp.Serialization Namespace
PostSharp.Serialization PortableFormatter
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


PSerializableAttribute Members

PSerializableAttribute Members PostSharp Documentation

The PSerializableAttribute type exposes the following members.
Constructors
 | Name | Description
Public method | PSerializableAttribute | Initializes a new instance of the PSerializableAttribute class
Back to Top
Properties
 | Name | Description
Public property | AttributeExclude | If true, indicates that this attribute removes all other instances of the same attribute type from the set of elements defined by the current instance. (Inherited from MulticastAttribute.)
Public property | AttributeId | Obsolete. (Inherited from MulticastAttribute.)
Public property | AttributeInheritance | Determines whether this attribute is inherited (Inherited from MulticastAttribute.)
Public property | AttributePriority | Gets or sets the priority of the current attribute in case that multiple instances are defined on the same element (lower values are processed before). (Inherited from MulticastAttribute.)
Public property | AttributeReplace | Determines whether this attribute replaces other attributes found on the target declarations. (Inherited from MulticastAttribute.)
Public property | AttributeTargetAssemblies | Gets or sets the assemblies to which the current attribute apply. (Inherited from MulticastAttribute.)
Public property | AttributeTargetElements | Gets or sets the kind of elements to which this custom attributes applies. (Inherited from MulticastAttribute.)
Public property | AttributeTargetExternalMemberAttributes | Gets or sets the visibilities, scopes, virtualities, and implementation of members to which this attribute applies, when the member is external to the current module. (Inherited from MulticastAttribute.)
Public property | AttributeTargetExternalTypeAttributes | Gets or sets the visibilities of types to which this attribute applies, when this type is external to the current module. (Inherited from MulticastAttribute.)
Public property | AttributeTargetMemberAttributes | Gets or sets the visibilities, scopes, virtualities, and implementation of members to which this attribute applies. (Inherited from MulticastAttribute.)
Public property | AttributeTargetMembers | Gets or sets the expression specifying to which members this instance applies. (Inherited from MulticastAttribute.)
Public property | AttributeTargetParameterAttributes | Gets or sets the passing style (by value, out or ref) of parameters to which this attribute applies. (Inherited from MulticastAttribute.)
Public property | AttributeTargetParameters | Gets or sets the expression specifying to which parameters this instance applies. (Inherited from MulticastAttribute.)
Public property | AttributeTargetTypeAttributes | Gets or sets the visibilities of types to which this attribute applies. (Inherited from MulticastAttribute.)
Public property | AttributeTargetTypes | Gets or sets the expression specifying to which types this instance applies. (Inherited from MulticastAttribute.)
Back to Top
See Also
PSerializableAttribute Class
PostSharp.Serialization Namespace

Online Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


PSerializableAttribute Constructor

PSerializableAttribute Constructor PostSharp Documentation
Initializes a new instance of the PSerializableAttribute class

Namespace: PostSharp.Serialization
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
public PSerializableAttribute()
public PSerializableAttribute()
See Also
PSerializableAttribute Class
PSerializableAttribute Members
PostSharp.Serialization Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


PSerializableAttribute Properties

PSerializableAttribute Properties PostSharp Documentation
The PSerializableAttribute type exposes the following members.
Properties
 | Name | Description
Public property | AttributeExclude | If true, indicates that this attribute removes all other instances of the same attribute type from the set of elements defined by the current instance. (Inherited from MulticastAttribute.)
Public property | AttributeId | Obsolete. (Inherited from MulticastAttribute.)
Public property | AttributeInheritance | Determines whether this attribute is inherited (Inherited from MulticastAttribute.)
Public property | AttributePriority | Gets or sets the priority of the current attribute in case that multiple instances are defined on the same element (lower values are processed before). (Inherited from MulticastAttribute.)
Public property | AttributeReplace | Determines whether this attribute replaces other attributes found on the target declarations. (Inherited from MulticastAttribute.)
Public property | AttributeTargetAssemblies | Gets or sets the assemblies to which the current attribute apply. (Inherited from MulticastAttribute.)
Public property | AttributeTargetElements | Gets or sets the kind of elements to which this custom attributes applies. (Inherited from MulticastAttribute.)
Public property | AttributeTargetExternalMemberAttributes | Gets or sets the visibilities, scopes, virtualities, and implementation of members to which this attribute applies, when the member is external to the current module. (Inherited from MulticastAttribute.)
Public property | AttributeTargetExternalTypeAttributes | Gets or sets the visibilities of types to which this attribute applies, when this type is external to the current module. (Inherited from MulticastAttribute.)
Public property | AttributeTargetMemberAttributes | Gets or sets the visibilities, scopes, virtualities, and implementation of members to which this attribute applies. (Inherited from MulticastAttribute.)
Public property | AttributeTargetMembers | Gets or sets the expression specifying to which members this instance applies. (Inherited from MulticastAttribute.)
Public property | AttributeTargetParameterAttributes | Gets or sets the passing style (by value, out or ref) of parameters to which this attribute applies. (Inherited from MulticastAttribute.)
Public property | AttributeTargetParameters | Gets or sets the expression specifying to which parameters this instance applies. (Inherited from MulticastAttribute.)
Public property | AttributeTargetTypeAttributes | Gets or sets the visibilities of types to which this attribute applies. (Inherited from MulticastAttribute.)
Public property | AttributeTargetTypes | Gets or sets the expression specifying to which types this instance applies. (Inherited from MulticastAttribute.)
Back to Top
See Also
PSerializableAttribute Class
PostSharp.Serialization Namespace

Online Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


ReferenceTypeSerializer Class

ReferenceTypeSerializer Class PostSharp Documentation
Base serializer for all reference types.
Inheritance Hierarchy
Online System Object
PostSharp.Serialization ReferenceTypeSerializer

Namespace: PostSharp.Serialization
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
public abstract class ReferenceTypeSerializer : ISerializer
public abstract class ReferenceTypeSerializer : ISerializer
Remarks

            This type is intentionally non-generic because it is intended to be derived several times, making strong typing less convenient.

See Also
ReferenceTypeSerializer Members
PostSharp.Serialization Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


ReferenceTypeSerializer Members

ReferenceTypeSerializer Members PostSharp Documentation

The ReferenceTypeSerializer type exposes the following members.
Constructors
 | Name | Description
Protected method | ReferenceTypeSerializer | Initializes a new instance of the ReferenceTypeSerializer class
Back to Top
Methods
 | Name | Description
Public method | Convert | Converts a value into a given target type.
Public method | CreateInstance | Creates an instance of the given type.
Public method | DeserializeFields | Completes the second phase of deserialization by setting fields and other properties.
Public method | SerializeObject | Serializes an object
Back to Top
See Also
ReferenceTypeSerializer Class
PostSharp.Serialization Namespace

Online Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


ReferenceTypeSerializer Constructor

ReferenceTypeSerializer Constructor PostSharp Documentation
Initializes a new instance of the ReferenceTypeSerializer class

Namespace: PostSharp.Serialization
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
protected ReferenceTypeSerializer()
protected ReferenceTypeSerializer()
See Also
ReferenceTypeSerializer Class
ReferenceTypeSerializer Members
PostSharp.Serialization Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


ReferenceTypeSerializer Methods

ReferenceTypeSerializer Methods PostSharp Documentation
The ReferenceTypeSerializer type exposes the following members.
Methods
 | Name | Description
Public method | Convert | Converts a value into a given target type.
Public method | CreateInstance | Creates an instance of the given type.
Public method | DeserializeFields | Completes the second phase of deserialization by setting fields and other properties.
Public method | SerializeObject | Serializes an object
Back to Top
See Also
ReferenceTypeSerializer Class
PostSharp.Serialization Namespace

Online Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


ReferenceTypeSerializer.Convert Method

ReferenceTypeSerializer Convert Method PostSharp Documentation
Converts a value into a given target type.

Namespace: PostSharp.Serialization
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
public virtual Object Convert(
    Object value,
    Type targetType
)
public virtual Object Convert(
    Object value,
    Type targetType
)
Parameters
value
Type:   Online System Object
Value to be converted.
targetType
Type:   Online System Type
target type.
Return Value
Type:   Online Object
The value converted to targetType.
Implements
ISerializer Convert(Object, Type)
Remarks
This method allows for additional flexibility if the serialization-time type is
                        not equal to the deserialization-time time. The current method is invoked
            at deserialization time to perform the conversion.
See Also
ReferenceTypeSerializer Class
ReferenceTypeSerializer Members
PostSharp.Serialization Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


ReferenceTypeSerializer.CreateInstance Method

ReferenceTypeSerializer CreateInstance Method PostSharp Documentation
Creates an instance of the given type.

Namespace: PostSharp.Serialization
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
public abstract Object CreateInstance(
    Type type,
    IArgumentsReader constructorArguments
)
public abstract Object CreateInstance(
    Type type,
    IArgumentsReader constructorArguments
)
Parameters
type
Type:   Online System Type
Type of the instance to be created.
constructorArguments
Type: PostSharp.Serialization IArgumentsReader
Gives access to arguments required to create the instance.
Return Value
Type:   Online Object
An instance of type type initialized using constructorArguments.
Implements
ISerializer CreateInstance(Type, IArgumentsReader)
See Also
ReferenceTypeSerializer Class
ReferenceTypeSerializer Members
PostSharp.Serialization Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


ReferenceTypeSerializer.DeserializeFields Method

ReferenceTypeSerializer DeserializeFields Method PostSharp Documentation
Completes the second phase of deserialization by setting fields and other properties.

Namespace: PostSharp.Serialization
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
public abstract void DeserializeFields(
    Object obj,
    IArgumentsReader initializationArguments
)
public abstract void DeserializeFields(
    Object obj,
    IArgumentsReader initializationArguments
)
Parameters
obj
Type:   Online System Object
The object being deserialized.
initializationArguments
Type: PostSharp.Serialization IArgumentsReader
Gives access to field values.
See Also
ReferenceTypeSerializer Class
ReferenceTypeSerializer Members
PostSharp.Serialization Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


ReferenceTypeSerializer.SerializeObject Method

ReferenceTypeSerializer SerializeObject Method PostSharp Documentation
Serializes an object

Namespace: PostSharp.Serialization
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
public abstract void SerializeObject(
    Object obj,
    IArgumentsWriter constructorArguments,
    IArgumentsWriter initializationArguments
)
public abstract void SerializeObject(
    Object obj,
    IArgumentsWriter constructorArguments,
    IArgumentsWriter initializationArguments
)
Parameters
obj
Type:   Online System Object
[Missing <param name="obj"/> documentation for "M:PostSharp.Serialization.ReferenceTypeSerializer.SerializeObject(System.Object,PostSharp.Serialization.IArgumentsWriter,PostSharp.Serialization.IArgumentsWriter)"]
constructorArguments
Type: PostSharp.Serialization IArgumentsWriter
Gives access to arguments that will be passed to the CreateInstance(Type, IArgumentsReader) method during deserialization.
initializationArguments
Type: PostSharp.Serialization IArgumentsWriter
Gives access to arguments that will be passed to the DeserializeFields(Object, IArgumentsReader) method during deserialization.
See Also
ReferenceTypeSerializer Class
ReferenceTypeSerializer Members
PostSharp.Serialization Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


SerializationServices Class

SerializationServices Class PostSharp Documentation
Provides some utility method for the current namespace.
Inheritance Hierarchy
Online System Object
PostSharp.Serialization SerializationServices

Namespace: PostSharp.Serialization
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
public static class SerializationServices
public static class SerializationServices
See Also
SerializationServices Members
PostSharp.Serialization Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


SerializationServices Members

SerializationServices Members PostSharp Documentation

Methods
Name | Description
GetSerializationException(MemberInfo) | Checks whether a given Online MethodInfo, Online ConstructorInfo, Online FieldInfo, Online PropertyInfo, Online EventInfo or Online Type can be safely serialized.
GetSerializationException(ParameterInfo) | Checks whether a given Online ParameterInfo can be safely serialized.
GetSerializationException(LocationInfo) | Checks whether a given LocationInfo can be safely serialized.
Back to Top
See Also
SerializationServices Class
PostSharp.Serialization Namespace

Online Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


SerializationServices Methods

SerializationServices Methods PostSharp Documentation
Methods
Name | Description
GetSerializationException(MemberInfo) | Checks whether a given Online MethodInfo, Online ConstructorInfo, Online FieldInfo, Online PropertyInfo, Online EventInfo or Online Type can be safely serialized.
GetSerializationException(ParameterInfo) | Checks whether a given Online ParameterInfo can be safely serialized.
GetSerializationException(LocationInfo) | Checks whether a given LocationInfo can be safely serialized.
Back to Top
See Also
SerializationServices Class
PostSharp.Serialization Namespace

Online Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


SerializationServices.GetSerializationException Method

SerializationServices GetSerializationException Method PostSharp Documentation
Overload List
Name | Description
GetSerializationException(MemberInfo) | Checks whether a given Online MethodInfo, Online ConstructorInfo, Online FieldInfo, Online PropertyInfo, Online EventInfo or Online Type can be safely serialized.
GetSerializationException(ParameterInfo) | Checks whether a given Online ParameterInfo can be safely serialized.
GetSerializationException(LocationInfo) | Checks whether a given LocationInfo can be safely serialized.
Back to Top
See Also
SerializationServices Class
SerializationServices Members
PostSharp.Serialization Namespace

Online Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


SerializationServices.GetSerializationException Method (MemberInfo)

SerializationServices GetSerializationException Method (MemberInfo) PostSharp Documentation
Checks whether a given Online MethodInfo, Online ConstructorInfo, Online FieldInfo, Online PropertyInfo, Online EventInfo or Online Type can be safely serialized.

Namespace: PostSharp.Serialization
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
public static PortableSerializationException GetSerializationException(
    MemberInfo memberInfo
)
public static PortableSerializationException GetSerializationException(
    MemberInfo memberInfo
)
Parameters
memberInfo
Type:   Online System.Reflection MemberInfo
The declaration to be serialized.
Return Value
Type: PortableSerializationException
null if memberInfo can be safely serialized, otherwise an exception where the text describes
            the reason why the declaration is not serializable.
See Also
SerializationServices Class
SerializationServices Members
GetSerializationException Overload
PostSharp.Serialization Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


SerializationServices.GetSerializationException Method (ParameterInfo)

SerializationServices GetSerializationException Method (ParameterInfo) PostSharp Documentation
Checks whether a given Online ParameterInfo can be safely serialized.

Namespace: PostSharp.Serialization
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
public static PortableSerializationException GetSerializationException(
    ParameterInfo parameterInfo
)
public static PortableSerializationException GetSerializationException(
    ParameterInfo parameterInfo
)
Parameters
parameterInfo
Type:   Online System.Reflection ParameterInfo
The declaration to be serialized.
Return Value
Type: PortableSerializationException
null if parameterInfo can be safely serialized, otherwise an exception where the text describes
            the reason why the declaration is not serializable.
See Also
SerializationServices Class
SerializationServices Members
GetSerializationException Overload
PostSharp.Serialization Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


SerializationServices.GetSerializationException Method (LocationInfo)

SerializationServices GetSerializationException Method (LocationInfo) PostSharp Documentation
Checks whether a given LocationInfo can be safely serialized.

Namespace: PostSharp.Serialization
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
public static PortableSerializationException GetSerializationException(
    LocationInfo locationInfo
)
public static PortableSerializationException GetSerializationException(
    LocationInfo locationInfo
)
Parameters
locationInfo
Type: PostSharp.Reflection LocationInfo
The declaration to be serialized.
Return Value
Type: PortableSerializationException
null if locationInfo can be safely serialized, otherwise an exception where the text describes
            the reason why the declaration is not serializable.
See Also
SerializationServices Class
SerializationServices Members
GetSerializationException Overload
PostSharp.Serialization Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


SerializerAttribute Class

SerializerAttribute Class PostSharp Documentation
Custom attribute that, when applied to a type, specifies its serializer for use by the PortableFormatter.
Inheritance Hierarchy
Online System Object
Online System Attribute
PostSharp.Serialization SerializerAttribute

Namespace: PostSharp.Serialization
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
public sealed class SerializerAttribute : Attribute
public sealed class SerializerAttribute : Attribute
Remarks
The use of the SerializerAttribute is optional if the serializer of a type is a nested class of that class named Serializer.
Windows Phone 7.0 does not allow to assign generic types to parameters of custom attributes.
See Also
SerializerAttribute Members
PostSharp.Serialization Namespace
PostSharp.Serialization ImportSerializerAttribute
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


SerializerAttribute Members

SerializerAttribute Members PostSharp Documentation

The SerializerAttribute type exposes the following members.
Constructors
 | Name | Description
Public method | SerializerAttribute | Initializes a new SerializerAttribute.
Back to Top
Properties
 | Name | Description
Public property | SerializerType | Gets the serializer type.
Back to Top
See Also
SerializerAttribute Class
PostSharp.Serialization Namespace

Online Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


SerializerAttribute Constructor

SerializerAttribute Constructor PostSharp Documentation
Initializes a new SerializerAttribute.

Namespace: PostSharp.Serialization
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
public SerializerAttribute(
    Type serializerType
)
public SerializerAttribute(
    Type serializerType
)
Parameters
serializerType
Type:   Online System Type
Serializer type. This type must implement ISerializer or ISerializerFactory,
            and must have a public default constructor. If serializerType is a generic type, if must have the same number
            of generic type parameters as the target type, and have a compatible set of constraints.
See Also
SerializerAttribute Class
SerializerAttribute Members
PostSharp.Serialization Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


SerializerAttribute Properties

SerializerAttribute Properties PostSharp Documentation
The SerializerAttribute type exposes the following members.
Properties
 | Name | Description
Public property | SerializerType | Gets the serializer type.
Back to Top
See Also
SerializerAttribute Class
PostSharp.Serialization Namespace

Online Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


SerializerAttribute.SerializerType Property

SerializerAttribute SerializerType Property PostSharp Documentation
Gets the serializer type.

Namespace: PostSharp.Serialization
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
public Type SerializerType { get; private set; }
public Type SerializerType { get; private set; }
Property Value
Type:   Online Type
Remarks

            This type must implement ISerializer or ISerializerFactory,
            and must have a public default constructor. If SerializerType is a generic type, if must have the same number
            of generic type parameters as the target type, and have a compatible set of constraints.

See Also
SerializerAttribute Class
SerializerAttribute Members
PostSharp.Serialization Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


SerializerFactoryProvider Class

SerializerFactoryProvider Class PostSharp Documentation
Provides instances of the ISerializerFactory interface for object types that have been previously registered using AddSerializer(Type, Type).
Inheritance Hierarchy
Online System Object
PostSharp.Serialization SerializerFactoryProvider

Namespace: PostSharp.Serialization
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
public class SerializerFactoryProvider : ISerializerFactoryProvider
public class SerializerFactoryProvider : ISerializerFactoryProvider
See Also
SerializerFactoryProvider Members
PostSharp.Serialization Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


SerializerFactoryProvider Members

SerializerFactoryProvider Members PostSharp Documentation

The SerializerFactoryProvider type exposes the following members.
Constructors
 | Name | Description
Public method | SerializerFactoryProvider | Initializes a new SerializerFactoryProvider.
Back to Top
Methods
 | Name | Description
Public method | AddSerializer(Type, Type) | Maps an object type to a serializer type.
Public method | AddSerializer ObjectType, SerializerType | Maps an object type to a serializer type (using generic type parameters).
Public method | GetSerializerFactory | Gets the instance of ISerializerFactory
Public method | GetSurrogateType | Gets the surrogate type for a given object type.
Public method | MakeReadOnly | Forbids further changes in the current SerializerFactoryProvider.
Back to Top
Fields
Name | Description
BuiltIn | Gets the SerializerFactoryProvider instance that supports built-in types.
Back to Top
Properties
 | Name | Description
Public property | NextProvider | Gets the next provider in the chain.
Back to Top
See Also
SerializerFactoryProvider Class
PostSharp.Serialization Namespace

Online Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


SerializerFactoryProvider Constructor

SerializerFactoryProvider Constructor PostSharp Documentation
Initializes a new SerializerFactoryProvider.

Namespace: PostSharp.Serialization
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
public SerializerFactoryProvider(
    ISerializerFactoryProvider nextProvider,
    ActivatorProvider activatorProvider
)
public SerializerFactoryProvider(
    ISerializerFactoryProvider nextProvider,
    ActivatorProvider activatorProvider
)
Parameters
nextProvider
Type: PostSharp.Serialization ISerializerFactoryProvider
The next provider in the chain, or null if there is none.
activatorProvider
Type: PostSharp.Serialization ActivatorProvider
[Missing <param name="activatorProvider"/> documentation for "M:PostSharp.Serialization.SerializerFactoryProvider.#ctor(PostSharp.Serialization.ISerializerFactoryProvider,PostSharp.Serialization.ActivatorProvider)"]
See Also
SerializerFactoryProvider Class
SerializerFactoryProvider Members
PostSharp.Serialization Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


SerializerFactoryProvider Fields

SerializerFactoryProvider Fields PostSharp Documentation
The SerializerFactoryProvider type exposes the following members.
Fields
Name | Description
BuiltIn | Gets the SerializerFactoryProvider instance that supports built-in types.
Back to Top
See Also
SerializerFactoryProvider Class
PostSharp.Serialization Namespace

Online Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


SerializerFactoryProvider.BuiltIn Field

SerializerFactoryProvider BuiltIn Field PostSharp Documentation
Gets the SerializerFactoryProvider instance that supports built-in types.

Namespace: PostSharp.Serialization
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
public static readonly SerializerFactoryProvider BuiltIn
public static readonly SerializerFactoryProvider BuiltIn
Field Value
Type: SerializerFactoryProvider
See Also
SerializerFactoryProvider Class
SerializerFactoryProvider Members
PostSharp.Serialization Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


SerializerFactoryProvider Methods

SerializerFactoryProvider Methods PostSharp Documentation
The SerializerFactoryProvider type exposes the following members.
Methods
 | Name | Description
Public method | AddSerializer(Type, Type) | Maps an object type to a serializer type.
Public method | AddSerializer ObjectType, SerializerType | Maps an object type to a serializer type (using generic type parameters).
Public method | GetSerializerFactory | Gets the instance of ISerializerFactory
Public method | GetSurrogateType | Gets the surrogate type for a given object type.
Public method | MakeReadOnly | Forbids further changes in the current SerializerFactoryProvider.
Back to Top
See Also
SerializerFactoryProvider Class
PostSharp.Serialization Namespace

Online Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


SerializerFactoryProvider.AddSerializer Method

SerializerFactoryProvider AddSerializer Method PostSharp Documentation
Overload List
 | Name | Description
Public method | AddSerializer ObjectType, SerializerType | Maps an object type to a serializer type (using generic type parameters).
Public method | AddSerializer(Type, Type) | Maps an object type to a serializer type.
Back to Top
See Also
SerializerFactoryProvider Class
SerializerFactoryProvider Members
PostSharp.Serialization Namespace

Online Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


SerializerFactoryProvider.AddSerializer(ObjectType, SerializerType) Method

SerializerFactoryProvider AddSerializer ObjectType, SerializerType Method PostSharp Documentation
Maps an object type to a serializer type (using generic type parameters).

Namespace: PostSharp.Serialization
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
public void AddSerializer<ObjectType, SerializerType>()
where SerializerType : new(), ISerializer
public void AddSerializer<ObjectType, SerializerType>()
where SerializerType : new(), ISerializer
Type Parameters
ObjectType
Type of the serialized object.
SerializerType
Type of the serializer.
See Also
SerializerFactoryProvider Class
SerializerFactoryProvider Members
AddSerializer Overload
PostSharp.Serialization Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


SerializerFactoryProvider.AddSerializer Method (Type, Type)

SerializerFactoryProvider AddSerializer Method (Type, Type) PostSharp Documentation
Maps an object type to a serializer type.

Namespace: PostSharp.Serialization
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
public void AddSerializer(
    Type objectType,
    Type serializerType
)
public void AddSerializer(
    Type objectType,
    Type serializerType
)
Parameters
objectType
Type:   Online System Type
Type of the serialized object.
serializerType
Type:   Online System Type
Type of the serializer (must be derived from ISerializer).
See Also
SerializerFactoryProvider Class
SerializerFactoryProvider Members
AddSerializer Overload
PostSharp.Serialization Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


SerializerFactoryProvider.GetSerializerFactory Method

SerializerFactoryProvider GetSerializerFactory Method PostSharp Documentation
Gets the instance of ISerializerFactory

Namespace: PostSharp.Serialization
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
public virtual ISerializerFactory GetSerializerFactory(
    Type objectType
)
public virtual ISerializerFactory GetSerializerFactory(
    Type objectType
)
Parameters
objectType
Type:   Online System Type
Type of object being serialized or deserialized. If a surrogate type has been specified during serialization,
            this parameter is set to the surrogate type during deserialization.
Return Value
Type: ISerializerFactory
An instance of ISerializerFactory able to serialize or deserialize objectType, or null
            if there is no known serializer factory for this object.
Implements
ISerializerFactoryProvider GetSerializerFactory(Type)
Remarks
It is not the reponsibility of this class to call the next provider (NextProvider).
See Also
SerializerFactoryProvider Class
SerializerFactoryProvider Members
PostSharp.Serialization Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


SerializerFactoryProvider.GetSurrogateType Method

SerializerFactoryProvider GetSurrogateType Method PostSharp Documentation
Gets the surrogate type for a given object type.

Namespace: PostSharp.Serialization
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
public virtual Type GetSurrogateType(
    Type objectType
)
public virtual Type GetSurrogateType(
    Type objectType
)
Parameters
objectType
Type:   Online System Type
Type of the object being serialized.
Return Value
Type:   Online Type
The surrogate type for objectType, or null (or objectType) is objectType
            does not require a surrogate type.
Implements
ISerializerFactoryProvider GetSurrogateType(Type)
Remarks
This method is called only during serialization. The surrogate type is the type whose name will be serialized; therefore, it will also
                        be the type that will be deserialized.
It is not the reponsibility of this class to call the next provider (NextProvider).
See Also
SerializerFactoryProvider Class
SerializerFactoryProvider Members
PostSharp.Serialization Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


SerializerFactoryProvider.MakeReadOnly Method

SerializerFactoryProvider MakeReadOnly Method PostSharp Documentation
Forbids further changes in the current SerializerFactoryProvider.

Namespace: PostSharp.Serialization
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
public void MakeReadOnly()
public void MakeReadOnly()
See Also
SerializerFactoryProvider Class
SerializerFactoryProvider Members
PostSharp.Serialization Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


SerializerFactoryProvider Properties

SerializerFactoryProvider Properties PostSharp Documentation
The SerializerFactoryProvider type exposes the following members.
Properties
 | Name | Description
Public property | NextProvider | Gets the next provider in the chain.
Back to Top
See Also
SerializerFactoryProvider Class
PostSharp.Serialization Namespace

Online Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


SerializerFactoryProvider.NextProvider Property

SerializerFactoryProvider NextProvider Property PostSharp Documentation
Gets the next provider in the chain.

Namespace: PostSharp.Serialization
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
public ISerializerFactoryProvider NextProvider { get; }
public ISerializerFactoryProvider NextProvider { get; }
Property Value
Type: ISerializerFactoryProvider
Implements
ISerializerFactoryProvider NextProvider
See Also
SerializerFactoryProvider Class
SerializerFactoryProvider Members
PostSharp.Serialization Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


ValueTypeSerializer(T) Class

ValueTypeSerializer T Class PostSharp Documentation
Base serializer for all value types.
Inheritance Hierarchy
Online System Object
PostSharp.Serialization ValueTypeSerializer T

Namespace: PostSharp.Serialization
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
public abstract class ValueTypeSerializer<T> : ISerializer
where T : struct, new()
public abstract class ValueTypeSerializer<T> : ISerializer
where T : struct, new()
Type Parameters
T
[Missing <typeparam name="T"/> documentation for "T:PostSharp.Serialization.ValueTypeSerializer`1"]
See Also
ValueTypeSerializer T  Members
PostSharp.Serialization Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


ValueTypeSerializer(T) Members

ValueTypeSerializer T Members PostSharp Documentation

The ValueTypeSerializer T type exposes the following members.
Constructors
 | Name | Description
Protected method | ValueTypeSerializer T | Initializes a new instance of the ValueTypeSerializer T class
Back to Top
Methods
 | Name | Description
Public method | Convert | Converts a value into a given target type.
Public method | DeserializeObject | Creates an instance of the given type.
Public method | SerializeObject | Serializes an object
Back to Top
See Also
ValueTypeSerializer T Class
PostSharp.Serialization Namespace

Online Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


ValueTypeSerializer(T) Constructor

ValueTypeSerializer T Constructor PostSharp Documentation
Initializes a new instance of the ValueTypeSerializer T class

Namespace: PostSharp.Serialization
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
protected ValueTypeSerializer()
protected ValueTypeSerializer()
See Also
ValueTypeSerializer T  Class
ValueTypeSerializer T  Members
PostSharp.Serialization Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


ValueTypeSerializer(T) Methods

ValueTypeSerializer T Methods PostSharp Documentation
The ValueTypeSerializer T type exposes the following members.
Methods
 | Name | Description
Public method | Convert | Converts a value into a given target type.
Public method | DeserializeObject | Creates an instance of the given type.
Public method | SerializeObject | Serializes an object
Back to Top
See Also
ValueTypeSerializer T Class
PostSharp.Serialization Namespace

Online Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


ValueTypeSerializer(T).Convert Method

ValueTypeSerializer T Convert Method PostSharp Documentation
Converts a value into a given target type.

Namespace: PostSharp.Serialization
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
public virtual Object Convert(
    Object value,
    Type targetType
)
public virtual Object Convert(
    Object value,
    Type targetType
)
Parameters
value
Type:   Online System Object
Value to be converted.
targetType
Type:   Online System Type
target type.
Return Value
Type:   Online Object
The value converted to targetType.
Implements
ISerializer Convert(Object, Type)
Remarks
This method allows for additional flexibility if the serialization-time type is
                        not equal to the deserialization-time time. The current method is invoked
            at deserialization time to perform the conversion.
See Also
ValueTypeSerializer T  Class
ValueTypeSerializer T  Members
PostSharp.Serialization Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


ValueTypeSerializer(T).DeserializeObject Method

ValueTypeSerializer T DeserializeObject Method PostSharp Documentation
Creates an instance of the given type.

Namespace: PostSharp.Serialization
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
public abstract T DeserializeObject(
    IArgumentsReader constructorArguments
)
public abstract T DeserializeObject(
    IArgumentsReader constructorArguments
)
Parameters
constructorArguments
Type: PostSharp.Serialization IArgumentsReader
Gives access to arguments required to create the instance.
Return Value
Type: T
An instance of type T initialized using constructorArguments.
See Also
ValueTypeSerializer T  Class
ValueTypeSerializer T  Members
PostSharp.Serialization Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


ValueTypeSerializer(T).SerializeObject Method

ValueTypeSerializer T SerializeObject Method PostSharp Documentation
Serializes an object

Namespace: PostSharp.Serialization
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
public abstract void SerializeObject(
    T obj,
    IArgumentsWriter constructorArguments
)
public abstract void SerializeObject(
    T obj,
    IArgumentsWriter constructorArguments
)
Parameters
obj
Type: T
[Missing <param name="obj"/> documentation for "M:PostSharp.Serialization.ValueTypeSerializer`1.SerializeObject(`0,PostSharp.Serialization.IArgumentsWriter)"]
constructorArguments
Type: PostSharp.Serialization IArgumentsWriter
Gives access to arguments that will be passed to the DeserializeObject(IArgumentsReader) method during deserialization.
See Also
ValueTypeSerializer T  Class
ValueTypeSerializer T  Members
PostSharp.Serialization Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


Getting Started with PostSharp PostSharp Documentation

PostSharp makes aspect-oriented programming easy. You can start writing your own aspect in a matter of minutes. Just follow the guide.

Prerequisites
  • Windows XP or higher.
  • Microsoft Visual Studio 2008 or 2010.
  • Administrative privileges.
  • 10 minutes of your time.

Getting Started with PostSharp

  1. Download the PostSharp setup program and execute it on your development machine.

    Note Note
    If you don't want to or cannot install software on your machine, you can download the zip package instead of the setup program, but then you have to enable PostSharp manually for your projects (see Installing PostSharp). We suggest that for your first experience with PostSharp, you use the setup program.

  2. Load one of your projects into Visual Studio 2008 or higher. Any project type will work, but for this example it's best to choose a console application. It doesn't matter whether you use C#, VB.NET, or another language: it will just work.

  3. Add a reference to PostSharp.dll to your project.

  4. Create a class and name it TraceAttribute; design the class just as if it were a custom attribute.

    A plain old custom attribute
    View Colorized Copy to Clipboard Print
    public sealed class TraceAttribute : Attribute
{
  private readonly string category;

  public TraceAttribute(string category)
  {
    this.category = category;
  }

  public string Category { get { return category; }  }
}
    public sealed class TraceAttribute : Attribute
{
  private readonly string category;

  public TraceAttribute(string category)
  {
    this.category = category;
  }

  public string Category { get { return category; }  }
}

  5. Since you are not developing an ordinary custom attribute but an aspect, include the namespace PostSharp.Aspects and make the class inherit OnMethodBoundaryAspect (which, itself, derives Online Attribute).

    A PostSharp aspect adding no behavior
    View Colorized Copy to Clipboard Print
    using PostSharp.Aspects;

[Serializable]
public sealed class TraceAttribute : OnMethodBoundaryAspect
{
  private readonly string category;

  public TraceAttribute(string category)
  {
     this.category = category;
  }

  public string Category { get { return category; }  }
}
    using PostSharp.Aspects;

[Serializable]
public sealed class TraceAttribute : OnMethodBoundaryAspect
{
  private readonly string category;

  public TraceAttribute(string category)
  {
     this.category = category;
  }

  public string Category { get { return category; }  }
}

  6. Add the advices, i.e. the code that will be executed before and after the target method:

    A PostSharp aspect adding new behaviors (advices)
    View Colorized Copy to Clipboard Print
    using PostSharp.Aspects;

[Serializable]
public sealed class TraceAttribute : OnMethodBoundaryAspect
{
  private readonly string category;

  public TraceAttribute(string category)
  {
    this.category = category;
  }

  public string Category { get { return category; }  }

  public override void OnEntry(MethodExecutionArgs args)
  {
    Trace.WriteLine(string.Format("Entering {0}.{1}.",
      args.Method.DeclaringType.Name, args.Method.Name), this.category);
  }

  public override void OnExit(MethodExecutionArgs args)
  {
    Trace.WriteLine(string.Format("Leaving {0}.{1}.",
      args.Method.DeclaringType.Name, args.Method.Name), this.category);
  }
}
    using PostSharp.Aspects;

[Serializable]
public sealed class TraceAttribute : OnMethodBoundaryAspect
{
  private readonly string category;

  public TraceAttribute(string category)
  {
    this.category = category;
  }

  public string Category { get { return category; }  }

  public override void OnEntry(MethodExecutionArgs args)
  {
    Trace.WriteLine(string.Format("Entering {0}.{1}.",
      args.Method.DeclaringType.Name, args.Method.Name), this.category);
  }

  public override void OnExit(MethodExecutionArgs args)
  {
    Trace.WriteLine(string.Format("Leaving {0}.{1}.",
      args.Method.DeclaringType.Name, args.Method.Name), this.category);
  }
}

  7. In your project, choose an existing method you want to log and decorate it with our aspect – remember it is a custom attribute.

    Adding an aspect to existing code using a plain old custom attribute
    View Colorized Copy to Clipboard Print
    internal static class Program
{
  private static void Main()
  {
    Trace.Listeners.Add(new TextWriterTraceListener(Console.Out));

    SayHello();
    SayGoodBye();
  }

  [Trace("MyCategory")]
  private static void SayHello()
  {
    Console.WriteLine("Hello, world.");
  }

  [Trace("MyCategory")]
  private static void SayGoodBye()
  {
    Console.WriteLine("Good bye, world.");
  }
}
    internal static class Program
{
  private static void Main()
  {
    Trace.Listeners.Add(new TextWriterTraceListener(Console.Out));

    SayHello();
    SayGoodBye();
  }

  [Trace("MyCategory")]
  private static void SayHello()
  {
    Console.WriteLine("Hello, world.");
  }

  [Trace("MyCategory")]
  private static void SayGoodBye()
  {
    Console.WriteLine("Good bye, world.");
  }
}

    If you want to trace the execution of every method in a namespace, you can use the following code:

    Adding an aspect to several elements of code using attribute multicasting
    View Colorized Copy to Clipboard Print
    [assembly: Trace("MyCategory", AttributeTargetTypes = "My.BusinessLayer.*")]
    [assembly: Trace("MyCategory", AttributeTargetTypes = "My.BusinessLayer.*")]

  8. We are done. Compile and execute the project.

Next Steps
  • Run the program with the debugger and step into the execution of methods that have been enhanced by an aspect.
  • Open the program binary file using Reflector and look how it has been transformed by PostSharp.
See Also

Reference

OnMethodBoundaryAspect

Other Resources

[f7b57aa1-369a-406a-8863-8b6865265a21]

Online Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


OnExceptionAspectConfigurationAttribute.SetAspectConfiguration Method

OnExceptionAspectConfigurationAttribute SetAspectConfiguration Method PostSharp Documentation
Sets up an AspectConfiguration object according to the current custom attribute instance.

Namespace: PostSharp.Aspects.Configuration
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
protected override void SetAspectConfiguration(
    AspectConfiguration aspectConfiguration
)
protected override void SetAspectConfiguration(
    AspectConfiguration aspectConfiguration
)
Parameters
aspectConfiguration
Type: PostSharp.Aspects.Configuration AspectConfiguration
The AspectConfiguration instance previously returned  by the
              CreateAspectConfiguration  method.
Remarks
Classes overriding this method must always invoke the base implementation before performing their own
                changes to the AspectConfiguration.
See Also
OnExceptionAspectConfigurationAttribute Class
OnExceptionAspectConfigurationAttribute Members
PostSharp.Aspects.Configuration Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


MsilAspectSerializer.Deserialize Method

MsilAspectSerializer Deserialize Method PostSharp Documentation
Deserializes a stream into an array if aspects.

Namespace: PostSharp.Aspects.Serialization
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
protected override IAspect[] Deserialize(
    Stream stream,
    IMetadataDispenser metadataDispenser
)
protected override IAspect[] Deserialize(
    Stream stream,
    IMetadataDispenser metadataDispenser
)
Parameters
stream
Type:   Online System.IO Stream
Stream containing serialized aspects.
metadataDispenser
Type: PostSharp.Reflection IMetadataDispenser
Metadata dispenser to be used to resolve serialized metadata references in stream.
Return Value
Type:  IAspect
An array of aspects.
Remarks

              The implementation is not allowed to change the order or array elements.

See Also
MsilAspectSerializer Class
MsilAspectSerializer Members
PostSharp.Aspects.Serialization Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


PortableAspectSerializer.Deserialize Method

PortableAspectSerializer Deserialize Method PostSharp Documentation
Deserializes a stream into an array if aspects.

Namespace: PostSharp.Aspects.Serialization
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
protected override IAspect[] Deserialize(
    Stream stream,
    IMetadataDispenser metadataDispenser
)
protected override IAspect[] Deserialize(
    Stream stream,
    IMetadataDispenser metadataDispenser
)
Parameters
stream
Type:   Online System.IO Stream
Stream containing serialized aspects.
metadataDispenser
Type: PostSharp.Reflection IMetadataDispenser
Metadata dispenser to be used to resolve serialized metadata references in stream.
Return Value
Type:  IAspect
An array of aspects.
Remarks

              The implementation is not allowed to change the order or array elements.

See Also
PortableAspectSerializer Class
PortableAspectSerializer Members
PostSharp.Aspects.Serialization Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


StateBagAspectSerializer.Deserialize Method

StateBagAspectSerializer Deserialize Method PostSharp Documentation
Deserializes a stream into an array if aspects.

Namespace: PostSharp.Aspects.Serialization
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
protected override IAspect[] Deserialize(
    Stream stream,
    IMetadataDispenser metadataDispenser
)
protected override IAspect[] Deserialize(
    Stream stream,
    IMetadataDispenser metadataDispenser
)
Parameters
stream
Type:   Online System.IO Stream
Stream containing serialized aspects.
metadataDispenser
Type: PostSharp.Reflection IMetadataDispenser
Metadata dispenser to be used to resolve serialized metadata references in stream.
Return Value
Type:  IAspect
An array of aspects.
Remarks

              The implementation is not allowed to change the order or array elements.

See Also
StateBagAspectSerializer Class
StateBagAspectSerializer Members
PostSharp.Aspects.Serialization Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)


XmlAspectSerializer.Deserialize Method

XmlAspectSerializer Deserialize Method PostSharp Documentation
Deserializes a stream into an array if aspects.

Namespace: PostSharp.Aspects.Serialization
Assembly: PostSharp (in PostSharp.dll) Version: 3.0.29.9 (3.0.29.0)
Syntax
C#
VB
C++
F#
View Colorized Copy to Clipboard Print
protected override IAspect[] Deserialize(
    Stream stream,
    IMetadataDispenser metadataDispenser
)
protected override IAspect[] Deserialize(
    Stream stream,
    IMetadataDispenser metadataDispenser
)
Parameters
stream
Type:   Online System.IO Stream
Stream containing serialized aspects.
metadataDispenser
Type: PostSharp.Reflection IMetadataDispenser
Metadata dispenser to be used to resolve serialized metadata references in stream.
Return Value
Type:  IAspect
An array of aspects.
Remarks

              The implementation is not allowed to change the order or array elements.

See Also
XmlAspectSerializer Class
XmlAspectSerializer Members
PostSharp.Aspects.Serialization Namespace
  Online
                        Copyright © SharpCrafters s.r.o. 2013. All rights reserved. (http://www.postsharp.net/)