Export (0) Print
Expand All
This topic has not yet been rated - Rate this topic

Add a Tab to Settings

Published: July 9, 2012

Updated: October 4, 2012

Applies To: Windows Server 2012 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.

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

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.

  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.

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

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

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

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

  7. Add the following using statement:

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

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

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

    
    public MySettingTab()
    {
       tab = new MySettingsControl();
    }
    
  11. 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
    }
    
  12. 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; }
    }
    
  13. 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; }
    }
    
  14. 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; }
    }
    
    noteNote
    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.

  15. 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"; }
    }
    
    noteNote
    The title text can also come from a resource file to accommodate localization needs.

  16. Save and build the solution.

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.

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

Did you find this helpful?
(1500 characters remaining)
Thank you for your feedback
Show:
© 2014 Microsoft. All rights reserved.