Aracılığıyla paylaş


PacketFactory Class

Used to get objects that implement IPacket.

Namespace:  Microsoft.SmartDevice.DeviceAgentTransport
Assembly:  Microsoft.SmartDevice.DeviceAgentTransport (in Microsoft.SmartDevice.DeviceAgentTransport.dll)

Syntax

'Declaration
Public NotInheritable Class PacketFactory
'Usage
You do not need to declare an instance of a static class in order to access its members.
public static class PacketFactory
public ref class PacketFactory abstract sealed
public final class PacketFactory

Remarks

Do not create objects of this type. The purpose of this class is to get objects that implement IPacket.

Examples

    packet = PacketFactory.GetNewPacket()

    ' Write the version of .NET Compact Framework into the packet.
    packet.WriteString("Hello Desktop Computer")
    packet.WriteInt32(Environment.Version.Major)
    packet.WriteInt32(Environment.Version.Minor)
    packet.WriteInt32(Environment.Version.Build)
    packet.WriteInt32(Environment.Version.Revision)

    ' Pass the packet to desktop application.
    packetStream.Write(packet)

End Sub 'Main
packet = PacketFactory.GetNewPacket();

// Write the version of .NET Compact Framework into the packet.
packet.WriteString("Hello Desktop Computer");
packet.WriteInt32(Environment.Version.Major);
packet.WriteInt32(Environment.Version.Minor);
packet.WriteInt32(Environment.Version.Build);
packet.WriteInt32(Environment.Version.Revision);

// Pass the packet to desktop application.
packetStream.Write(packet);

Inheritance Hierarchy

System.Object
  Microsoft.SmartDevice.DeviceAgentTransport.PacketFactory

Thread Safety

Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.

See Also

Reference

PacketFactory Members

Microsoft.SmartDevice.DeviceAgentTransport Namespace