/*-------------------------------------------------------------------------
 * 功能描述：PropertyCache
 * 作者：xulisong
 * 创建时间： 2019/6/17 10:04:51
 * 版本号：v1.0
 *  -------------------------------------------------------------------------*/

using System.Collections.Generic;
using System.Reflection;

namespace JBIM.Common
{
    public static class PropertyCache
    {
        private static readonly Dictionary<string, PropertyInfo> m_CacheProperties = new Dictionary<string, PropertyInfo>();

        /// <summary>
        /// 设置指定键值的属性
        /// </summary>
        /// <param name="key"></param>
        /// <param name="propertyInfo"></param>
        public static void SetProperty(string key, PropertyInfo propertyInfo)
        {
            m_CacheProperties[key] = propertyInfo;
        }
        /// <summary>
        /// 获取指定键值的属性
        /// </summary>
        /// <param name="key"></param>
        /// <returns></returns>
        public static PropertyInfo GetProperty(string key)
        {
            m_CacheProperties.TryGetValue(key, out PropertyInfo result);
            return result;
        }
    }
}
