コード例 #1
0
ファイル: PluginMessenger.cs プロジェクト: drcd/Moduthulhu
        public object SendMessage(string target, string name, object value = null)
        {
            List <MessageInfo> infos  = _messageRegister.Where(x => x.Matches(target, name)).ToList();
            MessageInfo        single = infos.SingleOrDefault();

            if (single != null)
            {
                return(single.Execute(value));
            }
            else
            {
                Log.Write(Log.Type.WARNING, $"No actions/functions registered in PluginMessenger that matched target = '{target}' and name = '{name}'. Messsage not sent.");
            }
            return(null);
        }