We recommend using Visual Studio 2017
This documentation is archived and is not being maintained.

IRunConfigurationCustomHostEditor Interface

Represents the required extensions to a user control for a custom editor in a host environment for editing test run configuration settings.

Namespace:  Microsoft.VisualStudio.TestTools.Vsip
Assembly:  Microsoft.VisualStudio.QualityTools.Vsip (in Microsoft.VisualStudio.QualityTools.Vsip.dll)

public interface IRunConfigurationCustomHostEditor : IRunConfigurationEditor

The IRunConfigurationCustomHostEditor type exposes the following members.

  NameDescription
Public propertyDescriptionGets the description of this configuration editor. (Inherited from IRunConfigurationEditor.)
Public propertyHelpKeywordGets the Help keyword for this configuration editor. (Inherited from IRunConfigurationEditor.)
Public propertyHostTypeGets the name of the host.
Top

  NameDescription
Public methodGetDataRetrieves persisted host configuration data.
Public methodInitializeInitializes this configuration editor by using objects from the testing framework. (Inherited from IRunConfigurationEditor.)
Public methodOnCommonDataDirtyHandles the event that occurs when common test run configuration data has been modified outside the editor. (Inherited from IRunConfigurationEditor.)
Public methodSetDataPersists host-specific data for this editor.
Public methodVerifyDataVerifies the data in the editor and prompts the user, if it is required. (Inherited from IRunConfigurationEditor.)
Top

  NameDescription
Public eventDataGetDirtyThe event that is raised by the editor when the data in the editor is changed by the user. (Inherited from IRunConfigurationEditor.)
Top

To display a new page in the test run configuration editor, implement the methods of the IRunConfigurationCustomHostEditor interface. The class that implements this interface must inherit from one of the user control classes:

This user control is displayed on the Hosts page in the test run configuration editor.

Your implementation of IRunConfigurationCustomHostEditor can be empty. This means that the implementations of all members other than the HostType property can be empty methods.

If your custom user control class contains user interface (UI) components, testers will see your user control when they take the following steps:

  1. Open the Hosts page of the test run configuration editor.

  2. In the Host type list, select a value that matches the value that is returned by the IRunConfigurationCustomHostEditor.HostType property.

For more information about the test run configuration editor, see How to: Configure Database Unit Test Execution.

For the complete code of the following example, see the MyHostAdapterRunConfigControl.cs file in the test extensibility sample in the Visual Studio SDK.

using System;
using System.Collections.Generic;
using System.Collections.Specialized;
using System.ComponentModel;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
using Microsoft.VisualStudio.TestTools.Common;
using Microsoft.VisualStudio.TestTools.Vsip;

namespace Microsoft.VisualStudio.TestTools.Samples
{
    /// <summary>
    /// UI control for my host adapter configuration. This control 
    /// is Hosted inside the test run configuration editor and 
    /// contains a data grid view where a user can define the 
    /// environment variables.
    /// </summary>
    public partial class MyHostAdapterRunConfigControl 
        : UserControl, IRunConfigurationCustomHostEditor
    {
        /// See the MyHostAdapterRunConfigControl.cs file in 
        /// the test extensibility sample. 
    }
}
Show: