Class PduExtension
Extension methods for PDU classes.
public static class PduExtension
- Inheritance
-
PduExtension
- Inherited Members
Methods
ClonePDU<TPdu>(IList<TPdu>)
Make a deep copy for each of the PDU object in the collection.
public static IList<TPdu> ClonePDU<TPdu>(this IList<TPdu> collection) where TPdu : SmppPDU
Parameters
collection
IList<TPdu>
Returns
- IList<TPdu>
Type Parameters
TPdu
ClonePDU<TPdu>(TPdu)
Make a deep copy of the PDU object.
public static TPdu ClonePDU<TPdu>(this TPdu pdu) where TPdu : SmppPDU
Parameters
pdu
TPdu
Returns
- TPdu
Type Parameters
TPdu
ClonePDU<TPdu>(TPdu[])
public static TPdu[] ClonePDU<TPdu>(this TPdu[] array) where TPdu : SmppPDU
Parameters
array
TPdu[]
Returns
- TPdu[]
Type Parameters
TPdu
Deserialize<TPdu>(ArraySegment<byte>, EncodingMapper)
An extension method that deserialize a byte array into SMPP PDU.
public static TPdu Deserialize<TPdu>(this ArraySegment<byte> data, EncodingMapper mapper) where TPdu : SmppPDU
Parameters
data
ArraySegment<byte>The byte array of the data.
mapper
EncodingMapperThe EncodingMapper to act on.
Returns
- TPdu
A SMPP PDU.
Type Parameters
TPdu
Type of the PDU.
Deserialize<TPdu>(byte[], EncodingMapper)
An extension method that deserialize a byte array into SMPP PDU.
public static TPdu Deserialize<TPdu>(this byte[] data, EncodingMapper mapper) where TPdu : SmppPDU
Parameters
data
byte[]The byte array of the data.
mapper
EncodingMapperThe EncodingMapper to act on.
Returns
- TPdu
A SMPP PDU.
Type Parameters
TPdu
Type of the PDU.
EnsureReferenceNumber<TRequest>(IEnumerable<TRequest>, ISequenceGenerator)
Help method that ensures that reference number in concatenated message segments. Sets same reference number for all items in requests
.
This method doesn't change reference number if it is already defined (not 0).
public static IEnumerable<TRequest> EnsureReferenceNumber<TRequest>(this IEnumerable<TRequest> requests, ISequenceGenerator sequenceGenerator) where TRequest : SmppRequest
Parameters
requests
IEnumerable<TRequest>The requests list to process.
sequenceGenerator
ISequenceGeneratorThe sequence generator.
Returns
- IEnumerable<TRequest>
A list of SMPP requests.
Type Parameters
TRequest
Type of the SMPP request.
Exceptions
- ArgumentNullException
Thrown when
sequenceGenerator
is not defined.
Serialize(SmppPDU, EncodingMapper)
A extension method that serialize SMPP PDU to the byte array.
public static byte[] Serialize(this SmppPDU pdu, EncodingMapper encodingMapper)
Parameters
pdu
SmppPDUThe PDU to act on.
encodingMapper
EncodingMapperThe encoding mapper.
Returns
- byte[]
A byte array