Snippet Guides

New Network Node

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 MP Content document, section Class naming.

Class naming


If the project is not open in Visual Studio, open it.


Add new folder
Right-click the project 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.TemperatureSensorNetworkNode.Class, the folder would be named TemperatureSensorNetworkNode.



Add new item
Right-click the new folder and choose Add\New Item....
In the list, select Empty Management Pack Fragment.



Enter fragment name
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.


Choose snippet
Right-click between the <ManagementPackFragment> tags and select Insert snippet. Choose MPDevToolkit\Classes\Network Node. Depending on how many properties the class should have, choose the corresponding Network Node snippet. The code is inserted.



Enter MPID and class name
Enter the MPID and press tab. Enter the class name. This is the description part of the class ID and should be the same as the folder you created earlier.

Press tab.


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 Class Display Name.


Enter property 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 enter.
Repeat this for each property.


Enter display name and description
Enter the Class display name you decided on earlier. Press tab. Enter a class description. Press tab.


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.

Enter property description
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.


Press enter to stop editing the snippet. The class has now been created.
Save the file/project.

Version: 1.0
Created: 2016-05-30, 08:03