BinaryMessageFormatter Constructors

Definition

Initializes a new instance of the BinaryMessageFormatter class.

Overloads

BinaryMessageFormatter()

Initializes a new instance of the BinaryMessageFormatter class without specifying a type style or top object assembly style.

BinaryMessageFormatter(FormatterAssemblyStyle, FormatterTypeStyle)

Initializes a new instance of the BinaryMessageFormatter class, specifying the formats of the root object and the type descriptions.

Remarks

Important

Calling methods from this class with untrusted data is a security risk. Call the methods from this class only with trusted data. For more information, see Validate All Inputs.

BinaryMessageFormatter()

Initializes a new instance of the BinaryMessageFormatter class without specifying a type style or top object assembly style.

C#
public BinaryMessageFormatter();

Remarks

You must specify values for the TopObjectFormat property (which defines how the root object in a graph is laid out) and the TypeFormat property (which defines how object type descriptions are laid out) before using an instance of the BinaryMessageFormatter class to serialize and send a message.

Applies to

.NET Framework 4.8.1 and other versions
Product Versions
.NET Framework 1.1, 2.0, 3.0, 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1

BinaryMessageFormatter(FormatterAssemblyStyle, FormatterTypeStyle)

Initializes a new instance of the BinaryMessageFormatter class, specifying the formats of the root object and the type descriptions.

C#
public BinaryMessageFormatter(System.Runtime.Serialization.Formatters.FormatterAssemblyStyle topObjectFormat, System.Runtime.Serialization.Formatters.FormatterTypeStyle typeFormat);

Parameters

topObjectFormat
FormatterAssemblyStyle

Determines how the top (root) object of a graph is laid out in the serialized stream.

typeFormat
FormatterTypeStyle

Determines how type descriptions are laid out in the serialized stream.

Applies to

.NET Framework 4.8.1 and other versions
Product Versions
.NET Framework 1.1, 2.0, 3.0, 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1