Book Image

Microsoft SharePoint 2010 Developer's Compendium: The Best of Packt for Extending SharePoint

Book Image

Microsoft SharePoint 2010 Developer's Compendium: The Best of Packt for Extending SharePoint

Overview of this book

The SharePoint platform is ideal for developers looking to build exciting solutions, and SharePoint 2010 is more equipped than ever for the task. While plenty of SharePoint titles will help you understand general SharePoint development techniques or spend time focusing on one method or tool, "Microsoft SharePoint 2010 Developer's Compendium: The Best of Packt for Extending SharePoint" offers you the option of using four different tools and platforms to achieve exceptional end user experience. This book fills the gap for a comprehensive SharePoint title which describes the end goal of a SharePoint developer. So often books focus on development techniques for one tool; this will get you on your way to developing a good business website with a great user experience, however, you choose to get there, be it using PowerShell, Visual Studio, Silverlight, Windows 7 Phone, or a combination of all four. "Microsoft SharePoint 2010 Developer's Compendium: The Best of Packt for Extending SharePoint" draws from five separate titles from Packt's existing collection of excellent SharePoint titles: Microsoft SharePoint 2010 and Windows PowerShell 2.0: Expert Cookbook Microsoft Silverlight 4 and SharePoint 2010 Integration Microsoft SharePoint 2010 Development with Visual Studio 2010 Expert Cookbook Microsoft SharePoint 2010 Enterprise Applications on Windows Phone 7 Microsoft SharePoint 2010 Business Application Development Blueprints "Microsoft SharePoint 2010 Developer's Compendium: The Best of Packt for Extending SharePoint" is an exciting mash-up of five existing Packt SharePoint titles for extending development techniques. It begins with two never before seen Packt chapters from an exciting new title, giving you a quick overview of the options available for extending SharePoint. It then moves on quickly to building a community site and discusses PowerShell scripting, as well as integrating Silverlight animations and helping you get to grips with SharePoint development on Windows Phone. With this book in hand you won't just find techniques for one development tool, you'll learn how to reach your end goal of developing a site with great user experience using a number of options at your fingertips.
Table of Contents (15 chapters)
Microsoft SharePoint 2010 Developer's Compendium: The Best of Packt for Extending SharePoint
Credits
About the Contributors
www.PacktPub.com
Preface

Creating custom content type using an object model


In the previous recipe, we extended a content type using an XML schema. This can get pretty difficult as Visual Studio does not provide ways to debug the XML schemas. Instead of using the xml schema method, you can always use object model APIs to create the content type. In this recipe we will do just that.

For this recipe, we will create a new content type called Project Proposal that has four custom columns Amount, Department, Project Start Date, and Project End Date. The Department field is a choice type where you can select the department to which the project belongs. The Amount field is of currency type and the Project Start Date and the Project End Date are of DateTime type. The content type will be inherited from the document content type.

Getting ready

You should have completed the previous recipes successfully.

How to do it...

  1. 1. Launch your Visual Studio 2010 IDE as an administrator (right-click the shortcut and select Run...