Logo
Windows XP
Windows Vista
Windows 7
Windows Azure
Windows Server
Windows Phone
PREGNANCY
 
 
Windows Server

BizTalk 2006 : Creating More Complex Pipeline Components (part 2) - Schema Selection in VS .NET Designer

8/3/2014 9:34:14 PM

Schema Selection in VS .NET Designer

The property MyDocSpec in the previous section's MyProber class is actually of type SchemaWithNone. SchemaWithNone is a class that lives in the Microsoft.BizTalk. Component.Utilities.dll assembly. Defining a property of type SchemaWithNone will give the user a drop-down list of all deployed schemas within the current BizTalk Management Database. The class has one public constructor, SchemaWithNone, which initializes a new instance of the SchemaWithNone class. Table 1 and Table 2 list the public properties and methods of the class.

Table 1. SchemaWithNone Public Properties
PropertyDescription
AssemblyName(inherited from Schema)Gets or sets the schema assembly name
DocSpecName (inherited from Schema)Gets or sets the document spec name for the selected schema
RootName (inherited from Schema)Gets or sets the root node of the selected schema
SchemaName (inherited from Schema)GGets or sets the selected schema name
TargetNamespace (inherited from Schema)Gets or sets the selected schema name

Table 2. SchemaWithNone Public Methods
MethodDescription
Equals(inherited from Schema)Overridden. Determines whether the specified Object is equal to the current Object.
GetHashCode(inherited from Schema)Overridden. Returns the hash code for this instance.
GetType (inherited from System.Object)For additional information about the System namespace, see the .NET Framework documentation available from Visual Studio .NET or online at http://go.microsoft.com/fwlink/?LinkID=9677.
ToString (inherited from Schema)Overridden. Converts the value of this instance to its equivalent string representation using the specified format.

As you can see in Figure 2, the properties for the SchemaWithNone class are available in the IDE. If you notice the InboundDocSpec property, it is a list of all the schemas that are currently deployed to the BizTalk solution. The SchemaWithNone property allows you to select one and only one schema from the deployed schemas, and this information will be used to populate the properties of the object as defined previously (AssemblyName, DocSpecName, etc.).

In the example from the preceding section, you want your developer to select only one schema, but what if your developer needs multiple? In many cases, your component will be able to handle a variety of schemas; in this case, you need to use the SchemaList property.

In the case where your property needs to select multiple schemas, you need to use the SchemaList object. Such an object will provide developers with an associate window from which they can choose multiple schemas. The selected schemas will be available as a collection of schemas within a main class. The IDE will present a screen as shown in Figure 3.

SchemaWithNone example in VS .NET

SchemaList example in VS .NET

Decorating Your Properties

It is important to consider the usability of your components from within the Visual Studio IDE. If you simply expose a public property from within your pipeline component, two things will happen. First, the property name that is displayed in the IDE will be the name of the property (in Figure 1 earlier, this would be InboundDocumentList, etc.). Second, there is no public description for what the property actually does. In order to make your components usable, you can use custom attributes to decorate your properties with metadata so that the developer experience is improved. The two main attributes you can use to do this are described next.

Using the DisplayName and Description Attributes

The DisplayName attribute allows you to set the name for the property that will be displayed in the IDE. The Description attribute sets the description box within the VS .NET designer to a friendly description. The effect of these attributes is shown in Figure 4. The following code snippet demonstrates how these attributes are to be used:

