//------------------------------------------------------------------------------
//
// Copyright (c) Microsoft Corporation. All rights reserved.
//
//------------------------------------------------------------------------------
using System;
using System.ComponentModel;
namespace Experimental.System.Messaging
{
///
///
/// The functions defined in this interface are used to
/// serailize and deserialize objects into and from
/// MessageQueue messages.
///
[TypeConverterAttribute(typeof(System.Messaging.Design.MessageFormatterConverter))]
public interface IMessageFormatter : ICloneable
{
///
///
/// When this method is called, the formatter will attempt to determine
/// if the contents of the message are something the formatter can deal with.
///
bool CanRead(Message message);
///
///
/// This method is used to read the contents from the given message
/// and create an object.
///
object Read(Message message);
///
///
/// This method is used to write the given object into the given message.
/// If the formatter cannot understand the given object, an exception is thrown.
///
void Write(Message message, object obj);
}
}