示例#1
0
 /// <summary>
 /// Constructor
 /// </summary>
 /// <param name="contentType"></param>
 /// <param name="data"></param>
 public OutgoingMessage(string contentType, byte[] data)
     : this()
 {
     if (contentType != null)
     {
         ContentType   = contentType;
         DataContainer = new MemoryDataContainer(data);
         Size          = data.Length;
     }
 }
        public override Message Validate()
        {
            if (From != null)
            {
                Wrap            wrap       = Wrap.GetInstance();
                IWrappedMessage wm         = wrap.GetWrapper(Header.CPIM_TYPE);
                byte[]          newContent = wm.Wrap(From, To, ContentType, DataContainer.Get(0, Size));
                ContentType   = Header.CPIM_TYPE;
                DataContainer = new MemoryDataContainer(newContent);
                Size          = newContent.Length;
            }

            return(this);
        }