Errata

Applied Microsoft® .NET Framework Programming

Errata for Applied Microsoft® .NET Framework Programming

The errata list is a list of errors and their corrections that were found after the product was released. If the error was corrected in a later version or reprint the date of the correction will be displayed in the column titled "Date Corrected".

The following errata were submitted by our customers and approved as valid errors by the author or editor.

Color key: Serious technical mistake Minor technical mistake Language or formatting error Typo Question Note Update

Version Location Description Submitted By Date submitted Date corrected
Printed
Page xxxi

Invalid URL
There is an invalid URL listed in the last sentence in the first

paragraph of the 'System Requirements' section on page xxxi. Change:

"You can download it from

Microsoft Press  Jul 13, 2010 
Printed
Page 10

MSCorLib.dll Should Be MSCorEE.dll in Diagram 1-3
On page 10, in figure 1-3, an incorrect DLL is referenced.

Change the box currently reading: "DLL:MSCorLib.dll

Function:_CorExeMain" To: "DLL:MSCorEE.dll

Function:_CorExeMain"

Microsoft Press  Jul 13, 2010 
Printed
Page 14

Invalid URL
There is an invalid URL listed in the last sentence in the second

to last paragraph on page 14. Change: "For more information

about ECMA, see http://www.ECMA.ch and http://MSDN.Microsoft.com/Net/ECMA."

To: "For more information about ECMA, see

http://www.ecma-international.org/ and

http://MSDN.Microsoft.com/Net/ECMA."

Microsoft Press  Jul 13, 2010 
Printed
Page 20

Verifier Should Be Verification
On page 20, in the box titled "Is Your Code Safe?", in last

sentence of the third paragraph, Change: "[...]

VerifierException [...]" To: "[...] VerificationException [...]"



Microsoft Press  Jul 13, 2010 
Printed
Page 28

Missing Text
On page 28, the next to last sentence of the third paragraph is

missing some words. Change: "The second error is because this type

exposes two public methods that differ only by case: Abc and abc."

To: "The second error is because this type exposes two public methods that

differ only by case and return type: Abc and abc."

Microsoft Press  Jul 13, 2010 
Printed
Page 77

AssemblyAlgIDAttribute Should Be AssemblyAlgorithmidAttribute
At the top of page 77, change

"System.Reflection.AssemblyAlgIDAttribute" to

"System.Reflection.AssemblyAlgorithmIdAttribute". Note there are two

changes--ID becomes Id, and Alg becomes Algorithm.

Microsoft Press  Jul 13, 2010 
Printed
Page 81

Bad Breaks In Listing
On page 81, there are two bad breaks in the listing.

Change:

/ur

Uninstalls an assembly reference. Include the name of the

assembly, type of reference, ID and data as parameters.

Example: /

ur myDLL.Version=1.1.0.0,Culture=en.PublicKeyToken=874e23ab874e23ab

FILEPATH c:appsmyapp.exe MyApp

To:

/ur

Uninstalls an assembly reference. Include the name of the

assembly, type of reference, ID and data as parameters.

Example: /ur myDLL.Version=1.1.0.0,Culture=en.

PublicKeyToken=874e23ab874e23ab FILEPATH c:appsmyapp.exe MyApp

Change:

/uf

Forces uninstall of an assembly by removing all install references.

Include the full name of the assembly to remove as a parameter.

Assembly will be removed unless referenced by Windows Installer.

Example: /

uf myDLL.Version=1.1.0.0,Culture=en.PublicKeyToken=874e23ab874e23ab

To:

/uf

Forces uninstall of an assembly by removing all install references.

Include the full name of the assembly to remove as a parameter.

Assembly will be removed unless referenced by Windows Installer.

Example: /uf myDLL.Version=1.1.0.0,Culture=en.

PublicKeyToken=874e23ab874e23ab

Microsoft Press  Jul 13, 2010 
Printed
Page 107

Policy.1.0.MyAsm.dll Should Be Policy.1.0.JeffTypes.dll
On page 107, in the bulleted paragraph "The /out switch",

Change: "[...] Policy.1.0.MyAsm.dll [...]" To:

"[...] Policy.1.0.JeffTypes.dll [...]"

Microsoft Press  Jul 13, 2010 
Printed
Page 116

Incorrect Statement Regarding MemberwiseClone
There is an error in the first sentence in the Description column

for the MemberwiseClone Protected Method row of the System.Object class table

located towards the bottom of Page 116. Change: "This

