Exemplo n.º 1
0
    public string NotifyToEventHandler(string methodName, eNotifyHandler notifyHandlerTypes, params object[] args)
    {
        if (Setting.UseDebugLog == true)
        {
            Setting.ClearDebugHandlerInfo();

            Setting.debugHandlerLogInfo            = StringUtil.Format("event method = {0}", methodName);
            Setting.debugHandlerCallStackTraceInfo = StringUtil.StringFromStackTrace(System.DateTime.Now);
        }

        string result = string.Empty;

        {
            List <INotifyHandler> eventHanlders = new List <INotifyHandler>();
            foreach (INotifyHandler handler in m_handlers)
            {
                if (handler == null)
                {
                    continue;
                }
                if (handler.IsActiveAndEnabled() == false)
                {
                    continue;
                }

                eNotifyHandler notifyHandlerType = handler.GetHandlerType();
                if ((notifyHandlerType & notifyHandlerTypes) == notifyHandlerType)
                {
                    eventHanlders.Add(handler);
                }
            }

            result = NotifyToHandler <INotifyHandler>(eventHanlders, false, true, methodName, args);
            if (!string.IsNullOrEmpty(result))
            {
                LogError(result);
            }
            else
            {
                Log(StringUtil.Format("NotifyToPluginHandler({0})", methodName));
            }
        }
        return(result);
    }