Practical code generation in .NET covering Visual Studio 2005, 2008, and 2010

With Practical Code Generation in .NET, spend less time writing monotonous, repetitive code--leaving more time to address troublesome areas! Microsoft MVP Peter Vogel covers code generation with Visual Studio 2010, 2008, and 2005, as well as all recent versions of .NET, including .NET 4.0. You'...

Full description

Bibliographic Details
Main Author: Vogel, Peter
Format: eBook
Language:English
Published: Upper Saddle River, N.J. Addison-Wesley 2010
Subjects:
Online Access:
Collection: O'Reilly - Collection details see MPG.ReNa
Table of Contents:
  • Cover
  • Contents
  • Foreword
  • Preface
  • Acknowledgments
  • About the Author
  • Chapter 1 Introducing Code Generation
  • Repetitive Code: Your History
  • Copy-and-Paste
  • General-Purpose Code
  • Benefits of Code Generation
  • When to Use Code Generation
  • Best Practices in Code-Generation Solutions
  • Code-Generation Process
  • Code-Generation Tools
  • Model-Driven Architecture, Declarative Programming, and Code Generation
  • Model-Driven Architecture
  • Declarative Programming
  • PART I: TOOLS
  • Chapter 2 Integrating with Visual Studio
  • Design-Time Integration
  • Starting Your Visual Studio Add-In
  • Creating a Menu-Driven User Interface
  • Working with Visual Studio Windows
  • Responding to Events
  • Accepting Input
  • Integrating with Visual Studio
  • Chapter 3 Manipulating Project Components
  • The Code Model
  • Managing Projects and Solutions
  • Generating Code
  • Modifying and Analyzing Components
  • Processing Components in a File
  • Working with Retrieved Elements
  • Working with the CodeType Objects
  • Storing Information
  • Working with Project Components
  • Chapter 4 Modifying Code in the Editor
  • Opening and Closing Documents and TextDocuments
  • Backing Out Changes
  • Creating EditPoints to Access Text
  • Retrieving Information
  • Accessing Text with an EditPoint
  • Working with Bookmarks
  • Inserting, Replacing, and Formatting Text
  • Inserting and Reading Text
  • Chapter 5 Supporting Project-Specific Features
  • Introducing the VSLangProj Libraries
  • Managing a "Projectless" Website
  • Project-Specific Features
  • Chapter 6 Generating Language-Neutral Code
  • A Comprehensive Example
  • Declarations
  • Defining Classes
  • Class Members
  • Statements and Expressions
  • Code Structures
  • When All Else Fails: Code Snippets
  • Other Code Features
  • Code Providers
  • Generating Code
  • Includes bibliographical references and index
  • Chapter 7 Generating Code from Templates with T4
  • T4 in Visual Studio
  • T4 Code-Generation Strategies
  • Creating a T4 Template
  • Extending T4
  • Invoking Templates from Code
  • Leveraging Templates
  • Chapter 8 Other Tools: Templates, Attributes, and Custom Tools
  • Item Templates
  • Attributes
  • Generating Code from Custom File Formats
  • Reviewing the Tools
  • PART II: CASE STUDIES
  • Chapter 9 Case Study: Generating a Connection String Manager
  • Defining the Problem
  • Setting Up the Add-In
  • Creating the Code Generator
  • Customizing the Template
  • Generating Code
  • Reading Input
  • Notifying the Developer
  • Supporting Customization
  • Tying Generation to Events
  • Generating a Simple Class
  • Chapter 10 Case Study: Generating Validation Code
  • Defining the Problem
  • Starting the Code-Generation Project
  • Wiring Up the Add-In
  • Starting the Generation Utility
  • Defining a Template
  • Generating Code
  • Specifying Code with the CodeDom
  • Generating Code in the Target Language
  • Supporting "Projectless" Websites
  • Handling Errors
  • Building a Complete Code-Generation Solution
  • Chapter 11 Case Study: Generating Data-Conversion Code
  • Defining the Problem
  • Creating the Designer
  • Enhancing Model Validation
  • Generating Code
  • Distributing Your Designer
  • Visual Studio 2010 Additions
  • Capturing Inputs
  • PART III: APPENDIXES
  • Appendix A: Generating Menu Names
  • Appendix B: Options Dialog Categories, Subcategories, and Properties
  • Appendix C: A Code-Generation Add-In
  • Integrating Code-Generation Classes
  • Appendix D: Distributing Code-Generation Solutions
  • Creating the .vscontent File
  • A Complete Example
  • Installing the Solution
  • Index