dotnetomaniak.pl - Artykuły z tagiem delegates

Have you ever wondered why blue screens of death happen so rarely, nowadays? Of course, we can thank Microsoft for this but the way they fixed this problem is not so obvious! According to Marino Posadas (and his book Mastering C# and .Net Framework) back in 2010, Microsoft made an analysis of this topic and they came to the conclusion that the 90% (wow!) of the blue screens were caused by drivers! So, Microsoft made manufacturers to follow the Hardware Compatibility List. That somehow solved most of...

C# stuff nobody told you – delegate is a class! And there is a good reason for that! – A Girl Among Geeks

Sztuka programowania 2228 dni, 20 godzin, 7 minut temu AGirlAmongGeeks 186 źrodło rozwiń

Many people neglect C# delegates because they cannot find a reason to use them. On the other hand, there is (rather small) group of people who overuse delegates in code that could be easily replaced by literal method call. So when should we use delegates? Well, they show their real power in situations when we need a mechanism to easily switch from one logic to another, without changing our application’s core code. Sounds ok but what does it mean in a real life? It’s time for a fairy tale 😊. Imagine...

Dziel się z innymi:
C# Delegates – a fairy tale about when (and how) to use them – A Girl Among Geeks

Sztuka programowania 2240 dni, 22 godziny, 19 minut temu AGirlAmongGeeks 114 źrodło rozwiń

I wyrażenia lambda! Trzeci wpis z tej mini-serii. Tym razem już o wyrażeniach lambda. Zostały one wprowadzone w trzeciej wersji języka C#. We wpisie o metodach anonimowych, przedstawiłem dwa przykłady rozwiązujące ten sam problem. Pierwszy – używający tylko delegatów, drugi – wykorzystujący metody anonimowe, a teraz czas na trzeci, w którym znajdziemy wyrażenia lambda.

Źródło: jakubmaguza.pl
Dziel się z innymi:
Ten o wyrażeniach lambda - jakubmaguza.pl

Daj się poznać 2017 2573 dni, 3 godziny, 2 minuty temu Jakub Maguza 71 źrodło rozwiń

… potem były metody anonimowe… Drugi wpis poprzedzający wyrażenia lambda. Krótki i dość prosty. Microsoft w C#2 postanowił usprawnić trochę tworzenie delegatów. Metody anonimowe nie dość, że skracają kod, dają nam również możliwość sprawdzenia ich wnętrzności bez przewijania plików i próby odnalezienia implementacji. Wszystko mamy w jednym miejscu. Nie musimy deklarować metod formalnie (implicitly).

Źródło: jakubmaguza.pl
Dziel się z innymi:
Ten o metodach anonimowych - jakubmaguza.pl

Daj się poznać 2017 2578 dni, 3 godziny, 26 minut temu Jakub Maguza 89 źrodło rozwiń

Najaktywniejsi w tym miesiącu