Format(), 175
ToType(), 330
TOutput placeholder identifier, 245
transitions to kernel mode, avoiding via
Threading.Interlocked class, 286
translating exceptions, 137-139
Try statements
exception handling, 134-136, 159-161
exception-neutral code and, 143-146
Try/Finally blocks
disposable objects, 65
iteration, 215
Using statements, 67
TryCast, 22
type arguments, 105-106
type conversion, 248-249, 257-268
type inference (LINQ), 375-376
type parameters, 105-106, 237
type safety
reference-types, 353-357
value-types, 368, 371
TypeConverter, 331
TypeInitializationException, 141-142, 155
TypeOf, 21, 23-24
types, 11
anonymous types, 9
arrays. See arrays
categories, 13-14
closed, 240-241
collections. See collections
common type system (CTS), 3
constructed, generics, 240, 251, 268-270
converting, 19-20
boxing conversions, 22-23
Convert class, 20
CType, 20-21
DirectCast and TryCast, 22
explicit conversion, 19-20
reference type operators, 23-25
widening conversions, 13, 19
custom CultureInfo types, 171-172
custom types, string formatting, 175, 177
enclosing type, 119
Func (LINQ), 378
generic
accessibility of types, 251
classes and structures, 241-242
collections, 255-257
constraints, 251-255
creating constructed types dynamically,
268-270
declaring, 237-240
delegates, 244-248
interfaces, 242
methods, 243-245
nullable types, 249-250
type conversion, 248-249, 257-268
type definitions and constructed types,
240
type placeholder naming conventions,
240
type safety, 238-240
ISomeInterface, 238-239
nullable, 249-250
enhancement in VB 2008, 9
open, 240-241
overloaded, 241, 244
ProcessResults, 219
reference types, 1-5, 17-18
New keyword, 59
versus value types, 18
reference-type best practices, 317
checklist, 361-362
cloneable objects, 320-322, 324-326
nINDEX 439
convertible objects, 329-331
defaulting to NotInheritable classes,
317-318
disposable objects, 334-336
finalizers, 337-344
formattable objects, 326-329
immutable reference types, 358-360
NVI pattern, using, 318-320
object equality, 344-350
ordering objects, 331-334
overriding GetHashCode(), 350-353
type safety, 353-357
SafeHandle-derived types, 309
strong typing, 11-13
value types, 1-5, 14-16
enumerations, 16-17
New keyword, 58
versus reference types, 18
value-type best practices, 362-372
checklist, 371-372
implementing type-safe forms, 368, 371
overriding Equals(), 363, 365, 367
nU
unary operators, overloading, 117-118
unboxing, 52-57
efficiency of, 56-57
generics, 239
undeclared variables, 12
unhandled exceptions in .
Pages:
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683