Add a Tab to Settings

 

Updated: October 4, 2012

Applies To: Windows Server 2012 Essentials, Windows Server 2012 R2 Essentials

You can add a tab to Settings on the Dashboard by creating and installing a code assembly that is used by the Settings Manager in operating system.

Add a tab to Settings

You add a tab to Settings by performing the following tasks:

Add an implementation of the ISettingsData interface to the assembly

The ISettingsData interface is included in the Microsoft.WindowsServerSolutions.Settings namespace of the AdminCommon.dll assembly which is located in \Program Files\Windows Server\Bin.

To add the ISettingsData code to the assembly
  1. Open Visual Studio 2010 as an administrator by right-clicking the program in the Start menu and selecting Run as administrator.

  2. Click File, click New, and then click Project.

  3. In the New Project dialog box, click Visual C#, click Class Library, enter DashboardSettingsPage for the name for the solution, and then click OK.

Important

The assembly that is installed on the server must be named DashboardSettingsPage.dll and then copy the dll to %ProgramFiles%\Windows Server\Bin\OEM.

  1. Create the control that you want to be used in the tab. In this example the settings control is named MySettingsControl.

  2. Rename the Class1.cs file. For example, MySettingTab.cs.

  3. Add a reference to the AdminCommon.dll file.

  4. Add the following using statement:

    using Microsoft.WindowsServerSolutions.Settings;
    
  5. Change the namespace and the class header to match the following example:

    namespace DashboardSettingsPage
    {
        public class MySettingTab : ISettingsData
        {
        }
    }
    
  6. Instantiate an instance of the control that you created for the tab. For example:

    private MySettingsControl tab;
    
  7. Add the constructor for the class. The following code example shows the constructor:

    public MySettingTab()
    {
       tab = new MySettingsControl();
    }
    
  8. Add the Commit method, which submits the setting changes. The following code example shows the Commit method:

    void ISettingsData.Commit(bool dismissed)
    {
       // Implement the code that is required to submit your setting changes
    }
    
  9. Add the TabControl method, which identifies the control for the tab. The following code example shows the TabControl method:

    System.Windows.Forms.Control ISettingsData.TabControl
    {
       get { return tab; }
    }
    
  10. Add the TabId method, which provides a unique identifier for the tab. The following code example shows the TabId method:

    private Guid id = Guid.NewGuid();
    
    Guid ISettingsData.TabId
    {
       get { return id; }
    }
    
  11. Add the TabOrder method, which returns the order of the tab. The following code example shows the TabOrder method:

    int ISettingsData.TabOrder
    {
       get { return 0; }
    }
    

Note

The tab order is defined by using numbers starting at 0. The Microsoft built-in settings tabs are displayed first and then your tabs are displayed based on the tab order that you define. For example, if you have three settings tabs, you specify the tab order as 0, 1, and 2 based on the order that you want the tabs to be displayed.

  1. Add the TabTitle method, which provides the title of the tab. The following code example shows the TabTitle method:

    string ISettingsData.TabTitle
    {
      get { return "My Settings Tab"; }
    }
    

Note

The title text can also come from a resource file to accommodate localization needs.

  1. Save and build the solution.

Sign the assembly with an Authenticode signature

You must Authenticode sign the assembly for it to be used in the operating system. For more information about signing the assembly, see Signing and Checking Code with Authenticode.

Install the assembly on the reference computer

After you successfully build the solution, place a copy of the DashboardSettingsPage.dll file in the following folder on the reference computer:

%Programfiles%\Windows Server\Bin\OEM

See Also

Creating and Customizing the Image Additional Customizations Preparing the Image for Deployment Testing the Customer Experience