Share via


DataCollectorNotifications Class

Used by custom test adapters to raise events for diagnostic data adapters.

Inheritance Hierarchy

Object
  Microsoft.VisualStudio.TestTools.Execution.DataCollectorNotifications

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

Syntax

'Declaration
Public MustInherit Class DataCollectorNotifications
public abstract class DataCollectorNotifications
public ref class DataCollectorNotifications abstract
[<AbstractClass>]
type DataCollectorNotifications =  class end
public abstract class DataCollectorNotifications

The DataCollectorNotifications type exposes the following members.

Constructors

  Name Description
Protected method DataCollectorNotifications Initializes a new instance of the DataCollectorNotifications class.

Top

Methods

  Name Description
Public method Equals Determines whether the specified object is equal to the current object. (Inherited from Object.)
Protected method Finalize Allows an object to try to free resources and perform other cleanup operations before it is reclaimed by garbage collection. (Inherited from Object.)
Public method GetHashCode Serves as the default hash function. (Inherited from Object.)
Public method GetType Gets the Type of the current instance. (Inherited from Object.)
Protected method MemberwiseClone Creates a shallow copy of the current Object. (Inherited from Object.)
Public method RaiseCustomEvent(CustomNotificationEventArgs) Raises a custom event by using the provided event arguments.
Public method RaiseCustomEvent(CustomNotificationEventArgs, NotificationBroadcastLevel) Raises a custom event by using the provided event arguments and indication of broadcast level.
Public method RaiseCustomEventAsync(CustomNotificationEventArgs) Asynchronously raises a custom event by using the provided event arguments.
Public method RaiseCustomEventAsync(CustomNotificationEventArgs, NotificationBroadcastLevel) Asynchronously raises a custom event by using the provided event arguments and indication of broadcast level.
Public method RaiseCustomEventAsync(CustomNotificationEventArgs, NotificationBroadcastLevel, Object) Asynchronously raises a custom event by using the provided event arguments, indication of broadcast level, and user token.
Public method RaiseTestFailedEvent Raises a TestCaseFailed event to notify diagnostic data adapters that the test case has failed.
Public method ToString Returns a string that represents the current object. (Inherited from Object.)

Top

Events

  Name Description
Public event CustomEventCompleted Raised by the testing framework when a diagnostic data adapter has finished handling an asynchronous event.

Top

Examples

To use a DataCollectorNotifications object in a custom test adapter class, you first add the IDataCollectionAwareTestAdapter to the class declaration for your derived test adapter.

public class MyTestAdapter : ITestAdapter, IDataCollectionAwareTestAdapter

Then in your test adapter code, you create a DataCollectors property that returns a DataCollectorNotifications object.

public DataCollectorNotifications DataCollectors { get; set; }

You can then use this object to raise events for diagnostic data adapters.

DataCollectors.RaiseCustomEvent(
    new MyCustomDataEventArgs(), 
    NotificationBroadCastLevel.All);

Thread Safety

Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.

See Also

Reference

Microsoft.VisualStudio.TestTools.Execution Namespace

DataCollectors

ITestAdapter

DataCollector

DataCollectorNotifications

Other Resources

Creating a Diagnostic Data Adapter to Collect Custom Data or Affect a Test Machine