次の方法で共有


IRunConfigurationCustomHostEditor Interface

[This documentation is for preview only, and is subject to change in later releases. Blank topics are included as placeholders.]

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)

Syntax

'Declaration
Public Interface IRunConfigurationCustomHostEditor _
    Inherits IRunConfigurationEditor
public interface IRunConfigurationCustomHostEditor : IRunConfigurationEditor
public interface class IRunConfigurationCustomHostEditor : IRunConfigurationEditor
type IRunConfigurationCustomHostEditor =  
    interface 
        interface IRunConfigurationEditor 
    end
public interface IRunConfigurationCustomHostEditor extends IRunConfigurationEditor

The IRunConfigurationCustomHostEditor type exposes the following members.

Properties

  Name Description
Public property Description Gets the description of this configuration editor. (Inherited from IRunConfigurationEditor.)
Public property HelpKeyword Gets the Help keyword for this configuration editor. (Inherited from IRunConfigurationEditor.)
Public property HostType Gets the name of the host.

Top

Methods

  Name Description
Public method GetData Retrieves persisted host configuration data.
Public method Initialize Initializes this configuration editor by using objects from the testing framework. (Inherited from IRunConfigurationEditor.)
Public method OnCommonDataDirty Handles the event that occurs when common test run configuration data has been modified outside the editor. (Inherited from IRunConfigurationEditor.)
Public method SetData Persists host-specific data for this editor.
Public method VerifyData Verifies the data in the editor and prompts the user, if it is required. (Inherited from IRunConfigurationEditor.)

Top

Events

  Name Description
Public event DataGetDirty The event that is raised by the editor when the data in the editor is changed by the user. (Inherited from IRunConfigurationEditor.)

Top

Remarks

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.

Examples

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. 
    }
}

See Also

Reference

Microsoft.VisualStudio.TestTools.Vsip Namespace

UserControl

UserControl

UserControl

Other Resources

Configuring Host Adapters and Test Types