Code before the first "try"
2 posts • Page 1 of 1
Code before the first "try"
Hi Gael
Please tell me what should I do to generate code before the first "try" from advice which uses JoinPointKinds.BeforeMethodBody, JoinPointKinds.AfterMethodBodyException and JoinPointKinds.AfterMethodBodyAlways?
I want to insert :
void SomeMethod()
{
// some code here
try
{
// some code here
}
catch(Exception exc)
{
// some code here
}
finally
{
// and some code here
}
}
Ed.ward
Please tell me what should I do to generate code before the first "try" from advice which uses JoinPointKinds.BeforeMethodBody, JoinPointKinds.AfterMethodBodyException and JoinPointKinds.AfterMethodBodyAlways?
I want to insert :
void SomeMethod()
{
// some code here
try
{
// some code here
}
catch(Exception exc)
{
// some code here
}
finally
{
// and some code here
}
}
Ed.ward
Edward Pavlov
- Ed_ward
- Posts: 11
- Joined: Sat Jan 12, 2008 4:55 pm
- Full Name: Edward Pavlov
Re: Code before the first "try"
You could use two instances of IAdvice and use different priorities. The most external advice will be the "on before". It should work.
Gael
Gael
Gael Fraiteur, project leader
got good support? consider donating to the project.
got good support? consider donating to the project.
- gfraiteur
- Site Admin
- Posts: 674
- Joined: Tue Dec 18, 2007 3:09 pm
- Full Name: Gael Fraiteur
- Company: postsharp.org
2 posts • Page 1 of 1