AllowMultiply = true

Do you program directly PostSharp.CodeModel or another low-level API and need help? Put your questions here and we will try to answer.

AllowMultiply = true

Postby Ed_ward on Sun Feb 10, 2008 9:50 pm

[MulticastAttributeUsage( MulticastTargets.Method, AllowMultiple = true, AutoReplace = true )]
public class HandleExceptionAttribute : : MulticastAttribute, IRequirePostSharp
{...}

When I apply HandleException attribute to some method n times should be correspond advice launched n times?

[HandleException( typeof(Exception), AttributePriority = 0 )]
[HandleException( typeof(ArgumentException, AttributePriority = 1) )]
void SomeMethod()
{
}

Now it is still applied once.

best regards

Ed.ward
Edward Pavlov
Ed_ward
 
Posts: 11
Joined: Sat Jan 12, 2008 4:55 pm
Full Name: Edward Pavlov

Re: AllowMultiply = true

Postby gfraiteur on Mon Feb 11, 2008 3:30 pm

The code you wrote should generate two instances. If it does not, it may be a bug. You can report it if you are sure it's on PostSharp's side.

Gael
Gael Fraiteur, project leader
got good support? consider donating to the project.
gfraiteur
Site Admin
 
Posts: 608
Joined: Tue Dec 18, 2007 3:09 pm
Full Name: Gael Fraiteur
Company: postsharp.org


Return to PostSharp Core