Introduction |
|
xv | |
|
Organization of this book |
|
|
xv | |
|
|
xvi | |
|
Quick access to online references |
|
|
xvi | |
|
Errata, updates, & book support |
|
|
xvi | |
|
|
xvii | |
|
|
xix | |
Chapter 1 Manage program flow |
|
1 | (94) |
|
Skill 1.1 Implement multithreading and asynchronous processing |
|
|
2 | (32) |
|
The Task Parallel library |
|
|
3 | (3) |
|
|
6 | (3) |
|
|
9 | (3) |
|
|
12 | (3) |
|
|
15 | (8) |
|
Tasks and the User Interface |
|
|
23 | (2) |
|
|
25 | (4) |
|
Using concurrent collections |
|
|
29 | (5) |
|
Skill 1.2 Manage multithreading |
|
|
34 | (14) |
|
|
34 | (3) |
|
|
37 | (7) |
|
Cancelling a long-running task |
|
|
44 | (3) |
|
Implementing thread-safe methods |
|
|
47 | (1) |
|
Skill 1.3 Implement program flow |
|
|
48 | (12) |
|
Iterating across collections |
|
|
49 | (5) |
|
|
54 | (5) |
|
|
59 | (1) |
|
Skill 1.4 Create and implement events and callbacks |
|
|
60 | (13) |
|
|
60 | (3) |
|
Unsubscribing from a delegate |
|
|
63 | (1) |
|
|
64 | (1) |
|
Create events with built-in delegate types |
|
|
64 | (4) |
|
|
68 | (2) |
|
Use lambda expressions (anonymous methods) |
|
|
70 | (2) |
|
|
72 | (1) |
|
Skill 1.5 Implement exception handling |
|
|
73 | (10) |
|
|
73 | (1) |
|
The try-catch construction |
|
|
74 | (2) |
|
Using the base class of an exception |
|
|
76 | (1) |
|
Implement try-catch-finally blocks |
|
|
77 | (1) |
|
|
78 | (1) |
|
|
79 | (1) |
|
Creating custom exceptions |
|
|
80 | (1) |
|
Handling inner exceptions |
|
|
81 | (1) |
|
Handling aggregate exceptions |
|
|
82 | (1) |
|
Exceptions as part of managed error handing |
|
|
83 | (1) |
|
|
83 | (3) |
|
|
83 | (1) |
|
2 Managing multithreading |
|
|
84 | (1) |
|
|
84 | (1) |
|
|
85 | (1) |
|
|
85 | (1) |
|
Thought experiment answers |
|
|
86 | (4) |
|
|
86 | (1) |
|
2 Managing multithreading |
|
|
87 | (1) |
|
|
88 | (1) |
|
|
89 | (1) |
|
|
90 | (1) |
|
|
90 | (5) |
Chapter 2 Create and use types |
|
95 | (116) |
|
|
95 | (22) |
|
Value and reference types |
|
|
96 | (3) |
|
|
99 | (3) |
|
|
102 | (15) |
|
|
117 | (11) |
|
|
118 | (2) |
|
|
120 | (8) |
|
Skill 2.3 Enforce encapsulation |
|
|
128 | (10) |
|
|
129 | (1) |
|
Enforce encapsulation by using properties |
|
|
130 | (2) |
|
Enforce encapsulation by using accessory |
|
|
132 | (3) |
|
Enforce encapsulation by using explicit interface implementation |
|
|
135 | (3) |
|
Skill 2.4 Create and implement a class hierarchy |
|
|
138 | (21) |
|
Design and implement an interface |
|
|
138 | (4) |
|
Inherit from a base class |
|
|
142 | (9) |
|
Create and implement classes based on the IComparable, IEnumerable, IDisposable, and IUnknown interfaces |
|
|
151 | (8) |
|
Skill 2.5 Find, execute, and create types at runtime by using reflection |
|
|
159 | (16) |
|
Create and apply attributes |
|
|
159 | (5) |
|
|
164 | (1) |
|
|
164 | (4) |
|
Generate code at runtime by using CodeDOM and Lambda expressions |
|
|
168 | (4) |
|
Use types from the System.Reflection namespace |
|
|
172 | (3) |
|
Skill 2.6 Manage the object life cycle |
|
|
175 | (8) |
|
Garbage collection in .NET |
|
|
176 | (3) |
|
Manage unmanaged resources |
|
|
179 | (1) |
|
Implement IDisposable, including interaction with finalization |
|
|
180 | (2) |
|
Manage IDisposable by using the Using statement |
|
|
182 | (1) |
|
Manage finalization and garbage collection |
|
|
182 | (1) |
|
Skill 2.7 Manipulate strings |
|
|
183 | (10) |
|
|
183 | (2) |
|
Manipulate strings by using the StringBuilder, StringWriter, and StringReader classes |
|
|
185 | (2) |
|
|
187 | (2) |
|
|
189 | (1) |
|
|
189 | (3) |
|
|
192 | (1) |
|
|
193 | (4) |
|
|
193 | (1) |
|
|
193 | (1) |
|
|
194 | (1) |
|
4 Create and implement a class hierarchy |
|
|
194 | (1) |
|
5 Find, execute, and create types at runtime by using reflection |
|
|
195 | (1) |
|
6 Manage the object life cycle |
|
|
196 | (1) |
|
|
196 | (1) |
|
Thought experiment answers |
|
|
197 | (8) |
|
|
197 | (2) |
|
|
199 | (1) |
|
|
200 | (1) |
|
4 Create and implement a class hierarchy |
|
|
200 | (2) |
|
5 Find, execute, and create types at runtime by using reflection |
|
|
202 | (1) |
|
6 Manage the object life cycle |
|
|
203 | (1) |
|
|
204 | (1) |
|
|
205 | (6) |
Chapter 3 Debug applications and implement security |
|
211 | (104) |
|
Skill 3.1 Validate application input |
|
|
212 | (24) |
|
|
212 | (6) |
|
|
218 | (1) |
|
Choose the appropriate data collection type |
|
|
219 | (2) |
|
Use the Entity Framework to design your data storage |
|
|
221 | (7) |
|
|
228 | (3) |
|
Evaluate a regular expression to validate the input format |
|
|
231 | (3) |
|
Use built-in functions to validate data type and content |
|
|
234 | (2) |
|
Skill 3.2 Perform symmetric and asymmetric encryption |
|
|
236 | (18) |
|
Cryptography and cryptoanalysis |
|
|
237 | (1) |
|
Symmetric and asymmetric encryption |
|
|
237 | (2) |
|
Data encryption using AES symmetric encryption |
|
|
239 | (3) |
|
Encrypting data using other symmetric standards |
|
|
242 | (2) |
|
Implementing public and private key management |
|
|
244 | (3) |
|
Digital signatures and certificates |
|
|
247 | (2) |
|
Implement the System.Security namespace |
|
|
249 | (1) |
|
Data integrity by hashing data |
|
|
250 | (3) |
|
|
253 | (1) |
|
Skill 3.3 Manage assemblies |
|
|
254 | (14) |
|
|
257 | (3) |
|
Sign assemblies using strong names |
|
|
260 | (3) |
|
The Global Assembly Cache (GAC) |
|
|
263 | (1) |
|
Implement side-by-side hosting |
|
|
264 | (1) |
|
Put an assembly in the global assembly cache |
|
|
265 | (1) |
|
|
265 | (3) |
|
Skill 3.4 Debug an application |
|
|
268 | (14) |
|
Create and manage preprocessor compiler directives |
|
|
268 | (8) |
|
Choose an appropriate build configuration |
|
|
276 | (3) |
|
Manage programming program database |
|
|
|
files and (debug symbols) |
|
|
279 | (3) |
|
Skill 3.5 Implement diagnostics in an application |
|
|
282 | (16) |
|
Implement logging and tracing |
|
|
282 | (6) |
|
|
288 | (3) |
|
Create and monitor performance counters |
|
|
291 | (4) |
|
|
295 | (3) |
|
|
298 | (3) |
|
1 Validate application input |
|
|
298 | (1) |
|
2 Perform symmetric and asymmetric encryption |
|
|
299 | (1) |
|
|
300 | (1) |
|
|
300 | (1) |
|
5 Implement diagnostics in an application |
|
|
301 | (1) |
|
Thought experiment answers |
|
|
301 | (7) |
|
1 Validate application input |
|
|
301 | (2) |
|
2 Perform symmetric and asymmetric encryption |
|
|
303 | (2) |
|
|
305 | (1) |
|
|
306 | (1) |
|
5 Implement diagnostics in an application |
|
|
307 | (1) |
|
|
308 | (7) |
Chapter 4 Implement data access |
|
315 | (84) |
|
Skill 4.1 Perform I/O operations |
|
|
315 | (17) |
|
Read and write files and streams |
|
|
316 | (5) |
|
|
321 | (6) |
|
Read and write from the network by using classes in the System.Net namespace |
|
|
327 | (3) |
|
Implement asynchronous I/O operations |
|
|
330 | (2) |
|
|
332 | (18) |
|
Retrieve data from a database |
|
|
332 | (6) |
|
Update data in a database |
|
|
338 | (3) |
|
Consume JSON and XML data |
|
|
341 | (4) |
|
Retrieve data by using Windows Communication Foundation (WCF) |
|
|
345 | (5) |
|
Skill 4.3 Query and manipulate data and objects by using LINQ |
|
|
350 | (15) |
|
|
350 | (9) |
|
Create method-based LINQ queries |
|
|
359 | (1) |
|
Query data by using query comprehension syntax |
|
|
360 | (1) |
|
Select data by using anonymous types |
|
|
361 | (1) |
|
Force execution of a query |
|
|
362 | (1) |
|
Read, filter, create, and modify data structures by using LINQ to XML |
|
|
363 | (2) |
|
Skill 4.4 Serialize and deserialize data by using binary serialization, custom serialization, XML Serializer, JSON Serializer, and Data Contract Serializer |
|
|
365 | (8) |
|
|
366 | (1) |
|
|
367 | (1) |
|
|
368 | (2) |
|
Manage versions with binary serialization |
|
|
370 | (1) |
|
|
370 | (2) |
|
|
372 | (1) |
|
Use Data Contract Serializer |
|
|
372 | (1) |
|
Skill 4.5 Store data in and retrieve data from collections |
|
|
373 | (12) |
|
Store and retrieve data by using dictionaries, arrays, lists, sets, and queues |
|
|
374 | (6) |
|
|
380 | (1) |
|
|
380 | (1) |
|
Add and remove items from a collection |
|
|
381 | (1) |
|
Use typed vs. non-typed collections |
|
|
382 | (1) |
|
Implement custom collections |
|
|
383 | (1) |
|
Implement collection interfaces |
|
|
384 | (1) |
|
|
385 | (3) |
|
|
385 | (1) |
|
|
386 | (1) |
|
3 Query and manipulate data and objects by using LINQ |
|
|
386 | (1) |
|
4 Serialize and deserialize data |
|
|
387 | (1) |
|
5 Store data in and retrieve data from collections |
|
|
387 | (1) |
|
Thought experiment answers |
|
|
388 | (6) |
|
|
388 | (2) |
|
|
390 | (1) |
|
3 Query and manipulate data and objects by using LINQ |
|
|
391 | (1) |
|
4 Serialize and deserialize data |
|
|
392 | (1) |
|
5 Store data in and retrieve data from collections |
|
|
393 | (1) |
|
|
394 | (5) |
Index |
|
399 | |