CARVIEW |
By Ben Albahari, Peter Drayton, Brad Merrill
Price: $24.95 USD
£17.50 GBP
Cover | Table of Contents | Index | Sample Chapter | Colophon
Index
[ Symbols ], [ Symbols ], [ Numbers ], [ A ], [ B ], [ C ], [ D ], [ E ], [ F ], [ G ], [ H ], [ I ], [ J ], [ L ], [ M ], [ N ], [ O ], [ P ], [ Q ], [ R ], [ S ], [ T ], [ U ], [ V ], [ W ], [ X ]
Symbols[ Top ]
@ (identifier prefix)
identifiers, 6
verbatim string literals and, 13
+ (addition) operator, 46
precedence of, 19
relevance to enums, 61
= (assignment) operator
precedence of, 20
relevance to enums, 61
! XML type ID prefix, 82
& (bitwise and) operator, 46
address-of, returning a pointer, 74
enums, relevance to, 61
precedence of, 19
^ (bitwise for) operator, 46
precedence of, 20
relevance to enums, 61
\' char type, 12
\\ char type, 12
\\" char type, 12
?: (conditional ternary)
precedence of, 20
using three-state logic operators, 48
-- (decrement) operator, 46
precedence of, 19
relevance to enums, 61
/ (division) operator, 46
/ (division) operator, precedence of, 20
% (division remainder) operator, 46
precedence of, 20
/// (documentation comments), 78
. (dot)
x.y (member access), 19
== (equals) operator, 46
Equals ( ) method and, 85
precedence of, 20
preprocess directives and, 77
relevance to enums, 61
> (greater than) operator, 46
precedence of, 20
relevance to enums, 61
++ (increment) operator, 46
precedence of, 19
relevance to enums, 61
+? lazy quanifiers, in regular expressions, 101
*? lazy quantifiers, in regular expressions, 101
?? lazy quantifiers, in regular expressions, 101
< (less than) operator, 46
precedence of, 20
relevance to enums, 61
* (multiplication) operator, 46
dereference, 74
precedence of, 19
! (not) operator, 46
precedence of, 19
!= operator, 46
Equals ( ) method and, 85
precedence of, 20
preprocessor directives and, 77
relevance to enums, 61
&& operator, 49
preprocessor directives and, 77
+= operator
delegates, invoking, 63
events, declaring and firing, 65
precedence of, 20
relevance to enums, 61
<< operator, 46
precedence of, 20
<= operator, 46
precedence of, 20
relevance to enums, 61
>= operator, 46
precedence of, 20
relevance to enums, 61
>> operator, 46
precedence of, 20
|| operator, 49
precedence of, 20
preprocessor directives and, 77
%= operator, precedence of, 20
&= operator, precedence of, 20
*= operator, precedence of, 20
-= operator, precedence of, 20
/= operator, precedence of, 20
<<= operator, precedence of, 20
>>= operator, precedence of, 20
^= operator, precedence of, 20
|= operator, precedence of, 20
-> (pointer-to-member) operator, 74
precedence of, 19
; (semicolon)
empty statements and, 22
in expressing statements, 21
-= (subtraction assignment) operator
events, declaring and firing, 65
relevance to enums, 61
removing a delegate from another delegate, 63
- (subtraction) operator, 46
negative value, precedence of, 19
~ (tilde) operator, 46
_ underscore (identifiers), 6
| (vertical bar) operator, 46
precedence of, 20
relevance to enums, 61
Symbols[ Top ]
[ ] (indexing), 43
customizing attributes, 127
precedence of, 19
specifying multiple attributes, 73
stackalloc keyword and, 76
( ) (parenthesis)
grouping (x) operators, 19
type cast ((T)x) operators, 19
/* ... */ (comments), 78
// (comments), 78
~ (tilde) operator
precedence of, 19
relevance to enums, 61
Numbers[ Top ]
\0 char type, 12
1-dimensional arrays type, 179
A[ Top ]
\a char type, 12
abstract classes, 33, 163
attribute classes and, 72
interfaces, differences from, 55
streams, 104
TextReader/TextWriter, 105
abstract methods, 44
access data, 152
access modifiers, 36, 51
restrictions on, 37
accessors (events), 66
activation, 124
additive operators, precedence of, 20
ADepends.exe (assembly dependency list), 158
Al.exe (assembly linking utility), 158
AnsiBStr enum value for UnmanagedType, 142
AppDomains, 120
arguments, passing by value, 44
arithmetic check off (unchecked) operator, 19
arithmetic check on (checked) operator, 19
Array class, 148
array stack allocation (stackalloc) operator, 19
ArrayList class, 95, 148
arrays, 58-60
bounds checking, 59
conversions, 60
foreach loops, using, 26
length of, 59
local/field declarations, 59
multidimensional, 58
rank of, 59
as operator, 32, 163
AsAny enum value for UnmanagedType, 142
assemblies, 115-119, 184-188
building shareable, 181
deployment, 3, 116
elements of, 115
FCL (Framework Class Library) and, 150
packaging, 116
reflection and, 120
security permissions, 118
type resolution, 118
versioning, 117
working with, 181-183
assembly dependency list (ADepends.exe), 158
assembly linking utility (AI.exe), 158
assignment operators, precedence of, 19
atomic operations, synchronizing threads, 114
atomic types, 18
attributes, 71-73
COM Interop, supporting, 145
custom, 126-132
named parameter, 72
positional parameter, 72
predefined, 128
Interop support for, 140
specifying multiple, 73
targets, 73
AttributeTargets enum, using AttributeUsage attribute, 129
AttributeUsage attribute, 129
defining a new custom attribute, 131
automatic memory management, 2, 133-136
dispose/close methods, 135
finalizers and, 135
garbage collector and, 133
optimization techniques for, 134
B[ Top ]
\b char type, 12
backing stores, 103
base class, 32
constructors, 50
base keyword, 53, 163
binary operators, precedence of, 19
BitArray class, 96, 148
bitwise operator (&)
address-of, returning a pointer, 74
enums, relevance to, 61
precedence of, 20
Bool enum value for UnmanagedType, 142
bool type, 12, 163, 179
conversions, 12
default value of, 18
three-state logic operators and, 48
bounds checking, 59
boxing value types, 16
break statement, 27, 163
switch statements, using, 24
BStr enum value for UnmanagedType, 142
<build> assembly version numbers, 117
byte integral type, 9, 163, 179
ByValArray enum value for UnmanagedType, 142
ByValTStr enum value for UnmanagedType, 142
C[ Top ]
C# keywords, 163-168
C# language, introduction to, 1-5
C# objects
binding with COM, 143
exposing to COM, 144
type, 85
<c> XML tag, 80
callbacks from unmanaged code, 139
callconv-enum parameter, for DllImport attribute, 141
CanRead property, 104
CanSeek property, 104
CanWrite property, 104
Capture instances, 102
CaptureCollection class, 102
case statement, 27, 163
catch statement, 67, 69, 163
C/C++-style comments, 78
CCW (COM Callable Wrapper), 144
char conversions, 12
char type, 11, 163, 179
default value of, 18
charset-enum parameter
for DllImport attribute, 140
for StructLayout attribute, 141
checked operator, 19, 163
class type, 164, 180
classes, 37-54
abstract, 33
base keywords, 53
cloning instances for, 88
concrete collection classes, 95
constant field, 40
conversions, 32
destructors and, 53
fields, 40
finalizers and, 53
indexers, indexing elements in a class, 43
instance constructors, 49
instance vs. static members and, 39
marshaling, 138
math, 91
methods and, 43
nested types and, 54
object, 85-88
operators and, 46-49
properties, 41
sealed, 34, 167
static constructors, 51
StringBuilder, 94
structs, differences between, 38
System.Object, definition of, 85
this keyword and, 52
close method, 135
CLR (Common Language Runtime), 84
features of, 3
garbage collectors and, 133
Interop with COM, 143
CLS (Common Language Specification), 4
CLSCompliant attribute, 130
<code> XML tag, 80
collections, 95-101, 148
concrete collection classes, 95
interfaces, 97-101
collections, using foreach loops, 26
COM Callable Wrapper (CCW), 144
COM objects, 143-146
exposing to C#, 143
Interop supporting attributes, 145
mapping in C#, 145
comments (// or /* ... */), 78
Common Language Runtime (see CLR)
Common Language Specification (see CLS)
Common Type System (see CTS)
common types, 84
ICloneable interface for, 88
IComparable interface for, 89
IFormattable interface for, 90
marshaling, 137
object classes and, 85-88
compiling
.NET programs, 3
supporting custom attributes, 127
components
orientation (C# language feature), 1
tool support for FCL, 155
ComRegisterFunction attribute, 146
ComVisible attribute, 145
concrete classes
collections, 95
Stream-derived, 104
StreamReader/StreamWriter, 105
StringReader/StringWriter, 106
conditional operator, precedence of, 19
configuration for FCL, 154
const keyword, 164
constant declaration, 22
constant field, 40
constants, 40
constructors
instance, 49
static, 51
continue statement, 27, 164
within switch statements and, 24
conversions
arrays, 60
bool type and, 12
char type and, 11
decimal datatype and, 11
enum, 61
floating-point type and, 10
implicit/explicit, 7
integral types, 9
interfaces, 58
object types and, 12
string types and, 13
Convert type, 147
CopyTo( ) method, 99
CorDbg.exe (runtime debugger), 158
core types, 147
Count property, 99
cross language integration in CLR, 4
CrossRefAttribute attribute, defining a new custom attribute, 131
Csc.exe (C# compiler), 158
CTS (Common Type System), 4
Currency enum value for UnmanagedType, 142
custom attributes, 126-132
compiler support for, 127
defining, 131
language support for, 127
predefined attributes and, 128
retrieving at runtime, 132
runtime support for, 128
custom implicit/explicit conversions, 48
CustomMarshaler enum value for UnmanagedType, 142
D[ Top ]
data access, 152
data marshaling, 179-180
data members, 38
DateTime
extended type, 148
format specifiers, 177
DbgClr.exe (GUI debugger), 159
DBNull extended types, 148
deadlocks, synchronizing threads, 113
DEBUG symbol, 77
debugging for FCL, 155
decimal datatype, 11, 164
data marshaling for, 179
for special types and operators, 91
default keyword, 164
default values, 18
#define symbol preprocessor directive, 77
delegate keyword, 164
delegates, 61-64
defining for an event, 64
function pointers, comparing with, 63
interfaces, comparing with, 63
multicast, 62
Delphi closure, comparing with delegates, 63
deployment in CLR, 3
dereference (*) operator, 74
derived class, 32
destructors, 53
development in CLR, 4
diagnostics for FCL, 155
Directory classes, 106
DispId attribute, 145
dispose method, 135
division remainder (%), 46
precedence of, 20
DllImport attribute, 140
dll-name parameter, for DllImport attribute, 140
DLLs (native), 137-143
DNS (Domain Name System), using, 111
do statement, 164
documentation comments (///), 78
Domain Name System (see DNS)
double datatype, 179
double floating-point type, 10
double type, 164
using trigonometric and exponential functions, 91
do-while loops, 25
downcasting classes, 32
E[ Top ]
E XML type ID prefix, 82
#elif symbol preprocessor directive, 77
#else preprocessor directive, 77
else statement, 164
empty statements, 22
encoding strings, 94
#end region preprocessor directive, 78
#endif preprocessor directive, 78
Enter methods, 114
synchronizing threads, 112
enum type, 164, 180
core types and, 147
default value of, 18
switch statements, using, 24
enums, 60
conversions, 61
operators relevant to, 61
equality operators, precedence of, 20
Equals( ) method, 85, 87, 88
Error enum value for UnmanagedType, 142
event keyword, 65, 164
EventArgs, storing data for events, 64
events, 64-67
accessors, 66
declaring and firing, 65
defining a delegate, 64
EventArgs, storing data for, 64
handlers, acting on, 65
ExactSpelling parameter, for DllImport attribute, 140
<example> XML tag, 80
Exception type, 147
<exception> XML tag, 80
exceptions, 67-71
catch statement, 69
variables, omitting, 69
exclusive (maximum) value, 91
Exit methods, 114
synchronizing threads, 112
explicit conversions, 7, 48, 164
expressions, 18-21
expression statements and, 21
extern methods, 44, 164
F[ Top ]
\f char type, 12
F XML type ID prefix, 82
false keyword, 48, 164
FCL (Framework Class Library), 4, 84, 155
advanced component services, 154
assemblies for, 150
client applications and, 153
collections for, 148
concrete collection classes and, 95
configuration for, 154
core types and, 147
creating friendly types, 87
data access, 152
diagnostics and debugging for, 155
globalization and, 154
graphics and, 152
I/O framework for, 103-107
native OS facilities, 156
networking, 107-111, 149
overview of, 147-156
runtime facilities for, 156
security and, 149
streams and I/O, 148
text, provided by, 148
threading, 149
undocumented types, 156
unmanaged code and, 155
web-based applications and, 153
XML and, 152
FieldOffset attribute parameter for StructLayout attribute, 141
fields, 40
definite assignment, 17
instance fields, assigning, 52
static fields, assigning, 52
File classes, 106
files, 29-31
FileStream class, 104
Finalize( ) methods, 86
automatic memory management and, 135
finalizers, 53, 135
finally blocks, 70, 165
simplifying program execution, 67
fixed statement, 75, 165
float datatype, 165, 179
floating-point types, 10
flushing (streams), 104
for loops, 25
for statement, 165
foreach statement, 26, 165
implementing the IEnumerable interface, 97
Format method, 93
format specifiers, 173-177
picture, 175
FormatString, for formatting strings, 93
function members, 38
function pointers, comparing with delegates, 63
function-name parameter, for DllImport attribute, 140
FunctionPtr enum value for UnmanagedType, 142
G[ Top ]
gacutil utility, working with assemblies, 182
GACUtil.exe (global assembly cache utility), 159
garbage collectors (GCs), 133
cleanup of non-memory resources, 53
GCs (see garbage collectors)
generations, in garbage collecting, 134
generic request/response architecture, 107
get keyword, 165
GetCustomAttribute method, retrieving a custom attribute at runtime, 132
GetHashCode( ) method, 85
GetLength method, returning number of elements, 59
GetType( ) method, 86
global assembly cache
GACUtil.exe utility, 159
managing, 182
global namespace, 31
globalization, 154
goto label statement, using switch statements, 24
goto statements, 27, 165
using switch statements, 24
graphics, 152
Group class, 102
GUI debugger (DbgClr.exe), 159
Guid attribute, 146
H[ Top ]
Hashtable class, 96, 148
Hejlsberg, Anders (co-creator of C# language), 1
HTTP-specific support, 108
I[ Top ]
I1/I2/I4/I8 enum values for UnmanagedType, 142
ICloneable interface, 88
core types and, 148
ICollection interface, 99
IComparable interface, 89
core types and, 148
IComparer interface, 99
IConvertible interface
core types and, 148
identifiers, 6
IDictionary interface, 100
IDictionaryEnumerator interface, 100
IDispatch enum value for UnmanagedType, 142
IEnumerable interface, 97
foreach loops and, 26
IEnumerator interface, 98
if statement, 165
#if symbol preprocessor directive, 77
if-else statements, 23
IFormattable interface, 90
core types and, 148
IHashCodeProvider interface, 101
ILAsm.exe
disassembler, for exploring BLC, 147
MSIL assembler, 159
ILDasm.exe (MSIL disassembler), 159
IList interface, 95, 100
implicit conversions, 7, 48
implicit operator, 165
imutable strings, 92
In attribute, 142
in operator, 165
<include> XML tag, 81
inclusive (minimum) value, 91
indexing strings, 94
inheritance, 31-36
InnerException argument, 71
input/output, 103-107
directories and files, 106
FCL and, 148
InstallUtil.exe (installer utility), 159
instances, 121
constructors, 49
members, 7, 39
int integral type, 9, 165, 179
integral conversions, 9
integral types, 9
Interface enum value for UnmanagedType, 142
interfaces, 55-58, 95
collections, 97-101
conversions, 58
defining, 55
delegates, comparing with, 63
explicitly implementing, 57
extending, 56
ICloneable/IComparable, 89
IFormattable, 90
implementing, 55
reimplementing, 57
types, 165, 180
InterfaceType attribute, 146
internal access modifier, 36, 165
interning (string), 92
Interop
with COM, 143-146
with native DLLs, 137-143
InvalidCastException, downcasting classes, 32
is operator, 32, 165
precedence of, 20
IsReadOnly( ) method, 99
IsSynchronized( ) method, 99
IUnknown enum value for UnmanagedType, 142
IWebRequestCreate interface, adding new protocol handlers, 109
J[ Top ]
jagged arrays, 58
jump statements, 26
L[ Top ]
last-in first-out (LIFO) data structure, 97
late binding, 122
layout-enum parameter for StructLayout attribute, 141
lazy quantifiers, in regular expressions, 101
left-associative, 19
Legacy code, interoperability with CLR, 4
Length property, 104
leveraging (C# language feature), 2
LIFO (last-in first-out) data structure, 97
#line number preprocessor directive, 78
<list> XML tag, 81
literals
bool types and, 12
char, 11
decimal types and, 11
floating-point, 10
integer, 9
null keyword, 166
numeric 0, converting to a enum, 61
string, 13
lock statement, 28, 166
thread synchronization and, 112
logical bitwise operator (see bitwise operator)
long integral type, 9, 166, 179
loop statements, 24
LPArray enum value for UnmanagedType, 142
LPStr enum value for UnmanagedType, 142
LPStruct enum value for UnmanagedType, 142
LPTStr enum value for UnmanagedType, 142
LPVoid enum value for UnmanagedType, 142
LPWStr enum value for UnmanagedType, 142
M[ Top ]
<major> assembly version numbers, 117
<minor> assembly version numbers, 117
M XML type ID prefix, 82
Main( ), 5
make utility (nmake.exe), 159
manifests in assemblies, 115
MarshalAs attribute, 142
marshaler (CLR)
for classes and structs, 138
common types and, 137
in/out attributes, 139
Match class, 101
MatchCollection class, 101
Math class, 91
math-oriented programming, 90-91
random class for, 91
special types/operators for, 91
math-oriented programming and, 91
maximum (exclusive) value, 91
member access (x.y), 19
member cross references (XML), 82
members
classes, 33
instance vs. static, 39
operators, 75
reflection and, 120
MemberwiseClone( ) method, 87
memory
automatic management, 133-136
memory for types, 13
Message string, 71
metadata, 150
metadata, compiling .NET programs, 3
method call (f(x)) operator, 19
method signatures, in delegate declarations, 62
Microsoft Intermediate Language (MSIL) code, compiling .NET programs, 3
Microsoft .NET framework (see .NET framework)
minimum (inclusive) value, 91
MinWidth, for formatting strings, 93
modify operators, precedence of, 20
modules, 116
building, 181
reflection and, 120
monitor class, 114
Monitor class, synchronizing threads, 112
MSIL assembler (ILAsm.exe), 159
MSIL disassembler (ILDasm.exe), 159
MSIL (Microsoft Intermediate Language) code, complying .NET programs, 3
multicast delegates, 62
multidimensional arrays, 58
multiplicative operators, precedence of, 20
mutable strings, 92
N[ Top ]
<no modifier> modifier, 180
\n char type, 12
N XML type ID prefix, 82
named parameter, 72
namespace declaration, 29
aliasing types and, 30
namespace keyword, 166
namespaces, 184-188
native DLLs, 137-143
NativeTypeMax enum value for UnmanagedType, 142
nested types, 54
reflection and, 120
nesting namespaces, 30
.NET framework
Common Language Runtime (CLR) and, 3
Framework Class Library (FCL) and, 4
introduction to, 1
programming, 84-146
.NET platform, working in C#, 147
.NET Software Developer Kit (SDK), v
networking, 107-111
DNS, using, 111
FCL and, 149
generic request/response architecture, 107
HTTP-specific support, 108
programming models, 107
protocol handlers, adding new, 109
using TCP, UDP, and Sockets, 109
NetworkStream class, 104
new keyword, 166
Ngen.exe (native image generator), 159
nmake, working with assemblies, 183
nmake.exe (make utility), 159
NonSerialized attribute, 131
O[ Top ]
object class, 85-88
FCL-friendly types, 87
object type, 12, 85, 166
COM default datatype mapping, 179
core types and, 147
inheriting, 31
Object( ) method, 85
Obsolete attribute, 130
compiling custom attributes, 128
one-stop coding (C# language feature), 2
operator keyword, 166
operators, 46-49
enums and, 61
implicit/explicit conversions and, 48
math-oriented programming and, 91
three-state logic, 48
value equality, implementing, 46-48
Out attribute, 143
out modifier, 45, 166, 180
overloadable operators, 46, 49
overloading methods, 46
override keyword, 166
P[ Top ]
<param> XML tag
user-defining, 81
P XML type ID prefix, 82
pack size, 139
packaging of assemblies, 116
packing-size parameter for StructLayout attribute, 141
<para> XML tag, 81
<param> XML tag, 80
ParamIndex, for formatting strings, 93
<paramref> XML tag, 81
params parameter modifiers, 166
in delegate declaration, 62
pause time, in garbage collecting, 134
PE (Portable Executable) files, packaging, 116
<permission> XML tag, 80
PEVerify.exe (portable executable verifier), 159
picture format specifiers, 175
PInvoke (Platform Invocation Services), 137
placeholders, 22
Platform Invocation Services (PInvoke), 137
Point class, using types, 30
pointer types, 8, 73-77
pointer-to-member (->) operator, 74
polymorphism, 32
Portable Executable (PE) files, packaging, 116
portable executable verifier (PEVerify.exe), 159
Position property, 104
positional parameter, 72
precedence, of operators, 18
predefined types, 8-13
bool, 12
char, 11
decimal, 11
floating-point, 10
integral, 9
object, 12
string, 13
predinined attributes, 128
preprocessor directives, 77
PreserveSig parameter, for DllImport attribute, 140
primary operators, precedence of, 19
primitive types, 18
private access modifiers, 36, 166
private assemblies, 117
ProgId attribute, 146
programming, 84-146
assemblies for, 115-119
collections for, 95-101
common types for, 84
custom attributes for, 126-132
input/output for, 103-107
Interop with Native DLLs for, 137-143
math, supporting language for, 90-91
networking for, 107-111
reflection for, 119-126
regular expressions for, 101
strings for, 92-94
threads for, 111-115
programming models, 107
property field, 41
protected access modifier, 36, 166
protected internal access modifier, 36
protocol handlers
adding new, 109
configuring requests, 108
pseudo-custom attributes, compiling custom attributes, 127
public access modifier, 36, 166
Pulse methods, 115
pulse operations, 113
PulseAll methods, 115
R[ Top ]
<return value> modifier, 180
<revision> assembly version numbers, 117
\r char type, 12
R4 enum value for UnmanagedType, 142
R8 enum value for UnmanagedType, 142
Random class, 91
RCW (Runtime Callable Wrapper), 143
readonly field modifiers, 41, 166
rectangular arrays, 58
ref modifier, 44, 167, 180
reference types, 8
ReferenceEquals( ) method, 87
reflection, 119-126, 150
activation for, 124
advanced uses of, 124
late binding and, 122
retrieving the type for an instance, 121
type hierarchy and, 119-120
RegAsm.exe
binding COM and C# objects, 143
ComRegisterFunction attribute and, 146
register assembly tool, 160
Regex class, 101
#region name preprocessor directive, 78
register assembly tool (RegAsm.exe), 160
register services utility (RegSvcs.exe), 160
RegSvcs.exe (register services utility), 160
regular expressions, 101, 169-171
relational operators, precedence of, 20
ReleaseComObject method, exposing COM objects to C#, 143
<remarks> XML tag, 80
Remoting, 151
request architecture (generic), 107
resources, 116
response architecture (generic), 107
retrieving type for, 121
return statement, 28, 167
<returns> XML tag, 80
right-associative, 19
roots, in garbage collections, 134
RPrecise enum value for UnmanagedType, 142
runtime
(CorDbg.exe), debugger, 158
facilities, 156
interactivity (CLR feature), 3
support for custom attributes, 128
Runtime Callable Wrapper (RCW), 143
Runtime.InteropServices.Marshal type, exposing COM objects to C#, 143
S[ Top ]
SafeArray enum value for UnmanagedType, 142
sbyte integral type, 9, 167, 179
SDK (Software Developer Kit), v
sealed classes, 34, 167
security
of CLR, 3
in FCL, 149
permissions for assemblies, 118
<see> XML tag, 81
<seealso> XML tag, 81
selection statements, 22
semicolon (;)
empty statements and, 22
in expression statements, 21
Serializable attribute, 130
compiling custom attributes, 128
retrieving a custom attribute at runtime, 132
serialization, 150
set keyword, 167
SetLastError parameter, for DllImport attribute, 140
shareable assemblies, 181
shared assemblies, 117
shared name utility (Sn.exe), 160
shared names, 117
shift operators, precedence of, 20
short integral type, 9, 167
COM type mapping and, 179
signature, 44
signed integers, 9
Size parameter for StructLayout attribute, 141
sizeof operator, 167
precedence of, 19
relevance to enums, 61
snarf utility (Unix), 108
Sn.exe (shared name utility), 160
SoapSuds.exe (SoapSuds utility), 160
Software Developer Kit (SDK), v
SortedList class, 96
specialized class, 32
specifiers
DateTime, 177
Stack class, 97, 148
stackalloc operator, 19, 167
allocating memory in a block, 76
StackTrace property (Exceptions), 71
statement blocks, 21
static constructors, 51
nondeterminism of, 52
static field initialization order, 52
static members, 7, 39, 167
Stream class, 104
encapsulating raw streams, 105
StreamReader classes, 105
streams (data flow), 103
StreamWriter classes, 105
String class, 92
text for handling immutable strings, 148
string interning, 92
string type, 13, 167, 179
switch statements, using, 24
StringBuilder class, 94
creating a mutable string, 92
text and, 148
StringCollection class, 97
StringReader classes, 106
strings, 92-94
encoding, 94
formatting, 93
immutability of, 92
indexing, 94
interning, 92
StringBuilder class, using to represent, 94
StringWriter classes, 106
Struct enum value for UnmanagedType, 142
struct keyword, 167
struct size retrieval (sizeof) operator, 19
StructLayout attribute, 141
structs, 37-54
base keywords, 53
classes, differences between, 38
cloning instances for, 88
constants, 40
destructors, 53
finalizers, 53
indexers, indexing elements in a class, 43
instance constructors, 49
instance vs. static members and, 39
marshaling, 138
methods and, 43
nested types and, 54
operators and, 46-49
properties, 41
static constructors and, 51
this keyword and, 52
subclass, 32
.SUFFIXES keyword, working with assemblies, 183
<summary> XML tag, 80
superclass, 32
SuppressFinalize method, 136
switch statements, 23, 167
synchronization of threads, 112-114
SyncRoot( ) method, 99
SysInt enum value for UnmanagedType, 142
System namespace
common types, location of, 84
core types, location of, 147
math-oriented types, location of, 90
strings, location of, 92
System.Array
array conversion and, 60
declaring array types, 58
System.Attribute class, 72
compiler support for custom attributes, 127
defining a new attribute, 131
System.Byte system type, 9
System.Char system type, 11
System.Currency type, 179
System.DateTime type, 179
System.Double system type, 10
System.Enum type, 60
System.EventArgs, storing data about events, 64
System.Exception class, 69
key properties of, 70
System.GC type
finalize method, suppressing, 136
initiating a garbage collection, 133
System.Guid type, 179
System.Int16 system type, 9
System.Int32 system type, 9
System.Int64 system type, 9
System.Net.Sockets namespace, providing protocol-level support for TCP and UDP, 109
System.Object class, definition of, 85
System.Object system type, 12
System.Reflection.Emit namespace, creating new types at runtime, 125
System.Sbyte system type, 9
System.Single system type, 10
System.String class, 92
System.String system type, 13
System.Text.RegularExpressions namespace, location of regular expressions, 101
System.Thread, 149
System.Threading.Monitor class, using an instance as a monitor, 114
System.ThreadStaticAttribute, 149
System.UInt16 system type, 9
System.UInt32 system type, 9
System.UInt64 system type, 9
SysUInt enum value for UnmanagedType, 142
T[ Top ]
\t char type, 12
T XML type ID prefix, 82
tags (XML), 80-82
user-defined, 81
target-enum, using AttributeUsage attribute, 129
targets (attributes), 73
TBStr enum value for UnmanagedType, 142
TCP (Transmission Control Protocol), 107
using, 109
TcpClient class, providing TCP support, 109
TcpListener class, providing TCP support, 109
Test class, retrieving a custom attribute at runtime, 132
text, supported by FCL, 148
TextReader class (abstract), 105
TextWriter class (abstract), 105
this keyword, 52, 167
Thread InterruptedException, obtaining/releasing a lock on an object, 114
threads, 111-115
common types, 114
monitor class, 114
synchronizing, 112-114
threads, FCL and, 149
three-state logic operators, 48
throw statement, 28, 167
using switch statements, 24
TimeSpan extended type, 148
TlbExp.exe, 160
binding COM and C# objects, 143
TlbImp.exe, 160
binding COM and C# objects, 143
tools
for exploring BCLs, 147
for .NET, 158-161
support for FCL, 155
ToString( ) method, 86
tracing garbage collector, 133
Transmission Control Protocol (see TCP)
true keyword, 48, 167
try statement, 67-71, 168
TryEnter methods, 114
type ID prefixes (XML), 82
type instances, 6
type library exporter (TlbExp.exe), 160
type library importer (Tlblmp.exe), 160
type members, 38
Type object, gaining access to, 86
typeof (type retrieval) operator, 19, 168
TypeRef identifier, 118
types, 6-17
aliasing namespaces and, 30
categories of, 8
creating at runtime, 125
default values of, 18
explicit conversions, 7
files, organizing, 29-31
implicit conversions, 7, 48
math-oriented programming and, 91
memory and, 13
namespace declaration, 29
organizing, 29-31
pointer, 8
predefined, 8-13
reference, 8
reflection and, 120
resolution, 118
retrieving for an instance, 121
type instances, 6
value, 8
U[ Top ]
U1/U2/U4/U8 enum values for UnmanagedType, 142
UDP (User Datagram Protocol), 107
using, 109
uint integral type, 9, 168, 179
ulong integral type, 9, 168, 179
unary operators, precedence of, 19
unboxing value types, 16
unchecked (arithmetic check off) operator, 19, 168
#undef symbol preprocessor directive, 77
underscore ( _ ) (identifiers), 6
undocumented types, 156
Unicode characters
representing char types, 11
representing string types, 13
unified type system, 2, 15-17
Uniform Resource Indicator (see URI)
Unix snarf utility, 108
unmanaged code, 76
callbacks from, 139
FCL (Framework Class Library) and, 155
UnmanagedType enum values, 142
unsafe code, 73-77
unsafe modifier, 168
unsigned integers, 9
upcasting classes, 32
URI (Uniform Resource Indicator), 107
User Datagram Protocol (see UDP)
user-defined tags, 81
ushort integral type, 9, 168, 179
using keyword, 30, 168
using statement, 28
V[ Top ]
\v char type, 12
value keyword, 168
value types, 8
boxing and unboxing, 16
memory for, 13
simple types and, 15
<value> XML tag, 81
ValueType type, 147, 179
variables, 17
assigning, 17
default values for, 18
VariantBool enum value for UnmanagedType, 142
VBByRefStr enum value for UnmanagedType, 142
verbatim string literals, 13
version numbers (assembly), 117
versioning
as a C# language feature, 2
as a CLR feature, 3
with constants, 41
virtual function members, 35
virtual function members, 33
versioning, 35
virtual keyword, 168
void keyword, 168
void* keyword, 76
volatile keyword, 40, 168
W[ Top ]
wait methods, 115
wait operations, 113
#warning text preprocessor directive, 78
web-based applications, 153
WebRequestFactory, creating protocol for requests, 107
while loop statement, 25, 48, 168
Wiltamuth, Scott (cocreator of C# language), 1
WinCV.exe, 160
for exploring BCLs, 147
windows class viewer (WinCV.exe), as a .NET tool, 160
Wsdl.exe (web services description language tool), 160
X[ Top ]
XML documentation, 78-82
FCL (Framework Class Library) and, 152
files, 79
predefined tags, 80-82
type/member cross references, 82
user-defined tags, 81
XML schema definition tool (Xsd.exe), 161
Xsd.exe (XML schema definition tool), 161
Return to C# Essentials
About O'Reilly | Contact | Jobs | Press Room | How to Advertise | Privacy Policy
|
© 2008, O'Reilly Media, Inc. | (707) 827-7000 / (800) 998-9938
All trademarks and registered trademarks appearing on oreilly.com are the property of their respective owners.