Index
Below is a list of all posts created so far for the 2,000 Things You Should Know About C# blog.Total number of posts = 1,058
Assemblies
- #11 – Examine IL Using Ildasm.exed
- #179 – What Is an Assembly?
- #180 – The CLR Loads Assemblies on Demand
- #485 – Project References and Dependent Assemblies
- #486 – Unnecessary Project References Are Ignored
- #705 – Applications and Class Libraries
- #706 – An Application Domain Enables Application Isolation
- #1 – What the Main() Signature Looks Like
- #2 – The Smallest Possible C# Program
- #3 – Who Designed C#?
- #4 – How is C# Different from Java?
- #5 – How is C# Different from VB.NET?
- #6 – An Even Smaller C# Program
- #8 – The Main() Function Can Return an int
- #9 – Main() Should Not Be Public
- #10 – The Return Value from Main() Sets ERRORLEVEL Variable in Windows
- #12 – Read Command Line Arguments
- #18 – What Is an Identifier?
- #19 – Contextual Keywords
- #20 – Literals
- #21 – Boolean Literals
- #22 – Integer Literals
- #23 – Real Literals
- #24 – Character Literals
- #26 – Null Literal
- #27 – Expressions, Operators and Operands
- #28 – Operator Precedence
- #29 – Comments
- #35 – Declaring Variables
- #36 – Variable Initialization and Definite Assignment
- #45 – Static Members of a Class
- #46 – There Is Only One Copy of Static Data
- #52 – Arithmetic Operators
- #53 – Modulus
- #54 – Increment and Decrement Operators
- #55 – Integer Division Results in Truncation
- #56 – How to Round When Converting Float to Int
- #67 – Default Behavior for Reference Type Equality
- #72 – Hexadecimal Numbers
- #73 – Bitwise Operators
- #74 – Shift Operators
- #75 – New Bits When Shifting
- #77 – Special Floating Point Values
- #78 – Check for Special Floating Point Values
- #79 – Equality Checks for NaN
- #83 – JIT Compilation in .NET
- #84 – Viewing Metadata as Source Code
- #85 – General Structure of a C# Program
- #86 – Equality and Inequality Operators
- #87 – Relational Operators
- #88 – Conditional Operators
- #89 – The Negation Operator
- #90 – More Complex Logical Expressions
- #91 – Conditional Operators Can Short-Circuit Evaluation
- #92 – The Ternary Conditional Operator
- #110 – Combining the Arithmetic Operators with the Assignment Operator
- #111 – Combining the Logical or Shift Operators with the Assignment Operator
- #117 – Use #define to Define a Symbol
- #118 – Disabling Specific Compiler Warnings
- #181 – C# Is Strongly Typed
- #182 – C# is (Mostly) Strongly Typed
- #183 – Use var to Tell the Compiler to Figure out the Type
- #184 – Cheating Type Safety with object Type
- #185 – The Heap and the Stack
- #186 – Value Types on the Heap
- #187 – Everything Is an Object
- #188 – Objects Are on the Heap, References to Objects Are on the Stack
- #189 – Memory Management for Stack-Based Objects
- #190 – Memory Management for Heap-Based Objects
- #199 – You Can’t Explicitly Delete Heap-Based Objects
- #200 – Static Data and Constants Are Stored on the Heap
- #201 – You Can Leak Memory in C#
- #202 – All Fields in an Object Are Automatically Initialized
- #204 – Three Rules About Using Implicitly-Typed Variables
- #205 – Five Kinds of Types That Are User-Definable
- #206 – Value Types Can’t Represent Null Values
- #207 – Nullable Types
- #208 – You Can Make Any Value Type Nullable
- #209 – Why You’d Want to Store a Null Value in a Variable
- #222 – C# Is Pronounced “C Sharp”
- #223 – Enabling Code Analysis for Your Project
- #224 – One Example of a Problem that Code Analysis Would Catch
- #225 – Free Static Analysis Using FxCop
- #371 – Delegate Basics
- #372 – What Delegates Are Good For
- #373 – A Delegate Can Refer to More than One Method
- #374 – A Custom Delegate Derives from System.MulticastDelegate
- #375 – Using GetInvocationList to Get a List of Individual Delegates
- #376 – What Happens When an Exception Occurs During Delegate Invocation
- #377 – Ensure that All of a Delegate’s Methods Are Called by Using GetInvocationList
- #385 – A Delegate Instance Can Refer to Both Instance and Static Methods
- #391 – Passing a Delegate Instance as a Parameter
- #401 – Every Object Inherits an Equals Method
- #402 – Value Equality vs. Reference Equality
- #403 – Equals Method vs. == Operator for Reference Types
- #404 – Equals Method vs. == Operator for Value Types
- #406 – Overriding the Equals Method
- #407 – Why You Should Override GetHashCode when Overriding Equals
- #411 – Overriding the Equals Method for a Value Type
- #413 – Check for Reference Equality Using Object.ReferenceEquals
- #417 – Provide a Type-Specific Equals Method for Value Equality
- #418 – Implementing the IComparable Interface
- #420 – Laundry List for Implementing Value Equality and IComparable
- #421 – Value Equality and IComparable Example
- #424 – The Garbage Collector
- #425 – Nondeterministic Destruction and Object Finalization
- #426 – Use a Destructor to Free Unmanaged Resources
- #427 – Finalizer Gotchas
- #428 – A Finalizer Should Always Call the Finalizer of Its Base Class
- #429 – Use the Dispose Pattern for Deterministic Destruction
- #430 – A Dispose Pattern Example
- #431 – The using Statement Automates Invocation of the Dispose Method
- #432 – Initialize Multiple Objects in a using Statement
- #467 – Metadata
- #468 – Attributes Allow Adding Metadata to Program Elements
- #469 – Attaching an Attribute to a Type Member
- #470 – Defining Your Own Custom Attribute
- #471 – Reading the Value of an Attribute Using Reflection
- #472 – Attributes Can Be Attached to a Variety of Elements
- #473 – Specifying what Type of Elements a Custom Attribute Can Be Applied To
- #475 – Comments Occuring within String Literals Are Treated as Part of the String
- #476 – Don’t Use Unicode Escape Sequences in Identifiers
- #499 – Conditional Compilation Symbols Are Defined or Undefined
- #500 – #define and #undef Must Be at Top of File
- #501 – Differences Between #define in C++ and C#
- #502 – #define and #undef Scope
- #503 – Conditionally Compile Code Using #if / #endif Directives
- #504 – Using the #else Directive
- #505 – Using the #elif Directive
- #506 – Using Expressions in #if and #elif Directives
- #507 – You can #define Other Symbols within a #if Block
- #508 – Using the #error and #warning Directives
- #509 – Use #pragma warning Directive to Disable Compile-Time Warnings
- #514 – Examples of Operator Precedence
- #515 – Binary Operators Are Left-Associative
- #516 – The Assignment Operator is Right-Associative
- #518 – Splitting the Implementation of a Class Across Multiple Files
- #521 – Namespaces Help Organize Types
- #522 – The Fully Qualified Name for a Type Includes the Namespace
- #523 – The using Directive Allows Omitting Namespace
- #524 – All Types Within a Namespace Must Be Unique
- #525 – Namespaces Can Be Nested
- #526 – Using Statements Can Alias Nested Namespaces
- #527 – Defining a Nested Namespace Using Dot Notation
- #529 – The using Directive Can Create an Alias for a Namespace
- #530 – Namespaces vs. Assemblies
- #531 – Best Practices for Naming Namespaces
- #532 – Using Identically Named Types from Different Assemblies
- #533 – Alternate Notation for Extern Aliases
- #535 – Creating a Generic Struct
- #542 – Conventions for Naming Type Parameters
- #543 – Operations You Can Perform on a Generically Typed Object
- #544 – Specifying a Constraint for a Type Parameter
- #545 – Specifying Constraints for More than One Type Parameter
- #550 – Anonymous Method Does Not Require Formal Parameters
- #551 – Use Anonymous Method When Adding to an Invocation List
- #552 – Anonymous Methods Have Access to Local Variables Where They Are Declared
- #583 – You Can’t Modify the Iterator Variable Within a foreach Loop
- #640 – Method Names that You Cannot Use
- #659 – Get Information About an Object’s Type
- #660 – The typeof Operator Gets Information About a Type
- #661 – Every Object Has A ToString Method
- #662 – Overriding the ToString Method for a Custom Type
- #664 – Physical Memory vs. Virtual Memory
- #665 – Maximum Amount of Virtual Memory
- #666 – Looking at .NET Memory Usage Using Performance Counters
- #667 – .NET Memory Performance Counters Updated When Garbage Collector Runs
- #668 – GetTotalMemory Indicates How Much Memory You’ve Allocated
- #673 – Types Used in using Statement Must Implement IDisposable
- #689 – References and Objects
- #707 – More Than One Class in A Program Can Contain A Main Method
- #709 – A Method Can Redefine a Name Present in Parent Class
- #710 – Variables Declared in a Block Aren’t Visible Outside of the Block
- #711 – The Global Namespace
- #712 – Accessibility Summary
- #713 – Declare Accessibility Explicitly
- #714 – Accessibility of a Public Method in an Internal Type
- #718 – Scope
- #721 – Local Variable Declarations Can Hide Class Members
- #722 – Local Variable Declarations May Not Always Hide Class Members
- #724 – Fully Qualified Names for Types
- #730 – Check for null Before Iterating Using foreach Statement
- #732 – Destruction vs. Collection
- #733 – How to Tell If an Object Has Been Garbage Collected
- #734 – Accessing the Original Object Referenced through a WeakReference
- #735 – Don’t Trust WeakReference.IsAlive If It Returns true
- #736 – Target of a WeakReference Will Be null after Garbage Collection
- #738 – You Shouldn’t Explicitly Force Garbage Collection
- #740 – Short vs. Long Weak References
- #771 – Summary of System.Object Members
- #803 – Situations When You Might Use the var Keyword
- #804 – Tradeoffs when Using the var Keyword
- #805 – An Example of Discretionary Use of the var Keyword
- #806 – An Example of Mandatory Use of the var Keyword
- #846 – A Call Stack Keeps Track of Methods that Have Been Called
- #847 – How the Call Stack Works
- #921 – Objects Are Explicitly Created but Automatically Destroyed
- #922 – Ways in Which References to an Object Are Released
- #923 – An Object Isn’t Necessarily Deleted as Soon as It’s Dereferenced
- #924 – You Shouldn’t Normally Worry about Memory Management
- #940 – Finalizers Are Called when an Application Shuts Down
- #941 – Checking to See If Objects Are Disposable
- #949 – What’s in Which Version of C#
- #950 – C# Has a Unified Type System
- #951 – Not Every Type Derives from object
- #952 – Type Safety
- #953 – Static Typing vs. Dynamic Typing
- #954 – Static Typing vs. Strongly Typed
- #955 – C# Is a Managed Language
- #956 – The Common Language Infrastructure (CLI)
- #957 – Naming Files that Contain C# Code
- #958 – Naming Conventions for Identifiers
- #959 – Don’t Use Double Underscores at the Start of an Identifier
- #960 – Conventions for Naming Classes
- #961 – Retrieving Command Line and Path to Executable
- #962 – Statements Can Span Multiple Lines
- #963 – Use Braces to Enclose a Block of Statements
- #964 – Declaring a Variable within a Block of Statements
- #965 – Indent Code to Improve Readability
- #966 – Visual Studio Code Editor Helps with Indenting
- #967 – Assigning a Value to a Variable
- #968 – Reading a Value from a Variable
- #969 – Creating a Simple Console Application
- #971 – Reading a Line of Input from the Console
- #972 – Reading Keystrokes from the Console
- #973 – Format Items in Composite Format Strings Can Be in Any Order
- #974 – Well Written Code Includes Well Written Comments
- #975 – Guidelines for Commenting Your Code
- #981 – Full List of C# Keywords
- #985 – Why It’s Useful for Conditional Operators to Short-Circuit Evaluation
- #987 – The using Directive Can Create an Alias for a Type
- #988 – Using global to Explicitly Refer to a Namespace
- #989 – Formatting Numbers as Hexadecimal
- #990 – Converting Hexadecimal Strings to Numeric Data
- #994 – Unicode Basics
- #995 – Unicode Code Points
- #996 – UTF-16 Encoding, Part I
- #997 – UTF-16 Encoding, Part II
- #998 – UTF-8 Encoding
- #999 – Some Examples of UTF-16 and UTF-8 Encoding
- #1,000 – UTF-8 and ASCII
- #1,001 – Representing Unicode Surrogate Pairs
- #1,002 – Specifying Character Encoding when Writing to a File
- #1,017 – Delegate Types vs. Delegate Instances
- #1,018 – Delegate Invocation Syntax
- #1,019 – Syntax for Adding Methods to a Delegate’s Invocation List
- #1,020 – Removing Methods from a Delegate’s Invocation List
- #1,021 – What Happens to a Delegate’s Return Value
- #1,022 – How to Use Return Values from All Delegate Instances
- #141 – Implementing ICloneable for a Custom Type
- #143 – An Example of Implementing ICloneable for Deep Copies
- #144 – Using Serialization to Implement Deep Copying
- #226 – Classes and Objects
- #227 – Instances of Classes Are Created on the Heap
- #228 – Object-Oriented Programming in C# Using Classes
- #229 – The Core Principles of Object-Oriented Programming
- #230 – User-Defined Types Are First Class Citizens
- #231 – Declaring and Using Instance Fields in a Class
- #232 – Declaring and Using Instance Methods in a Class
- #233 – Returning a Result from an Instance Method
- #234 – Multiple return Statements
- #235 – return Statement Is Not Needed for void Methods
- #236 – Returning a Reference Type from a Method
- #237 – Referencing Class Fields from Within One of its Methods
- #238 – Call a Method from Another Method
- #239 – The this Reference
- #240 – Private and Public Instance Data in a Class
- #241 – Declaring and Using Private Instance Methods
- #242 – Declaring and Using a Property in a Class
- #243 – Property Get and Set Accessors
- #244 – Defining a Get Accessor for a Property
- #245 – Defining a Set Accessor for a Property
- #246 – Implementing a Read-Only Property
- #247 – Implementing a Write-Only Property
- #248 – Implementing a Property that Returns a Calculated Value
- #249 – Using a get Accessor to Clean up Property Data
- #250 – Using a set Accessor to Convert or Validate Property Data
- #251 – Class Properties Support the Principle of Encapsulation
- #252 – Automatic Properties
- #253 – Implementing a Read-Only Automatic Property
- #254 – Implementing a Read-Only Property with a Private Set Accessor
- #255 – Static Fields vs. Instance Fields
- #256 – Using Static Fields
- #257 – Private Static Fields
- #258 – Initializing a Static Variable as Part of Its Declaration
- #259 – Static vs. Instance Properties
- #260 – How Properties Look Under-the-Covers
- #261 – How Automatic Properties Look Under-the-Covers
- #262 – Passing Data to a Method Using Parameters
- #263 – A Method’s Signature Must Be Unique Within Its Type
- #285 – Class Member Overview
- #286 – A Constructor is Called When an Instance of a Class Is Created
- #287 – You Don’t Have to Define a Constructor
- #288 – Passing Arguments to a Constructor
- #289 – You Can Define Multiple Constructors
- #290 – Chaining Constructors
- #291 – No Default Constructor if You Define any Constructors
- #292 – A Static Constructor Initializes Static Data
- #293 – You Can Declare a Private Constructor
- #294 – Make All Constructors Private to Prevent Object Creation
- #295 – When Is a Static Constructor Called?
- #299 – Intellisense Shows You Available Constructors
- #303 – Accessibility of Class Members
- #304 – Private Class Members
- #305 – Public Class Members
- #306 – Protected Class Members
- #307 – Internal Class Members
- #308 – Protected Internal Class Members
- #309 – Accessing Protected Members In a Derived Class
- #310 – Accessibility of Fields in a Class
- #311 – Accessibility of Properties in a Class
- #312 – Accessibility of Methods in a Class
- #313 – Accessibility of Constructors in a Class
- #314 – Access Modifiers Are Not Allowed on Static Constructors
- #315 – Accessibility of Static Methods and Properties
- #322 – Class Accessibility
- #323 – A Generic Class is a Template for a Class
- #324 – A Generic Class Can Have More than One Type Parameter
- #325 – Intellisense Understands Generic Classes
- #326 – Generic Type vs. Constructed Type
- #329 – A Class Can Inherit Data and Behavior from Another Class
- #330 – Derived Classes Do Not Inherit Constructors
- #331 – Calling a Base Class Constructor Implicitly vs. Explicitly
- #332 – Every Class Inherits from Exactly One Class
- #333 – Class Inheritance Leads to a Hierarchy of Classes
- #334 – A Base Class Variable Can Refer to Instances of Derived Classes
- #335 – Accessing a Derived Class Using a Base Class Variable
- #336 – Declaring and Using a readonly Field
- #337 – Declaring and Using Static readonly Fields
- #338 – Static Readonly Fields vs. Constants
- #339 – Readonly Fields vs. Read-Only Properties
- #342 – Using a Static Variable to Count Instances of a Class
- #343 – Use the new Keyword to Replace a Method in a Base Class
- #344 – Hidden Base Class Member Is Invoked Based on Declared Type of Object
- #345 – Method in Derived Class Hides Base Class Method by Default
- #346 – Polymorphism
- #347 – Another Example of Polymorphism
- #348 – Virtual Methods Support Polymorphism
- #349 – The Difference Between Virtual and Non-Virtual Methods
- #350 – Method Modifiers Required for Polymorphic Behavior
- #351 – An Abstract Method Has No Implementation
- #352 – You Can’t Instantiate an Abstract Class
- #353 – Why You Might Define an Abstract Class
- #355 – Use the new Keyword to Replace a Property in a Base Class
- #356 – Hidden Base Class Property Is Used Based on Declared Type of Object
- #357 – Property in Derived Class Hides Base Class Property by Default
- #358 – Virtual Properties Support Polymorphism
- #359 – The Difference Between Virtual and Non-Virtual Properties
- #360 – Property Modifiers Required for Polymorphic Behavior
- #361 – An Abstract Property Has No Implementation
- #362 – Defining an Indexer
- #363 – An Indexer Can Have Both get and set Accessors
- #364 – Defining an Indexer whose Parameter Is an Enumerated Type
- #365 – Overloading an Indexer
- #366 – Defining an Indexer with More than One Parameter
- #517 – Static Classes
- #534 – What Good Are Generics?
- #546 – Specifying More than One Constraint for the Same Type Parameter
- #547 – Things That Can Serve as Type Parameter Constraints
- #548 – No More Than One Class for a Type Parameter Constraint
- #567 – Wider vs. Narrower Types
- #570 – Assignment Compatibility for Reference Types
- #590 – Optional Parameters in Constructors
- #601 – A Class Can Both Inherit from A Parent Class and Implement an Interface
- #602 – Initializing Fields in a Class
- #603 – Using Constants Can Force Recompilation
- #609 – Omit the Class Name for Static Members in the Same Class
- #610 – Lazy Evaluation in Property Get Accessors
- #614 – Subclass Accessibility
- #615 – You Can’t Remove a Base Class Member
- #616 – Base Class Needs to Know If Polymorphism Is Desired
- #617 – The Simplest Way to Call a Method in a Base Class
- #618 – Use the base Keyword to Call A Method in the Base Class
- #619 – Calling the Constructor in a Base Class
- #620 – Inherit from a Class In A Different Assembly
- #621 – Sealing a Class to Prevent Inheritance
- #622 – Sealing vs. Not Sealing
- #623 – Defining One Type Inside Another Type
- #624 – Accessibility of a Nested Class
- #625 – Reference a Nested Type Using Dot Notation
- #626 – Nested Type Options
- #627 – Accessibility of Nested Types in a struct or a class
- #628 – Why You Might Create a Nested Type
- #629 – Nested Types Have Full Access to Members in Parent
- #630 – Nested Type May Hide Member in Outer Class
- #631 – Code-Generation Tools and Partial Classes
- #639 – Static Class Can Contained Nested Non-Static Class
- #648 – Using an Object Initializer
- #649 – Creating an Anonymous Type
- #655 – Initializing Only Some Properties with An Object Initializer
- #656 – Nested Object Initializers
- #669 – Initializing Fields by Calling A Method
- #670 – Static vs. Instance Initialization
- #671 – A Base Class Constructor Can Call a Virtual Method
- #675 – Polymorphic Behavior Requires virtual / override Combination
- #676 – An Overridden Method Can Itself Be Overridden
- #677 – Method Marked with new Modifier Cannot Be Overridden
- #678 – A Sealed Method Cannot Be Overridden
- #679 – Hide An Inherited Method with A Virtual Method
- #680 – Virtual Modifier Combinations
- #681 – Avoid Using the new Keyword To Hide Methods
- #682 – The Real Reason for the new Keyword
- #683 – Two Ways an Object Can Behave Polymorphically
- #684 – Hidden Base Class Members Aren’t Really Hidden
- #685 – Inheritance Can Break Encapsulation
- #686 – Inheritance vs. Containment
- #687 – An Example of Containment
- #688 – Aggregation, Composition and Containment
- #690 – Using the this Keyword To Distinguish Between Fields and Parameters
- #692 – Two Approaches for Optional Parameters in Constructors
- #693 – Named Arguments in Constructors Allow the Most Flexibility
- #694 – Sequence of Events for Chained Constructors
- #696 – Using a Static Property to Count Instances
- #697 – Encapsulation is Managed through the Use of Access Modifiers
- #698 – Type Members Are Implicitly Private
- #699 – Types Are Implicitly Internal
- #700 – Using a set Accessor To Enforce Casing
- #701 – Centralize Business Rules Logic in set Accessors
- #702 – An Automatic Property Must Define Both get and set Accessors
- #703 – Object Initializers Allow Setting Either Fields or Properties
- #704 – Using an Object Initializer with Any Constructor
- #708 – A Name Must Be Unique Within A Declaration Space
- #715 – Private Members Are Not Visible in a Derived Class
- #716 – How Derived Classes Can Access Protected Members
- #717 – Class Members Can’t Be More Accessible Than Their Type
- #719 – Location of Declarations within A Class Doesn’t Matter
- #720 – Location of Declarations within A Method Does Matter
- #723 – New Methods in Subclass May Not Be Visible in Derived Classes
- #737 – When to Implement a Finalizer
- #739 – Avoid Accessing an Object After Its Been Finalized
- #741 – The Basics of Inheritance
- #742 – A Simple Example of Inheritance
- #744 – The Purpose of Inheritance
- #751 – Inheritance Only Partially Preserves Encapsulation
- #752 – C# Does Not Support Multiple Inheritance
- #753 – Implicitly Upcast to a Base Class Reference
- #754 – Downcast to a Reference to a Derived Class
- #768 – When to Call the Constructor of a Base Class
- #769 – Pattern – Call a Base Class Method When You Override It
- #783 – When to Create a Static Class
- #784 – When Not to Use a Static Class
- #787 – Avoid Public Fields in a Class
- #788 – A Backing Field Stores Data for a Property
- #790 – Property get and set Accessors Can Have Different Access Modifiers
- #791 – Properties Are Not Variables
- #795 – Rules for Creating an Immutable Class
- #796 – Default Accessibility for Property Accessors
- #797 – Setting Accessibility for Property Accessors
- #798 – You Can’t Override Accessors that Are Not Accessible
- #800 – A Property in an Interface May Include One or Two Accessors
- #801 – An Example of a Simple Immutable Class
- #817 – What Happens When a Static Constructor Throws an Exception
- #818 – What Happens When an Instance Constructor Throws an Exception
- #819 – A Private Constructor May Prevent Inheritance
- #820 – A Protected Constructor Allows a Subclass to Create Instances
- #824 – A Copy Constructor Makes a Copy of an Existing Object
- #825 – Shallow Copies
- #826 – Deep Copies
- #827 – Making a Deep Copy with a Copy Constructor
- #828 – Implementing Both a Copy Constructor and ICloneable
- #829 – Add Comments to Indicate Shallow vs. Deep Copying
- #830 – The Problem with ICloneable
- #831 – Implementing a Copy Constructor in a Derived Class
- #832 – The Sequence in Which Finalizers Are Called
- #1, 023 – Fields Are Initialized Before Execution of Constructors
- #1,024 – Exposing internal Members to Another Assembly
- #1,027 – Type Parameters vs. Type Arguments in a Generic Class
- #1,028 – Generic Types vs. Generic Methods
- #1,029 – How to Define a Constructor in a Generic Type
- #1,030 – Requiring Generic Type Parameters to Derive from a Specified Class
- #1,031 – Requiring Generic Type Parameters to Implement an Interface
- #1,032 – Requiring Generic Type Parameters to Be a Reference or Value Type
- #1,033 – Requiring a Generic Type Parameter to Have a Parameterless Constructor
- #1,034 – Making One Type Parameter Depend on Another
- #1,035 – Summary of Type Parameter Constraints
- #1,036 – Specifying Multiple Type Parameter Constraints
- #1,037 – Specifying Type Parameter Constraints for More than One Type Parameter
- #1,039 – Deriving from a Generic Class
- #1,040 – Deriving from a Constructed Type
- #1,041 – Adding New Type Parameters when You Derive from a Generic Class
- #1,042 – Deriving from a Self-Referencing Constructed Type, Part I
- #1,043 – Deriving from a Self-Referencing Constructed Type, part II
- #1,044 – How Static Data Behaves in Generic Types
- #423 – Compare Two Lists Using SequenceEquals
- #842 – The Stack Data Type
- #843 – Using the Generic Stack Class
- #844 – The Queue Data Type
- #845 – Using the Generic Queue Class
- #30 – Types, Variables, Values, Instances
- #31 – Value Types and Reference Types
- #32 – Built-In Types
- #34 – The object Type
- #37 – All Value Types Have a Default Constructor
- #38 – Data Type Hierarchy
- #39 – MinValue / MaxValue for Numeric Types
- #40 – TrueString and FalseString
- #41 – Instantiating Reference Types
- #42 – Interacting With an Object
- #43 – Objects Are Instantiated on the Heap
- #44 – Multiple References to the Same Object
- #47 – Numeric Conversions Through Casting
- #48 – How Explicit Casts Fail
- #49 – When to Use the Decimal Type
- #50 – Static Methods of System.Char
- #51 – Float Literals Must Use f Suffix
- #57 – Overflow on Integer Operations
- #58 – Generate Exceptions on Integer Overflow Using Checked Operator
- #59 – Using Unchecked Keyword to Avoid Overflow Exceptions
- #76 – Arithmetic Operations with Small Integers
- #80 – Use Decimal Type for Monetary Calculations
- #81 – DateTime and TimeSpan Types
- #82 – Some Common DateTime and TimeSpan Functions
- #93 – Escape Sequences in Character Literals
- #94 – Converting Between Char and Numeric Types
- #107 – Defining and Using a Struct
- #108 – Defining a Constructor for a Struct
- #109 – Defining and Using Enums
- #119 – Arrays
- #120 – Array Declaration and Instantiation
- #121 – Array Initialization
- #122 – Arrays Can Contain Any Type of Object
- #123 – Storing Arbitrary Objects in an Array
- #124 – Declaring and Instantiating Multidimensional Arrays
- #125 – Initializing Multidimensional Arrays
- #126 – Initializing Arrays of Reference-Type Objects
- #127 – Declaring and Instantiating Jagged Arrays
- #128 – Accessing Elements in Jagged Arrays
- #129 – Initializing Jagged Arrays
- #130 – Default Values of Array Elements
- #131 – Arrays Derive from System.Array
- #132 – Arrays That Are Both Multidimensional and Jagged
- #133 – An Array’s Length is Fixed
- #134 – Sorting One-Dimensional Arrays
- #135 – Implement IComparable to Allow Sorting a Custom Type
- #136 – Sorting an Array of Values Based on an Array of Keys
- #137 – Sorting an Array Using an Independent Comparer Method
- #138 – Searching a Sorted Array
- #139 – Using the Array.Clone Method to Make a Shallow Copy of an Array
- #140 – Making a Deep Copy of an Array Using an Object’s Clone Method
- #142 – Implement ICloneable All the Way Down for Deep Copies
- #145 – Using Array.Find to Search an Unsorted Array
- #146 – Using Array.FindAll to Find a Set of Matching Elements in an Array
- #147 – Getting the Average of an Array of Numbers
- #148 – Getting the Average of an Array of Custom Objects
- #149 – Using IEnumerable.Aggregate to Perform a Calculation Based on All Elements in an Array
- #150 – Other Aggregate Functions You Can Apply to Numeric Arrays
- #151 – Determining Whether an Array Contains a Specific Element
- #152 – Remove Duplicate Array Entries Using Distinct() Method
- #153 – Returning a Subset of Array Elements Matching a Particular Criteria
- #154 – Using an Invalid Array Index Causes an Exception to Be Thrown
- #155 – Iterating Through An Array Using the foreach Statement
- #156 – Using break and continue in foreach Loops
- #191 – Changing the Underlying Type of an enum
- #192 – Using Non-Default Constant Values for Enumeration Members
- #193 – An Enum Type’s ToString Method Displays the Member’s Name
- #194 – Storing a Set of Boolean Values as Bits
- #195 – Using an Enum Type to Store a Set of Flags
- #196 – Using the ToString() Method on a Flags-Based Enum Type
- #197 – Checking an Enumerated Value for the Presence of a Flag
- #198 – Enumeration Values That Set Combinations of Flags
- #203 – It’s Good Practice to Always Have a 0-Valued Enumeration Constant
- #210 – Checking to See Whether a Nullable Object Has a Value
- #211 – Using the Null-Coalescing (??) Operator
- #212 – Using Several Null-Coalescing (??) Operators in the Same Expression
- #213 – Final Operand When Using Null-Coalescing (??) Operator
- #214 – Using the Null-Coalescing (??) Operator with Reference Types
- #215 – Using the Null-Coalescing (??) Operator with Custom Nullable Types
- #216 – Null-Coalescing (??) Operator Is Equivalent to GetValueOrDefault Method
- #217 – T? Is Equivalent to Nullable<T>
- #218 – Store Value-Typed Objects on the Heap Through Boxing
- #219 – Unboxing a Boxed Object
- #220 – Boxing Can Happen Automatically
- #221 – When Unboxing, You Must Match the Original Type Exactly
- #280 – Implicitly-Typed Arrays
- #296 – You Must Assign a Value to All Fields Before Using a struct
- #297 – Three Different Ways to Initialize the Contents of a struct
- #298 – A struct Can Have Several Constructors
- #316 – Declaring and Using Constants
- #317 – Constants Can Be Class Members
- #318 – You Can’t Use the static Modifier On a Constant
- #319 – You Initialize a Constant Using an Expression
- #320 – The Constant Expression for a Reference-Typed Constant Must Be Null
- #321 – Accessibility of Constants
- #327 – Assigning a struct to a New Variable Makes a Copy
- #328 – Copying a struct Will Not Copy Underlying Reference Types
- #367 – Iterating through All Possible Values of an Enumeration Type
- #433 – All structs Inherit from System.ValueType
- #457 – Converting Between enums and their Underlying Type
- #458 – Errors While Converting Between enum and Underlying Type
- #459 – Assigning a Value of a Different Type to an enum
- #460 – Converting from a String to an Enum Type
- #461 – Enumeration Elements Don’t Need to Be Sequential
- #462 – Duplicate Enumerators in an Enumerated Type
- #463 – Enumerated Values Can Be Any Constant Expression
- #464 – Getting an Enumeration’s Underlying Type at Runtime
- #465 – Dumping All Names and Values for an Enumerated Type
- #466 – Explicitly Assigning Only Some Enumerated Values
- #477 – Full List of Escape Sequences for Character Literals
- #510 – Declaring More than One Local Variable On the Same Line
- #519 – Differences Between structs and classes
- #520 – Choosing Between a struct and a Class
- #566 – Implicit Conversions to Nullable Types
- #568 – Array Covariance
- #569 – Assignment Compatibility
- #571 – Covariance in Programming Languages
- #572 – Why Array Covariance Is Called Covariance
- #573 – Array Covariance Doesn’t Apply to Value Types
- #574 – The Problem with Array Covariance
- #581 – Boxing and Unboxing Nullable Types
- #582 – Use the as Operator to Unbox to a Nullable Type
- #596 – Implicitly-Typed Arrays and Best Type Inference
- #598 – Clearing an Array or a Subset of an Array
- #599 – Copying an Array Onto Another Array
- #600 – Reversing the Elements in an Array
- #611 – Accessibility of Members in a struct
- #641 – Using the this Keyword in a struct
- #642 – Reassigning the this Pointer in a struct
- #643 – The Constructor for a struct Must Initialize All Data Members
- #644 – Chaining struct Constructors
- #645 – You Can Chain to the Default Constructor for a struct
- #646 – Value Types Don’t Have Finalizers
- #650 – Creating an Array of Anonymously-Typed Objects
- #651 – Passing an Anonymously-Typed Object to a Method
- #652 – Using Expressions and Variables in Anonymous Type Declarations
- #653 – Projection Initializers
- #654 – You Can’t Use an Anonymous Type Directly
- #657 – Boxing Makes a Copy of An Object
- #658 – What Boxing and Unboxing Look Like in IL
- #767 – A struct Is Implicitly Sealed
- #775 – Copying an Array of Anonymously-Typed Objects
- #776 – Declaring and Using Nullable structs
- #777 – A struct Isn’t Mutable When Used as a Property
- #778 – A struct Isn’t Mutable When Used in a Collection
- #779 – Methods in struct that Modify Elements Can Be Dangerous
- #780 – The Case for Immutable structs
- #781 – A struct Can Implement an Interface
- #782 – You Can Create an Instance of a struct Without the new Keyword
- #789 – Grouping Constants into Their Own Class
- #833 – Some Examples of Anonymous Object Initializers
- #834 – Use a Generic List to Store a Collection of Objects
- #835 – A Generic List Can Store Value-Typed or Reference-Typed Objects
- #836 – Initializing a Generic List with an Object Initializer
- #837 – Object Initializers within Collection Initializers
- #838 – Object and Collection Initializers as Parameters
- #839 – Anonymous Type Limitations
- #840 – Use an Anonymous Type as a Read-Only Subset of an Object
- #982 – An Enum Type Can Store a Maximum of 32 Flags
- #983 – Using a BitArray to Store a Large Collection of Boolean Values
- #991 – Using the Round-Trip Format Specifier
- #992 – The System.Char Data Type
- #993 – Some Examples of Characters
- #1,012 – Options for Array Declaration, Instantiation and Initialization
- #1,013 – default Operator Returns Default Values
- #1,014 – Using default Operator in a Generic Class
- #1,015 – Rendering a Byte Array as a Series of Hex Characters
- #1,016 – Retrieving the Length of an Array
- #1,025 – Converting between enum Types
- #1,026 – Checking a Flagged enum Type for Validity
- #1,045 – Implicit Conversions When Assigning from a Nullable Type
- #1,046 – Implicit vs. Explicit Conversions
- #1,047 – The Implicit Identity Conversion
- #1,048 – No Implicit Conversions between Signed vs. Unsigned
- #1,049 – Full List of Implicit Numeric Conversions
- #1,050 – Implicit Conversions between Nullable Types
- #1,051 – Implicit Reference Conversions
- #1,052 – Boxing Is a Kind of Implicit Conversion
- #1,053 – Implicit Conversion from Type dynamic
- #1,054 – Implicit Conversions from Constant Expressions
- #1,055 – Defining Your Own Implicit Conversions
- #1,056 – Custom Implicit Conversions between Reference Types
- #1,057 – Custom Explicit Conversions
- #1,058 – Custom Implicit Conversions in Both Directions
- #112 – Conditionally Compiling Code in Debug Builds
- #491 – Use Debug.WriteLine to Output Debug Information
- #555 – Enumerable Objects and Enumerators
- #556 – Using an Enumerator Explicitly
- #557 – Using an Iterator to Return the Elements of an Enumerable Type
- #558 – Using an Iterator Within a for Loop
- #559 – An Iterator Can Return an Enumerable Type or an Enumerator
- #560 – Returning an Enumerator from an Iterator
- #561 – Using a yield break Statement
- #562 – What an Iterator Looks Like Under the Covers
- #563 – Enumerable Types Can Generate Multiple Enumerators
- #564 – Use the Reverse Method to Iterate Backwards through a Collection
- #565 – Using an Iterator to Return A Shuffled Sequence
- #368 – How Events Work
- #369 – Multiple Clients Can Subscribe to the Same Event
- #370 – Subscribe to an Event by Adding an Event Handler
- #378 – Implementing an Event
- #379 – Using the EventHandler Delegate for Events that Return No Data
- #380 – Handling Events that Use the EventHandler Delegate Type
- #381 – Implementing an Event that Returns Some Data
- #382 – Handling an Event that Returns Some Data
- #383 – Removing a Handler from an Event
- #384 – The Difference Between Delegates and Events
- #386 – Implementing a Static Event
- #387 – Static Events vs. Static Event Handler Methods
- #388 – Declaring and Using Private Events
- #389 – Check for Null Before Raising an Event
- #390 – Using the Same Handler for Multiple Events
- #393 – Implement a Helper Method to Raise an Event
- #394 – Raising an Event in a Thread-Safe Manner
- #395 – Overriding the Default add and remove Accessors for an Event
- #672 – An Exception Thrown From a Finalizer Will Be Treated as an Unhandled Exception
- #841 – Exceptions
- #850 – Three Types of Errors that Can Lead to Exceptions
- #851 – A General Philosophy for Handling Exceptions
- #852 – How Exceptions Work
- #853 – An Exception Is an Instance of the System.Exception Class
- #854 – Catching an Exception
- #855 – Throwing an Exception
- #856 – Choosing an Exception Type to Throw
- #857 – What an Exception Object Contains
- #858 – Reading Exception Information in a Handler
- #859 – The Scope of a try Block
- #860 – Exceptions Bubble up the Call Stack
- #861 – A finally Block Always Executes
- #862 – Options for Including catch and finally Blocks
- #863 – How a finally Block Works with No catch Block
- #864 – An Example of a finally Block with No catch Block
- #865 – A catch Block Specifies the Type of Exception to Catch
- #866 – A catch Block Without Arguments Catches All Exceptions
- #867 – Including Several catch Blocks
- #868 – List Most Specific Exception Types First
- #869 – Example of Catching an Exception Thrown by the .NET Framework
- #870 – Where Execution Continues when an Exception Is Caught
- #871 – Where Execution Continues when an Exception Is Not Caught
- #872 – Code After a throw Statement Is Not Executed
- #873 – Full Example of Throwing and Catching an Exception
- #874 – An Exception Can Be Thrown from a Constructor
- #875 – Looking at the Call Stack after Catching an Exception
- #876 – Unhandled Exceptions
- #877 – Unhandled Exceptions on Background Threads
- #878 – Unhandled Exceptions in Static Constructors
- #879 – Unhandled Exceptions in Finalizers
- #880 – Catching Different Exception Types at Different Levels
- #881 – When to Throw Exceptions
- #882 – What Types of Exceptions to Throw
- #883 – Re-throwing an Exception
- #884 – Things You Might Do in an Exception Handler
- #885 – Getting Information about the Method that Threw an Exception
- #886 – Setting the HelpLink Property when You Throw an Exception
- #887 – Report Additional Data when You Throw an Exception
- #888 – Objects Added to Exception’s Data Dictionary Must Be Serializable
- #889 – Catching Exceptions that Derive from a Common Base Type
- #890 – Common System Exception Types that You Might Throw
- #891 – Example of Throwing a System Exception Type
- #892 – Creating a Custom Exception Type
- #893 – A Custom Exception Type Doesn’t Need to Add Custom Data
- #894 – Creating a Custom Exception Type with Custom Data
- #895 – Catching a Custom Exception Type
- #896 – Custom Exceptions Should Be Marked as Serializable
- #897 – Rules for Creating a Custom Exception Type
- #898 – Using Code Snippets to Implement a Custom Exception Type
- #899 – Exception Type Variable in a catch Block Is Optional
- #900 – What the Exception Object Contains when You Re-throw an Exception
- #901 – Throwing a New Exception from a catch Block
- #902 – Data Available to the Handler of a Wrapped Exception
- #903 – Wrapped Exceptions Can Be Several Levels Deep
- #904 – Getting the Innermost Wrapped Exception
- #905 – Examining an Exception’s Stack Trace
- #906 – Adding Custom Data vs. Using a Custom Exception Type
- #907 – Exceptions Thrown from Main Are Treated as Unhandled Exceptions
- #908 – Handling Unhandled Exceptions
- #909 – When a finally Block Executes
- #910 – One Example of a finally Block
- #911 – finally Block Execution When Exception Is Rethrown
- #912 – Intellisense Can Show Exceptions that a Method Might Throw
- #913 – How to Document that a Method Can Throw an Exception
- #914 – Using the Debugger to Break when an Exception Is Thrown
- #915 – An Exception Can Cross Assembly Boundaries
- #916 – Exception Can Cross .NET Language Boundaries
- #917 – Corrupted State Exceptions Are Not Normally Caught
- #918 – Catching Corrupted State Exceptions
- #919 – Think Twice about Handling Corrupted State Exceptions
- #920 – A finally Block Is Not Executed When a Corrupted State Exception Occurs
Interfaces
- #434 – Interfaces
- #435 – Implementing an Interface
- #436 – The Implementation of an Interface Can Be a Subset of the Class
- #437 – Access Interface Members through an Interface Variable
- #438 – Benefits of Using Interfaces
- #440 – A Class Can Implement More than One Interface
- #441 – Implementing Interface Members Explicitly
- #442 – Explicit Interface Implementation Allows Duplicate Member Names
- #443 – An Interface Cannot Contain Fields
- #444 – Interfaces Can Inherit from Other Interfaces
- #445 – Differences Between an Interface and an Abstract Class
- #446 – Deciding Between an Abstract Class and an Interface
- #447 – Use as Operator to Get At an Object’s Interfaces
- #448 – Use the is Operator to See if an Object Implements an Interface
- #449 – You Can Pass an Interface Variable to a Method
- #450 – Interfaces Should Normally Start with the Letter ‘I’
- #451 – Implement Interface Explicitly to Simplify How a Class Appears to Clients
- #454 – Return an Interface as a Return Value from a Method
- #455 – Define an Interface Based on Existing Members of a Class
- #456 – Explicitly Implemented Interface Members Are Automatically Private
- #536 – Using a Generic Interface
- #537 – Implement a Generic Interface with a Generic Class
- #612 – Members of an Interface Are Implicitly Public
- #613 – Interfaces Cannot Contain Static Members
- #647 – A struct Can Implement an Interface
- #799 – Interface Members Are Implicitly Public
- #604 – The Problem with Reading/Writing Shared Data from Different Threads
- #605 – The Causes of Problems With Reading/Writing Shared Data from Multiple Threads
- #606 – Use volatile Keyword to Fix Problems With Reading/Writing Shared Data
- #607 – When Do You Need the volatile Keyword?
- #925 – The Managed Heap
- #926 – How Memory Is Allocated for Objects on the Managed Heap
- #927 – Visualizing How Objects Are Created on the Managed Heap
- #928 – How Objects Are Removed from the Managed Heap
- #929 – Visualizing How Objects Are Removed from the Managed Heap
- #930 – Objects on the Heap Can Refer to Each Other
- #931 – Objects with Finalizers Take Longer to Garbage Collect
- #932 – When Objects Become Eligible for Garbage Collection
- #933 – The Garbage Collector Groups Objects into Generations
- #934 – How Generations Help the Garbage Collector Run More Efficiently
- #935 – Large Objects Are Allocated on the Large Object Heap
- #936 – Visualizing Garbage Collection Generations
- #937 – Forcing a Garbage Collection
- #938 – Finding Out What GC Generation an Object Is In
- #939 – Not All Objects on Heap Are Promoted to Next GC Generation
- #264 – By Default, Parameters Are Passed by Value
- #265 – Passing Reference Types by Value
- #266 – You Can’t Prevent a Method from Changing the Contents of Reference Types
- #267 – Passing Data Back from a Method Using out Parameters
- #268 – You Must Set the Value of All out Parameters Before Returning from a Method
- #269 – Use ref Modifier on Parameters that Are Input/Output
- #270 – Passing a Reference Type by Reference
- #271 – Passing a Reference Type as an Output Parameter
- #272 – Differences Between ref and out Parameters
- #273 – Parameter Modifier Summary
- #274 – Can’t Overload if Methods Differ Only by ref and out Modifiers
- #275 – Passing a struct to a Method
- #276 – Passing a struct by Reference
- #277 – Passing an Array to a Method
- #278 – Passing an Array by Reference
- #279 – Passing a Multidimensional Array to a Method
- #281 – Declaring and Using Static Methods in a Class
- #282 – Creating Private Static Methods
- #283 – Instance Methods Can Call Static Methods
- #284 – Static Methods Can Call Instance Methods
- #340 – Use the params Keyword to Pass a Variable Number of Arguments
- #341 – Defining and Using Local Variables
- #354 – Correct Overloaded Method Is Automatically Called
- #511 – Rules for Using Parameter Arrays
- #512 – Two Ways to Pass Data to a Method that Takes a Parameter Array
- #513 – Some Familiar Methods that Accept Parameter Arrays
- #538 – Implement a Generic Method
- #539 – Type Inference When Calling Generic Methods
- #540 – Non-Generic Methods in a Generic Class
- #541 – Generic Method Type Parameters Can Hide Class-Level Type Parameters
- #549 – Anonymous Method Basics
- #553 – Anonymous Methods as Static or Instance Methods
- #554 – Rules for Matching an Anonymous Method to a Delegate Type
- #584 – Defining an Optional Parameter
- #585 – Optional Parameters Must Come Last
- #586 – Default Values for Optional Parameters Must Be Constants
- #587 – If Provided, Optional Arguments Must Be in Correct Order
- #588 – A Default Parameter Value Can Be Null
- #589 – Optional Parameters Must Be Input Parameters
- #593 – Using Named Arguments
- #594 – When You’d Want to Use Named Arguments
- #597 – Returning an Array from a Method
- #608 – Instance Methods Can Use Static Data
- #632 – Partial Methods
- #633 – The Implementation of A Partial Method Is Optional
- #634 – Invoking Partial Methods That Have No Implementation
- #635 – Limitations on Partial Methods
- #636 – The Reason for Partial Methods
- #637 – A Delegate Can Refer to A Partial Method
- #638 – Defining and Using a Partial struct
- #674 – Can Overload If Parameters Differ Only by ref Modifier
- #695 – Static Methods Can Access Static Members
- #772 – Initializing an Array as Part of a Method Call
- #774 – Passing an Array as an out Parameter
- #802 – A Method Might Have No Parameters
- #807 – Defining and Using an Extension Method
- #808 – Adding Parameters to an Extension Method
- #809 – Extension Method Signatures Shouldn’t Match Class Methods
- #810 – Where Extension Methods Came From
- #811 – Extension Methods Can Only Access Public Members of Class
- #812 – Defining an Extension Method for a Value Type
- #813 – Defining an Extension Method for an Enumerated Type
- #814 – Parameters vs. Arguments
- #815 – Named vs. Positional Arguments
- #816 – Named Argument and Optional Parameter Combinations
- #1,038 – Type Parameter Constraints on Generic Methods
- #453 – Use Reflection to Get a List of Interfaces that a Class Implements
- #480 – Pre-Processing Directives
- #725 – Dumping Out a List of Types in an Assembly
- #726 – Listing all Types within a Namespace
- #727 – Get a List of All Namespaces in an Assembly
- #728 – Dumping Out All Types in the .NET Framework
- #729 – Dumping Out All Types in .NET Framework, part II
- #731 – Getting Information About the Members of a Class
- #743 – ASCII Art Generator
- #745 – Use ReSharper to Increase Your Productivity in Visual Studio
- #748 – Use GhostDoc Tool to Document Your Code
- #749 – Example of Some C# Design Patterns
- #750 – Use xUnit.net for Unit Testing
- #757 – Books on Object-Oriented Programming
- #942 – The Case for Lazy Instantiation
- #943 – Lazy Instantiation, Solution #1
- #944 – Lazy Instantiation, Solution #2
- #945 – Lazy Instantiation, an Easier Solution
- #946 – Specifying Whether Lazy Instantiated Object Should Be Thread-Safe
- #947 – Specifying Lazy Instantiation Using a Lambda Expression
- #984 – The Birthday Problem
- #396 – Operators as Class Members
- #397 – Defining an Operator
- #398 – Overloadable Operators
- #399 – Overloading Unary Operators
- #400 – Overloading Binary Operators
- #405 – Equals Method for Equivalence, == Operator for Identity
- #408 – Overloading the == Operator for a Reference Type
- #409 – Example of Overloading the == Operator
- #410 – Overloading the == Operator for a Value Type
- #412 – Guidelines when Overloading == Operator for a Value Type
- #414 – Equivalence Can Be Based on a Subset of Fields
- #415 – Be Careful When Checking Floating Point Numbers for Equality
- #416 – Use an Epsilon to Compare Two Floating Point Numbers
- #419 – Override Relational Operators When You Implement IComparable
- #575 – Using the is Operator to Check the Type of a Reference-Typed Object
- #576 – Using the is Operator with Value Typed Objects
- #577 – Using the is Operator to Check for an Unboxing Conversion
- #578 – Using the as Operator to Do Type Conversions
- #579 – Typical Pattern for Using as Operator
- #580 – as Operator Can Generate Compile-Time Errors
- #592 – Optional Parameters in Indexers
- #785 – The Singleton Pattern
- #786 – A Lazier Singleton Pattern
- #792 – Being Notified When an Object’s Properties Change, Part I
- #793 – Being Notified When an Object’s Properties Change, Part II
- #794 – A Better INotifyPropertyChanged Implementation
- #821 – The Factory Pattern
- #822 – Embed a Factory Class Inside Its Related Class
- #823 – A Nested Factory Class Implemented as a Singleton
- #948 – Using Generic Lazy Class to Implement the Singleton Pattern
- #976 – Security Issues when Storing Confidential Data in Strings
- #977 – Security Issues with Managed Strings
- #978 – Use a SecureString Object to Store Confidential Text Data
- #979 – Store Confidential Data Only Within SecureString Instances
- #980 – Getting Data Out of a SecureString
- #157 – Iterating Using the while Loop
- #158 – A while Loop Expression Is Evaluated Before Executing the Loop
- #159 – A while Loop Might Execute Forever
- #160 – A while Loop Can Exit on break, goto, return or throw Statements
- #161 – Use continue to Jump to Next Iteration of while Loop
- #162 – do/while Loop Executes at Least Once
- #163 – Iterating Using the for Loop
- #164 – for Loop Clauses Can Contain Lists of Statements
- #165 – Any Clause of the for Loop May Be Left Empty
- #166 – Using the for Statement to Create an Infinite Loop
- #167 – Use continue to Jump to Next Iteration of for Loop
- #168 – Use if Statement to Conditionally Execute a Block of Code
- #169 – The if Statement Must Always Include a Boolean Expression
- #170 – The else Portion of an if Statement
- #171 – if/else Statement Can Have One or More Statements in Body
- #172 – Nested if Statements
- #173 – The switch Statement
- #174 – Multiple Case Statements in switch Statement Can Share Code
- #175 – The default Clause of a switch Statement
- #176 – Switch Statement Doesn’t Fall Through from Case to Case
- #177 – Using goto in a switch Statement
- #178 – Throwing an Exception from a switch Statement
- #986 – Using goto to Jump to a Label
- #14 – Composite Format Strings in C#
- #15 – Using Long Lists of Format Items in Composite Format Strings
- #16 – Use an Array of Objects for a Composite Format String
- #17 – Methods that Support Composite Formatting
- #25 – String Literals
- #33 – The string Type
- #60 – Using Parse to Convert from String to Numeric Types
- #61- Formatting and Parsing Strings for Non-Default Cultures
- #62 – String Concatenation
- #63 – Use StringBuilder for More Efficient String Concatenation
- #64 – Escape Sequences in String Literals
- #65 – Verbatim String Literals
- #66 – Including Quotation Marks in Strings
- #68 – String Equality
- #69 – Strings are Immutable
- #70 – The StringBuilder Class
- #71 – StringBuilder Capacity
- #95 – ToString() Called Automatically When Doing String Concatenation
- #96 – Comparing String Values
- #97 – String Comparisons Using Other Cultures
- #98 – Using An Indexer to Get A Specific Character in A String
- #99 – Use StringInfo to Get Specific Characters From A UTF32 String
- #100 – Using IndexOf to Search for Characters Within A String
- #101 – Use Contains() to Discover If A String Contains Other Strings
- #102 – Use Substring() to Extract Substrings From A String
- #103 – Inserting and Removing Substrings
- #104 – Functions to Trim Leading and Trailing Characters From A String
- #105 – Chaining String Functions Together
- #106 – Using String.Split to Parse A String Into Substrings
- #392 – Reversing a String Using the Reverse Method
- #422 – How ReferenceEquals Behaves When Comparing Strings
- #478 – Verbatim String Literals Can Span Multiple Lines
- #479 – Identical String Literals Are Stored in the Same Object
- #773 – Reversing a String that Contains Unicode Characters Expressed as Surrogate Pairs
- #970 – Checking for Valid Characters in a String
- #1,003 – Accessing Underlying Bytes in a String for Different Encodings
- #1,004 – Converting a String to Uppercase or Lowercase
- #1,005 – Replacing a Substring with a New Substring
- #1,006 – Getting the Length of a String
- #1,007 – Getting Length of String that Contains Surrogate Pairs
- #1,008 – What Happens When You Forget That Strings Are Immutable
- #1,009 – A String Can Be Null or Empty
- #1,010 – Checking to See Whether a String is Null or Empty
- #1,011 – TryParse Indicates Whether a Parse Operation Will Succeed
- #13 – Specify Command Line Arguments in Visual Studio 2010
- #113 – Conditionally Compiling Code Base on Symbols
- #114 – Creating a New Build Configuration
- #115 – Using #if, #else, #endif
- #116 – Use #region Directive to Create Code Regions
- #300 – Use XML Documentation to Inform Intellisense
- #301 – Using XML Documentation at the Class Level
- #302 – Generating an XML Documentation File
- #439 – Use Visual Studio to Implement an Interface
- #452 – Object Browser Shows You the Interfaces that a Class Implements
- #474 – You Can Include Unicode Characters in Your Source Code
- #481 – Projects and Solutions in Visual Studio
- #482 – Basic Project Types in Visual Studio
- #483 – Adding a new Project to an Existing Solution
- #484 – Add a Project Reference to Use a Type from Another Project
- #487 – Build Configurations Allow Saving Sets of Project Properties
- #488 – Build Platforms Allow Project Properties to Target a Platform
- #489 – Debug and Release Configurations Are Created Automatically
- #490 – Using the DEBUG Conditional Compilation Symbol
- #492 – Define Your Own Conditional Compilation Symbol
- #493 – Project Properties Are Specific to Build Configuration and Platform
- #494 – Selecting a Solution-Level Build Configuration and Platform
- #495 – Viewing Solution Configurations with the Configuration Manager
- #496 – Editing Solution Configurations with the Configuration Manager
- #497 – Creating a New Build Configuration in a Project
- #498 – Creating a New Solution Configuration
- #528 – Types Are Organized by Namespace in the Object Browser
- #591 – How Optional Parameters Look with Intellisense
- #595 – Intellisense Shows Method Overloads
- #663 – Visual Studio Debugger Will Call Your Object’s ToString Method
- #691 – Use the this Keyword to Trigger Intellisense
- #746 – Get a Free Copy of Visual Studio 2012
- #747 – Turning Off All Caps Menus in Visual Studio 2012
- #755 – Viewing Class Members Directly in the Solution Explorer
- #756 – Viewing a Class Diagram in Visual Studio 2012
- #758 – Cleaning Up using Directives in a File
- #759 – Creating a New Type from a Class Diagram
- #760 – Adding New Class Members from a Class Diagram
- #761 – Create or Modify Type Members Using the Class Details Window
- #762 – Creating a Class Diagram Containing Types in the .NET Framework
- #763 – Fixing a Class Diagram that Cannot Find Types
- #764 – Expanding All Classes in a Class Diagram
- #765 – Adding Base or Derived Classes to a Class Diagram
- #766 – Adding an Interface to a Class Diagram
- #770 – Use Intellisense to Get List of Methods to Override
- #848 – Viewing the Call Stack in Visual Studio
- #849 – Using the Call Stack in Visual Studio to Navigate within Your Code
Thank you very much for this helpful and valuable information. Great your blog, congratulations!
ReplyDeletevoyance par mail