Quantcast
Channel: Windows Forms General forum
Viewing all articles
Browse latest Browse all 12583

Custom Attribue is being called automatically whenever any method is exectued? possible?

$
0
0

Hello,

Whenever any method is executed, if the method has an attribute declaration,

I would like to query this to use...

For example, let's say..I have a win form..let's say this form has Load event..

class MyAttribute : Attribute {

}

[My("Form1_Load")]

private void Form1_Load(object sender, EventArgs e) {

    blah..

    blah..

    MyNextMethod();

}

[My("MyNextMethod")]

private void MyNextMethod() {

  blah..

  blah..

  MyNextNextMethod();

}

private void MyNextNextMethod() {

   blah..

   blah..

}

Form1_Load and MyNextMethod have MyAttribute declaration..so MyAttribute will be called to take some action when those methods were executed, but MyNextNextMethod won't call MyAtttribute cuz it doesn't have the declaration...

Is this something possible?

Which event am I supposed to use to query my custom attribute? ..Is there any something like global event that I can use so that something is always triggered whenever any method is executed?

No third-party plz.

Thanks,


Viewing all articles
Browse latest Browse all 12583

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>