Practical code generation in .NET : covering Visual Studio 2005, 2008, and 2010 /
"Once this skill is within your everyday comfort zone, it will give your productivity a boost and increase your value to your team. I encourage you to add the techniques outlined in this book to your toolset and to use them to develop your own workbench of generative tools. In doing so, I'...
Clasificación: | Libro Electrónico |
---|---|
Autor principal: | |
Formato: | Electrónico eBook |
Idioma: | Inglés |
Publicado: |
Upper Saddle River, N.J. :
Addison-Wesley,
©2010.
|
Temas: | |
Acceso en línea: | Texto completo (Requiere registro previo con correo institucional) |
Tabla de Contenidos:
- 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.
- 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.