- Animation
- Application design
- ASP.NET
- C#, .NET 3.5
- Controls
- Data access
- Effects
- Expression Blend
- Expression Design
- Game development
- Graphics
- Javascript and AJAX
- Math and Physics
- Media streaming
- Multimedia
- Security
- Silverlight
- Styling
- UI Design
- VB.NET
- Video
- Visual Studio
- WCF
- WPF
- XAML

BlueForest Networks

C# 3.0 Cookbook
Publisher: O'Reilly Media, Inc. - January 11, 2008 ISBN-10: 059651610X, ISBN-13: 9780596516109
Author: Jay Hilyard
Stephen Teilhet
886 pages
Language Integrated Query (LINQ)
Query a Message Queue, Using Set Semantics with Data, Reuse Parameterized Queries with LINQ to SQL, Sort Results in a Culture-Sensitive Manner, Adding Functional Extensions for Use with LINQ, Query and Join Across Data Repositories, Querying Configuration Files with LINQ, Creating XML Straight from a Database, Being Selective About Your Query Results, Using LINQ with Collections That Don’t Support IEnumerable<T>
Strings and Characters
Determining the Kind of, Controlling Case Sensitivity When Comparing Two Characters, Finding the Location of All Occurrences of a String
Within Another String, Controlling Case Sensitivity When Comparing Two Strings, Comparing a String to the Beginning or End of a Second String, Inserting Text into a String, Removing or Replacing Characters Within a String, Encoding Binary Data As Base64, Decoding a Base64-Encoded Binary, Converting a String Returned As a Byte[ ] Back into a String, Passing a String to a Method That Accepts Only a Byte[ ], Converting Strings to Other Types, Creating a Delimited String, Extracting Items from a Delimited String, Iterating over Each Character in a String, Pruning Characters from the Head and/or Tail of a String, Testing a String for Null or Empty, Appending a Line
Classes and Structures
Creating Union-Type, Making a Type Sortable, Making a Type Searchable, Indirectly Overloading the +=, -=, Indirectly Overloading the &&, Making Error-Free Expressions, Reducing Your Boolean Logic, Converting Between Simple Types in a Programming, Language-Agnostic Manner, Determining When to Use the cast Operator, the as Operator, or the is Operator, Casting with the as Operator, Determining a Variable’s Type with the is Operator, Returning Multiple Items from a Method, Parsing Command-Line Parameters, Initializing a Constant Field at Runtime, Building Cloneable Classes, Assuring an Object’s Disposal, Disposing of Unmanaged Resources, Determining Where Boxing and Unboxing Occur
Generics
Deciding When and Where to Use Generics, Understanding Generic Types, Replacing the ArrayList with Its Generic Counterpart, Replacing the Stack and Queue with Their Generic Counterparts, Using a Linked List, Creating a Value Type That Can Be Initialized to Null, Reversing the Contents of a Sorted List, Making Read-Only Collections the Generic Way, Replacing the Hashtable with Its Generic Counterpart, Using foreach with Generic Dictionary Types, Constraining Type Arguments, Initializing Generic Variables to Their Default Values
Collections
Swapping Two Elements in an Array, Reversing an Array Quickly, Writing a More Flexible StackTrace Class, Determining the Number of Times an Item Appears in a List<T>, Retrieving All Instances of a Specific Item in a List<T>, Inserting and Removing Items from an Array, Keeping Your List<T> Sorted, Sorting a Dictionary’s Keys and/or Values, Creating a Dictionary with Max and, Storing Snapshots of Lists in an Array, Persisting a Collection Between Application Sessions, Testing Every Element in an Array or List<T>, Performing an Action on Each Element in an Array or List<T> , Creating a Read-Only Array or List<T>
Iterators, Partial Types, and Partial Methods
Creating an Iterator on a Generic Type, Creating an Iterator on a Nongeneric Type, Creating Custom Enumerators, Implementing Iterator Logic, Forcing an Iterator to Stop Iterating, Dealing with Finally Blocks and Iterators, Implementing Nested foreach Functionality in a Class, Organizing Your Interface, Generating Code That Is No Longer in Your Main Code Paths, Adding Hooks to Generated Entities
Exception Handling
Knowing When to Catch, Assuring Exceptions Are Not Lost When Using Finally Blocks, Handling Exceptions Thrown from Methods Invoked via Reflection, Preventing Unhandled, Getting Exception Information, Getting to the Root of a Problem Quickly, Creating a New Exception Type, Obtaining a Stack Trace, Breaking on a First-Chance Exception, Handling Exceptions Thrown from an Asynchronous Delegate, Giving Exceptions the Extra Info They Need with Exception.Data, Dealing with Unhandled Exceptions in WinForms Applications, Dealing with Unhandled Exceptions in Windows Presentation
Foundation (WPF), Analyzing Exceptions for Common Errors
Diagnostics
Providing Fine-Grained Control over Debugging/Tracing Output, Determining Whether a Process Has Stopped Responding, Using Event Logs in Your Application, Searching Event, Watching the Event Log for a Specific Entry, Implementing a Simple Performance Counter, Enabling and Disabling Complex Tracing Code, Capturing Standard Output for a Process, Creating Custom Debugging Displays for Your Classes
Delegates, Events, and Lambda Expressions
Controlling When and If a Delegate Fires Within a Multicast Delegate, Obtaining Return Values from Each Delegate in a Multicast Delegate, Handling Exceptions Individually for Each Delegate in a Multicast Delegate, Converting Delegate Invocation from Synchronous to Asynchronous, An Advanced Interface Search Mechanism, Observing Additions and Modifications to Dictionaries, Using Lambda Expressions, Set Up Event Handlers Without the Mess, Using Different Parameter Modifiers in Lambda Expressions, Using Closures in C#, Performing Multiple Operations on a List Using Functors
Regular Expressions
Enumerating Matches 10.2 Extracting Groups from a MatchCollection, Verifying the Syntax of a Regular Expression, Quickly Finding Only the Last Match in a String, Augmenting the Basic String Replacement Function, Implementing a Better Tokenizer, Counting Lines of Text, Returning the Entire Line in Which a Match Is Found, Finding a Particular Occurrence of a Match, Using Common Patterns
Data Structures and Algorithms
Creating a Hash Code for a Data Type, Creating a Priority Queue, Creating a One-to-Many Map (MultiMap), Creating a Binary Search Tree, Creating an n-ary Tree, Using a HashSet Object
Filesystem I/O
Manipulating File 12.2 Renaming a File, Outputting a Platform-Independent EOL Character, Manipulating Directory 12.5 Renaming a Directory, Searching for Directories or Files Using Wildcards, Obtaining the Directory Tree, Parsing a Path, Parsing Paths in Environment Variables, Launching and Interacting with Console Utilities, Locking Subsections of a File, Waiting for an Action to Occur in the Filesystem, Comparing Version Information of Two Executable Modules,
Querying Information for All Drives on a System, Compressing and Decompressing Your Files
Reflection
Listing Referenced Assemblies, Listing Exported Types, Finding Overridden, Finding Members in an Assembly, Determining and Obtaining Nested Types Within an Assembly, Displaying the Inheritance Hierarchy for a Type, Finding the Subclasses of a Type, Finding All Serializable Types Within an Assembly,
Dynamically Invoking, Determining If a Type or Method Is Generic, Accessing Local Variable Information, Creating a Generic Type,
Web
Converting an IP Address to a Hostname, Converting a Hostname to an IP Address, Parsing a URI, Handling Web, Communicating with a Web Server, Going Through a Proxy, Obtaining the HTML from a URL, Using the Web Browser Control, Tying Database Tables to the Cache, Prebuilding an ASP.NET Web Site Programmatically, Escaping and Unescaping Data for the Web, Using the UriBuilder Class, Inspect and Change Your Web Application Configuration,
Using Cached Results When Working with HTTP for Faster Performance, Checking Out a Web Server’s Custom Error Pages
XML
Reading and Accessing XML Data in Document Order, Reading XML on the Web, Querying the Contents of an XML Document, Validating XML, Creating an XML Document Programmatically, Detecting Changes to an XML Document, Handling Invalid Characters in an XML String, Transforming XML, Tearing Apart an XML Document, Putting Together an XML Document, Validating Modified XML Documents Without Reloading, Extending Transformations, Getting Your Schemas in Bulk from Existing XML Files, Passing Parameters to Transformations
Networking
Writing a TCP Server, Writing a TCP Client, Simulating Form Execution, Transferring Data via HTTP, Using Named Pipes to Communicate, Pinging Programmatically, Send SMTP Mail Using the SMTP Service, Use Sockets to Scan the Ports on a Machine, Use the Current Internet Connection Settings, Transferring Files Using FTP
Security
Controlling Access to Types in a Local Assembly, Encrypting/Decrypting a String, Encrypting and Decrypting a File, Cleaning Up Cryptography Information, Verifying That a String Remains Uncorrupted, Following Transmission, Storing Data Securely, Making a Security Assert Safe, Verifying That an Assembly Has Been Granted Specific Permissions, Minimizing the Attack Surface of an Assembly, Obtaining Security/Audit Information, Granting/Revoking Access to a File or Registry Key, Protecting String Data, Securing Stream Data, Encrypting web.config Information, Obtaining the Full Reason a SecurityException Was Thrown, Achieving Secure Unicode Encoding, Obtaining a Safer File Handle
Threading and Synchronization
Creating Per-Thread, Providing Thread-Safe Access to Class Members, Preventing Silent Thread Termination, Being Notified of the Completion of an Asynchronous Delegate, Storing Thread-Specific Data Privately, Granting Multiple Access to Resources with a Semaphore, Synchronizing Multiple Processes with the Mutex, Using Events to Make Threads Cooperate, Get the Naming Rights for Your Events, Performing Atomic Operations Among Threads, Optimizing Read-Mostly Access
Toolbox
Dealing with Operating System Shutdown, Power Management, or User Session Changes, Controlling a Service, List What Processes an Assembly Is Loaded In, Using Message Queues on a Local Workstation, Finding the Path to the Current Framework Version, Determining the Versions of an Assembly That Are
Registered in the Global Assembly Cache (GAC), Capturing Output from the Standard Output Stream, Running Code in Its Own AppDomain, Determining the Operating System and Service Pack, Version of the Current Operating System
Numbers and Enumerations
Converting Between Degrees and Radians, Using the Bitwise Complement Operator with Various Data Types, Converting a Number in Another Base to Base10, Determining Whether a String Is a Valid Number, Rounding a Floating-Point Value, Choosing a Rounding Algorithm, Converting Between Temperature, Safely Performing a Narrowing Numeric Cast, Displaying an Enumeration Value As a String, Converting Plain Text to an Equivalent Enumeration Value, Testing for a Valid Enumeration Value, Testing for a Valid Enumeration of Flags, Using Enumerated Members in a Bit Mask, Determining Whether One or More Enumeration Flags Are Set, Determining the Integral Part of a Decimal or Double