473,387 Members | 1,611 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,387 software developers and data experts.

Attributes and events

One can specify an event as either the raw event:

__event System::EventHandler * OnSomethingChanged;

or as a series of add_,remove_, and raise_ methods:

__event virtual void remove_OnSomethingChanged(System::EventHandler *);
__event virtual void add_OnSomethingChanged(System::EventHandler *);
__event virtual void raise_OnSomethingChanged(System::Object,
*System::EventHandler *);

In the latter case, when creating an attribute for the event, ie.
[System::ComponentModel::DescriptionAttribute("Some thing Changed")] , is it
sufficient to specify it before any one of the __event member functions, or must
one repeat the attribute for all ?
Nov 17 '05 #1
2 849
In the case of properties, applying to any of the get_ or set_ works, so I
guess the same should hold true for events as well.

- Atul
Sky Software http://www.ssware.com/
Shell MegaPack ActiveX & .Net
Drop-In Windows Explorer-Like Shell Browsing UI for your apps.
"Edward Diener" <ed*******************@tropicsoft.com> wrote in message
news:eK**************@TK2MSFTNGP09.phx.gbl...
One can specify an event as either the raw event:

__event System::EventHandler * OnSomethingChanged;

or as a series of add_,remove_, and raise_ methods:

__event virtual void remove_OnSomethingChanged(System::EventHandler *);
__event virtual void add_OnSomethingChanged(System::EventHandler *);
__event virtual void raise_OnSomethingChanged(System::Object,
*System::EventHandler *);

In the latter case, when creating an attribute for the event, ie.
[System::ComponentModel::DescriptionAttribute("Some thing Changed")] , is
it sufficient to specify it before any one of the __event member
functions, or must one repeat the attribute for all ?

Nov 17 '05 #2
Atul wrote:
In the case of properties, applying to any of the get_ or set_ works
Yes, I know.
, so I
guess the same should hold true for events as well.
I hope so but I was hoping someone knew for sure. Maybe no one has ever used an
attribute with the extended form of specifying events. I will assume I only need
the attribute on one of the three event methods.

- Atul
Sky Software http://www.ssware.com/
Shell MegaPack ActiveX & .Net
Drop-In Windows Explorer-Like Shell Browsing UI for your apps.
"Edward Diener" <ed*******************@tropicsoft.com> wrote in message
news:eK**************@TK2MSFTNGP09.phx.gbl...
One can specify an event as either the raw event:

__event System::EventHandler * OnSomethingChanged;

or as a series of add_,remove_, and raise_ methods:

__event virtual void remove_OnSomethingChanged(System::EventHandler *);
__event virtual void add_OnSomethingChanged(System::EventHandler *);
__event virtual void raise_OnSomethingChanged(System::Object,
*System::EventHandler *);

In the latter case, when creating an attribute for the event, ie.
[System::ComponentModel::DescriptionAttribute("Some thing Changed")] , is
it sufficient to specify it before any one of the __event member
functions, or must one repeat the attribute for all ?

Nov 17 '05 #3

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

Similar topics

0
by: gcash | last post by:
I'm having problems with some attributes in Internet Explorer. I'm trying to figure out how to set things up so I don't have to do my own event loop even though I'm using DispatchWithEvents() ...
4
by: rufus | last post by:
I want to add 2 'onclick' events to a link button but, of course, the javascript wont work. In other words: linkbutton.Attributes.Add("onClick", "MyFunction1();")...
3
by: xAvailx | last post by:
I apologize ahead of time for the long post... Background: Working on a CRM type custom application. The application is for an event management company. The company will provide the application...
5
by: Flipje | last post by:
In my view, there is a major drawback to using attributes: the getter and the setter have identical protection levels. But I usually want the getter to be public and the setter to be protected or...
2
by: Showjumper | last post by:
I have a problem. Somecontrol.Attributes.Add is not working for me nor is page.registerclientscriptblock. I have created a script using the stringbuilder class. Then when i try to register it on...
1
by: Dhruba Bandopadhyay | last post by:
I know that JavaScript lets us add: ondragenter, ondragover, ondragleave, ondrop events to normal HTML table td tags. This lets us do highlighting of table cells/rows, and capture drag & drop...
11
by: Nathan Sokalski | last post by:
I add several JavaScript events (onchange, onkeypress, etc.) to Controls using the Add method of the Attributes collection. However, if the JavaScript code contains certain characters, such as & or...
0
by: KJ | last post by:
I have developed some ascx controls using VS2005. Some of these controls have public events. I would like to reference these events by name as attributes in the tag of the control where it is...
1
by: Max | last post by:
Hello everyone! I would want to know if reserved attributes (xml:lang, xml:space, xmlns:prefix etc.) are parsed and registered as normal attributes. As an example: xmlns:cc="http://namespace"...
2
by: Safalra | last post by:
Recently I've rewritten much of my old Javascript code to use DOM functions so that enhancements can be attached to documents without needing to alter the HTML code. I assumed that adding event...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
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
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
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
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

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.