List of Figures

Chapter 1. The changing face of C# development

Figure 1.1. Evolution of the Product type, showing greater encapsulation, stronger typing, and ease of initialization over time

Figure 1.2. Features involved in making sorting easier in C# 2 and 3

Figure 1.3. Anonymous methods and lambda expressions aid separation of concerns and readability for C# 2 and 3.

Figure 1.4. Options for working with “missing” data

Chapter 2. Core foundations: building on C# 1

Figure 2.1. Processing a call to a delegate instance that uses the C# shorthand syntax

Figure 2.2. The transformation process used for the C# shorthand syntax for combining delegate instances

Figure 2.3. Comparing value type and reference type behaviors, particularly with regard to assignment

Chapter 3. Parameterized typing with generics

Figure 3.1. Unbound generic types act as blueprints for constructed types, which then act as blueprints for actual objects, just as nongeneric types do.

Figure 3.2. The anatomy of a generic method declaration

Figure 3.3. Visual demonstration of why List<T> takes up a lot less space than ArrayList when storing value types

Figure 3.4. Interfaces for shapes and drawings, and two implementations of each

Chapter 4. Saying nothing with nullable types

Figure 4.1. Sample values of Nullable<int>

Figure 4.2. Results of boxing an instance without a value (top) or one with a value(bottom)

Chapter 5. Fast-tracked delegates

Figure 5.1. Snapshot of multiple captured variable scopes in memory

Chapter 7. Concluding C# 2: the final features

Figure 7.1. Code in partial types is able to see all of the members of the type, regardless of which file each member is in.

Figure 7.2. Comparison between XAML precompilation and autogenerated entity classes

Figure 7.3. Part of the Properties window of Visual Studio 2010, showing an extern alias of FirstAlias for the First.dll reference

Chapter 8. Cutting fluff with a smart compiler

Figure 8.1. Transformation of an automatically implemented property

Figure 8.2. Hovering over var in Visual Studio displays the type of the declared variable.

Figure 8.3. Hovering over the use of an implicitly typed local variable displays its type.

Figure 8.4. Hovering over a variable that’s declared (implicitly) to be of an anonymous type shows the details of that anonymous type.

Figure 8.5. Anonymous types allow you to keep just the data you need for a particular situation, in a form that’s tailored to that situation, without the tedium of writing a fresh type each time.

Chapter 9. Lambda expressions and expression trees

Figure 9.1. Lambda syntax shortcuts

Figure 9.2. Graphical representation of the expression tree created by listing 9.6

Figure 9.3. Type hierarchy from Expression<TDelegate> up to Expression

Figure 9.4. Graphical representation of expression tree that calls a method and uses parameters from a lambda expression

Figure 9.5. Debugger visualization of an expression tree

Figure 9.6. Both LINQ to Objects and LINQ to SQL start with C# code and end with query results. The ability to execute the code remotely comes through expression trees.

Figure 9.7. The two-phase type inference flow

Chapter 10. Extension methods

Figure 10.1. Hovering over a method call in Visual Studio reveals whether the method is actually an extension method.

Figure 10.2. Pulling apart a fluent interface expression to create a meeting. The time of the meeting is specified using extension methods to create a TimeSpan from an int, and a DateTime from a TimeSpan.

Chapter 11. Query expressions and LINQ to Objects

Figure 11.1. A simple query expression broken down into the sequences and transformations involved

Figure 11.2. Sequence diagram of the execution of a query expression

Figure 11.3. Class diagram of the SkeetySoft defect data model

Figure 11.4. A simple query expression broken down into its constituent parts

Figure 11.5. Sequences involved in listing 11.11, where a let clause introduces the length range variable

Figure 11.6. The join from listing 11.12 in graphical form, showing two different sequences (defects and subscriptions) used as data sources

Figure 11.7. Sequences involved in the group join from listing 11.13. The short arrows indicate embedded sequences within the result entries. In the output, some entries contain multiple email addresses for the same defect.

Figure 11.8. Sequences from listing 11.15, cross joining users and projects. All possible combinations are returned in the results.

Figure 11.9. Sequences used when grouping defects by assignee. Each entry of the result has a Key property and is also a sequence of defect entries.

Chapter 12. LINQ beyond collections

Figure 12.1. The LINQ to SQL classes designer showing the rearranged and modified entities

Figure 12.2. Class diagram based on the interfaces involved in IQueryable<T>

Figure 12.3. A query taking two paths, depending on whether the data source implements IQueryable or only IEnumerable

Figure 12.4. Class diagram for LINQ to XML, showing the most commonly used types

Figure 12.5. Mandelbrot image generated on a single thread

Figure 12.6. Class diagram for Parallel LINQ, including relationship to normal LINQ interfaces

Figure 12.7. Mandelbrot image generated using an unordered query, resulting in some sections being incorrectly placed

Figure 12.8. Sequence diagram showing the duality of IEnumerable<T> and IObservable<T>

Chapter 13. Minor changes to simplify code

Figure 13.1. Declaring optional parameters

Figure 13.2. Positional and named arguments in the same call

Figure 13.3. Mixing named arguments and optional parameters

Figure 13.4. Linking PIAs in Visual Studio 2010

Figure 13.5. Comparing referencing and linking

Chapter 14. Dynamic binding in a static language

Figure 14.1. How the components of .NET 4 fit together, allowing static and dynamic languages to execute on the same underlying platform

Figure 14.2. Lifecycle of a dynamic expression

Figure 14.3. Relationships between dynamic caches and call sites

Figure 14.4. Tree structure of sample XML file

Figure 14.5. Selecting data using DynamicXElement

Figure 14.6. Visual Studio 2010 displaying dynamic properties of a DynamicXElement

Chapter 15. Letting your code speak more clearly with Code Contracts

Figure 15.1. Code Contracts project property page in Visual Studio 2010

Figure 15.2. Static check results in Visual Studio 2010

Appendix B. Generic collections in .NET

Figure B.1. Interfaces in System.Collections.Generic

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.145.40.189