Log In
Or create an account -> 
Imperial Library
  • Home
  • About
  • News
  • Upload
  • Forum
  • Help
  • Login/SignUp

Index
Developer’s Guide to Collections in Microsoft® .NET
A Note Regarding Supplemental Files Introduction
Who Should Read This Book
Assumptions
Who Should Not Read This Book Organization of This Book
Part I, Collection Basics Part II, .NET Built-in Collections Part III, Using Collections Part IV, Using Collections with UI Controls Finding Your Best Starting Point in This Book
Conventions and Features in This Book System Requirements Code Samples
Installing the Code Samples Using the Code Samples
Acknowledgments Errata & Book Support We Want to Hear from You Stay in Touch
I. Collection Basics
1. Understanding Collections: Arrays and Linked Lists
Array Overview
Uses of Arrays Advantages of Arrays Disadvantages of Arrays
Array Implementation
Understanding Indexing Getting Started Creating Constructors Allowing Users to Add Items Allowing Users to Remove Items Adding Helper Methods and Properties Using the ArrayEx(T) Class
Linked List Overview
Uses of Linked Lists Advantages of Linked Lists Disadvantages of Linked Lists
Linked List Implementation
Singly Linked List Implementation
Creating the Node Class Declaring the SingleLinkedList(T) Class Creating Constructors Allowing Users to Add Items Allowing Users to Remove Items Adding Helper Methods and Properties
Doubly Linked List Implementation
Creating the Node Class Declaring the DoubleLinkedList(T) Class Creating Constructors Allowing Users to Add Items Allowing Users to Remove Items Adding Helper Methods and Properties
Using an Array to Create a Linked List Using the Linked List Class
Summary
2. Understanding Collections: Associative Arrays
Associative Array Overview
Uses of Associative Arrays Advantages and Disadvantages of Associative Arrays
Associative Array Implementation
Using Association Lists for Associative Arrays
Advantages of Association Lists Disadvantages of Association Lists Getting Started Creating Constructors Allowing Users to Associate Values with Keys Allowing Users to Remove Keys Adding Helper Methods and Properties
Using Hash Tables for Associative Arrays
Advantages of Hash Tables Disadvantages of Hash Tables Understanding Hash Table Buckets Understanding Hash Table Collisions Understanding Chaining Understanding Object.GetHashCode Picking a Hashing Function Picking a Good Number of Buckets Implementing Your Internal Storage Getting Started Creating the Constructor Allowing Users to Associate Values with Keys Allowing Users to Remove Keys Adding Helper Methods and Properties
Using the Associative Array Class
Summary
3. Understanding Collections: Queues, Stacks, and Circular Buffers
Queue Overview
Uses of Queues
Queue Implementation
Using an Array to Implement a Queue
Creating Constructors Allowing Users to Add Items Allowing Users to Remove Items Adding Helper Methods and Properties
Using a Linked List to Implement a Queue
Creating Constructors Allowing Users to Add Items Allowing Users to Remove Items Adding Helper Methods and Properties
Using the Queue Classes
Stack Overview
Uses of Stacks
Stack Implementation
Adding the Common Functionality Using an Array to Implement a Stack
Creating Constructors Allowing Users to Add to Items Allowing Users to Remove Items Adding Helper Methods
Using a Linked List to Implement a Stack
Creating Constructors Allowing Users to Add Items Allowing Users to Remove Items Adding Helper Methods
Using the Stack Classes
Circular Buffer Overview
Uses of Circular Buffers
Circular Buffer Implementation
Getting Started Understanding the Internal Storage Creating Constructors Allowing Users to Add Items Allowing Users to Remove Items Adding Helper Methods and Properties Changing Capacity
When the Start Is Smaller Than the End When the Start Is Larger Than the End
Using the CircularBuffer(T) Class
Summary
II. .NET Built-in Collections
4. Generic Collections
Understanding the Equality and Ordering Comparers
Understanding the Equality Comparer
How Reference Equality Works How Bitwise Equality Works
Understanding the Ordering Comparer
Understanding Delegates, Anonymous Methods, and Lambda Expressions
Lambda Expressions in Visual Basic
List(T) Overview Using the List(T) Class
Creating a List(T)
List(T)() List(T)(IEnumerable(T) collection) List(T)(int size)
Appending Items to a List(T)
void Add(T item) void AddRange(IEnumerable(T) collection)
Traversing a List(T)
The foreach Statement void ForEach(Action(T) action)
Using a Method for the Action(T) Argument Using a Lambda Expression for the Action(T) Method
Removing Items from a List(T)
void Clear() bool Remove(T item) int RemoveAll(Predicate(T) match)
Using a Method with RemoveAll Using a Lambda Expression with RemoveAll
void RemoveAt(int index) void RemoveRange(int index, int count)
Inserting Items into a List(T)
void Insert(int index, T item) void InsertRange(int index, IEnumerable collection)
Sorting a List(T)
How Built-in Sorting Works void Sort() void Sort(Comparison(T) comparison)
Using a Lambda Expression for the Comparison(T) Using a Method for the Comparison(T)
void Sort(IComparer(T) comparer) void Sort(int index, int count, IComparer(T) comparer)
Searching a List(T)
T Find(Predicate(T) match) and T FindLast(Predicate(T) match)
Using a Lambda Expression for the Search Using a Method for the Search
FindIndex and FindLastIndex
int FindIndex(Predicate(T) match) int FindLastIndex(Predicate(T) match)
Using a Method to Do the Matching Using a Lambda Expression to Do the Matching
int FindIndex(int startIndex, Predicate(T) match) int FindLastIndex(int startIndex, Predicate(T) match)
Using a Method to Do the Matching Using a Lambda Expression to Do the Matching
int FindIndex(int startIndex, int count, Predicate(T) match) int FindLastIndex(int startIndex, int count, Predicate(T) match
Using a Method to Do the Matching Using a Lambda to Do the Matching
List(T) FindAll(Predicate(T) match)
Using a Lambda Expression for the FindAll Using a Method for the FindAll
Using a Binary Search to Do the Searching
int BinarySearch(T item) int BinarySearch(T item, IComparer(T) comparer) int BinarySearch(int index, int count, T item, IComparer(T) comparer)
Checking the Contents of a List
int IndexOf(T item) and int LastIndexOf(T item) int IndexOf(T item, int index) and int LastIndexOf(T item, int index) int IndexOf(T item, int index, int count) and int LastIndexOf(T item, int index, int count) bool Contains(T item) bool Exists(Predicate(T) match)
Using a Method to Check for Existence Using a Lambda Expression to Check for Existence
bool TrueForAll(Predicate(T) match)
Using a Method to See Whether All Match Using a Lambda Expression to See Whether All Match
Modifying the List
List(TOutput) ConvertAll(Converter(T, TOutput) converter)
Using a Method to Do the Conversion Using a Lambda Expression to Do the Conversion
void Reverse() void Reverse(int index, int count) void TrimExcess()
LinkedList(T) Overview Using the LinkedList(T) Class
Creating a New LinkedList(T)
LinkedList(T)() LinkedList(T)(IEnumerable(T) collection)
Adding to the LinkedList(T)
void AddAfter(LinkedListNode(T) node, LinkedListNode(T) newNode) LinkedListNode(T) AddAfter(LinkedListNode(T) node, T value) void AddBefore(LinkedListNode(T) node, LinkedListNode(T) newNode) LinkedListNode(T) AddBefore(LinkedListNode(T) node, T value) LinkedListNode(T) AddFirst(T item) void AddFirst(LinkedListNode(T) node) LinkedListNode(T) AddLast (T item) void AddLast (LinkedListNode(T) node)
Removing Nodes from the LinkedList(T)
void Clear() bool Remove(T value) bool Remove(LinkedListNode(T) node) void RemoveFirst() void RemoveLast()
Obtaining Information on the LinkedList(T)
LinkedListNode(T) Find(T value) and LinkedListNode(T) FindLast(T value) LinkedListNode(T) First { get; } and LinkedListNode(T) Last { get; } int Count { get; } bool Contains(T value)
Summary
5. Generic and Support Collections
Queue(T) Overview Using the Queue(T) Class
Creating a Queue
Queue(T)() Queue(T)(IEnumerable(T)) Queue(T)(int size)
Adding Items to the Queue
void Enqueue(T item)
Removing Items from the Queue
void Clear() T Dequeue()
Checking the Queue
T Peek() bool Contains(T item) int Count
Cleaning the Queue
void TrimExcess()
Stack(T) Overview Using the Stack(T) Class
Creating a Stack
Stack(T)() Stack (T)(IEnumerable(T)) Stack (T)(int size)
Adding Items to the Stack
void Push(T item)
Removing Items from the Stack
void Clear() T Pop()
Checking the Stack
T Peek() bool Contains(T item) int Count
Cleaning the Stack
TrimExcess
Dictionary(TKey,TValue) Overview Understanding Dictionary(TKey,TValue) Implementation Using the Dictionary(TKey,TValue) Class
Creating a Dictionary
Dictionary(TKey, TValue)() Dictionary(TKey, TValue)(IDictionary(TKey, TValue) dictionary) Dictionary(TKey, TValue)(IEqualityComparer(TKey) comparer) Dictionary(TKey, TValue)(int capacity) Dictionary(TKey, TValue)(IDictionary(TKey, TValue) dictionary, IEqualityComparer(TKey) comparer) Dictionary(TKey, TValue)(int capacity, IEqualityComparer(TKey) comparer)
Adding Items to a Dictionary
void Add(TKey key, TValue value) TValue Item[TKey key] { set; }
Removing Items from a Dictionary
void Clear() bool Remove(TKey key)
Retrieving Values from the Dictionary by Using a Key
bool TryGetValue(TKey key, out TValue value) TValue Item[TKey key] { get; }
Checking the Dictionary
bool ContainsKey(TKey key) bool ContainsValue(TValue value) int Count Dictionary<TKey,TValue>.KeyCollection Keys Dictionary<TKey,TValue>.ValueCollection Values
BitArray Overview Using the BitArray Class
Creating a BitArray
BitArray(BitArray bits) BitArray(Boolean[] values) BitArray(Byte[] bytes) BitArray(Int32 length, Boolean defaultValue) BitArray(Int32 length) BitArray(Int32[] values)
Accessing Bits in the BitArray Class
void Set(int index, bool value) void SetAll(bool value) bool Get(int index) bool Item[int index] {get; set; }
Using the BitArray Class for Bit Operations
BitArray And(BitArray value) BitArray Not() BitArray Or(BitArray value) BitArray Xor(BitArray value)
CollectionBase and DictionaryBase Overview
Using CollectionBase
void OnValidate(object value) void OnClear() and void OnClearComplete() void OnInsert(int index, Object value) and void OnInsertComplete(int index, Object value) void OnRemove(int index, object value) and void OnRemoveComplete(int index, object value) void OnSet(int index, object oldValue, object newValue) and void OnSetComplete(int index, object oldValue, object newValue)
Using DictionaryBase
void OnValidate(object key, object value) void OnClear() and void OnClearComplete() void OnGet() void OnInsert(Object key, Object value) and void OnInsertComplete(Object key, Object value) void OnRemove(Object key, Object value) and void OnRemoveComplete(Object key, Object value) void OnSet(Object key, object oldValue, object newValue) and void OnSetComplete(Object key, object oldValue, object newValue)
HashSet(T) Overview Using the HashSet(T) Class
Creating a HashSet(T)
HashSet(T) () HashSet(T) (IEnumerable(T)) HashSet(T) ( IEqualityComparer(T)) HashSet(T) ( IEnumerable(T), IEqualityComparer(T))
Adding Items to the HashSet(T)
bool Add(T item)
Removing Items from a HashSet(T)
void Clear() bool Remove(T item) int RemoveWhere(Predicate(T) match)
Using a Method with RemoveWhere Using a Lambda Expression with RemoveWhere
Performing Set Operations on a HashSet(T)
void IntersectWith(IEnumerable(T) other) bool IsProperSubsetOf(IEnumerable(T) other) bool IsProperSupersetOf(IEnumerable(T) other) bool IsSubsetOf(IEnumerable(T) other) bool IsSupersetOf(IEnumerable(T) other) bool Overlaps(IEnumerable(T) other) void UnionWith(IEnumerable(T) other) void ExceptWith(IEnumerable(T) other) bool Contains(T item) void TrimExcess()
Sorted Collections Overview
SortedList(TKey, TValue) SortedDictionary(TKey, TValue)
Summary
III. Using Collections
6. .NET Collection Interfaces
Enumerators (IEnumerable and IEnumerator) Overview Adding Enumeration Support to Classes
ArrayEx(T) CircularBuffer(T) SingleLinkedList(T) and DoubleLinkedList(T) QueuedArray(T) QueuedLinkedList(T) StackedArray(T) StackedLinkedList(T) AssociativeArrayAL(TKey,TValue) AssociativeArrayHT(TKey,TValue)
ICollection and ICollection(T) Overview Adding Collection Support to Classes
ArrayEx(T) CircularBuffer(T) SingleLinkedList(T) and DoubleLinkedList(T) QueuedArray(T) QueuedLinkedList(T) StackedArray(T) StackedLinkedList(T) AssociativeArrayAL(TKey,TValue) AssociativeArrayHT(TKey,TValue)
IList and IList(T) Overview Adding IList(T) and IList Support to Classes
ArrayEx(T)
IDictionary(TKey,TValue) Overview Adding Key/Value Pair Support to Classes
AssociativeArrayAL(TKey,TValue) AssociativeArrayHT(TKey,TValue)
Summary
7. Introduction to LINQ
What Is LINQ? LINQ Basics
Potential LINQ Data Sources What You Should Know About Query Execution
Forcing Immediate Query Execution
Getting Started with LINQ
Additions to the .NET Language for LINQ
The var Keyword Anonymous Types Object Initialization Collection Initialization
Picking a Data Source (from Clause) and Selecting Results (select Clause)
The from Clause The select Clause Examples of from and select Clauses
Filtering Results (the where Clause) Ordering Results (the orderby Clause) The group Clause The join Clause
Inner Join Outer Join
The let Clause
Summary
8. Using Threads with Collections
What Is a Thread? What Is Thread Synchronization?
Why Should I Care About Thread Synchronization? Why Not Write Thread Synchronization Code As Needed?
.NET Framework Tools for Synchronization
Interlocked Operations Signaling Locking
Exclusive Locks Non-Exclusive Locks
Adding Synchronization Support to Your Collection Classes
ICollection Revisited Getting Started
SyncRoot vs. the Synchronized Wrapper Class (IsSynchronized) Using the Monitor Class Using the ReaderWriterLockSlim Class
Handling Recursion Using Upgradeable Locks
Implementing a Synchronized Wrapper Class Handling Collection Changes While Enumerating Synchronized Collection Classes
SynchronizedCollection(T) SynchronizedKeyedCollection(T) SynchronizedReadOnlyCollection(T)
Summary
9. Serializing Collections
Serialization Using the Serializer Formatters
Applying the Serializable Attribute Controlling Serialization Behavior
Adding Serialization Support to Collection Classes
The ArrayEx(T) Class The Linked List Classes The Associative Array Classes
The AssociativeArrayAL(TKey,TValue) Class The AssociativeArrayHT Class
The Queue Classes The Stack Classes
Summary
IV. Using Collections with UI Controls
10. Using Collections with Windows Form Controls
Simple Binding Two-Way Data Binding
Implementing the IBindingList Interface
Adding List Manipulation Support
AllowEdit AllowNew AllowRemove AddNew
Adding Notification Support Adding Sorting Support
SupportsSorting SortDirection SortProperty IsSorted ApplySort RemoveSort
Adding Searching Support
SupportsSearching Find AddIndex RemoveIndex
Implementing the IBindingListView Interface
Adding Filtering Support
SupportsFiltering Filter RemoveFilter
Adding Advanced Sorting
SupportsAdvancedSorting SortDescriptions Modifications to IBindingList ApplySort
Using the BindingList(T) Class Using the BindingSource Class
Understanding the Sample Code
Binding with the ComboBox Control Binding with the ListBox Control Binding with the DataGridView Control and IBindingList Binding with the DataGridView Control and IBindingListView Binding with the BindingSource Object
Summary
11. Using Collections with WPF and Silverlight Controls
INotifyCollectionChanged Overview Implementing the INotifyCollectionChanged Interface
Notifying the User of Cleared Items Resolving Problems with the Recursive Collection Change Event
ObservableCollection(T) Overview Using the ObservableCollection(T) Class
Handling Recursive Collection Change Events
ICollectionView and CollectionView Overview
When to Use BindingListCollectionView When to Use ListCollectionView
Understanding the Sample Code
Binding with the ComboBox Control Binding with the ListBox Control Binding with the ListView Control Binding with the TreeView Control Binding with the CollectionView Class
Summary
A. About the Author Index About the Author
  • ← Prev
  • Back
  • Next →
  • ← Prev
  • Back
  • Next →

Chief Librarian: Las Zenow <zenow@riseup.net>
Fork the source code from gitlab
.

This is a mirror of the Tor onion service:
http://kx5thpx2olielkihfyo4jgjqfb7zx7wxr3sd4xzt26ochei4m6f7tayd.onion