Advanced VB Programming Constructs

PM Milestone Project Management Templates

PM Milestone 7000 Project Management Templates

Get Instant Access

chapter 9 Working with Interface Types 255

Understanding Interface Types 255

Defining Custom Interfaces 257

Implementing an Interface 259

Interacting with Types Supporting Interfaces 262

Resolving Name Clashes with the Implements Keyword 268

Building Enumerable Types (IEnumerable and IEnumerator) 273

Building Comparable Objects (IComparable) 280

Using Interfaces As a Callback Mechanism 285

Summary 289

chapter 10 Collections, Generics, and Nullable Data Types 291

The Nongeneric Types of System.Collections 291

System.Collections.Specialized Namespace 298

Understanding Boxing and Unboxing Operations 298

Type Safety and Strongly Typed Collections 302

The System.Collections.Generic Namespace 307

Understanding Nullable Data Types and the System.Nullable(Of T)

Generic Type 310

Creating Generic Methods 313

Creating Generic Structures (or Classes) 316

Creating a Custom Generic Collection 317

Creating Generic Interfaces 323

Creating Generic Delegates 324

Summary 326

chapter 11 Delegates, Events, and Lambdas 327

Understanding the .NET Delegate Type 327

The Simplest Possible Delegate Example 331

Retrofitting the Car Type with Delegates 334

Understanding (and Using) Events 339

Defining a "Prim-and-Proper" Event 345

Defining Strongly Typed Events 347

Customizing the Event Registration Process 348

Visual Basic Lambda Expressions 352

Summary 357

chapter 12 Operator Overloading and Custom Conversion Routines. . . 359

Understanding Operator Overloading 359

The Details of Value Types and Reference Types 365

Creating Custom Conversion Routines 374

Defining Implicit Conversion Routines 377

The VB DirectCast Keyword 378

Summary 381

chapter 13 VB 2008-Specific Language Features 383

Understanding Implicit Data Typing 383

Understanding Extension Methods 391

Understanding Object Initializer Syntax 399

Understanding Anonymous Types 403

Summary 408

chapter 14 An Introduction to LINQ 409

Understanding the Role of LINQ 409

A First Look at LINQ Query Expressions 412

LINQ and Generic Collections 417

LINQ and Nongeneric Collections 419

The Internal Representation of LINQ Query Operators 420

Investigating the VB LINQ Query Operators 424

LINQ Queries: An Island unto Themselves? 432

Summary 433

part 4 ■■■ Programming with .NET Assemblies chapter 15 Introducing .NET Assemblies 437

The Role of .NET Assemblies 437

Understanding the Format of a .NET Assembly 439

Constructing Custom .NET Namespaces 443

Building and Consuming a Single-File Assembly 448

Building and Consuming a Multifile Assembly 457

Understanding Private Assemblies 460

Understanding Shared Assemblies 466

Consuming a Shared Assembly 471

Configuring Shared Assemblies 473

Understanding Publisher Policy Assemblies 477

Understanding the <codeBase> Element 478

The System.Configuration Namespace 480

Summary 481

chapter 16 Type Reflection, Late Binding, and Attribute-Based

Programming 483

The Necessity of Type Metadata 483

Understanding Reflection 487

Building a Custom Metadata Viewer 490

Dynamically Loading Assemblies 494

Reflecting on Shared Assemblies 496

Understanding Late Binding 498

Understanding Attributed Programming 500

Building Custom Attributes 505

Assembly-Level (and Module-Level) Attributes 507

Reflecting on Attributes Using Early Binding 509

Reflecting on Attributes Using Late Binding 510

Putting Reflection, Late Binding, and Custom Attributes in Perspective 511

Building an Extendable Application 511

Summary 516

chapter 17 Processes, AppDomains, and Object Contexts 517

Reviewing Traditional Win32 Processes 517

Interacting with Processes Under the .NET Platform 519

Understanding .NET Application Domains 526

Understanding Object Context Boundaries 531

Summarizing Processes, AppDomains, and Context 535

Summary 536

chapter 18 Building Multithreaded Applications 537

The Process/AppDomain/Context/Thread Relationship 537

A Brief Review of the .NET Delegate 539

The Asynchronous Nature of Delegates 541

Invoking a Method Asynchronously 542

The System.Threading Namespace 547

The System.Threading.Thread Class 548

Programmatically Creating Secondary Threads 551

The Issue of Concurrency 556

Programming with Timer Callbacks 562

Understanding the CLR ThreadPool 564

The Role of the BackgroundWorker Component 565

Summary 569

chapter 19 .NET Interoperability Assemblies 571

The Scope of .NET Interoperability 571

A Simple Example of .NET to COM Interop 572

Investigating a .NET Interop Assembly 575

