How to create custom events in C#? [Resolved]

Posted by Rajeshatkiit under C# on 12/19/2015 | Points: 10 | Views : 693 | Status : [Member] | Replies : 8
How to create custom events using delegates?
Please give real example of event which you have created your own?
Please do not provide any web url.




Responses

Posted by: Rajnilari2015 on: 12/19/2015 [Member] [Microsoft_MVP] [MVP] Platinum | Points: 50

Up
0
Down

Resolved
OK, @Rajeshatkiit Sir, as you said
" I want to create custom event but i didn't get my answer any where. I have searched a lot but i didn't get proper answer."

So I just put the search criteria in google as "create custom events in c#" and it produced

About 9,52,000 results (0.45 seconds) (:

"If possible please provide sample program for creating events. "

In DNF ( http://www.dotnetfunda.com/articles/show/3019/event-accessors-and-lock-statements-in-csharp ) (:

Hope this helps

Thanks

--
Thanks & Regards,
RNA Team

Rajeshatkiit, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Rajnilari2015 on: 12/19/2015 [Member] [Microsoft_MVP] [MVP] Platinum | Points: 25

Up
0
Down
@Rajeshatkiit Sir, are you seriously taking our interview ?

"Please give real example of event which you have created your own ?"

Have a look at the way you have asked this question and the responses that you made in some other forum questions ( http://www.dotnetfunda.com/forums/show/20898/which-is-best-for-website-development-aspnet-or-mvc )

" I am asking about which is best ASP.net or MVC ? "

and ( http://www.dotnetfunda.com/forums/show/20899/what-is-difference-between-abstract-factory-and-factory-method-design )

"Plz explain in detail instead of posting url ."

Have you done any kind of research on the topic before asking the question. If so, where exactly you had the doubt ? We have provided a reference to you (because it was written elegantly and precisely addressed to your question) and requested you to go through that and once you have any doubt then please let us know where you have that.

Please don't ask a question where it reflects the dictatorship or dogmatism.

We hope you will accept our statement in a cordial manner.

Coming to the main topic

a) How to create custom events using delegates ?

No need to mention that. If there is any other way in dotnet for creating custom events without using delegates (or the later improvement i.e. Lambda), please let us know.

b) Please give real example of event which you have created your own?

Many. But among those many, I would like to highlight the best use-case (as of now). We were working on a project of Excel VSTO where we need to communicate between two different excel applications since their app domain changed. In simple words, any Publisher/Subscriber model will use this and generally the best design pattern for this is Observer DP.

Another example is to invoke the event of a control inside a user control in asp.net

c) Please do not provide any web url.

Obeyed.

Thanks for your understanding.

--
Thanks & Regards,
RNA Team

Rajeshatkiit, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Rajeshatkiit on: 12/19/2015 [Member] Starter | Points: 25

Up
0
Down
@Rajnilari2015 Thanks for reply. You have taken my questions in wrong way. I don't have intention to dominate any body or take interview of any one. I asked these question because, interviewer had asked me these type of question. I am here to learn .net technology. I want to create custom event but i didn't get my answer any where. I have searched a lot but i didn't get proper answer.

Rajeshatkiit, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Rajeshatkiit on: 12/19/2015 [Member] Starter | Points: 25

Up
0
Down
@Rajnilari2015 I didn't get my answer.
If possible please provide sample program for creating events.

Rajeshatkiit, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Rajeshatkiit on: 12/19/2015 [Member] Starter | Points: 25

Up
0
Down
You are not understanding my points.

Rajeshatkiit, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Rajnilari2015 on: 12/19/2015 [Member] [Microsoft_MVP] [MVP] Platinum | Points: 25

Up
0
Down
@Rajeshatkiit Sir, please ask the question precisely so that others can have a better understanding (as an example, have a look at ( http://www.dotnetfunda.com/forums/show/20913/why-do-we-use-replaceall-method-in-jquery ) the way the OP has asked. Like that many questions are asked precisely. And when you are in a Forum of a particular site, please check if already the answer/solution to the question is available or not. If it is available but not satisfying your need (after going thru the material properly) , then please ask where exactly it's not fathomable.

"You are not understanding my points."

Seriously not understanding "points" (though the literal meaning is known)

We hope , we do make ourselves clear.

--
Thanks & Regards,
RNA Team

Rajeshatkiit, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Rajnilari2015 on: 12/19/2015 [Member] [Microsoft_MVP] [MVP] Platinum | Points: 25

Up
0
Down
" I asked these question because, interviewer had asked me these type of question."

Did seriously the interviewer asked you -

"Please do not provide any web url. " ?



--
Thanks & Regards,
RNA Team

Rajeshatkiit, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Sheonarayan on: 12/19/2015 [Administrator] HonoraryPlatinum | Points: 25

Up
0
Down
Thanks Rajnilari2015 for responding to the question and thanks Rajeshtkiit for asking question and for understanding Rajnilari2015's the point of view.

I would highly recommend to read these posts http://www.dotnetfunda.com/forums/show/1503/forum-guidelines-before-posting-or-answering-a-question and http://www.dotnetfunda.com/forums/show/10687/how-to-answer-the-forum-questions-to-improve-the-forum for everybody who either ask questions or respond to a question.

The whole idea is that we help each other out of our interest, hobby and as a community so we all must choose the words carefully while asking or responding so that it doesn't hurt others.

I strongly feel that we are mature community and sometimes difference of opinions or misunderstanding may happen while communicating via words without seeing each others face. So we all should ignore these things and continue to help each as a DotNetFunda community to make this a healthy place to learn, share and grow together.

Thanks again and keep up the great work together.

Regards,
Sheo Narayan
http://www.dotnetfunda.com

Rajeshatkiit, if this helps please login to Mark As Answer. | Alert Moderator

Login to post response