/// <summary>
        ///
        /// </summary>
        /// <param name="contentInfo"></param>
        /// <returns></returns>
        public static ContentType ContentType(this MessageContentInfo contentInfo)
        {
            #region Validate parameters
            if (contentInfo == null)
            {
                throw new ArgumentNullException("contentInfo");
            }
            #endregion

            return(ContentType(contentInfo.Type, contentInfo.Name));
        }
Exemple #2
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="contentName"></param>
        /// <exception cref="MessageContentNotFoundException"></exception>
        /// <returns></returns>
        public MessageContentInfo GetContent(string contentName)
        {
            MessageContentInfo content = FindContent(contentName);

            if (content == null)
            {
                throw new MessageContentNotFoundException(this.LINK, contentName);
            }

            return(content);
        }
        /// <summary>
        ///
        /// </summary>
        /// <param name="contentInfo"></param>
        /// <returns></returns>
        public static bool IsBase64(this MessageContentInfo contentInfo)
        {
            #region Validate parameters
            if (contentInfo == null)
            {
                throw new ArgumentNullException("contentInfo");
            }
            #endregion

            if (String.IsNullOrWhiteSpace(contentInfo.Type))
            {
                return(false);
            }

            return(contentInfo.ContentType().IsBase64());
        }