0

Suppose i have these structure as

class ss
{

 public void createfile() 
    { 
        StreamWriter sw= new StreamWriter("d:/test.txt");     
    }
}

i need to do aspect where ever i use StreamWriter?

as for as consideration i already used the below code as

[assembly: MyAspect(AttributeTargetAssembly="mscorlib", AttributeTargetTypes="System.IO.File", AttributeTargetMembers="Create"]

for file.create method ..

it works fine ..

Is there any way to solve this problem ...

waiting for your response

GowthamanSS
  • 1,434
  • 4
  • 33
  • 58

1 Answers1

0

You might want to clarify your question a little, I don't know if you have seen the following link...

http://www.codeproject.com/Articles/337564/Aspect-Oriented-Programming-Using-Csharp-and-PostS

however it provides a good example of how you use postsharp in a similar way to how you described.

  • check this link for updation of my question http://stackoverflow.com/questions/12798391/aspect-the-constructor-in-c-sharp-net-using-postsharp – GowthamanSS Oct 09 '12 at 11:17