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
collectionIList<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
pduTPdu
Returns
- TPdu
Type Parameters
TPdu
ClonePDU<TPdu>(TPdu[])
public static TPdu[] ClonePDU<TPdu>(this TPdu[] array) where TPdu : SmppPDU
Parameters
arrayTPdu[]
Returns
- TPdu[]
Type Parameters
TPdu
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
databyte[]The byte array of the data.
mapperEncodingMapperThe EncodingMapper to act on.
Returns
- TPdu
A SMPP PDU.
Type Parameters
TPduType 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
requestsIEnumerable<TRequest>The requests list to process.
sequenceGeneratorISequenceGeneratorThe sequence generator.
Returns
- IEnumerable<TRequest>
A list of SMPP requests.
Type Parameters
TRequestType of the SMPP request.
Exceptions
- ArgumentNullException
Thrown when
sequenceGeneratoris 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
pduSmppPDUThe PDU to act on.
encodingMapperEncodingMapperThe encoding mapper.
Returns
- byte[]
A byte array