示例#1
0
        /// <summary>
        /// Gets the messages that's mapped to the specified object.
        /// </summary>
        /// <param name="obj">The object to get the message for.</param>
        /// <returns>string</returns>
        protected override string GetMessageFromMapping(object obj)
        {
            IMappedItem item = FindItem(obj);

            if (item != null)
            {
                return(item.GetMessage(obj));
            }
            return(string.Empty);
        }
示例#2
0
        /// <summary>
        /// Gets the messages that's mapped to the specified type.
        /// </summary>
        /// <param name="type">The type to get the message for.</param>
        /// <returns>string</returns>
        protected override string GetMessageFromMapping(Type type)
        {
            IMappedItem item = FindItem(type);

            if (item != null)
            {
                return(item.GetMessage(type));
            }
            return(string.Empty);
        }
示例#3
0
        protected override string GetMessageFromMapping(object obj)
        {
            TSub        subItem = SubItemAccessor((T)obj);
            IMappedItem item    = FindItem(subItem);

            if (item != null)
            {
                return(item.GetMessage(subItem));
            }
            return(string.Empty);
        }