DataDirect XML Converters 5.0 Send comments on this topic.
ConverterListener Interface
See Also  Members  
DDTek.XmlConverter Namespace : ConverterListener Interface




This is the error reporting interface for Converter errors.

Syntax

Visual Basic (Declaration) 
Public Interface ConverterListener 
Visual Basic (Usage)Copy Code
Dim instance As ConverterListener
C# 
public interface ConverterListener 
Managed Extensions for C++ 
public __gc __interface ConverterListener 
C++/CLI 
public interface class ConverterListener 

Remarks

If an XML Converter application needs to implement customized error handling then it may implement this interface and register it with the Converter object. This may be done either by assigning a ConverterListener to the ConverterFactory in which case all Converters created from that ConverterFactory will share the same instance, or afterwards to an individual Converter, ConvertToXml or ConvertFromXml object.

One use might be simply to report warnings and errors encountered. A simple ConverterListener like the one below would do that:

            
using DDTek.XmlConverter;
namespace Custom {
    class ReportingListener : ConverterListener {

        public void Warning(ConverterException exception) {
            Console.WriteLine(exception.Message);
        }
        public void Error(ConverterException exception) {
            Console.WriteLine(exception.Message);
        }
        public void FatalError(ConverterException exception) {
            Console.WriteLine(exception.Message);
        }

    }
}

Currently, only the EDI converter supports the ConverterListener. If an application registers a ConverterListener with any converter other than an EDI converter, then it will be ignored.

Requirements

Target Platforms: Windows 98, Windows NT 4.0, Windows Millennium Edition, Windows 2000, Windows XP Home Edition, Windows XP Professional, Windows Server 2003 family, Windows Vista, Windows Server 2008 family

See Also

© 2009 All Rights Reserved.