示例#1
0
        private IUpdateEvent ChatUpdateHandler(ref EventArgs ea, IDictionary <string, object> globals)
        {
            IChatUpdate evt    = (IChatUpdate)ea;
            var         findBy = evt.FindByCriteria();
            var         action = evt.GetAction();

            ea = null;

            if (String.IsNullOrEmpty(findBy))        // apply action to all chats
            {
                runtime.Chats().ForEach(action);
            }
            else if (findBy.StartsWith(Util.LABEL_IDENT, Util.IC)) // to one chat
            {
                action.Invoke(runtime.FindChatByLabel(findBy));
            }
            else                                  // to all those matching findBy
            {
                UpdateFinder(ref updateDelegate, findBy);
                runtime.FindAllAsync(updateDelegate, action, globals);
            }

            return(null);
        }