.NET Event Tracing Class Library  

EventTraceOperationObserver Class

This class is used to control the asynchronous operation and monitoring of an event tracing analysis session.

For a list of all members of this type, see EventTraceOperationObserver Members.

System.Object
    WmiSolutions.EventTracing.Consumer.EventTraceOperationObserver

[Visual Basic]
Public Class EventTraceOperationObserver Inherits Object
[C#]
public class EventTraceOperationObserver : Object
[C++]
public __gc class EventTraceOperationObserver : public Object

Example

[C#]
    using System;
    using WmiSolutions.EventTracing;
    using WmiSolutions.EventTracing.Consumer;

    EventTraceLogFile file = new EventTraceLogFile(@"C:\SomeLogFile.etl");

    MyHandler handler = new MyHandler();
    file.EndOfBuffer += new EndOfBufferEventHandler(handler.EndOfBufferHandler); 
    file.TraceEvent += new TraceEventHandler(handler.TraceEventHandler); 

    EventTraceProcessLogs process = new EventTraceProcessLogs();
    process.AddTrace(file);

    EventTraceOperationObserver observer = new EventTraceOperationObserver();
    MyProcessHandler procHandler = new MyProcessHandler();
    observer.Completed += new CompletedEventHandler(procHandler.CompletedHandler); 
    process.Process(observer);

    Console.WriteLine("Waiting 10 seconds...");
    System.Threading.Thread.Sleep(10000);

    Console.WriteLine("Waited too long, cancelling...");
    observer.Cancel();

    process.CloseAllTraces();
    
[Visual Basic]

    Imports System
    Imports WmiSolutions.EventTracing
    Imports WmiSolutions.EventTracing.Consumer
 
    Dim file As EventTraceLogFile =  New EventTraceLogFile("C:\SomeLogFile.etl") 
 
    Dim handler As MyHandler =  New MyHandler() 
    AddHandler file.EndOfBuffer, AddressOf handler.EndOfBufferHandler
    AddHandler file.TraceEvent, AddressOf handler.TraceEventHandler
 
    Dim process As EventTraceProcessLogs =  New EventTraceProcessLogs() 
    process.AddTrace(file)
 
    Dim observer As EventTraceOperationObserver =  New EventTraceOperationObserver() 
    Dim procHandler As MyProcessHandler =  New MyProcessHandler() 
    AddHandler observer.Completed, AddressOf procHandler.CompletedHandler

    process.Process(observer)
 
    Console.WriteLine("Waiting 10 seconds...");
    System.Threading.Thread.Sleep(10000)

    Console.WriteLine("Waited too long, cancelling...");
    observer.Cancel();
 
    process.CloseAllTraces()
    

Requirements

Namespace: WmiSolutions.EventTracing.Consumer

Platforms: Windows 2000, Windows XP Home Edition, Windows XP Professional, Windows Server 2003 family

Assembly: WmiSolutions.EventTracing.Consumer (in WmiSolutions.EventTracing.dll)

 

See Also

TraceMessageEventArgs Members | TraceEventFieldBitmaskCollection Members | TraceEventFieldBitmask Members | TraceEventField Members | TraceEventArgs Members | EventTraceRealTimeLog Members | EventTraceProcessLogs Members | EventTraceOperationObserver Members | EventTraceMessage Members | EventTraceLogFile Members | EventTraceFieldCollection Members | EventTraceEvent Members | EndOfBufferEventArgs Members | CompletedEventArgs Members

Contact Me   |  Developing WMI Solutions    |   Gwyn Cole's Developer Blog    |   Legal
 © 2003 Content by Gwyn Cole. All rights reserved.