473,387 Members | 1,844 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.

ActionLists?

Hi All,
(You guys must be getting bored of me asking questions here!). In Delphi
(and other windows development) one can create action lists. These hold a
list of actions which encapsulate an event sink, an icon and text
representing the functionality of that sink as well as other useful
attributes such as whether the sink is enabled or not. These action lists
were great as you could set the various controls on your form to use
particular actions. Once a control was allocated an action that control's
text field, icon and event handler were set to those of the actionlist.

The big advantage with the above approach is that you could (for instance)
have a main menu entry, a speed menu entry and even a toolbar button all
point to the same action. This has the effect of assuring that the
functionality for a an action only need be written once and if an attribute
is changed on the action (such as the enabled property) all the other
controls using that action take on the new attribute change.

As far as I can tell C# has no actionlists in it (at least as far as my
standard edition is concerned). Is there a new .net replacement or
equivalent?

Thanks
RobP
'There are only 10 types of people in this world - Those that understand
binary and those that don't'
Oct 22 '06 #1
4 2082
DC
I have no idea Delphi and actionlists but I wouls assume that what you are
after is the event/delgate model.
Delegates are essentially an objects that encapsulate a 'function pointer'.
If you want to register the same action on a context menu and 'main' menu,
create the delegate explicitly and add it to both events.

e.g

EventHanlder menuHandler = new EventHandler(handleMenuClick);
contextMenuItem.Click += menuHandler;
mainMenuItem.Click += menuHandler;
"Rob Pollard" <ro************@hotmail.comwrote in message
news:ln*******************@fe3.news.blueyonder.co. uk...
Hi All,
(You guys must be getting bored of me asking questions here!). In Delphi
(and other windows development) one can create action lists. These hold a
list of actions which encapsulate an event sink, an icon and text
representing the functionality of that sink as well as other useful
attributes such as whether the sink is enabled or not. These action lists
were great as you could set the various controls on your form to use
particular actions. Once a control was allocated an action that control's
text field, icon and event handler were set to those of the actionlist.

The big advantage with the above approach is that you could (for instance)
have a main menu entry, a speed menu entry and even a toolbar button all
point to the same action. This has the effect of assuring that the
functionality for a an action only need be written once and if an
attribute is changed on the action (such as the enabled property) all the
other controls using that action take on the new attribute change.

As far as I can tell C# has no actionlists in it (at least as far as my
standard edition is concerned). Is there a new .net replacement or
equivalent?

Thanks
RobP
'There are only 10 types of people in this world - Those that understand
binary and those that don't'

Oct 22 '06 #2
Rob,

There are ActionList implementations on Code Project. Here is one in
particular:

http://tinyurl.com/tcysq

--
http://www.hadihariri.com
http://www.malagadnug.org
Oct 22 '06 #3
Hi Hadi,
That was just what I'm looking for. I'm so suprised that c# doesn't come
with this by default as it helps produce consistent UI's.

Thanks for your help

RobP
'There are only 10 types of people in this world - Those that understand
binary and those that don't'
<Hadi Haririwrote in message news:uJ**************@TK2MSFTNGP04.phx.gbl...
Rob,

There are ActionList implementations on Code Project. Here is one in
particular:

http://tinyurl.com/tcysq

--
http://www.hadihariri.com
http://www.malagadnug.org

Oct 22 '06 #4
"Rob Pollard" <ro************@hotmail.coma écrit dans le message de news:
04*****************@fe1.news.blueyonder.co.uk...

| That was just what I'm looking for. I'm so suprised that c# doesn't come
| with this by default as it helps produce consistent UI's.

Action Lists are not part of the Delphi language, they are components
provided as part of the VCL. C# doesn't have any "components", however the
FCL does, but it does not provide a direct replacement. However, it is such
a simple concept to implement and, sure enough, as Hadi points out, someone
has already done this.

Joanna

--
Joanna Carter [TeamB]
Consultant Software Engineer
Oct 22 '06 #5

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

Similar topics

0
by: Joshua Flanagan | last post by:
I have a custom CompositeControl (FooControl) whose child controls are determined at runtime. I created a custom CompositeControlDesigner (FooControlDesigner) which displays the control at design...
7
by: Oleg Subachev | last post by:
What is C#'s analogue of Delphi's TAction ? If there is no one, how to implement the same functionality > Oleg Subachev
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: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
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
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?
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.