共用方式為


DataCollector.Initialize 方法

由測試架構呼叫,以初始化診斷資料配接器的內部物件和資料。

命名空間:  Microsoft.VisualStudio.TestTools.Execution
組件:  Microsoft.VisualStudio.QualityTools.ExecutionCommon (在 Microsoft.VisualStudio.QualityTools.ExecutionCommon.dll 中)

語法

'宣告
Public MustOverride Sub Initialize ( _
    configurationElement As XmlElement, _
    events As DataCollectionEvents, _
    dataSink As DataCollectionSink, _
    logger As DataCollectionLogger, _
    environmentContext As DataCollectionEnvironmentContext _
)
public abstract void Initialize(
    XmlElement configurationElement,
    DataCollectionEvents events,
    DataCollectionSink dataSink,
    DataCollectionLogger logger,
    DataCollectionEnvironmentContext environmentContext
)
public:
virtual void Initialize(
    XmlElement^ configurationElement, 
    DataCollectionEvents^ events, 
    DataCollectionSink^ dataSink, 
    DataCollectionLogger^ logger, 
    DataCollectionEnvironmentContext^ environmentContext
) abstract
abstract Initialize : 
        configurationElement:XmlElement * 
        events:DataCollectionEvents * 
        dataSink:DataCollectionSink * 
        logger:DataCollectionLogger * 
        environmentContext:DataCollectionEnvironmentContext -> unit 
public abstract function Initialize(
    configurationElement : XmlElement, 
    events : DataCollectionEvents, 
    dataSink : DataCollectionSink, 
    logger : DataCollectionLogger, 
    environmentContext : DataCollectionEnvironmentContext
)

參數

備註

當您建立自訂診斷資料配接器時,必須實作這個 Initialize 方法,您將會在其中註冊想要使用的事件。

.NET Framework 安全性

請參閱

參考

DataCollector 類別

Microsoft.VisualStudio.TestTools.Execution 命名空間

DataCollectionEvents

DataCollectionSink

DataCollectionLogger

DataCollectionEnvironmentContext