'<summary>
'this property will contain a single schema
'</summary>
<Description("The inbound request document specification. Only messages of this _
type will be accepted by the component.")> _
<DisplayName("Inbound Specification")> _
Public Property InboundFileDocumentSpecification() As _
Microsoft.BizTalk.Component.Utilities.SchemaWithNone
Get
Return _InboundFileDocumentSpecification
End Get
Set(ByVal Value As Microsoft.BizTalk.Component.Utilities.SchemaWithNone)
_ InboundFileDocumentSpecification = Value
End Set
End Property


DisplayName and Description attributes set

Other -----------------
- BizTalk 2006 : Custom Components (part 2) - Key BizTalk API Objects
- BizTalk 2006 : Custom Components (part 1) - Component Categories, Component Interfaces
- Microsoft Exchange Server 2010 : Getting Started with Email Archiving - Enabling Archiving (part 2) - Using Exchange 2010 Discovery, Offline Access
- Microsoft Exchange Server 2010 : Getting Started with Email Archiving - Enabling Archiving (part 1) - Archive Quotas , Exchange 2010 Discovery Operation Considerations
- Microsoft Exchange Server 2010 : Getting Started with Email Archiving - Placing a Mailbox on Retention Hold, Litigation or Legal Hold
- Microsoft Exchange Server 2010 : Getting Started with Email Archiving - Exchange Server 2010 Email Archiving - Policies
- Microsoft Exchange Server 2010 : Getting Started with Email Archiving - Industry Best Practices
- Microsoft Exchange Server 2010 : Getting Started with Email Archiving - Archiving
- Microsoft Exchange Server 2007 : Implementing Client Access and Hub Transport Servers - Installing the Hub Transport Server
- Microsoft Exchange Server 2007 : Implementing Client Access and Hub Transport Servers - Transport Pipeline
- Microsoft Exchange Server 2007 : Hub Transport Server Policy Compliance Features (part 4) - Message Classification , Rights Management and the Hub Transport Server
- Microsoft Exchange Server 2007 : Hub Transport Server Policy Compliance Features (part 3) - Journaling
- Microsoft Exchange Server 2007 : Hub Transport Server Policy Compliance Features (part 2) - Disclaimers
- Microsoft Exchange Server 2007 : Hub Transport Server Policy Compliance Features (part 1) - Transport Rules
- Microsoft Exchange Server 2007 : Implementing Client Access and Hub Transport Servers - Understanding the Hub Transport Server
- Sharepoint 2013 : Office 2013 and an Overview of Integration (part 5) - Live Co-Authoring,Document Information Panel
- Sharepoint 2013 : Office 2013 and an Overview of Integration (part 4) - SkyDrive and SkyDrive Pro
- Sharepoint 2013 : Office 2013 and an Overview of Integration (part 3) - SkyDrive and Office 365
- Sharepoint 2013 : Office 2013 and an Overview of Integration (part 2) - Opening and Saving to SharePoint
- Sharepoint 2013 : Office 2013 and an Overview of Integration (part 1) - The Backstage Area
 
 
Most view of day
- Advanced Windows 7 Programming : Working in the Background - DEVELOPING TRIGGER-START SERVICES (part 7)
- Windows Phone 7 : 3D Game Development (part 1) - 3D Game Concepts
- Managing Windows 7 : Configuring a Pen or Touch Computer, Managing Pen Settings
- Adobe Dreamweaver CS5 : Using Library Items and Server-side Includes (part 2) - Using the Library Assets Panel - Inserting a Library item in your Web page
- Windows Server 2012 Group Policies and Policy Management : Understanding Group Policy (part 2) - Group Policy Link Enforcement, Group Policy Inheritance, Group Policy Block Inheritance
- System Center Configuration Manager 2007 : Creating and Modifying Configurations (part 5) - External Authoring, Authoring with CP Studio
- Microsoft Exchange Server 2010 : Managing Transport and Journaling Rules - Setting Up Message Classifications (part 2)
- Adobe Flash Catalyst CS5 : Applying and removing filters
- Microsoft PowerPoint 2010 : Animating Slide Content (part 1) - Choosing an Animation Effect
- Microsoft Exchange Server 2010 : Defining Email Addresses (part 3) - Email Address Policies - Creating a New Email Address Policy
Top 10
- Integrating SharePoint 2013 with the Office Applications (part 10) - Microsoft Outlook - Lists and Libraries
- Integrating SharePoint 2013 with the Office Applications (part 9) - Microsoft InfoPath - Customizing the Document Information Panel and List Forms
- Integrating SharePoint 2013 with the Office Applications (part 8) - Microsoft InfoPath -Deploying a Form Via Central Administration, Rendering a Form Using the InfoPath Form Web Part
- Integrating SharePoint 2013 with the Office Applications (part 7) - Microsoft Access - Access Services
- Integrating SharePoint 2013 with the Office Applications (part 6) - Microsoft Access
- Integrating SharePoint 2013 with the Office Applications (part 5) - Microsoft OneNote
- Integrating SharePoint 2013 with the Office Applications (part 3) - Microsoft Excel
- Integrating SharePoint 2013 with the Office Applications (part 3) - Microsoft Excel
- Integrating SharePoint 2013 with the Office Applications (part 2) - Microsoft Word - Compare Document Versions, Quick Parts
- Integrating SharePoint 2013 with the Office Applications (part 1) - Microsoft Word - Writing Blog Posts
 
 
Windows XP
Windows Vista
Windows 7
Windows Azure
Windows Server
Windows Phone
2015 Camaro