473,396 Members | 1,929 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

Attributes

Hi All...

I have a Auditing system. I want to send Audit messages using attributes. I
managed to activate the ContextAttribute object, BUT it forced me to inherit
from ContextBound object (which is too much for me, cause I want to use this
attribute auditing also in web pages).
Is there any option to do so ?
Maybe the solution is somewhere in the Demand staff (.NET rle base
security).... How is that check enabled ??

Thanks a lot,...

Zviki.
Jul 19 '05 #1
2 1463
You can apply attributes to any construct specified in AttributeTargets.
The thing is, they don't automatically execute, as they are merely
attributes. Certain attributes appear to do so (like
SoapExtenstionAttribute and ContextAttribute) because a superclass has a
method call that introspects the construct to search for appropriate
attributes of a certain type and acts upon them. So, to make a long story
short, the only way you can have certain web pages execute an attribute is
to insert it into an already-existing attribute-checking infrastructure
(again, SoapExtensionAttribute is a fine example, as the web service
superclass automatically looks for SoapExtentionAttributes)
Another avenue is to put some code to look for and deal with attributes in
some central method call (an MSDN search for SqlParameterAttribute will
produce an article illustrating this)

"Zviki Goldberg" <zv****@matrix.co.il> wrote in message
news:%2****************@TK2MSFTNGP12.phx.gbl...
Hi All...

I have a Auditing system. I want to send Audit messages using attributes. I managed to activate the ContextAttribute object, BUT it forced me to inherit from ContextBound object (which is too much for me, cause I want to use this attribute auditing also in web pages).
Is there any option to do so ?
Maybe the solution is somewhere in the Demand staff (.NET rle base
security).... How is that check enabled ??

Thanks a lot,...

Zviki.

Jul 19 '05 #2

"Zviki Goldberg" <zv****@matrix.co.il> wrote in message
news:%2****************@TK2MSFTNGP12.phx.gbl...
Hi All...

I have a Auditing system. I want to send Audit messages using attributes. I managed to activate the ContextAttribute object, BUT it forced me to inherit from ContextBound object (which is too much for me, cause I want to use this attribute auditing also in web pages).


Why is this a problem? In an auditing system you want to get informed when
an object method is called. By creating a new context you are defining a
context boundary that must be crossed when method calls are made, hence you
can intercept those calls and do your auditing. The is procisely what
contexts are for (allowing you to intercept method calls).

Have a look at this magazine article for more details (or even buy Juval
Lowy's recent book on .NET Components):

http://msdn.microsoft.com/msdnmag/is...ContextsinNET/

Richard
--
my email ev******@zicf.bet is encrypted with ROT13 (www.rot13.org)
Jul 19 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

50
by: Dan Perl | last post by:
There is something with initializing mutable class attributes that I am struggling with. I'll use an example to explain: class Father: attr1=None # this is OK attr2= # this is wrong...
1
by: John L. Clark | last post by:
I am curious as to the rationale, and effect, of having default namespaces not applying (directly) to attributes (see http://www.w3.org/TR/REC-xml-names/#defaulting). Given an attribute without a...
9
by: Soren Kuula | last post by:
Hi, I just can't find namespaces of attributes stated clearly enough in the XML namespace spec. But .. I hear rumors that attributes, unless qualified otherwise, default to the namespace of the...
7
by: Info 3000 | last post by:
Hello, I'm beginner in XML. I have just a little question : I understand that I can write : <Book> <Title> A nice day </Title> <Author> James Nicepen </Author> </Book>
7
by: John R. | last post by:
How do you set the following file attributes: Compressed Encrypted Normal ReparsePoint SparsePoint You CAN'T set these using FileInfo.Attributes or File.SetAttributes. It doesn't work for...
7
by: localhost | last post by:
What is the best and/or fastest way to enumerate attributes of an HTML control? In my page template, I have: <body id="myBody" bottomMargin="0" leftMargin="0" topMargin="0" rightMargin="0"...
3
by: Janaka | last post by:
I've seen and used some samples where you can set the onclick attrubute to a Button control to get it to do some javascript a la : btnUse.Attributes = "DoSomeJS()"; However when i try and get...
2
by: prabhupr | last post by:
Hi Folks I was reading this article (http://www.dotnetbips.com/articles/displayarticle.aspx?id=32) on "Custom Attribute", written by Bipin. The only thing I did not understand in this article...
2
by: james_027 | last post by:
hi everyone, I am now in chapter 5 of Dive Into Python and I have some question about it. From what I understand in the book is you define class attributes & data attributes like this in python...
2
by: cloftis | last post by:
Using VS2003, VB and MSHTML, Using an HTMLSpanElement I want to enumerate the attributes of a SPAN tag. 1 'For testing sake 2 Dim strMarkup as String = "<span attr1='somevalue'...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.