SDM Manager Generator (SdmG.exe)

The SDM Manager Generator (SdmG.exe) is an SDK tool that helps developers build abstract SDM models for use with Visual Studio . The SDM Manager Generator creates portions of the code that would otherwise need to be created manually. The SDM Manager Generator covers code generation for common developer scenarios.

SdmManagerGenerator.exe filename [/Reference ref] [/SearchPath path]
         [/Classes[+|-] [file]] [/Resources[+|-] [file]]
         [/Settings[+|-]] [/Flows[+|-]] [/Constraints[+|-]]       
         [/ErrorLimit limit] [/WarningAsError level] 
         [/WarningReported level] 
         [/Nologo] [/Help]

Arguments

  • filename
    The .sdm file to use to generate manager code. This file should be source code.

  • /Reference ref
    Short form: /R

    Reference definitions in another document. The referenced document should be a compiled .sdm file.

  • /SearchPath path
    Short form: /S

    The search path for references in this list of directories.

  • /Classes[+|-] [file]
    By default, classes are generated and written to a file in the current directory with the same file name as the source file but with a .cs extension. The /Classes argument is used either to suppress the generation of classes or to specify a different destination file name.

    Note  If /Classes- is used the /Settings, /Flows, and /Constraints arguments are ignored.

    Example to suppress class generation: /Classes-

    Example to specify a file name: /Classes+ [file]

  • /Resources[+|-] [file]
    By default, resources are generated and written to a file in the current directory with the same file name as the source file but with a .resources extension. The /Resources argument is used either to suppress the generation of resources or to specify a different destination file name.

    Example to suppress resource generation: /Resources-

    Example to specify file name: /Resources+ [file]

  • /Settings[+|-]
    By default, settings are generated and written to a file in the current directory with the same file name as the source file but with a .cs extension. The /Settings argument is used to suppress the generation of settings.

    Note  This argument is ignored if /Classes- is used.

    Example to suppress setting generation: Settings-

  • /Flows[+|-]
    By default flows are generated and written to a file in the current directory with the same file name as the source file but with a .cs extension. The /Flows argument is used to suppress the generation of flows.

    Note  This argument is ignored if /Classes- is used.

    Example to suppress flow generation: /Flows-

  • /Constraints[+|-]
    By default, constraints are generated and written to a file in the current directory with the same file name as the source file but with a .cs extension. The /Constraints argument is used to suppress the generation of constraints.

    Note  This argument is ignored if /Classes- is used.

    Example to suppress constraint generation: /Constraints-

  • /ErrorLimit limit
    Limit on the number of errors printed, warnings not included. The default is 100.

  • /WarningAsError level
    The minimum warning level to treat as an error. The default is 0.

  • /WarningReported level
    Short form: /W

    The highest warning level to report. The default is 2.

  • /Nologo
    The copyright information is not displayed.

  • /Help
    Short form: /?

    Help is printed for this tool.

Remarks

Visual Studio 2005 Team Edition for Software Architects or Visual Studio Team System 2008 Architecture Edition must be installed to use the SDM command-line tools and compile the SDM samples.

Managers are the extension mechanism that the SDM runtime uses to support the addition of behavior to definitions. Setting, flow, constraint, object, and relationship definitions can all identify associated classes within managers that provide additional behavior. These classes can be used to support instance discovery and deployment.

Here is a simple scenario where the manager generator is used: A user creates a new SDM model containing setting constraint definitions. The model will not compile until the user creates corresponding CLR classes for the setting constraint definitions. The user runs the SDM manager generator to generate C# code, provides a constraint body implementation when required, and uses CsC.exe to build the manager.

The SDM Manager Generator performs much of the same validation that the SDM Command Line Compiler (SdmC.exe) performs. Thus, many of the compiler error messages can be returned by both tools. Also, the command-line arguments are similar for both tools because they both call the compiler API in the namespace Microsoft.SystemDefinitionModel.Tools.

Example Code

The following example creates C# code for a manager in a file named CollapseListProperties.cs . The C# code creates the manager that is generated from the Microsoft.Samples.CollapseList.sdm file that contains the flow definition.

SdmG.exe Microsoft.Samples.CollapseList.sdm /Flows+ /Classes:CollapseListProperties.cs

See Also

How to: Create an SDM Resource

Send comments about this topic to Microsoft

Build date: 9/5/2007