C# cookbook.
Saved in:
Author / Creator: | Hilyard, Jay. |
---|---|
Edition: | 2nd ed. |
Imprint: | Sebastopol, CA : O'Reilly, c2006. |
Description: | xxviii, 1154 p. ; 24 cm. |
Language: | English |
Subject: | |
Format: | Print Book |
URL for this record: | http://pi.lib.uchicago.edu/1001/cat/bib/6216178 |
Table of Contents:
- Preface
- 1. Numbers and Enumerations
- 1.1. Determining Approximate Equality Between a Fraction and Floating-Point Value
- 1.2. Converting Degrees to Radians
- 1.3. Converting Radians to Degrees
- 1.4. Using the Bitwise Complement Operator with Various Data Types
- 1.5. Testing for an Even or Odd Value
- 1.6. Obtaining the High Word or Low Word of a Number
- 1.7. Converting a Number in Another Base to Base10
- 1.8. Determining Whether a String Is a Valid Number
- 1.9. Rounding a Floating-Point Value
- 1.10. Choosing a Rounding Algorithm
- 1.11. Converting Celsius to Fahrenheit
- 1.12. Converting Fahrenheit to Celsius
- 1.13. Safely Performing a Narrowing Numeric Cast
- 1.14. Finding the Length of Any Three Sides of a Right Triangle
- 1.15. Finding the Angles of a Right Triangle
- 1.16. Displaying an Enumeration Value as a String
- 1.17. Converting Plain Text to an Equivalent Enumeration Value
- 1.18. Testing for a Valid Enumeration Value
- 1.19. Testing for a Valid Enumeration of Flags
- 1.20. Using Enumerated Members in a Bit Mask
- 1.21. Determining if One or More Enumeration Flags Are Set
- 1.22. Determining the Integral Part of a Decimal or Double
- 2. Strings and Characters
- 2.1. Determining the Kind of Character a char Contains
- 2.2. Determining Whether a Character Is Within a Specified Range
- 2.3. Controlling Case Sensitivity When Comparing Two Characters
- 2.4. Finding All Occurrences of a Character Within a String
- 2.5. Finding the Location of All Occurrences of a String Within Another String
- 2.6. Implementing a Poor Man''s Tokenizer to Deconstruct a String
- 2.7. Controlling Case Sensitivity When Comparing Two Strings
- 2.8. Comparing a String to the Beginning or End of a Second String
- 2.9. Inserting Text into a String
- 2.10. Removing or Replacing Characters Within a String2.11 Encoding Binary Data as Base64
- 2.12. Decoding a Base64-Encoded Binary
- 2.13. Converting a String Returned as a Byte[ ] Back into a String
- 2.14. Passing a String to a Method That Accepts only a Byte[ ]
- 2.15. Converting Strings to Other Types
- 2.16. Formatting Data in Strings
- 2.17. Creating a Delimited String
- 2.18. Extracting Items from a Delimited String
- 2.19. Setting the Maximum Number of Characters a StringBuilder Can Contain
- 2.20. Iterating over Each Character in a String
- 2.21. Improving String Comparison Performance
- 2.22. Improving StringBuilder Performance
- 2.23. Pruning Characters from the Head and/or Tail of a String
- 2.24. Testing a String for Null or Empty
- 2.25. Appending a Line
- 2.26. Encoding Chunks of Data
- 3. Classes and Structures
- 3.1. Creating Union-Type Structures
- 3.2. Allowing a Type to Represent Itself as a String
- 3.3. Converting a String Representation of an Object into an Actual Object
- 3.4. Implementing Polymorphism with Abstract Base Classes
- 3.5. Making a Type Sortable
- 3.6. Making a Type Searchable
- 3.7. Indirectly Overloading the +=, -=, /=, and = Operators
- 3.8. Indirectly Overloading the &&, and ?: Operators
- 3.9. Turning Bits On or Off
- 3.10. Making Error-Free Expressions
- 3.11. Minimizing (Reducing) Your Boolean Logic
- 3.12. Converting Between Simple Types in a Language-Agnostic Manner
- 3.13. Determining When to Use the Cast Operator, the as Operator, or the is Operator
- 3.14. Casting with the as Operator
- 3.15. Determining a Variable''s Type with the is Operator
- 3.16. Implementing Polymorphism with Interfaces
- 3.17. Calling the Same Method on Multiple Object Types
- 3.18. Adding a Notification Callback Using an Interface
- 3.19. Using Multiple Entry Points to Version an Application
- 3.20. Preventing the Creation of an Only Partially Initialized Object
- 3.21. Returning Multiple Items from a Method
- 3.22. Parsing Command-Line Parameters
- 3.23. Retrofitting a Class to Interoperate with COM
- 3.24. Initializing a Constant Field at Runtime
- 3.25. Writing Code That Is Compatible with the Widest Range of Managed Languages
- 3.26. Building Cloneable Classes
- 3.27. Assuring an Object''s Disposal
- 3.28. Releasing a COM Object Through Managed Code
- 3.29. Creating an Object Cache
- 3.30. Rolling Back Object Changes
- 3.31. Disposing of Unmanaged Resources
- 3.32. Determining Where Boxing and Unboxing Occur
- 4. Generics
- 4.1. Deciding When and Where to Use Generics
- 4.2. Understanding Generic