Build the skills to apply Microsoft® .NET collections effectivelyPut .NET collections to work—and manage issues with GUI data binding, threading, data querying, and storage. Led by a data collection expert, you'll gain task-oriented guidance, exercises, and extensive code samples to tackle common pr
Developer's Guide to Collections in Microsoft .NET
✍ Scribed by Calvin Janes
- Publisher
- Microsoft Press
- Year
- 2011
- Tongue
- English
- Leaves
- 648
- Category
- Library
No coin nor oath required. For personal study only.
✦ Synopsis
Build the skills to apply Microsoft® .NET collections effectively
Put .NET collections to work—and manage issues with GUI data binding, threading, data querying, and storage. Led by a data collection expert, youll gain task-oriented guidance, exercises, and extensive code samples to tackle common problems and improve application performance. This one-stop reference is designed for experienced Microsoft Visual Basic® and C# developers—whether you’re already using collections or just starting out.
Discover how to:
-Implement arrays, associative arrays, stacks, linked lists, and other collection types
-Apply built in .NET collection classes by learning their methods and properties
-Add enumerator, dictionary, and other .NET collection interfaces to your classes
-Query collections by writing simple to complex Microsoft LINQ statements
-Synchronize data across threads using built in .NET synchronization classes
-Enhance your custom collection classes with serialization support
-Use simple data binding to display collections in Windows® Forms, Microsoft Silverlight®, and Windows Presentation Foundation
✦ Table of Contents
Introduction......Page 15
Part 1: Collection Basics......Page 23
Uses of Arrays......Page 25
Disadvantages of Arrays......Page 26
Getting Started......Page 27
Creating Constructors......Page 30
Allowing Users to Add Items......Page 32
Allowing Users to Remove Items......Page 35
Adding Helper Methods and Properties......Page 39
Using the ArrayEx(T) Class......Page 45
Advantages of Linked Lists......Page 49
Singly Linked List Implementation......Page 50
Doubly Linked List Implementation......Page 76
Using the Linked List Class......Page 103
Summary......Page 107
Uses of Associative Arrays......Page 109
Using Association Lists for Associative Arrays......Page 110
Using Hash Tables for Associative Arrays......Page 127
Using the Associative Array Class......Page 169
Summary......Page 174
Queue Implementation......Page 175
Using an Array to Implement a Queue......Page 176
Using a Linked List to Implement a Queue......Page 185
Using the Queue Classes......Page 192
Adding the Common Functionality......Page 197
Using an Array to Implement a Stack......Page 199
Using a Linked List to Implement a Stack......Page 204
Using the Stack Classes......Page 209
Uses of Circular Buffers......Page 215
Getting Started......Page 216
Understanding the Internal Storage......Page 217
Creating Constructors......Page 220
Allowing Users to Add Items......Page 223
Allowing Users to Remove Items......Page 225
Adding Helper Methods and Properties......Page 227
Changing Capacity......Page 229
Using the CircularBuffer(T) Class......Page 232
Summary......Page 233
Part 2: .NET Built-in Collections......Page 235
Understanding the Equality Comparer......Page 237
Understanding the Ordering Comparer......Page 240
Understanding Delegates, Anonymous Methods, and Lambda Expressions......Page 241
Lambda Expressions in Visual Basic......Page 243
Creating a List(T)......Page 244
Appending Items to a List(T)......Page 245
Traversing a List(T)......Page 246
Removing Items from a List(T)......Page 250
Inserting Items into a List(T)......Page 252
Sorting a List(T)......Page 253
Searching a List(T)......Page 269
Checking the Contents of a List......Page 285
Modifying the List......Page 291
LinkedList(T) Overview......Page 294
Adding to the LinkedList(T)......Page 295
Removing Nodes from the LinkedList(T)......Page 299
Obtaining Information on the LinkedList(T)......Page 301
Summary......Page 303
Using the Queue(T) Class......Page 305
Creating a Queue......Page 306
Removing Items from the Queue......Page 307
Checking the Queue......Page 308
Cleaning the Queue......Page 309
Creating a Stack......Page 310
Adding Items to the Stack......Page 311
Removing Items from the Stack......Page 312
Checking the Stack......Page 313
Dictionary(TKey,TValue) Overview......Page 314
Using the Dictionary(TKey,TValue) Class......Page 315
Creating a Dictionary......Page 316
Adding Items to a Dictionary......Page 319
Removing Items from a Dictionary......Page 320
Retrieving Values from the Dictionary by Using a Key......Page 321
Checking the Dictionary......Page 323
Creating a BitArray......Page 328
Accessing Bits in the BitArray Class......Page 330
Using the BitArray Class for Bit Operations......Page 332
CollectionBase and DictionaryBase Overview......Page 338
Using CollectionBase......Page 339
Using DictionaryBase......Page 346
Creating a HashSet(T)......Page 351
Adding Items to the HashSet(T)......Page 352
Removing Items from a HashSet(T)......Page 353
Performing Set Operations on a HashSet(T)......Page 355
SortedDictionary(TKey, TValue)......Page 361
Summary......Page 363
Part 3: Using Collections......Page 365
Enumerators (IEnumerable and IEnumerator) Overview......Page 367
ArrayEx(T)......Page 371
CircularBuffer(T)......Page 377
SingleLinkedList(T) and DoubleLinkedList(T)......Page 382
QueuedArray(T)......Page 389
QueuedLinkedList(T)......Page 395
StackedArray(T)......Page 396
StackedLinkedList(T)......Page 401
AssociativeArrayAL(TKey,TValue)......Page 407
AssociativeArrayHT(TKey,TValue)......Page 413
ICollection and ICollection(T) Overview......Page 419
ArrayEx(T)......Page 420
CircularBuffer(T)......Page 423
SingleLinkedList(T) and DoubleLinkedList(T)......Page 425
QueuedArray(T)......Page 430
QueuedLinkedList(T)......Page 433
StackedArray(T)......Page 434
StackedLinkedList(T)......Page 437
AssociativeArrayAL(TKey,TValue)......Page 439
AssociativeArrayHT(TKey,TValue)......Page 444
IList and IList(T) Overview......Page 450
ArrayEx(T)......Page 451
IDictionary(TKey,TValue) Overview......Page 456
Adding Key/Value Pair Support to Classes......Page 457
AssociativeArrayAL(TKey,TValue)......Page 458
AssociativeArrayHT(TKey,TValue)......Page 459
Summary......Page 461
What Is LINQ?......Page 463
Potential LINQ Data Sources......Page 464
What You Should Know About Query Execution......Page 465
Getting Started with LINQ......Page 471
Additions to the .NET Language for LINQ......Page 473
Picking a Data Source (from Clause) and Selecting Results (select Clause)......Page 475
Filtering Results (the where Clause)......Page 480
Ordering Results (the orderby Clause)......Page 482
The group Clause......Page 483
The join Clause......Page 485
The let Clause......Page 488
Summary......Page 490
What Is a Thread?......Page 491
Why Should I Care About Thread Synchronization?......Page 492
Why Not Write Thread Synchronization Code As Needed?......Page 496
Interlocked Operations......Page 497
Signaling......Page 498
Locking......Page 500
Adding Synchronization Support to Your Collection Classes......Page 502
Getting Started......Page 503
SyncRoot vs. the Synchronized Wrapper Class (IsSynchronized)......Page 505
Using the Monitor Class......Page 509
Using the ReaderWriterLockSlim Class......Page 512
Using Upgradeable Locks......Page 522
Implementing a Synchronized Wrapper Class......Page 526
SynchronizedCollection(T)......Page 533
Summary......Page 534
Applying the Serializable Attribute......Page 535
Controlling Serialization Behavior......Page 539
Adding Serialization Support to Collection Classes......Page 543
The ArrayEx(T) Class......Page 544
The Linked List Classes......Page 546
The Associative Array Classes......Page 550
The Queue Classes......Page 554
The Stack Classes......Page 555
Summary......Page 557
Part 4: Using Collections with UI Controls......Page 559
Simple Binding......Page 561
Two-Way Data Binding......Page 562
Implementing the IBindingList Interface......Page 563
Implementing the IBindingListView Interface......Page 584
Using the BindingList(T) Class......Page 596
Using the BindingSource Class......Page 597
Binding with the ComboBox Control......Page 598
Binding with the ListBox Control......Page 599
Binding with the DataGridView Control and IBindingList......Page 600
Binding with the DataGridView Control and IBindingListView......Page 602
Binding with the BindingSource Object......Page 603
Summary......Page 604
Implementing the INotifyCollectionChanged Interface......Page 605
Notifying the User of Cleared Items......Page 612
Resolving Problems with the Recursive Collection Change Event......Page 613
Using the ObservableCollection(T) Class......Page 615
Handling Recursive Collection Change Events......Page 617
ICollectionView and CollectionView Overview......Page 618
When to Use BindingListCollectionView......Page 619
Binding with the ComboBox Control......Page 620
Binding with the ListBox Control......Page 622
Binding with the ListView Control......Page 623
Binding with the TreeView Control......Page 625
Binding with the CollectionView Class......Page 627
Summary......Page 631
Index......Page 633
📜 SIMILAR VOLUMES
Put .NET collections to work - and manage issues with GUI data binding, threading, data querying, and storage. Led by a data collection expert, you'll gain task - oriented guidance, exercises, and extensive code samples to tackle common problems and improve application performance. This one-stop ref
<P style="MARGIN: 0px">“This book is a great reference for web designers new to ASP.NET who are looking to jump start their development with </P> <P style="MARGIN: 0px">Visual Web Developer 2008.”</P> <P style="MARGIN: 0px">Mikhail Arkhipov</P> <P style="MARGIN: 0px">Principal Development Manager
Content: <br>Acknowledgments</span></a></h3>, <i>Page v</i><br>Contributors</span></a></h3>, <i>Pages vii-x</i><br>Technical Reviwer</span></a></h3>, <i>Page xi</i><br>Technical Editor and Series Editor</span></a></h3>, <i>Page xi</i><br>About the Web Site</span></a></h3>, <i>Page xii</i><br>Forewor
Learn how to apply the concepts and techniques of Test-Driven Development (TDD) to writing software for Microsoft .NET. Two experts in agile software development teach-using a wealth of pragmatic examples in C# and other .NET development tools-how to use automated tests to drive lean, efficient codi