Version |
Location |
Description |
|
Page 50 |
There's an extra "W" in the "Example" column of first row. A "-", (dash), is used instead of "~", (tilde) as Bitwise complement in 5th row. Note from the Author or Editor: |
|
Page 99 |
public class RichTextBox : TextBox, IUndoable { public new void Undo() { Console.WriteLine ("RichTextBox.Undo"); } } should be: public class RichTextBox : TextBox, IUndoable { public new void Undo() { Console.WriteLine ("RichTextBox.Undo"); } } It is illegal to declare Undo method with new modifier. The Undo method in derived class doesn't hide any method in it base class, since the explictily implemented Undo method is tranparent to TextBox. Note from the Author or Editor: |
|
Page 159 |
Shouldn't: Overloading an assignment operator automatically supports the corresponding compound assignment operator. Be: Overloading an operator automatically supports the corresponding compound assignment operator. I mean you can't overload assignment operator, right? Note from the Author or Editor: |
Printed |
Page 185 |
In the <include> example, the ending tag is </para> but should be </include>. |
|
Page 416 |
The table shows (and the paragraph above it implies) that the result type of Average for a float selector is double, but I have verified that the output type of Average for a float selector is, in fact, float. Note from the Author or Editor: |
|
Page 427 |
The example output is missing a closing angle bracket (>). Note from the Author or Editor: |
|
Page 445 |
There is an erroneous "s" character after the quoted string "OReilly.Nutshell.CSharp" in the XML snippet (it's the second XML snippet on the page). Note from the Author or Editor: |
|
Page 461 |
"ReadStartElement verifies that the current NodeType is StartElement" There is no such member as StartElement in the XmlNodeType enum. It should be just Element. Note from the Author or Editor: |
|
Page 477 |
XLST written for XSLT |
Printed |
Page 478 |
XDocument doc = XDocument.Load (@"Customers.xml"); XElement e = e.XPathSelectElement ("customers/customer[firstname='Jim']"); // Here is mistake! I think it should be: XElement e = doc.XPathSelectElement ... Note from the Author or Editor: |
|
Page 484 |
XLST written for XSLT |
Printed, PDF |
Page 562 |
In method Void UpdateMessage(string message), the line should read // Marshal the delegate to the UI thread: _uiSyncContext.Post(_ => txtMessage.Text = message, null); null is missing. Note from the Author or Editor: |
|
Page 565 |
The word "avoid" should be 3rd person singular: "avoids". Context: "...and with a TaskCompletionSource, they can leverage a callback approach that avoid threads altogether while waiting on I/O-operations." Should read: "...that avoids threads altogether...". |
Printed |
Page 568 |
replace OperationCancelledOperation with OperationCancelledException Note from the Author or Editor: |
|
Page 572 |
The third sentence in the paragraph begins: "We can write this without a thread through use the Timer class" The word "use" should probably be removed, or possibly "through use" should be changed to "by using". Note from the Author or Editor: |
|
Page 572 |
The word "any" is repeated: "...we can write its results without any blocking any thread:". The first "any" is a repetition typo to be removed. |
|
Page 581 |
Third line from top reads: "...change-of-thread does not affect order execution and is of little consequence...". It should have "of" between "order" and "execution": "order of execution". |
|
Page 599 |
There is an undefined variable "someOperation" being referenced in the code example...I suspect that is meant to be a reference to the previously defined "task" variable. Note from the Author or Editor: |
|
Page 629 |
Before the parenthetical in the second sentence, "filesdata" should probably be changed to "data". At the end of the paragraph, "and the use asynchronous methods" should be something like "and using asynchronous methods". |
|
Page 631 |
ZipFile class lives not in System.IO.Compression.dll, but in a System.IO.Compression.FileSystem.dll assembly. Also, the compression results from running examples in several previous sections should be updated. It seems that compressing algorithms were improved considerably in 4.5, so, for instance, thousand long empty array now compresses to mere 11 and not 113 bytes. Note from the Author or Editor: |
|
Page 664 |
"StreamContent" is listed twice, one of these should be "StringContent". Note from the Author or Editor: |
Printed |
Page 664 |
2nd paragraph says 'HttpResponseMessage has a CopyToAsync method for writing ... Actually it is the HttpContent class, not HttpResponseMessage, that has the CopyToAsync method being discussed. Note from the Author or Editor: |
Printed |
Page 859 |
It seems MSDN refers to UAC as User 'Account' Control, not User 'Access' Control as shown near top of the page. |
Printed |
Page 963 |
The 2nd paragraph starts with: 'This enables monitoring for the current domain'. According to MSDN write up on MonitoringIsEnabled = true, it means 'monitoring is enabled for all application domains for the current process'. Note from the Author or Editor: |
Printed |
Page 979 |
In the middle paragraph that starts with 'The fixed directive...', a sentence near the end says: 'Unlike with standard C# array, NumberArray is not...' It seems 'NumberArray' should be 'Numbers'. Note from the Author or Editor: |
|
Page 985 |
The third statement in the Main() function has: Workbook workBook = excel.Workbooks.Add(); Since in the "usings" above we alias Microsoft.Office.Interop.Excel as "Excel", this line should actually read: Excel.Workbook workBook = excel.Workbooks.Add(); In order to compile correctly. Note from the Author or Editor: |
Printed |
Page 985 |
On pages 985, 988, and possibly other pages, there are references to the type library importer tool 'tlimp.exe'. According to MSDN that should be 'tlbimp.exe' (missing the 'b') |
Printed |
Page 993 |
Change the first line of the code listing from: Regex r = new Regex (@"sausages?"); to: Regex r = new Regex (@"sausages?" , RegexOptions.Compiled); And in the paragraph that follows, change : This is not just a syntactic convenience: under the covers, a RegEx instance uses lightweight code generation... to: RegexOptions.Compiled instructs the RegEx instance to use lightweight code generation... |
|
Page 994 |
In the Table 26-1 "Regular expression" there's entry with following text: Enum value: Compiled Regular expressions code: c Decription: Forces compilation of regular expression to IL There's NO such inline option. It exists only when using constructor (http://msdn.microsoft.com/en-us/library/h5845fdz.aspx). Here are all legal options: http://msdn.microsoft.com/en-us/library/yd1hzczs.aspx. Note from the Author or Editor: |
|
Page 995 |
The table shows the regular expression \s as "same as" expression [\n\\r\t\f]...this is not true, since \s also will match a space character and [\n\r\t\f] will not...easily fixed by adding a space into that set: [\n\r\t\f ] Note from the Author or Editor: |
|
Page 995 |
Actually, \s also matches the vertical tab (\v), so it should be something like: [\n\r\t\f\v ] Note from the Author or Editor: |
|
Page 1000 |
The output of the first example snippet has "In" as the second word, but it should be "in" (lowercase i) |
Printed, PDF |
Page 1007 |
The table shows the regular expression \s as "same as" expression [\n\r\t\f]...this is not true, since \s also will match a space character as well as a vertical tab and [\n\r\t\f] will not...easily fixed by adding these characters into that set: [\n\r\t\f\v ] Note from the Author or Editor: |
|
Page 1043 |
Paragraph ends: "...often they will lay eggs directly on the ground, protected only spotted vegetation." This is grammatically incorrect, it should possibly read something like "protected only by spotted vegetation"...or something |
Errata for C# 5.0 in a Nutshell
猜你喜欢
转载自www.cnblogs.com/tthua/p/10539993.html
今日推荐
周排行