Тёмный

C# Events and Delegates Made Simple | Mosh 

Programming with Mosh
Подписаться 4 млн
Просмотров 935 тыс.
50% 1

🔥Get the COMPLETE course (75% OFF - LIMITED TIME): bit.ly/2s3qkxn
Want to learn more from me? Check out these links:
Courses: codewithmosh.com
Blog: programmingwithmosh.com
Facebook: / programmingwithmosh
Twitter: / moshhamedani
Are you confused about events and delegates in C#? Watch this tutorial and your confusion will be gone in 30 minutes!
Check out my other C# video tutorials:
Debugging in Visual Studio
• Debugging C# Code in V...
Generics
• C# Generics Tutorial: ...

Опубликовано:

 

16 ноя 2014

Поделиться:

Ссылка:

Скачать:

Готовим ссылку...

Добавить в:

Мой плейлист
Посмотреть позже
Комментарии : 1 тыс.   
@sanfordhoffman2392
@sanfordhoffman2392 8 лет назад
I've looked at a lot of tutorials for events. This one did the trick for me. Broken down to its simplest form. Thank you very much Mosh.
@MrRasZee
@MrRasZee 5 лет назад
mosh is fairly good, i always cross reference when i study
@HingalshDealer
@HingalshDealer 2 года назад
same with me
@jakeowsley6552
@jakeowsley6552 3 года назад
As a seasoned C++ developer, I don't know why events and delegates aren't explained this way: straightforward and uncomplicated. Thank you, Mosh.
@arrrryyy
@arrrryyy 10 месяцев назад
He did not explain the basic but right away went to type of events standard code used only in winforms and webforms
@eobardthawne6903
@eobardthawne6903 8 месяцев назад
​@@arrrryyywhat is at 1:00 ?
@emzyempire658
@emzyempire658 7 месяцев назад
I couldn't agree more
@jagroop31521
@jagroop31521 8 лет назад
This is called teaching skills , explained complex topi in simple way like int i =0;. Great job!!
@purpleice2343
@purpleice2343 8 лет назад
*TRIGGER WARNING, ARGUING FOR THE SAKE OF ARGUING, it is also rhethorical question, tutorial is good* How am I supposed to know what int is and why I need ; at the end of line if I never looked at code before nor know what anything means?
@gkjnsdfg454
@gkjnsdfg454 8 лет назад
If you don't know what an int is or what the semi colon is for you shouldn't be learning about events and delegate...in fact you should be learning the absolute basics if you don't know what either of them are for. It would be like trying to learn to run, yet you can't even crawl..
@purpleice2343
@purpleice2343 8 лет назад
Daniel Rosenbrock You shouldn't be on internet if you take everything seriously, fuck off.
@gkjnsdfg454
@gkjnsdfg454 8 лет назад
Mate I encounter many idiots on the daily just assumed you were one of them...now I know you are one of them :)
@JordanMetroidManiac
@JordanMetroidManiac 8 лет назад
+Daniel Rosenbrock There wouldn't be any arguing if you just explained to him what they do instead of criticizing him. It's as simple as saying, "Semicolons indicate the end of each line. Ints are integers."
@Phcodesign
@Phcodesign 5 лет назад
Clear and uncluterred as usual. Mosh is one of my favorite teachers. I respect all my teachers, and so the Mosh! Thanks!
@zithfrg
@zithfrg 8 лет назад
One of the best tutorials I have ever seen in RU-vid. You gained a new subscriber today. Keep up the good work man!
@biggs6466
@biggs6466 Год назад
Years after the fact and this is still the best video that explains this subject. Thank you so much for your simple, no-nonsense explanation and easing the viewer into the more complex subject matter only *after* explaining the absolute basics.
@cyclewithjb
@cyclewithjb 2 года назад
Love how you basically started from nothing instead of started with the codes already in place. Always thankful for your generosity and willingness to teach other people.
@greenbear9790
@greenbear9790 2 года назад
Even 7 years later after this video has been uploaded, I want to notice you that there are many people who are still confused about it. and there are many books and tutorial videos on youtube, but there is no such tutorial video that explains how to use it and why it's used that well and simple. This is one of the best and awesome tutorials I've ever met. thanks to your video, their people never need to buy a book for it.
@obo6261
@obo6261 3 года назад
Dude this tutorial is sick, thank you so much. As a less experienced programmer, explaining this programming concept in detail without a heap of jargon made this superrrrr accessible
@JedaiSaboteur
@JedaiSaboteur 6 лет назад
I've struggled with delegates and events for a long time and this is the tutorial that drove it home for me.
@scotmcpherson
@scotmcpherson 3 года назад
This is probably the best tutorial on events and event handlers....all the other's just whip right through each concept and it's nearly impossible to follow unless you already understand it...in which case you don't need the tutorial. You take the time to explain what each thing REALLY IS and the HOW and WHY that thing is important for creating a successful event.
@Andre-wu9fe
@Andre-wu9fe 5 лет назад
To be honest, I never expected a tutorial this good when I felt like reading up on delegates and events again after feeling like I lacked in this area. This video was incredibly helpful, and explained the topic in a simple and the most uncomplexed way possible. Subscribed. Thank you.
@shawnemartin3410
@shawnemartin3410 8 лет назад
This is great! I really appreciate that you took the time to first show the 'formal' way of doing it then showing the shortcut.. most would just show the shortcut!
@lgfdecv4133
@lgfdecv4133 7 лет назад
This video has solved my question very well,I have been confused about events and delegates for several months and i try to understand them by reading books,but it is not easy to understand them fully until i meet this video, thank you,Mosh,Good job!
@turtleboy3628
@turtleboy3628 18 дней назад
You can always rely on this guy Mosh, I have already bought some of your courses and now I am definitely buying your C# one, thankyou so much!
@datkidkizzle
@datkidkizzle 8 лет назад
This is by far the best and most complete introductory tutorial for Delegates and Events that I have ever seen. You did a fantastic job of explaining all the different aspects of events, why they are useful, and I love how you started from a simpler design and then went back and added some more to it.
@MrToksvienas
@MrToksvienas 8 лет назад
helped me instantly man!! Now I can see!!!!!!!!!!!!!!!!!
@phjorland
@phjorland 7 лет назад
Very clear, thank you very much! Keep making videos like this- many, many thumbs up will follow
@walkercase1836
@walkercase1836 7 лет назад
Same, I looked all over the MSDN website and it just didn't explain anything well. Thanks a ton man!
@nailalzuhairi2690
@nailalzuhairi2690 7 лет назад
hmmmm , so what would you then say if u watch his Video about INTERFACES, showing that so many books and youtubers teaching the developers false concepts like ( INTERFACE is used for Multi-inheritance ).. If you are one of those who thing the INTERFACE is so , so I would strongly recommend you to watch his legendary Course "C# Intermediate Classes, Interfaces and OOP"
@crabsynth3480
@crabsynth3480 5 лет назад
Best Comment Ever ! :P
@sensans5238
@sensans5238 2 года назад
This actually helped me a lot, I have been struggling for hours. So simple and straight to the point. Thank you very much!
@ebayoscorner5512
@ebayoscorner5512 4 года назад
After three years in C#, I finally understand events and Delegates.....I have to go and refactor some codes....Many thanks Mosh......Greetings from Nigeria
@anhtuanle8318
@anhtuanle8318 2 года назад
Man, my teacher spent hours explaining this, and i couldnt seem to grasp it, but with just merely 30mins of your video, i got it, thanks bro, appreciate it, this is simplicity at its finest
@mgeorgescu
@mgeorgescu 9 лет назад
More C# tutorials sir, you are amazing.
@WholeNewLevel2018
@WholeNewLevel2018 8 лет назад
This is the Best Video on Events and Delegates ....... Thanks So Much ... and Pls keep up .....
@MelechFreedman
@MelechFreedman 7 лет назад
I finally understand events!! Your amazing. I've Been programming for over ten years and avoiding events for as long as I can. Now I can create true uncoupled code. I've subscribed and set alerts!!!!!! Thank you!!!!!
@Jolnichek
@Jolnichek 8 лет назад
I just made it through the course ..slowly... took hour and a half following along and making notes etc...I can actually say I completely understand this material. The cool thing is that you seem to anticipate listener questions as you teach. Just when I seemed to be getting a little confused you added the precise depth needed to bring me right back on course. Thank you!
@patz540
@patz540 8 лет назад
This was amazing exhibition of using delegates and events with a superb real time example.Amazing work.You have a new subscriber to your list :)
@hikkenwayans
@hikkenwayans 8 лет назад
EXCELLENT TUTORIAL!!!
@pmcgktr
@pmcgktr 3 года назад
I've been working on a feature in an app I'm doing for a client and literally spent 10 hours of jiggery pokery in the code with nothing working. 2/3rds of the way through the video and with a little tweaking I got the feature working!! 😭 Thank you so much you are a god send!!!!! 😭
@UmeshKumar-ox3zp
@UmeshKumar-ox3zp 7 лет назад
At last I found one video which really explains what delegates and events are all about. I owe to you for this great video, Mr. Mosh.
@gunting
@gunting 5 лет назад
Holy cat, this is the most clearest and easiest explanation to follow
@vipulzambare5329
@vipulzambare5329 9 лет назад
Best video to understand events and delegates.. Thanks!!!
@ismaelsanchez3492
@ismaelsanchez3492 3 года назад
I’ve seen many videos to try understand Events and Delegates, I can say this is the most clear, understandable and practical of them all. Congrats!
@ThreeBeerMinimum
@ThreeBeerMinimum 6 лет назад
OK, by far the best freaking Teacher out there. You took something complex and broke it down. I will be purchasing your course SIMPLE BECAUSE YOU DESERVE IT! whether my or my co-workers need it or not - you're getting it!
@viktoradamsky8319
@viktoradamsky8319 8 лет назад
The best explanation I've ever seen on RU-vid on this topic!!! Thanks! Cheers from Russia!
@douglascristhian7178
@douglascristhian7178 9 лет назад
Nice job! congrats from Brazil!
@jonathantanu2209
@jonathantanu2209 7 лет назад
Thank you so much for explaining the concept of event-driven development utilizing delegate in C#. It has been a stressful time trying to understand what delegate is for and now I understand it. Once again, thank you.
@k4kfh
@k4kfh 5 лет назад
This saved my bacon. Thank you so much!!! I was so confused, especially about delegates, but you explained the relationship and all the syntax perfectly in simple examples without 100 lines of confusing extras.
@pebito
@pebito 8 лет назад
Awesome! Thanks for posting this. Gotta watch it again a few times to get the hang of it though :)
@Thoscellen
@Thoscellen 8 лет назад
Same as many other, you made Delegates and Events Crystal Clear to me :D. But, why have you used EventHandler over Func and Action ? What are the Pro and Cons ?
@donfeto7636
@donfeto7636 5 лет назад
Thoscellen cuz of argument bro sender and eventarg are only in eventhander fun action predicate related to linq i think
@jasonchu852
@jasonchu852 4 года назад
It is the best tutorial on c# "Events and Delegates" that I've ever seen!
@ashishbhardwaj5908
@ashishbhardwaj5908 9 лет назад
Mosh. You are a genius. In my entire career I didn't see so much easily explained video on such confusing subject Event and Delegate. Good Job...
@lucaschambe
@lucaschambe 5 лет назад
This tutorial was extremely helpful
@MaamuBhanjiVines
@MaamuBhanjiVines 3 года назад
Events/Delegates is asked in every .NET interview and I have always shied away from this topic. I have an interview tom morning and can't wait to explain this exact same thing to the interviewer :p Thanks Mosh!
@alexisbarrette7652
@alexisbarrette7652 3 года назад
So how did you do? Were you asked about delegates during the interview?
@Gauravkumar-jm4ve
@Gauravkumar-jm4ve 3 года назад
Yea same with m I also shy from delegates
@MaamuBhanjiVines
@MaamuBhanjiVines 3 года назад
I was able to defend my hold on events/delegates this time. Practical examples do help 👍
@seanpenn6994
@seanpenn6994 2 года назад
Bro you have given me a new life by explaining this video on delegates and classes and resharper..i am so grateful..i wish i had the confidence to check this video out sooner..but i am hoping with your blessings i can find good work in software again..just low on confidence the last 2 and half years after losing my family and now getting to see my son once a week and for christmas and new years..you saved my life bro...grateful..god bless you...sorry for being overdramatic but such is life now..parents are the only ones who care about me and my son
@murphyochuba5340
@murphyochuba5340 4 года назад
This is unarguably the best video I have seen on C# events and delegates. Very detailed and explanatory!
@akisey1
@akisey1 7 лет назад
This is some top quality teaching! Subscribed! +=
@ArpanMukhopadhyay93
@ArpanMukhopadhyay93 3 года назад
hahaha nice
@vitaliysakun-duvalko8946
@vitaliysakun-duvalko8946 2 года назад
subscribers ++;
@SantoshMishra-rw6fy
@SantoshMishra-rw6fy 8 лет назад
Very nice video, hard work is done to help others.Really different perrsonality
@wdujsub7902
@wdujsub7902 3 года назад
Excellent explanation! I had just a vague idea about how events come into existence and how they work, but I had no problem implementing events into my project and understanding it throughly after the video. The explanation was so clear that there was no need to pause, because everything was put so simply that it seemed that I knew it all along. Thank you.
@et379
@et379 9 лет назад
This video is great! I was reading so much on the internet about this, but the examples used, were not explained step by step as you do. Now I finally understood how to use events correctly and also learned a bit about delegates. Thanks!
@MasterTeeee
@MasterTeeee 5 лет назад
To expand on this quickly: delegate = More or less a variable, but rather than storing data, it stores one or more methods, provided they adhere to the exact signature. event = Expands on delegate to provide protection for malicious code potentially being run... Things like the delegate being overriden or overloaded, and a few other things like that. Technically, this can all be done without using the event keyword at all. You can just add the other classes [the subscribers] to the delegate method, and when the publisher calls the delegate method, it runs through every method that has been stored in it. Just to give an actual explanation of what's going on here...
@AonyjsViolmlar05
@AonyjsViolmlar05 2 года назад
If you were my college teacher i'm probably a software architect now.
@Trio_In_Dubai
@Trio_In_Dubai 8 лет назад
The best video lesson about C# programming I've ever seen. Now i'm reading Andrew Troelsen Pro. C# and after i read that topic in my book i was little bit confused. I wached many videos about that in russian language, cause i'm not wery good in english. Then I saw that lesson and now it is clear. Thank you! I'm subscribing.
@newandroidfan
@newandroidfan 3 года назад
Damn, you've taught this topic in less than 15 minutes and Tim Corey couldn't even do it in 40 minutes. Honestly, I'm disappointed in how Corey chose to explain this topic and Tim seems like he doesn't plan his videos, at least when he's trying to explain a intermediate concept.
@sinanmuhamedagic6475
@sinanmuhamedagic6475 4 года назад
was watching this video 1 hour before an uni deadline. you've saved me. thank you.
@marcu54h
@marcu54h 5 лет назад
Well recorded video. Voice isn't tiring. I watched all ads without shortcuts (not happens too often) to support the author. Thank You!
@saifmuslim9376
@saifmuslim9376 8 лет назад
I don't have better words than what Viktor said "The best explanation I've ever seen on RU-vid on this topic!!! Thanks! Cheers from UK"
@mindblower113
@mindblower113 9 месяцев назад
I don't remember I learned that much information within a 30 minute video with ease. Thanks big man!
@ghazwan2568
@ghazwan2568 6 лет назад
You were born a teacher man, my absolute favorite instructor and one of my reasons to pick .Net stack because you explain it very well greetings from Syria.
@ahmedelwa2000
@ahmedelwa2000 4 года назад
و الله يا موش أي حد بيرشح أي حاجة من ناحيتك بفتحها و اتعلمها و أنا مغمض و كل مرة مش بتخيب ظني ♥ شكراً يا موش Thank you mosh ♥
@ArmaghanUljamil
@ArmaghanUljamil 8 лет назад
Awesome video. I always gets confused when defining and raising events in C#. You have explained it very simply!! great job.
@AJ-xd2wt
@AJ-xd2wt 3 года назад
studying c# in school now and could not get this right, you explain this so much better! thank you for the simple explanation.
@poboyinsamsara
@poboyinsamsara Год назад
Ive been trying to get a clear explanation of how events work for weeks. Best explanation I have found. Thank you.
@ChinmayPrasoon
@ChinmayPrasoon 7 лет назад
Dude that was awesome. I read this thing at so many places and still did not get the concept. U nailed it in my head. Million thanks :)
@flabberdog
@flabberdog 4 года назад
You made this click instantly in my head. Much better than the paid tutorials!
@nithinchandran7959
@nithinchandran7959 6 лет назад
After one year of programming, got the idea of events and delegates just a few minutes ago. Great teaching Mosh
@user-xg7hi5mh3g
@user-xg7hi5mh3g 3 года назад
I've watched a lof of Videos learning c# ididn't got the Meaning of Delegate, Events before, but Now its more Clear and simple Thank u so much and i had never make a like for a video before but u absolutelry deserve it
@mbb720
@mbb720 4 года назад
Man, it took me about an hour and a half to finish this because of all my rewinding and note taking... but I understand it! Great video!
@cloud77hot40
@cloud77hot40 6 лет назад
It’s 1am in my area, and I think I have to watch this video a few more times to understand everything and get ahead in my advance C# class. Great Video!
@mattshu
@mattshu 7 лет назад
I watched this 7 months ago and only sort of understood the concept. I bought your Intermediate course on sale at Udemy and got to the INotificationChannel section which brought me back here to this video. Now I can fully comprehend it! Thanks again! :)
@ahmedhani555
@ahmedhani555 2 года назад
@Programming with Mosh i watched +6 videos trying to understand events + uni scripts... and couldn't understand it. And this video made it so simple and easy
@InfectionSaarg
@InfectionSaarg 8 лет назад
This is one of the nicest and well-explaining videos regarding programming in C# that I've found on RU-vid. Would even say that it's Pluralsight-level, although it's free to watch. Thank you very much, keep up the good work!
@sipi41
@sipi41 4 года назад
Thanks Mosh, always so good! I did take your React course, I did abandon but it was because I did not see much utility if Blazor is coming... I would like to see you explaining Blazor, we need that!
@Zergosss
@Zergosss 9 лет назад
This is the best tutorial on Events & Delegates available anywhere on the internet. Thank you for sharing your knowledge.
@klsjdflksjfd
@klsjdflksjfd 3 года назад
Thank you so much Mosh. This is the best delegate/event tutorial for C# I have seen. I had to watch the video twice but at the end of the second watching I had a strong understanding of these concepts. Thank you!
@QuickZ_
@QuickZ_ 6 лет назад
Fantastic video. Everything was understandable. My poor memory is overwhelmed so I will have to rewhatch this tutorial probably 3 times but at least I see the light in the delegate tunnel. I have been struggling for several days to understand how to implement delegate in your everyday coding.
@AmitVerma-uc1fc
@AmitVerma-uc1fc 9 лет назад
Perfect......main part of this video is what was the need of events and delegates and you mention it very well that is to make loose connection between two or more entities...no body mentioned this point except how to implement it, and bla bla bla bla ..thanks a lot Mosh...
@TheCodingKent
@TheCodingKent 2 года назад
Always struggle with the event and delegate. This video makes me understand them very well. Thank you so much.
@roydonk2878
@roydonk2878 3 года назад
All of the other comments already said it, but let me repeat it: this is such a great tutorial/lecture. Thanks for the content!
@mrtalukdarr
@mrtalukdarr 2 года назад
Viewing it in 2021 really saved me a lot of effort with a lot of things in Unity, thanks a lot!
@kitsVideo
@kitsVideo 8 лет назад
Absolutely amazing tutorial! This tutorial allowed me to implement drag and drop functionality of objects embedded in controls in my c# application. Thanks!
@Shamikix
@Shamikix 8 лет назад
Great video! I was very confused about the difference between Delegate and EventHandler, thank you for clearing this up.
@sudheshg
@sudheshg 9 лет назад
thank u mosh . now i have clearly understood clearly what is the use of event handler and delegates to write a loosely coupled events for pub / sub pattern.
@bahozm7214
@bahozm7214 7 лет назад
This video was more simpler than most of the other videos on delegates and events that I have seen. Thanks!!!
@elineoosterloo3555
@elineoosterloo3555 5 лет назад
There are so many tutorials that don't explain and just 'do'. Thanks for really explaining, I learned a lot.
@kenc4208
@kenc4208 7 лет назад
Best material on Events and Delegates i have watched on here. Very clear and gets to the point!
@joro353
@joro353 7 лет назад
This is by far the best explenation of events and delegates. Great job Mosh!
@TomkhaDev
@TomkhaDev 4 года назад
Great tutorial, especially with showing the exact thing the EventHandler classes accomplish it finally clicked for me.
@p.philippeaudet4608
@p.philippeaudet4608 8 лет назад
I loved the clean, clear explanation and the speed was perfect. A beautiful ability to deliver. I would love to see a tutorial on serializing and de-serializing classes
@nomanali5220
@nomanali5220 6 лет назад
What i like for this guy, is doing things in super simple way, making complicated situations very easy.
@patrickhitch
@patrickhitch 3 года назад
This was awesome video. I have watched several other tutorials on this topic, but none of them explained it in a way I could understand for the purpose I had in mind (not a GUI application). Your video seemed to be tailored to the way I think and absorb information. Thank You!
@rajtilak8841
@rajtilak8841 6 лет назад
Really glad I found this video. One of the best tutorials on delegate and events.
@MyUTube2312
@MyUTube2312 8 лет назад
Awesome video Mash! I got rid off confusion around events & delegates after seeing your video only!
@qram04
@qram04 8 лет назад
This is by far the best video that explains Delegates. i understand it much better now. Thanks
@DamianChambers
@DamianChambers 7 лет назад
Finally got it! Events and delegates. Appreciate this video. Simple and clear.
@kanzanaveed
@kanzanaveed Год назад
Okay so I was short on time and I had to write a code snippet using delegates and events. I found this 30 minutes video and some others but being aware of the simplicity of Programming with Mosh, I decided to watch this one. And after completing it "I am here to confirm that I now have a very clear and pretty good understanding of Events and Delegates and can write code using them". Hence, proved once again that Mosh Hamedani is one of the best teachers in explaining things at the most easiest level. Thank you so much, God bless!
@robertkak9029
@robertkak9029 7 лет назад
This tutorial is awesome! after looking into heaps of articles, finally found the one that made me understand it. Thanks!
@jsfroese
@jsfroese 9 лет назад
Your explanation of delegates in c# is great. I like how you keep my attention on what you are teaching with the changes in intonation and volume with your voice. I will have to check out your other videos. thanks.
@owhondaowhonda-wopara509
@owhondaowhonda-wopara509 6 лет назад
Thank you very very very much Mosh!!!! After lots of searches, this video goes straight to the point in a very simplified manner. You are awesome.
@p3rks
@p3rks 7 лет назад
Finally I understand how these work.. Life save man, thanks! Subscribed.
@Foodie_Yaatra
@Foodie_Yaatra 8 лет назад
Great! I am very happy that I finally understood Events and Delegates. Thank you so much Mosh.
@alih4341
@alih4341 Год назад
I have seen many Video about Events and Delegates but i found this one the best one
Далее
Mouse Events In Window Application with C#
5:30
Просмотров 2,1 тыс.
C# Generics Tutorial: Whats and Whys | Mosh
19:57
Просмотров 257 тыс.
What are Events? (C# Basics)
15:05
Просмотров 379 тыс.
C# Tutorial For Beginners - Learn C# Basics in 1 Hour
1:10:32