Page 17 - CSharp/C#
P. 17

Declaring a delegate type                                                                        283

            The Func, Action and Predicate delegate types                                                    285

            Assigning a named method to a delegate                                                           286

            Delegate Equality                                                                                286

            Assigning to a delegate by lambda                                                                286

            Passing delegates as parameters                                                                  287

            Combine Delegates (Multicast Delegates)                                                          287

            Safe invoke multicast delegate                                                                   289
            Closure inside a delegate                                                                        290

            Encapsulating transformations in funcs                                                           290

        Chapter 47: Dependency Injection                                                                    292


          Remarks                                                                                            292
          Examples                                                                                           292


            Dependency injection using MEF                                                                   292
            Dependency Injection C# and ASP.NET with Unity                                                   294

        Chapter 48: Diagnostics                                                                             298

          Examples                                                                                           298


            Debug.WriteLine                                                                                  298
            Redirecting log output with TraceListeners                                                       298

        Chapter 49: Dynamic type                                                                            299


          Remarks                                                                                            299

          Examples                                                                                           299

            Creating a dynamic variable                                                                      299

            Returning dynamic                                                                                299
            Creating a dynamic object with properties                                                        300

            Handling Specific Types Unknown at Compile Time                                                  300

        Chapter 50: Enum                                                                                    302


          Introduction                                                                                       302
          Syntax                                                                                             302


          Remarks                                                                                            302

          Examples                                                                                           302

            Get all the members values of an enum                                                            302
   12   13   14   15   16   17   18   19   20   21   22