public IMatches MatchForQuery(IAction action, object[] arguments, int localMaxMatches)
        {
            IMatches matches = MatchWithoutEvent(action, arguments, localMaxMatches);

            matches = matches.Clone();
            return(matches);
        }
        public IMatches[] MatchForQuery(params ActionCall[] actions)
        {
            IMatches[] matchesArray = new IMatches[actions.Length];

#if DEBUGACTIONS || MATCHREWRITEDETAIL
            PerformanceInfo.StartLocal();
#endif
            int matchesFound = 0;
            for (int i = 0; i < actions.Length; ++i)
            {
                ActionCall actionCall = actions[i];
                IMatches   matches    = actionCall.Action.Match(this, actionCall.MaxMatches, actionCall.Arguments);
                matchesFound   += matches.Count;
                matches         = matches.Clone(); // must be cloned before the next iteration step, as that could be the same action
                matchesArray[i] = matches;
            }

#if DEBUGACTIONS || MATCHREWRITEDETAIL
            PerformanceInfo.StopMatch();
#endif
            PerformanceInfo.MatchesFound += matchesFound;

            if (matchesFound > 0)
            {
                PreMatched(matchesArray);
            }

            return(matchesArray);
        }