| Introduction | 1 |
| The Code in This Book | 2 |
| Conventions | 2 |
| Customer Support | 3 |
| How to Download the Sample Code for the Book | 3 |
| Errata | 3 |
| E-Mail Support | 3 |
| p2p.wrox.com | 4 |
| Why This System Offers the Best Support | 4 |
| Chapter 1: Features at a Glance | 7 |
| The idea behind SharpDevelop | 8 |
| SharpDevelop Software Requirements | 8 |
| SharpDevelop's Panels and Views | 9 |
| Limitations | 12 |
| Customizing SharpDevelop | 12 |
| Internationalization | 12 |
| Defining the Appearance | 13 |
| Customizations for Coding | 14 |
| Getting Started with Templates | 14 |
| Changing Syntax Highlighting | 14 |
| Code Completion and Method Insight | 15 |
| Bookmarks | 16 |
| Search and Replace Functionality | 16 |
| Compiling the Code | 17 |
| Managing Projects | 17 |
| Combines and Projects - What's in a Name? | 17 |
| Navigating the Project | 17 |
| The Project and Class Views of the World | 18 |
| Creating Windows Forms | 18 |
| Adding Controls to Windows Forms | 19 |
| Properties and Formatting of Controls | 20 |
| Summary | 20 |
| Chapter 2: Designing the Architecture | 23 |
| History of Architectural Design Decisions | 23 |
| The Early Stages | 23 |
| Building SharpDevelop with SharpDevelop | 24 |
| Correcting Bad Design Decisions | 26 |
| The Design Decisions | 27 |
| Designing Component-Exchangeability | 29 |
| Best Practices | 30 |
| Design Patterns | 30 |
| Singleton | 31 |
| Factory | 31 |
| Decorator | 33 |
| Strategy | 35 |
| Memento | 36 |
| Proxy | 37 |
| Coding Style Guideline | 39 |
| Defect Tracking and Testing | 39 |
| Bug Tracker | 39 |
| Unit Tests | 40 |
| Refactor Frequently | 41 |
| Design and Refactoring | 42 |
| Summary | 48 |
| Chapter 3: Implementing the Core | 51 |
| The AddIn Tree | 52 |
| Advantages of Using the AddIn Tree | 53 |
| The AddIn Tree Superstructure | 56 |
| Add-in Definition | 57 |
| From Tree Node to Running Object | 60 |
| Codon Creation | 62 |
| Conditions | 64 |
| AddIn Management | 66 |
| Property Management in SharpDevelop | 70 |
| The Idea behind the IXmlConvertable Interface | 71 |
| Overview of the IProperties Interface | 71 |
| The Default Implementation | 72 |
| Properties at Work | 75 |
| Property Persistence | 76 |
| Summary | 79 |
| Chapter 4: Building the Application with Add-ins | 81 |
| Working with Codons | 82 |
| The ICommand Interface | 82 |
| Making Menus Work | 85 |
| Codon Overview | 93 |
| Wiring up Add-ins with Conditions | 96 |
| Condition Structure | 97 |
| Defining Conditions | 98 |
| Overview of Available Conditions | 100 |
| Summary | 104 |
| Chapter 5: Providing Functionality with Workspace Services | 107 |
| Implementation Considerations | 107 |
| Requirements for Services | 108 |
| The ServiceManager | 109 |
| Defining Services | 111 |
| Common Services at your Service | 112 |
| File Utility Service | 113 |
| Property Service | 119 |
| Resource Service | 119 |
| String Parser Service | 119 |
| Ambience Service | 121 |
| Class Browser Icons Service | 123 |
| File Service | 124 |
| Project Service | 126 |
| Parser Service | 131 |
| Other Services | 133 |
| Summary | 133 |
| Chapter 6: The User Interface | 135 |
| Display Management | 136 |
| The Workbench Window | 136 |
| Views | 137 |
| Pads | 139 |
| Views and Pads Applied - An Integrated HTML Help Viewer | 141 |
| The HTML View | 142 |
| Navigating the Help File | 148 |
| Layout Managers | 153 |
| The Current and Future Implementation | 166 |
| Summary | 167 |
| Chapter 7: Internationalization | 169 |
| Handling Internationalization in SharpDevelop | 171 |
| Redrawing with Events | 173 |
| Accessing Resources | 176 |
| Managing Translations | 180 |
| The Translation Web Application | 181 |
| Localization Implications | 182 |
| Compiling to Resource Files | 182 |
| Generating Resource Files from XML | 182 |
| Generating Resource Files from the Database | 184 |
| Summary | 186 |
| Chapter 8: Document Management | 189 |
| Text Representation | 190 |
| Basic Sequence Data Structures | 190 |
| Arrays | 190 |
| Linked Lists | 192 |
| The Gap Buffer Approach | 192 |
| Theory of the Gap Buffer | 193 |
| The Gap Buffer in Practice | 194 |
| The Future - The Piece Table | 197 |
| Composite Sequence Data Structures | 198 |
| Representing Lines | 199 |
| Caret and Selection Management | 206 |
| The Text Model | 210 |
| Putting It All Together | 212 |
| Summary | 216 |
| Chapter 9: Syntax Highlighting | 219 |
| Syntax Highlighting Definitions | 220 |
| Increasing Ease of Use with XML | 220 |
| Implementing Syntax Highlighting | 226 |
| Validation of the Syntax Highlighting Definition File | 226 |
| The Sequence of Events from the Opening of a File to the Highlighting of the Text Editor Window | 231 |
| Summary | 233 |
| Chapter 10: Search and Replace | 235 |
| The Search Strategy | 235 |
| Inside Search and Replace | 249 |
| Basic Find and Replace Implementation | 249 |
| Using Algorithms | 252 |
| The Brute Force Algorithm | 254 |
| The Knuth-Morris-Pratt (KMP) Algorithm | 256 |
| Wildcard Search Strategy | 257 |
| Summary | 260 |
| Chapter 11: Writing the Editor Control | 263 |
| Introduction to the Editor | 263 |
| The TextArea Control | 265 |
| Theory | 265 |
| Getting Started | 266 |
| Event Handling | 272 |
| Updating | 277 |
| The TextAreaPainter | 279 |
| Mouse Management | 285 |
| Folding | 286 |
| SharpPad | 287 |
| Summary | 289 |
| Chapter 12: Writing the Parser | 291 |
| Need for a Parser | 291 |
| Parser and Language Theory | 292 |
| Basic Definitions and Theory | 292 |
| Grammar | 292 |
| Parsing | 295 |
| Technical Requirements | 296 |
| The SharpDevelop Parser | 297 |
| Design Decisions | 297 |
| Implementation | 298 |
| The Big Picture | 298 |
| Reflection Parsing for Assemblies | 299 |
| Persistent Parsing for the Framework Class Library | 304 |
| The C# Parser for the Editor | 309 |
| The Abstract Parser | 316 |
| Putting It All Together in the Parser Service | 318 |
| Summary | 326 |
| Chapter 13: Code Completion and Method Insight | 329 |
| Resolving Matters | 329 |
| Code Completion | 340 |
| Method Insight | 357 |
| Summary | 366 |
| Chapter 14: Navigating Code with the Class Scout and the Assembly Scout | 369 |
| The Class Scout | 369 |
| Implementing the Class Scout | 370 |
| The Assembly Scout | 383 |
| Browsing References with an Assembly Scout | 383 |
| Writing the Assembly Scout | 385 |
| Summary | 411 |
| Chapter 15: The Designer Infrastructure | 413 |
| Forms Designer Overview | 413 |
| Implementation Considerations | 414 |
| Design Overview | 415 |
| The .NET Component Model | 416 |
| The Service Interfaces | 418 |
| .NET Designers | 419 |
| The Root Designer | 420 |
| Designer Host Implementation | 421 |
| Designer Host Services | 431 |
| The ComponentChangeService | 431 |
| The Name Creation Service | 432 |
| The Design Panel | 433 |
| Summary | 434 |
| Chapter 16: Implementing a Windows Forms Designer | 437 |
| Designer Services | 437 |
| Toolbox Service | 438 |
| Menu Command Service | 442 |
| Executing the Standard Commands | 446 |
| Implementing a Key Event Handler | 447 |
| Selection Service | 450 |
| Additional Important Services | 454 |
| Designer Option Service | 455 |
| Dictionary Service | 457 |
| UI Service | 457 |
| Type Descriptor Filter Service | 460 |
| Unimplemented Services | 462 |
| Summary | 462 |
| Chapter 17: Code Generation | 465 |
| Making Components Persistent | 465 |
| The XML Forms Persistence Format | 466 |
| Generating the XML | 467 |
| Loading the XML | 470 |
| The Designer Serialization Service | 474 |
| Generating C#/VB.NET Code | 475 |
| Round-tripping | 484 |
| Summary | 496 |
| Index | 499 |