Content Source Plugins
Content source plugins extend the capabilities of Windows Live Writer to insert, edit, and publish new types of content.
Examples of content types that can be added to Writer by using content sources include:
-
Images from online photo publishing sites.
-
Embedded video or audio players.
-
Product thumbnails or links from e-commerce sites.
You can implement two types of content sources:
-
Simple—Enable the insertion of custom HTML content into a post. Simple content sources are derived from the ContentSource base class.
-
Smart—Enable the insertion of HTML content with "smart" editing capabilities into a post. These capabilities include atomic selection, two-way editing by using the Sidebar, the ability to be resized, and the ability to have distinct HTML representations for editing and publishing contexts. Smart content sources are derived from the SmartContentSource base class.
Content that is created by both simple and smart content sources can originate from an Insert dialog box, a URL, or Live Clipboard data. Each content source plugin can support the creation of content from one or all of these contexts. For each context that a plugin is to support, an attribute is added to its implementing class and a specific method is overridden:
-
Insert
dialog box—Add the InsertableContentSourceAttribute attribute and override the ContentSource.CreateContent or SmartContentSource.CreateContent method.
-
URL (Blog This or Paste)—Add the UrlContentSourceAttribute attribute and override the ContentSource.CreateContentFromUrl or SmartContentSource.CreateContentFromUrl method.
-
Live Clipboard (Paste)—Add the LiveClipboardContentSourceAttribute attribute and override the ContentSource.CreateContentFromLiveClipboard or SmartContentSource.CreateContentFromLiveClipboard method.
In addition to the content-creation plugin base classes and attributes just described, there are other, related types that are used for implementing advanced features of smart content sources. These types include:
-
SmartContentEditor Class—The base class for the Sidebar editor control, which is used for two-way editing of smart content sources.
-
SmartContentSource.ResizeCapabilities Property and ResizeOptions Class—These elements control the resizing behavior of smart content objects, along with the SmartContentSource methods OnResizeStart, OnResizing, and OnResizeComplete , all of which you can override.