80 likes | 240 Views
Extensions in Visual Studio .Net 2008. Using Visual Basic By Jim Fouch Fouch Software. Extensions in Visual Studio .Net 2008. What are Extensions? Why should I care? How can they help me as a developer? What are the prerequisites and how do I Implement Extensions? Examples Pitfalls.
E N D
Extensions in Visual Studio .Net 2008 Using Visual Basic By Jim Fouch Fouch Software
Extensions in Visual Studio .Net 2008 • What are Extensions? • Why should I care? • How can they help me as a developer? • What are the prerequisites and how do I Implement Extensions? • Examples • Pitfalls
Extensions in Visual Studio .Net 2008 • What are Extensions? • Extensions are a way of extending a Sub or Function to all instances of class and any classes that inherit that class.
Extensions in Visual Studio .Net 2008 • Why should I care? • They can save you much effort. • Extensions will help you be more efficient by centralizing your code. • Help you build an easy to implement library of often used Subs/Functions. • Extending the functionality of Classes that can not be inherited such as the String Class. • They are Cool!
Extensions in Visual Studio .Net 2008 • How can they help me as a developer? • Extensions will make your code more manageable, easier to read and understood yourself and others. • Extensions are easily shared by teams because prior knowledge of each Extension is not required. • Intellisense will provide team members with your Extensions when they use Classes you have extended .
Extensions in Visual Studio .Net 2008 • What are the prerequisites and how do I Implement Extensions? • Extensions must exist in a Module • The module must Import the System.Runtime.CompilerServices class • Must define Extended class as first parameter.
Extensions in Visual Studio .Net 2008 • Examples • Exists/DoesnotExist
Extensions in Visual Studio .Net 2008 • Pitfalls • Overloaded Extensions do not show a different Icon in Intellisense. • Use caution when passing the Extended class ByRef.