Export (0) Print
Expand All

DataCollectorNotifications Class

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

System.Object
  Microsoft.VisualStudio.TestTools.Execution.DataCollectorNotifications

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

public abstract class DataCollectorNotifications

The DataCollectorNotifications type exposes the following members.

  NameDescription
Protected methodDataCollectorNotificationsInitializes a new instance of the DataCollectorNotifications class.
Top

  NameDescription
Public methodEqualsDetermines whether the specified Object is equal to the current Object. (Inherited from Object.)
Protected methodFinalizeAllows an object to try to free resources and perform other cleanup operations before it is reclaimed by garbage collection. (Inherited from Object.)
Public methodGetHashCodeServes as a hash function for a particular type. (Inherited from Object.)
Public methodGetTypeGets the Type of the current instance. (Inherited from Object.)
Protected methodMemberwiseCloneCreates a shallow copy of the current Object. (Inherited from Object.)
Public methodRaiseCustomEvent(CustomNotificationEventArgs)Raises a custom event by using the provided event arguments.
Public methodRaiseCustomEvent(CustomNotificationEventArgs, NotificationBroadcastLevel)Raises a custom event by using the provided event arguments and indication of broadcast level.
Public methodRaiseCustomEventAsync(CustomNotificationEventArgs)Asynchronously raises a custom event by using the provided event arguments.
Public methodRaiseCustomEventAsync(CustomNotificationEventArgs, NotificationBroadcastLevel)Asynchronously raises a custom event by using the provided event arguments and indication of broadcast level.
Public methodRaiseCustomEventAsync(CustomNotificationEventArgs, NotificationBroadcastLevel, Object)Asynchronously raises a custom event by using the provided event arguments, indication of broadcast level, and user token.
Public methodRaiseTestFailedEventRaises a TestCaseFailed event to notify diagnostic data adapters that the test case has failed.
Public methodToStringReturns a string that represents the current object. (Inherited from Object.)
Top

  NameDescription
Public eventCustomEventCompletedRaised by the testing framework when a diagnostic data adapter has finished handling an asynchronous event.
Top

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);

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

Community Additions

ADD
Show:
© 2014 Microsoft