Share via


Example Code: Reading Forms Tool Properties

Applies to: SharePoint Workspace 2010 | Visual Studio 2008

This C# example code demonstrates how to test if a Forms tool has a specific design template name and version. The code does the following:

  • Calls the ReadToolProperties operation.

  • Tests whether the design template name matches the one defined for the Customizable Discussion tool.

  • Isolates the major version number from the template version number string and then compares it to the expected version number.

// First create the GrooveForms2 service and 
// verify that the tool is initialized.

GrooveForms2.ToolProperties toolProps = forms2Svc.ReadToolProperties();

// Test whether the design URN matches that of a Discussion tool 
if (toolProps.DesignTemplateName ==
    "urn:groove.net.platform.tools.forms.CustomizableDiscussion")
{
    // The tool was created from Discussion tool template
    // Check the version
    string[] Version = toolProps.DesignTemplateVersion.Split('.');
    
    if (Version[0] == "2")
    {
        // Major version matches, do work here
    }
}

See Also

Reference

GrooveForms2.IsFormsToolDesignInitialized Operation

GrooveForms2.ReadToolProperties Operation

GrooveTools Web Service

Concepts

Example Code: Testing Whether the Forms Tool Design Is Initialized

Accessing Forms Tool Design Information

Testing Whether the Forms Tool Design Has Been Initialized

Identifying the Forms Tool

Getting Information About Forms