Understanding the Runtime Callable Wrapper 578

The Role of COM IDL 580

Late Binding to the CoCalc Coclass 586

Building a More Interesting VB6 COM Server 587

Examining the Interop Assembly 590

Understanding COM to .NET Interoperability 593

The Role of the CCW 595

The Role of the .NET Class Interface 596

Building Your .NET Types 597

Generating the Type Library and Registering the .NET Types 600

Examining the Exported Type Information 601

Building a Visual Basic 6.0 Test Client 602

Summary 603

part 5 ■■■ Introducing the .NET Base Class Libraries chapter 20 File and Directory Manipulation 607

Exploring the System.IO Namespace 607

The Directory(Info) and File(Info) Types 608

Working with the DirectoryInfo Type 609

Working with the Directory Type 613

Working with the DriveInfo Class Type 614

Working with the FileInfo Class 615

Working with the File Type 618

The Abstract Stream Class 620

Working with StreamWriters and StreamReaders 623

Working with StringWriters and StringReaders 626

Working with BinaryWriters and BinaryReaders 627

Programmatically "Watching" Files 629

Performing Asynchronous File I/O 631

Summary 632

chapter 21 Introducing Object Serialization 633

Understanding Object Serialization 633

Configuring Objects for Serialization 636

Choosing a Serialization Formatter 637

Serializing Objects Using the BinaryFormatter 639

Serializing Objects Using the SoapFormatter 640

Serializing Objects Using the XmlSerializer 641

Persisting Collections of Objects 644

Customizing the Serialization Process 645

Summary 651

chapter 22 ADO.NET Part I: The Connected Layer 653

A High-Level Definition of ADO.NET 653

Understanding ADO.NET Data Providers 655

Additional ADO.NET Namespaces 658

The Types of the System.Data Namespace 658

Abstracting Data Providers Using Interfaces 663

Creating the AutoLot Database 665

The ADO.NET Data Provider Factory Model 671

Understanding the Connected Layer of ADO.NET 677

Working with Data Readers 682

Building a Reusable Data Access Library 684

Creating a Console UI-Based Front End 692

Asynchronous Data Access Using SqlCommand 697

An Introduction to Database Transactions 698

Summary 703

chapter 23 ADO.NET Part II: The Disconnected Layer 705

Understanding the Disconnected Layer of ADO.NET 705

Understanding the Role of the DataSet 706

Working with DataColumns 709

Working with DataRows 711

Working with DataTables 715

Binding DataTable Objects to User Interfaces 720

Filling DataSet/DataTable Objects Using Data Adapters 730

Revisiting AutoLotDAL.dll 733

Navigating Multitabled DataSet Objects 736

The Data Access Tools of Visual Studio 2008 742

Decoupling Autogenerated Code from the UI Layer 753

Summary 756

chapter 24 Programming with the LINQ APIs 759

The Role of LINQ to ADO.NET 759

Programming with LINQ to DataSet 760

Programming with LINQ to SQL 765

Generating Entity Classes Using sqlmetal.exe 770

Building Entity Classes Using Visual Studio 2008 776

Programming with LINQ to XML 779

The Integrated XML Support of Visual Basic 2008 781

Programmatically Creating XML Elements 783

Programmatically Creating XML Documents 785

Generating Documents from LINQ Queries 787

Loading and Parsing XML Content 788

Navigating an In-Memory XML Document 789

Summary 794

chapter 25 Introducing Windows Communication Foundation 795

A Potpourri of Distributed Computing APIs 795

The Role of WCF 801

Investigating the Core WCF Assemblies 804

The Visual Studio WCF Project Templates 805

The Basic Composition of a WCF Application 807

The ABCs of WCF 808

Building a WCF Service 813

Hosting the WCF Service 816

Building the WCF Client Application 824

Using the WCF Service Library Project Template 826

Hosting the WCF Service As a Windows Service 829

Invoking a Service Asynchronously 833

Designing WCF Data Contracts 835

Summary 841

chapter 26 Introducing Windows Workflow Foundation 843

Defining a Business Process 843

The Building Blocks of WF 844

WF Assemblies, Namespaces, and Projects 850

Building a Simple Workflow-Enabled Application 852

Examining the WF Engine Hosting Code 856

Invoking Web Services Within Workflows 859

Building a Reusable WF Code Library 873

A Brief Word Regarding Custom Activities 878

Summary 879

Was this article helpful?

0 0
Project Management Made Easy

Project Management Made Easy

What you need to know about… Project Management Made Easy! Project management consists of more than just a large building project and can encompass small projects as well. No matter what the size of your project, you need to have some sort of project management. How you manage your project has everything to do with its outcome.

Get My Free Ebook


Post a comment