/// <summary>
        /// 引发 <see cref="RequestCheckComponentFlag" /> 事件
        /// </summary>
        /// <param name="ea">包含此事件的参数</param>
        protected virtual void OnRequestCheckComponentFlag(RequestCheckComponentFlagEventArgs ea)
        {
            var handler = RequestCheckComponentFlag;

            if (handler != null)
            {
                handler(this, ea);
            }
        }
        /// <summary>
        /// 检测组件标记
        /// </summary>
        /// <param name="compId">组件ID</param>
        /// <returns></returns>
        bool CheckComponentFlag(string compId)
        {
            var dic = Context.ComponentStatus;

            if (dic.ContainsKey(compId))
            {
                return(dic[compId]);
            }

            var ea = new RequestCheckComponentFlagEventArgs(compId);

            OnRequestCheckComponentFlag(ea);
            dic.Add(compId, ea.Valid);

            return(ea.Valid);
        }
예제 #3
0
 /// <summary>
 /// 引发 <see cref="RequestCheckComponentFlag" /> 事件
 /// </summary>
 /// <param name="ea">包含此事件的参数</param>
 protected virtual void OnRequestCheckComponentFlag(RequestCheckComponentFlagEventArgs e)
 {
     RequestCheckComponentFlag?.Invoke(this, e);
 }