nonvirtual method creates a new instance of the type and sets the new object's

fields to be identical to this object's fields." To: "This

nonvirtual method creates a new instance of the type and sets the new object's

nonstatic fields to be identical to this object's nonstatic fields."

Microsoft Press  Jul 13, 2010 
Printed
Page 121

Incorrect Table Number
On page 121, in the Table "Type-Safety Quiz", change the table

number from "4-4" to "4-3".

Microsoft Press  Jul 13, 2010 
Printed
Page 123

Complier Should Be Compiler
On page 123, in the second sentence of the second paragraph,

change "complier" to "compiler".

Microsoft Press  Jul 13, 2010 
Printed
Page 126

System.Collections.ArrayList Should Be System.IO.FileStream
On page 126, in the first paragraph of "How Namespaces and

Assemblies Relate" change "System.Collections.ArrayList" to

"System.IO.FileStream"

Microsoft Press  Jul 13, 2010 
Printed
Page 129

Int64 Should Be Int32
On page 129, in the second bulleted item, third line, change

"Int64" to "Int32".

Microsoft Press  Jul 13, 2010 
Printed
Page 129

BinaryRead Should Be BinaryReader
On page 129, in the listing in the third bulleted item,

Change:

BinaryReader br = new BinaryRead(...);

...

To:

BinaryReader br = new BinaryReader(...);

...

Microsoft Press  Jul 13, 2010 
Printed
Page 135

ValueType Should Be System.ValueType
On page 135, in the third paragraph, last sentence (above the

Note box), change the final word "ValueType" to "System.ValueType".

Microsoft Press  Jul 13, 2010 
Printed
Page 140

InteropService Should Be Pluralized
On page 140, in the box "How the CLR Controls the Layout of a

Type's Fields", in the example at the bottom, Change:

using System;

using System.Runtime.InteropService;

...

To:

using System;

using System.Runtime.InteropServices;

...

Microsoft Press  Jul 13, 2010 
Printed
Page 141

void Should Be Int32
On page 141, after the second paragraph is a code snip for the

Add method, Change:

public virtual void Add(Object value);

To:

public virtual Int32 Add(Object value);

Microsoft Press  Jul 13, 2010 
Printed
Page 152

p Should Be p2
On page 152, in the third bulleted item, change the first two

references to "p" to "p2".

Microsoft Press  Jul 13, 2010 
Printed
Page 160

Capital "I" Needed
On page 160, under "Summary of Implementing Equals and the ==/!=

Operators", in the first bulleted item, references to "Uint16", "Uint32",

"Uint64" all need the "i" capitalized so they read: "UInt16", "UInt32",

"UInt64"

Microsoft Press  Jul 13, 2010 
Printed
Page 176

Incorrect Descriptions In Table 7-4
There are multiple errors in the description column of Table

7-4.In the Newslot row, change:"Method should not override a

virtual method ... Applies only to virtual methods."To:"Method

should not override an instance method ... Applies only to instance

methods."In the Override row, change:"Applies only to

virtual methods."To: "Applies only to derived methods."In

the Final row, change:"Applies only to virtual

methods."To:"Applies only to derived methods."

Microsoft Press  Jul 13, 2010 
Printed
Page 179

Disregard Note Box
On page 179, disregard the Note Box at the top of the page.

Microsoft Press  Jul 13, 2010 
Printed
Page 180

type's Should Be class's
On page 180, in the final paragraph, Change:

"[...] to initialize a type's constants, [...]" To: "[...] to

initialize a class's constants, [...]"

Microsoft Press  Jul 13, 2010 
Printed
Page 188

Disregard Portion Of Sentence
On page 188, in the third paragraph, disregard: "(or

process if the assembly is loaded in a domain neutral fashion)"

Microsoft Press  Jul 13, 2010 
Printed
Page 202

Initialize Should Be Initialized
On page 202, in the upper code example, change: v += 10; // This method can use the initialize value in v. To: v += 10; // This method can use the initialized value in v.

Microsoft Press  Jul 13, 2010 
Printed
Page 204

ProcessingFiles Should Be ProcessFiles
On page 204, in the third to last line at the bottom of the

