NetDataContractSerializer.NetDataContractSerializer(StreamingContext) Constructor

Initializes a new instance of the NetDataContractSerializer class with the supplied streaming context data.

Namespace: System.Runtime.Serialization
Assembly: System.Runtime.Serialization (in system.runtime.serialization.dll)

public NetDataContractSerializer (
	StreamingContext context
public NetDataContractSerializer (
	StreamingContext context
public function NetDataContractSerializer (
	context : StreamingContext
Not applicable.



A StreamingContext that contains context data.

The StreamingContext class allows you to pass in user-specific context data to use while reading and writing objects.

The following example creates an instance of the NetDataContractSerializer using a StreamingContext.

public static void Constructor2()
    // Create an instance of the StreamingContext to hold
    // context data.
    StreamingContext sc = new StreamingContext
    // Create a DatatContractSerializer with the collection.
    NetDataContractSerializer ser2 = new NetDataContractSerializer(sc);

    // Other code not shown.

Windows 98, Windows Server 2000 SP4, Windows Millennium Edition, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition

The Microsoft .NET Framework 3.0 is supported on Windows Vista, Microsoft Windows XP SP2, and Windows Server 2003 SP1.

.NET Framework

Supported in: 3.0

Community Additions