I
I
iRumba2015-03-19 07:20:54
.NET
iRumba, 2015-03-19 07:20:54

Is it possible in C# to subscribe one event to another?

Hello.
Is it possible to build a chain of events and only bind to the last one?
For example, there is a tree - class MyTree, which is inherited from MyTreeNodeList
MyTreeNodeList controls the list of nodes MyTreeNode
MyTreeNode also has a reference to the child MyTreeNodeList
MyTreeNode can trigger the TextChanged event
MyTreeNodeList can trigger the NodeAdded event
So, I want the NodeAdded event, for example, to come from the current object to the main MyTree and called the OnAdd event there.
How can this be done without creating a function in the MyTreeNodeList class to handle the event? It's just that there are a lot of events that should reach the roots, do you really have to write a control function for each?

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question