Esempio n. 1
0
        /// <summary>
        /// Determines whether all parts of a concatenated message are present.
        /// </summary>
        /// <param name="parts">The parts that make up the concatenated message.</param>
        /// <returns>true if all parts are present, false otherwise.</returns>
        /// <exception cref="T:System.ArgumentNullException">parts is null.</exception>
        /// <exception cref="T:System.ArgumentException">
        /// <para>The reference numbers differ between the message parts.</para>
        /// <para> -or- </para>
        /// <para>The number of total messages differs between the message parts.</para>
        /// <para> -or- </para>
        /// <para>A non-concatenated message part is present at an invalid position.</para>
        /// </exception>
        public static bool AreAllConcatPartsPresent(IList <SmsPdu> parts)
        {
            bool flag = false;

            SmartMessageDecoder.GetConcatUserData(parts, false, true, true, out flag);
            return(flag);
        }
Esempio n. 2
0
        /// <summary>
        /// Combines the parts of a concatenated message into a single message text.
        /// </summary>
        /// <param name="parts">The parts that make up the concatenated message.</param>
        /// <returns>A string containing the combined message text of all parts.</returns>
        /// <remarks>
        /// <para>All parts must be available, but can be in any order.</para>
        /// <para>The user data is converted into text according to the data coding scheme specified in the message.
        /// If you want the user data to be returned in its binary format, use <see cref="M:GsmComm.PduConverter.SmartMessaging.SmartMessageDecoder.CombineConcatMessage(System.Collections.Generic.IList{GsmComm.PduConverter.SmsPdu})" /> instead.</para>
        /// <para>If the first part is a non-concatenated message, its user data is returned back as text, and no more parts are processed
        /// afterwards.</para>
        /// </remarks>
        /// <exception cref="T:System.ArgumentNullException">parts is null.</exception>
        /// <exception cref="T:System.ArgumentException">
        /// <para>Not all parts of the message are available.</para>
        /// <para> -or- </para>
        /// <para>The reference numbers differ between the message parts.</para>
        /// <para> -or- </para>
        /// <para>The number of total messages differs between the message parts.</para>
        /// <para> -or- </para>
        /// <para>A non-concatenated message part is present at an invalid position.</para>
        /// </exception>
        /// <seealso cref="M:GsmComm.PduConverter.SmartMessaging.SmartMessageDecoder.CombineConcatMessage(System.Collections.Generic.IList{GsmComm.PduConverter.SmsPdu})" />
        public static string CombineConcatMessageText(IList <SmsPdu> parts)
        {
            bool          flag           = false;
            List <object> concatUserData = SmartMessageDecoder.GetConcatUserData(parts, true, false, false, out flag);
            StringBuilder stringBuilder  = new StringBuilder();

            foreach (string concatUserDatum in concatUserData)
            {
                stringBuilder.Append(concatUserDatum);
            }
            return(stringBuilder.ToString());
        }
Esempio n. 3
0
        /// <summary>
        /// Combines the parts of a concatenated message into a single message.
        /// </summary>
        /// <param name="parts">The parts that make up the concatenated message.</param>
        /// <returns>A byte array containing the combined user data of all parts without any headers.</returns>
        /// <remarks>
        /// <para>All parts must be available, but can be in any order.</para>
        /// <para>The user data is returned in its binary format. If you want the user data to be
        /// returned as text, use <see cref="M:GsmComm.PduConverter.SmartMessaging.SmartMessageDecoder.CombineConcatMessageText(System.Collections.Generic.IList{GsmComm.PduConverter.SmsPdu})" /> instead.</para>
        /// <para>If the first part is a non-concatenated message, its user data is returned back, and no more parts are processed
        /// afterwards.</para>
        /// </remarks>
        /// <exception cref="T:System.ArgumentNullException">parts is null.</exception>
        /// <exception cref="T:System.ArgumentException">
        /// <para>Not all parts of the message are available.</para>
        /// <para> -or- </para>
        /// <para>The reference numbers differ between the message parts.</para>
        /// <para> -or- </para>
        /// <para>The number of total messages differs between the message parts.</para>
        /// <para> -or- </para>
        /// <para>A non-concatenated message part is present at an invalid position.</para>
        /// </exception>
        /// <seealso cref="M:GsmComm.PduConverter.SmartMessaging.SmartMessageDecoder.CombineConcatMessageText(System.Collections.Generic.IList{GsmComm.PduConverter.SmsPdu})" />
        public static byte[] CombineConcatMessage(IList <SmsPdu> parts)
        {
            bool          flag           = false;
            List <object> concatUserData = SmartMessageDecoder.GetConcatUserData(parts, false, false, false, out flag);
            List <byte>   nums           = new List <byte>();

            foreach (byte[] concatUserDatum in concatUserData)
            {
                nums.AddRange(concatUserDatum);
            }
            return(nums.ToArray());
        }