page,Change: void ProcessingFiles(ref FileStream fs) {

To: void ProcessFiles(ref FileStream fs) {

Microsoft Press  Jul 13, 2010 
Printed
Page 218

Missing Word
On page 218, the word "method" is missing in the first two

bulleted items. In the first bullet, change: "...define a get

accessor for the property." To: "...define a get accessor method

for the property." In the second bullet, change: "...define

a set accessor for the property." To: "...define a set accessor

method for the property."

Microsoft Press  Jul 13, 2010 
Printed
Page 220

Delete Parenthesis
On page 220, in the code listing, next to last line, remove the

final parenthesis. Change:

return (byteArray[bitPos / 8] & (1 << (bitPos % 8 ))) != 0);

To:

return (byteArray[bitPos / 8] & (1 << (bitPos % 8 ))) != 0;

Microsoft Press  Jul 13, 2010 
Printed
Page 221

foreach Should Be for
In the third section of the code listing after the sentence

"Using the BitArray type's indexer...", the word "foreach" should be

"for". Change:

// Show the state of all the bits by calling the get accessor.

foreach (Int32 x = 0; x < 14; x++) {

To:

// Show the state of all the bits by calling the get accessor.

for (Int32 x = 0; x < 14; x++) {

Microsoft Press  Jul 13, 2010 
Printed
Page 223

Changes To Code Listing
On page 223, in the second code listing, there are three errors.

On the first line, the words "SomeType" should be "BitArray", on the second

line the word "as" should be capitalized, on the eighth line "cs.Bit(2)" should

be "ba.Bit(2)". Change:

' Construct an instance of the SomeType type.

Dim ba as new BitArray(10)



' Visual Basic uses ( ) instead of [ ] to specify array elements.

Console.WriteLine(ba(2)) 'Displays True or False



'Visual Basic also allows you to access the indexer by its name.

Console.WriteLine(cs.Bit(2)) 'Displays same as previous line

NOTE: While not shown in the code samples here, the vertical ellipsis

shown in the book should be retained. To:

' Construct an instance of the BitArray type.

Dim ba AS new BitArray(10)



' Visual Basic uses ( ) instead of [ ] to specify array elements.

Console.WriteLine(ba(2)) 'Displays True or False



'Visual Basic also allows you to access the indexer by its name.

Console.WriteLine(ba.Bit(2)) 'Displays same as previous line

Microsoft Press  Jul 13, 2010 
Printed
Page 232

Missing "virtual"
On page 232, the word "virtual" is missing from the second

section of the code listing. Change:

// 2. A PUBLIC add_* method

// Allows objects to register interest in the event.

[MethodImplAttribute(MethodImplOptions.Synchronized) ]

public void add_MailMsg(MailMsgEventHandler handler) {

To:

// 2. A PUBLIC add_* method

// Allows objects to register interest in the event.

[MethodImplAttribute(MethodImplOptions.Synchronized) ]

public virtual void add_MailMsg(MailMsgEventHandler handler) {

Microsoft Press  Jul 13, 2010 
Printed
Page 234

Transposed Text In Code Listing
On page 234, in the code listing, in the 26th line, the text is

transposed. Change:

"To: {0}
From: {1}
Subject:

{2}
Body: {3}
"

To:

"From: {1}
To: {0}
Subject:

{2}
Body: {3}
"

Microsoft Press  Jul 13, 2010 
Printed
Page 255

.SubString Should Be .Substring
On page 255, in the final code snip, ".SubString" should be

".Substring" Change:



if (s.ToLower( ).SubString(10, 20).EndsWidth("exe")) {

To:

if (s.ToLower( ).Substring(10, 20).EndsWidth("exe")) {

Microsoft Press  Jul 13, 2010 
Printed
Page 273

Correction To Table 12-4
On page 273, in table 12-4, the entry for Member AppendInsert

should be broken into 2 separate lines. Change:

"AppendInsert" To: "AppendInsert"

Microsoft Press  Jul 13, 2010 
Printed
Page 284

Doesn't Should Be Does
On page 284, in the second paragraph after the code listing,

change: "If the object doesn't support IFormattable, [...]"

To: "If the object does support IFormattable, [...]"

Microsoft Press  Jul 13, 2010 
Printed
Page 302

Missing Semicolon In Code Sample
There is a semicolon missing from a code sample on page

302.Change:"Console.WriteLine(Enum.Format(typeof(Color), 2,

"G"))"To:"Console.WriteLine(Enum.Format(typeof(Color), 2,

"G"));"

Microsoft Press  Jul 13, 2010 
Printed
Page 310

Section Should Be Chapter
On page 310, change the very last word on the page, "section", to

"chapter".

Microsoft Press  Jul 13, 2010 
Printed
Page 328

this Should Be other In Code Listing
On page 328, in the code listing, third section,

change:

return (x == this.x) && (y == this.y)

To:

return (x == other.x) && (y == other.y)

Microsoft Press  Jul 13, 2010 
Printed
Page 337

Error In Code Sample
There is an error in the code sample at the bottom of page

337. Change:menu = gp.GetMenu()); To:menu = gp.GetMenu();

Microsoft Press  Jul 13, 2010 
Printed
Page 340

private Should Be protected
On page 340, in the third and fourth paragraph, and in the sample

errors between these paragraphs, there are four instances where the word

"private" must be changed to "protected". Change: "Finally,

notice that the IComparable.CompareTo method isn't prefixed with a public or

private access modifier. In fact, the C# compiler produces one of the following

errors if a public or private access modifier is added: error CS0106:

The modifier 'public' is not valid for this item error CS0106: The

modifier 'private' is not valid for this item The fact that

IComparable.CompareTo can't have a public or private access modifier

[...]" To: "Finally, notice that the IComparable.CompareTo

method isn't prefixed with a public or protected access modifier. In fact, the

C# compiler produces one of the following errors if a public or protected

access modifier is added: error CS0106: The modifier 'public' is not

valid for this item error CS0106: The modifier 'protected' is not valid

for this item The fact that IComparable.CompareTo can't have a public

or protected access modifier [...]"

Microsoft Press  Jul 13, 2010 
Printed
Page 346

Incorrect Capitalization In Code Sample
There is an error in the code sample in the middle of page 346.

Uint32 should be UInt32.Change:"public Uint32 PlatformId =

0;"To:"public UInt32 PlatformId = 0;"

Microsoft Press  Jul 13, 2010 
Printed
Page 355

Remove "and"
On page 355, in the third paragraph, in the fifth sentence,

change: "You'll recall that all CLS-compliant attributes are derived

from System.Attribute and this type..." To: "You'll recall that

all CLS-compliant attributes are derived from System.Attribute; this

type..."

Microsoft Press  Jul 13, 2010 
Printed
Page 369

Error In Code Sample
There is an error in the code sample at the bottom of page

369.Change:"void FeedbackToConsole(Object , Int32 , Int32 ,

String s) {"To:"Static void FeedbackToConsole(Object value,

Int32 item, Int32 numItems, String s) {"

Microsoft Press  Jul 13, 2010 
Printed
Page 374

Correction To Code Sample
On page 374, in the code snip after the second paragraph, middle

of the page, change: " feedback(items[item], item, items.length);

" To: " feedback(items[item], item + 1, items.length); "

Microsoft Press  Jul 13, 2010 
Printed
Page 378

Error In Code Sample
There is an error in the code sample in the middle of page

378.Change:"Feedback fb3 = new

Feedback(appobj.FeedbackToStream);"To:"Feedback fb3 = new

Feedback(appobj.FeedbackToFile);"

Microsoft Press  Jul 13, 2010 
Printed
Page 381

Missing Parenthesis In Code Sample
On page 381, in the Note box, in the code sample, a parenthesis

is missing. Change:

// Do fb and fbChain refer to the same object? "False"

Console.WriteLine(Object.ReferenceEquals(fb, fbChain);

To:

// Do fb and fbChain refer to the same object? "False"

Console.WriteLine(Object.ReferenceEquals(fb, fbChain));

Microsoft Press  Jul 13, 2010 
Printed
Page 438

Error In Table 18-2
There is an incorrect statement in the Description column of the

2 row in Table 18-2.Change:"In this case, no dialog box is

displayed to the user and AppDomain's UnhandledException event doesn't fire.

Instead, the CLR ..."To:"In this case, no dialog box is

displayed to the user. Instead, the CLR ..."

Microsoft Press  Jul 13, 2010 
Printed
Page 473

"would" Should Be "should"
On page 473, in the comments section of the code listing section

beginning "// The common method that does the actual cleanup. ",

change: "// If this class weren't sealed, this method would be

protected." To: "// If this class weren't sealed, this method

should be protected."

Microsoft Press  Jul 13, 2010 
Printed
Page 477

"didn't" Should Be "did"
On page 477, in the paragraph immediately after the code listing,

third sentence, change: "For if Finalize didn't execute,

[...]" To: "For if Finalize did execute, [...]"

Microsoft Press  Jul 13, 2010 
Printed
Page 492

Missing } Bracket In Code Sample
"The second instance of the code sample located at the end of the

Expensive destructor on page 492 is missing a } bracket."Change: pool.Push(this);

} To: pool.Push(this);

}

}

Microsoft Press  Jul 13, 2010 
Printed
Page 500

Error In Code Sample
There is an error in the code sample at the bottom of page

500.Change:"// Create a new BaseObj in the

heap."To:"// Create a new GenObj in the heap."

Microsoft Press  Jul 13, 2010 
Printed
Page 535

Incorrect Version Statement
There is an incorrect version statement in the middle of page

535.Change:"Version=1.0.2411.0"To:"Version=1.0.3300.0"

Microsoft Press  Jul 13, 2010 
Printed
Page 539

Error In Table 20-3
There is an error in the Description column of the IsDefined row

in Table 20-3.Change:"Returns true if one and only one

instance..."To:"Returns true if at least one instance..."

Microsoft Press  Jul 13, 2010 
Printed
Page 553

Incorrect Statement
There is an incorrect statement in the first paragraph on page

553. The second half of the first paragraph after "Note that these methods"

should be removed.The remaining text should read:"All these

methods return Type objects that represent an interface.Determining

which members of a type implement a particular interface ..."

Microsoft Press  Jul 13, 2010 
Printed
Page xxviii

Incorrect "And" In Lead-In In the lead-in line (in boldface) of the second entry on the page, remove the "and".Change:"Automatic memory and management (garbage collection)"To:"Automatic memory management (garbage collection)"

Microsoft Press  May 06, 2010 
Printed
Page http

//go.microsoft.com/fwlink/?LinkId=5584." To: "You can download it from http://msdn2.microsoft.com/en-us/netframework/aa731542.aspx"

Microsoft Press  May 06, 2010 
Printed
Page 11

Standard Edition Should Be Second Edition On page 11, in the first sentence of the third paragraph, Change: "[...] Windows 98 Standard Edition [...]" To: "[...] Windows 98 Second Edition [...]"

Microsoft Press  May 06, 2010 
Printed
Page 19

System.Security.Verifier.Exception Should Be System.Security.VerificationException In the last sentence on page 19, Change: "[...] System.Security.Verifier.Exception [...]" To: "[...] System.Security.VerificationException [...]"

Microsoft Press  May 06, 2010 
Printed
Page 27

CTS And CLR Should Be CLS On page 27, in the second sentence of the fourth paragraph, there is a reference to "CTS" and a reference to "CLR". Both of these should read "CLS".

Microsoft Press  May 06, 2010 
Printed
Page 68

Standard Edition Should Be Second Edition On page 68, in the first paragraph, change the reference to "Windows 98 Standard Edition" to "Windows 98 Second Edition".

Microsoft Press  May 06, 2010 
Printed
Page 78

Incorrect Build Number On page 78, in the listing AssemblyRef #1, Change: "Build Number: 0x0000c1e" To: "Build Number: 0x0000ce4"

Microsoft Press  May 06, 2010 
Printed
Page 92

Error In Code Sample The second attribute of Step 1 on page 92 is incorrect. Change:[assembly:DelaySign(true)]To:[assembly:AssemblyDelaySign(true)]

Microsoft Press  May 06, 2010 
Printed
Page 110

Standard Should Be Second On page 110, in the Note box, change the reference to "Windows 98 Standard Edition" to "Windows 98 Second Edition".

Microsoft Press  May 06, 2010 
Printed
Page 119

public void Should Be public static void On page 119, in the first line of the listing, Change: public void PromoteEmployee(Object o) { ... To: public static void PromoteEmployee(Object o) { ...

Microsoft Press  May 06, 2010 
Printed
Page 121

Corrections To Table Items On page 121, in the table "Type-Safety Quiz", there are three incorrect lines. On line 10, change: "B b3 = d1;" To: "B b4 = d1;" On line 15, change: "B b4 = (B) o1;" To: "B b5 = (B) o1;" On line 16, change: "B b5 = (D) b2;" To: "B b6 = (D) b2;"

Microsoft Press  May 06, 2010 
Printed
Page 126

System.Collections.StringCollections Should Be System.IO.FileSystemWatcher On page 126, in the first paragraph of "How Namespaces and Assemblies Relate" change "System.Collections.StringCollections" to "System.IO.FileSystemWatcher"

Microsoft Press  May 06, 2010 
Printed
Page 126

Correction To Sentence On page 126, in the box "How Names and Assemblies Relate", change the final line of the third paragraph from: "[...] source code and you'd use the /r:System.Windows.dll compiler switch." To: "[...] source code and use the /r:System.Windows.Forms.dll compiler switch.""

Microsoft Press  May 06, 2010 
Printed
Page 129

Correction To Sentence On page 129, in the third bulleted item, change the first sentence: "[...] that have type names in the method." To: "[...] that have type names as part of their method names."

Microsoft Press  May 06, 2010 
Printed
Page 130

Int64 Should Be Int16 There are two instances of Int64 that should be changed to Int16.Change:"converting from Single to Int64 requires a cast because Single can represent numbers of a larger magnitude than Int64 can."To:"converting from Single to Int16 requires a cast because Single can represent numbers of a larger magnitude than Int16 can."

Microsoft Press  May 06, 2010 
Printed
Page 138

Missing "Is" On page 138, in the second sentence, Change: "[...] C# thinks the instance initialized [...]" To: "[...] C# thinks the instance is initialized [...]"

Microsoft Press  May 06, 2010 
Printed
Page 141

Array Should Be ArrayList On page 141, in the code example, Change: ... a.Add(p); //Box the value type and add the // reference to the Array. ... To: ... a.Add(p); //Box the value type and add the // reference to the ArrayList. ...

Microsoft Press  May 06, 2010 
Printed
Page 144

Missing Semicolon On page 144, in the code example, Change: ... o = p } To: ... o = p; }

Microsoft Press  May 06, 2010 
Printed
Page 155 & 157

Correction To Code Sample On pages 155 and 157, approximately middle of each page, Change: // Optional overloads of the == and != operators public static Boolean operator==(MyRefType o1, MyRefType o2) { if (ol == null) return false; return ol.Equals(o2); } To: // Optional overloads of the == and != operators public static Boolean operator==(MyRefType o1, MyRefType o2) { return Object.Equals(o1, o2); }

Microsoft Press  May 06, 2010 
Printed
Page 166

Correction To Code Sample On page 166, in the first code sample, Change: ... // Refer to a deep copy of the set passed. this.set = set.Clone(); To: ... // Refer to a shallow copy of the set passed. this.set = (ArrayList) set.Clone();

Microsoft Press  May 06, 2010 
Printed
Page 177

MaxInt32 Should Be MaxInt16 On page 177, on the last line, change "MaxInt32" to "MaxInt16".

Microsoft Press  May 06, 2010 
Printed
Page 180

Correction To Code Sample On page 180, in the code sample, Change: ... // This is an instance read-only field. public String readonly pathName = "untitled"; To: ... // This is an instance read-only field. public readonly String pathName = "untitled";

Microsoft Press  May 06, 2010 
Printed
Page 186

Correction To Error Text On page 186, in the second paragraph after the Note box, Change: "[...] produces the following: "error CS0573: 'SomeType.x': [...]" To: "[...] produces the following: "error CS0573: 'SomeValType.x': [...]"

Microsoft Press  May 06, 2010 
Printed
Page 199

2.5 Should Be 2.5F On page 199, in the code example, change: Rational r2 = 2.5; // Implicit cast from Single to Rational To:Rational r2 = 2.5F; // Implicit cast from Single to Rational

Microsoft Press  May 06, 2010 
Printed
Page 204

Void Should Be Static Void On page 204, in the first code example, there are two lines beginning with the word "void" that need to be changed. Change:void StartProcessingFiles(out FileStream fs) { To:static void StartProcessingFiles(out FileStream fs) { Change:void ContinueProcessingFiles(ref FileStream fs) { To:static void ContinueProcessingFiles(ref FileStream fs) {

Microsoft Press  May 06, 2010 
Printed
Page 206

Void Should Be Static Void On page 206, in the code sample, change:void GetAnObject(out Object o) { To:static void GetAnObject(out Object o) {

Microsoft Press  May 06, 2010 
Printed
Page 219

Delete Closing Brace The code sample on page 219 contains one closing brace too many. The code sample should read as follows: public void set_Age(Int32 value) { If (value < 0) // The 'value always identifies the new value. throw new ArgumentOutOfRangeExceptional( "Age must be greater than or equal to 0"); _Age = value; } }

Microsoft Press  May 06, 2010 
Printed
Page 220

Correction To Code Listing On page 220, in the second section of the code listing, there is missing text. Change: if (numBits <= 0) throw new ArgumentOutOfRangeException("numBits must be > 0"); To: if (numBits <= 0) throw new ArgumentOutOfRangeException("numBits", "numBits must be > 0");

Microsoft Press  May 06, 2010 
Printed
Page 222

Missing Word On page 222, the word "method" is missing in the first two bulleted items. In the first bullet, change: "...define a get accessor for the property." To: "...define a get accessor method for the property." In the second bullet, change: "...define a set accessor for the property." To: "...define a set accessor method for the property."

Microsoft Press  May 06, 2010 
Printed
Page 230

Final Paragraph Should Be Part Of Note Box On page 230, the final paragraph, beginning "As you can see, this type is nothing to write home about.", should be part of the Note box immediately above it.

Microsoft Press  May 06, 2010 
Printed
Page 232

Missing "virtual" On page 232, the word "virtual" is missing from the third section of the code listing. Change: // 3. A PUBLIC remove_* method // Allows objects to unregister interest in the event. [MethodImplAttribute(MethodImplOptions.Synchronized) ] public void remove_MailMsg(MailMsgEventHandler handler) { To: // 3. A PUBLIC remove_* method // Allows objects to unregister interest in the event. [MethodImplAttribute(MethodImplOptions.Synchronized) ] public virtual void remove_MailMsg(MailMsgEventHandler handler) {

Microsoft Press  May 06, 2010 
Printed
Page 236

Brace Should Be Parenthesis On page 236, change the code example near the top of the page from: mm.remove_MailMsg(callback] ; To: mm.remove_MailMsg(callback) ;

Microsoft Press  May 06, 2010 
Printed
Page 273

Correction To Table 12-4 On page 273, in table 12-4, the entry for Member Type for Member Length is incorrect. Change: "Read only property" To: "Read/write property"

Microsoft Press  May 06, 2010 
Printed
Page 283-284

Replace Code Listing On page 283, replace the code listing beginning at the bottom third of the page (first line: "public StringBuilder AppendFormat(IFormatProvide formatProvider") and continuing on to page 284, with the following: public StringBuilder AppendFormat(IFormatProvider formatProvider, String format, params Object[] args) { // If an IFormatProvider was passed, find out // whether it offers an ICustomFormatter object. ICustomFormatter cf = null; if (formatProvider != null) cf = (ICustomFormatter) formatProvider.GetFormat(typeof(ICustomFormatter)); // Keep appending literal characters (not shown in this pseudocode) // and replaceable parameters to the StringBuilder's character array. while (MoreReplaceableArgumentsToAppend) { // argFormat refers to the replaceable format string obtained // from the format parameter String argFormat = ...; // argObj refers to the corresponding element // from the args array parameter Object argObj = ...; // argStr will refer to the formatted string to be appended // to the final, resulting string String argStr = null; // If a custom formatter is available, let it format the argument. if (cf != null) argStr = cf.Format(argFormat, argObj, formatProvider); // If there is no custom formatter or if it didn't format // the argument, try something else. if (argStr == null) { // Does the argument's type support rich formatting? IFormattable formattable = argObj as IFormattable; if (formattable != null) { // Yes; pass the format string and provider to // the type's IFormattable ToString method. argStr = formattable.ToString(argFormat, formatProvider); } else { // No; get the general format using // the thread's culture information. if (argObj != null) argStr = argObj.ToString(); else argStr = String.Empty; } } // Append argStr's characters to the character array field member. ... } return this; }

Microsoft Press  May 06, 2010 
Printed
Page 302

Error In Code Sample There is an error in the code sample at the top of page 302.Change:"Console.WriteLine(c.ToString("X")); // "2" (heX format)"To:"Console.WriteLine(c.ToString("X")); // "00000002" (heX format)"

Microsoft Press  May 06, 2010 
Printed
Page 303

Correction To Code Listing On page 303, in the code listing, second line from the top, change: "Console.WriteLine("{0,5:D} {1:G}",c, c); " To: "Console.WriteLine("{0,5:D} {0:G}",c); "

Microsoft Press  May 06, 2010 
Printed
Page 326

Error In Code Sample There is an error in the code sample at the bottom of page 326.Change:" Int32 CompareTo(Object object);"To:" Int32 CompareTo(Object obj);"

Microsoft Press  May 06, 2010 
Printed
Page 334

Second Should Be Fourth There is an error near the end of the second paragraph on page 334.Change:"When WriteLine is called the second time,"To:"When WriteLine is called the fourth time,"

Microsoft Press  May 06, 2010 
Printed
Page 339

private Should Be protected On page 339, in the code listing, change: "// NOTE: No public/private used on the next line " To: "// NOTE: No public/protected used on the next line "

Microsoft Press  May 06, 2010 
Printed
Page 341

Error In Sample Code There is an error in the code sample in the middle of page 341.Change:"n = ((IComparable) v1).CompareTo(v2)); // Boxes v1 and v2"To:"n = ((IComparable) v1).CompareTo(v2); // Boxes v1 and v2"

Microsoft Press  May 06, 2010 
Printed
Page 348

Error In Text There is an error in the text of the first paragraph on page 348.Change:"System.Runtime.InteropService namespace"To:"System.Runtime.InteropServices namespace"

Microsoft Press  May 06, 2010 
Printed
Page 361

Error In Code Sample There is an error in the code sample at the top of page 361.Change:"// Override GetHashCode because Equals is overloaded."To:"// Override GetHashCode because Equals is overridden."

Microsoft Press  May 06, 2010 
Printed
Page 374

Correction To Code Listing On page 374, in the first code listing (first line: "public void ProcessItems(Feedback feedback) { "), change: " feedback(items[item], item, items.length); " To: " feedback(items[item], item + 1, items.length); "

Microsoft Press  May 06, 2010 
Printed
Page 374

Correction To Code Sample On page 374, in the second code snip after the second paragraph, middle of the page, change: " feedback.Invoke(items[item], item, items.length); " To: " feedback.Invoke(items[item], item + 1, items.length); "

Microsoft Press  May 06, 2010 
Printed
Page 378

Errors In Code Sample There are two errors in the code sample at the bottom of page 378.Change:"fbArray[2] = new Feedback(appobj.FeedbackToStream);Feedback fbChain = Delegate.Combine(fbArray);"To:"fbArray[2] = new Feedback(appobj.FeedbackToFile);Feedback fbChain = (Feedback) Delegate.Combine(fbArray);"

Microsoft Press  May 06, 2010 
Printed
Page 383

FeedbackToStream Should Be FeedbackToFile There are four instances of FeedbackToStream in the code sample on page 383. All of these instances of FeedbackToStream should be changed to FeedbackToFile.

Microsoft Press  May 06, 2010 
Printed
Page 459

Error In Code Sample There are two error in the code sample at the top of page 459.Change:"Console.WriteLine(a.Length);"// After a.Length returns, a isn't refered to in the code and is no"To:"Console.WriteLine(a.Count);" // After a.Count returns, a isn't refered to in the code and is no"

Microsoft Press  May 06, 2010 
Printed
Page 473

"wouldn't" Should Be "would" In the code listing on page 473, line 31, change: "// If this class weren't sealed, this method wouldn't be protected." To: "// If this class weren't sealed, this method would be protected."

Microsoft Press  May 06, 2010 
Printed
Page 491

Error In Code Sample There is an error in the code sample in the middle of page 491.Change:"// This static ArrayList contains references"To:"// This static Stack contains references"

Microsoft Press  May 06, 2010 
Printed
Page 496 & 497

"J" Should Be "K" In figures 19-12 and 19-13, on pages 496 and 497, the letter "J" found in the box should be changed to a "K".

Microsoft Press  May 06, 2010 
Printed
Page 523

Delete "second version" On page 523, in the first sentence of the section "Reflecting Over a Type's Members: Binding", change: "In the second version of the Reflector application, [...]" To: "In the Reflector application, [...]"

Microsoft Press  May 06, 2010 
Printed
Page 537

RunTime Should Be RuntimeType There is an error in the text at the top of page 537.Change:"the IL code just saves the RuntimeTime reference..."To:"the IL code just saves the RuntimeType reference..."

Microsoft Press  May 06, 2010 
Printed
Page 547

Incorrect Text In Important Box There is an error in the last paragraph of the Important box on page 547.Change:"invoke a member, the member performs the same kind"To:"invoke a member, the method performs the same kind"

Microsoft Press  May 06, 2010 
Printed
Page 553

Incorrect Text There is an incorrect reference to Type in the last paragraph of page 553.Change:"about the interface's member as defined by the Type."To:"about the interface's member as defined by the TargetType." Microsoft Press is committed to providing informative and accurate books. All comments and corrections listed above are ready for inclusion in future printings of this book. If you have a later printing of this book, it may already contain most or all of the above corrections.

Microsoft Press  May 06, 2010