Пример #1
0
        /// <summary>
        /// Clones this UnsuccessAddress.
        /// </summary>
        /// <returns>The cloned object.</returns>
        public object Clone()
        {
            UnsuccessAddress temp = new UnsuccessAddress(
                _destinationAddressTon, _destinationAddressNpi, _destinationAddress, _errorStatusCode);

            return(temp);
        }
Пример #2
0
        /// <summary>
        /// Checks to see if two UnsuccessAddresses are equal.
        /// </summary>
        /// <param name="obj">The UnsuccessAddresses to check</param>
        /// <returns>true if obj and this are equal</returns>
        public override bool Equals(object obj)
        {
            if (obj == null)
            {
                return(false);
            }

            if (this.GetType() != obj.GetType())
            {
                return(false);
            }

            // safe because of the GetType check
            UnsuccessAddress us = (UnsuccessAddress)obj;

            // value member check
            return
                (_destinationAddressTon.Equals(us._destinationAddressTon) &&
                 _destinationAddressNpi.Equals(us._destinationAddressNpi) &&
                 _destinationAddress.Equals(us._destinationAddress) &&
                 _errorStatusCode.Equals(us._errorStatusCode));
        }
Пример #3
0
 /// <summary>
 /// Clones this UnsuccessAddress.
 /// </summary>
 /// <returns>The cloned object.</returns>
 public object Clone()
 {
     UnsuccessAddress temp = new UnsuccessAddress(
         _DestinationAddressTon, _DestinationAddressNpi, _DestinationAddress, _ErrorStatusCode);
     return temp;
 }
Пример #4
0
        /// <summary>
        /// Decodes the submit_multi response from the SMSC.
        /// </summary>
        protected override void DecodeSmscResponse()
        {
            DecodeNonTlv();

            byte[] remainder = base.ResponseAfterMsgId;
            //the SMSC might not send back the number of unsuccessful messages,
            //so check if it did
            if(remainder.Length > 0)
            {
                _NumberUnsuccessful = remainder[0];
                UnsuccessfulAddresses = new UnsuccessAddress[NumberUnsuccessful];
                long length = remainder.Length - 1;
                byte[] newRemainder = new byte[length];
                Array.Copy(remainder, 1, newRemainder, 0, length);
                remainder = newRemainder;
                newRemainder = null;
                //unsuccessful
                for(int i = 0; i < UnsuccessfulAddresses.Length; i++)
                {
                    _UnsuccessfulAddresses[i] = new UnsuccessAddress(ref remainder);
                }
            }

            //fill the TLV table if applicable
            TranslateTlvDataIntoTable(remainder);
        }