using System;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Com.FirmLib.Entity
{
    /// <summary>
    /// 参数信息
    /// </summary>
    public class MBIParameter
    {
        /// <summary>
        /// 参数编码
        /// </summary>
        public string Code { get; internal set; }

        /// <summary>
        /// 参数值信息
        /// </summary>
        public object Value { get; set; }
    }

    public class MBIParameterSet : KeyedCollection<string, MBIParameter>
    {
        protected override string GetKeyForItem(MBIParameter item)
        {
            return item.Code;
        }
        /// <summary>
        /// 获取相关参数
        /// </summary>
        /// <param name="code"></param>
        /// <returns></returns>
        public MBIParameter GetParameter(string code)
        {
            if (this.Contains(code))
            {
                return this[code];
            }
            return null;
        }
    }
}
