Before you begin: Before creating a new class you need to decide on a class ID and a display name. You should also think about if your class should have any properties.
For more information, consult the Management Pack Content document, section Workflow/Element naming.
If the project is not open in Visual Studio, open it.
Right-click the project name in the solution explorer and choose
Add\New folder. The name of the folder should be same as the description part of the Class ID. So if the full Class ID is
MyCompany.TestMP.3.0.ExportServiceApplicationComponent.Class, the folder would be named
Right-click the new folder and choose
In the list, select
Empty Management Pack Fragment.
Enter a name for the fragment. This should be the same as the folder you created before. Click
Add. The fragment is created and opened.
Right-click between the
<ManagementPackFragment> tags and select
MPDevToolkit\Classes\Application Component. Depending on how many properties the class should have, choose the corresponding Computer Role snippet.
Pick one with a dependency monitor. If you don't want a dependency monitor, there's a seperate snippet/guide for that.
Appcliation Component guide
The code is inserted.
Enter the MPID and press
Enter the class name. This is the description part of the class ID and should be the same as the folder you created.
If you have choosen a snippet for a class with one or more properties, do the following step for each property. Otherwise, skip this step and continue with Source Class Name.
Enter the name of the property and press
tab. Choose a type for the property. If it is a string, just press
tab. Otherwise, press
Backspace and then press
Ctrl-Space. A list of possible types are shown. Pick one and press
Repeat this for each property.
Enter the description part of the name for the source class for the relationship. This is the class that is hosting the application component. The name entered here is only used to clarify the relationship. It's not used to create the relationship.
For example, if the application component is to be hosted by the
WindowsComputer. Or if you created another class called
IntegrationServerComputerRole. Or remove the base class from the description and just enter 'IntegrationServer'. All of these examples makes it fairly easy to understand which class is the source class.
Enter the class ID of the source class. This is the full ID of the source class and is used to create the relationship. To use intellisense, press
Backspace and then
Enter the ID of the parent monitor. This is under which aggregate rollup monitor the dependency monitor will show up. Press
Ctrl+Space to use Intellisense.
Enter the ID of the member monitor. This is the monitor that the dependency monitor will depend on. It will mirror this monitors health.
Enter the Class display name you decided on earlier. Press
tab. Enter a class description. Press
If you have choosen a snippet for a class with one or more properties, do the following step for each property. Otherwise, skip this and continue to the last step.
The property name is automatically entered as display name. But enter a short description of the property and press
tab. Repeat this for each property.
enter to stop editing the snippet. The class has now been created.
Save the file/project.