IT tutorials
 
Applications Server
 

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

11/19/2011 5:16:08 PM
- How To Install Windows Server 2012 On VirtualBox
- How To Bypass Torrent Connection Blocking By Your ISP
- How To Install Actual Facebook App On Kindle Fire

2. 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. Tables 1 and 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)Gets or sets the selected schema name
TargetNamespace (inherited from Schema)Gets or sets the target namespace of the selected schema

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 1, 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, and so on).

In the example from the preceding section, you want your developer to select only one schema, but what if your developer needs multiple schemas, for example, to handle different message formats in one component? 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 the screen shown in Figure 2.

Figure 1. SchemaWithNone example in VS .NET

Figure 2. SchemaList example in VS .NET

2.1. 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 . 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.

2.1.1. 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. Figure 3 shows the effect of these attributes. 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


Figure 3. DisplayName and Description attributes set
 
Others
 
- BizTalk 2009 : Creating More Complex Pipeline Components (part 1) - Dynamically Promoting Properties and Manipulating the Message Context
- Microsoft Dynamics GP 2010 : Tailoring SmartLists by adding Fields
- Microsoft Dynamics GP 2010 : Controlling data with SmartList Record Limits
- Upgrading and Configuring SharePoint 2010 : Configuring a content database
- Upgrading and Configuring SharePoint 2010 : Creating and associating content databases to a specific web application and site collection
- Administering Active Directory Domain Services : Working with Active Directory Snap-ins (part 2) - Saving and Distributing a Custom Console
- Administering Active Directory Domain Services : Working with Active Directory Snap-ins (part 1)
- Microsoft Dynamic CRM 2011 : Canceling and Reopening a Service Request Case
- Microsoft Dynamic CRM 2011 : Resolving a Service Request Case
- Systems Management Server 2003 : Server Modifications After Installation
 
 
Top 10
 
- Microsoft Visio 2013 : Adding Structure to Your Diagrams - Finding containers and lists in Visio (part 2) - Wireframes,Legends
- Microsoft Visio 2013 : Adding Structure to Your Diagrams - Finding containers and lists in Visio (part 1) - Swimlanes
- Microsoft Visio 2013 : Adding Structure to Your Diagrams - Formatting and sizing lists
- Microsoft Visio 2013 : Adding Structure to Your Diagrams - Adding shapes to lists
- Microsoft Visio 2013 : Adding Structure to Your Diagrams - Sizing containers
- Microsoft Access 2010 : Control Properties and Why to Use Them (part 3) - The Other Properties of a Control
- Microsoft Access 2010 : Control Properties and Why to Use Them (part 2) - The Data Properties of a Control
- Microsoft Access 2010 : Control Properties and Why to Use Them (part 1) - The Format Properties of a Control
- Microsoft Access 2010 : Form Properties and Why Should You Use Them - Working with the Properties Window
- Microsoft Visio 2013 : Using the Organization Chart Wizard with new data
programming4us programming4us
 
Popular tags
 
Video Tutorail Microsoft Access Microsoft Excel Microsoft OneNote Microsoft PowerPoint Microsoft Project Microsoft Visio Microsoft Word Active Directory Biztalk Exchange Server Microsoft LynC Server Microsoft Dynamic Sharepoint Sql Server Windows Server 2008 Windows Server 2012 Windows 7 Windows 8 Adobe Indesign Adobe Flash Professional Dreamweaver Adobe Illustrator Adobe After Effects Adobe Photoshop Adobe Fireworks Adobe Flash Catalyst Corel Painter X CorelDRAW X5 CorelDraw 10 QuarkXPress 8 windows Phone 7 windows Phone 8 BlackBerry Android Ipad Iphone iOS