H
hardieca
Hi!
I have built a custom attribute that tracks my list of things left to
do in my application:
[ToDo("hardie.ca", "2007-07-16", Comment:="Fix recursion")]
Public Class SomeClass ...
Using reflection, I am able to find all attributes within the App_Code
folder:
Assembly a = Assembly.Load("__code")
string alltypes = "";
Type[] types = a.GetTypes();
foreach (Type t in types) {
MemberInfo inf = t;
object[] attributes;
attributes = inf.GetCustomAttributes(typeof(ToDoAttribute), false);
foreach (object attribute in attributes) {
ToDoAttribute todo = (ToDoAttribute)attribute;
alltypes += "<p>" + t.ToString() + "<br>";
alltypes += "Programmer: " + todo.Programmer + "<br>";
alltypes += "Date: " + todo.LogDate + "<br>";
alltypes += "Comments: " + todo.Comment + "</p>";
}
}
My problem is I would like to decorate the classes of Aspx pages, but
because they don't reside within the App_code folder, I can't get a
reference to their assembly. Is there some way to do this?
Thanks,
Chris
I have built a custom attribute that tracks my list of things left to
do in my application:
[ToDo("hardie.ca", "2007-07-16", Comment:="Fix recursion")]
Public Class SomeClass ...
Using reflection, I am able to find all attributes within the App_Code
folder:
Assembly a = Assembly.Load("__code")
string alltypes = "";
Type[] types = a.GetTypes();
foreach (Type t in types) {
MemberInfo inf = t;
object[] attributes;
attributes = inf.GetCustomAttributes(typeof(ToDoAttribute), false);
foreach (object attribute in attributes) {
ToDoAttribute todo = (ToDoAttribute)attribute;
alltypes += "<p>" + t.ToString() + "<br>";
alltypes += "Programmer: " + todo.Programmer + "<br>";
alltypes += "Date: " + todo.LogDate + "<br>";
alltypes += "Comments: " + todo.Comment + "</p>";
}
}
My problem is I would like to decorate the classes of Aspx pages, but
because they don't reside within the App_code folder, I can't get a
reference to their assembly. Is there some way to do this?
Thanks,
Chris