Ejemplo n.º 1
0
        /// <summary> Called to add a user data object to the buffer </summary>
        /// <param name="userData"></param>
        public void AddUserData(UserData userData)
        {
            SmppBuffer tmpBuff = new SmppBuffer(DefaultEncoding);

            if (userData.Headers.Count > 0)
            {
                tmpBuff.AddUserDataHeaderCollection(userData.Headers);
            }

            if ((userData.ShortMessage != null) && (userData.ShortMessage.Length > 0))
            {
                tmpBuff.AddBytes(userData.ShortMessage);
            }

            AddByte(Convert.ToByte(tmpBuff.Length));
            AddSmppBuffer(tmpBuff);
        }