コード例 #1
0
        protected override void Search(Action <Object> consumer,
                                       string containerId,
                                       Action <QueryVisitor> query,
                                       int startingIndex,
                                       int requestCount,
                                       string sortCriteria,
                                       out int numberReturned,
                                       out int totalMatches)
        {
            if (query == null)
            {
                throw new ArgumentNullException("query");
            }

            var visitor = new Wmp11QueryVisitor(this, containerId);

            query(visitor);
            if (visitor.Results != null)
            {
                totalMatches   = visitor.Results.Count;
                numberReturned = VisitResults(consumer, visitor.Results, startingIndex, requestCount);
            }
            else
            {
                base.Search(consumer, containerId, query, startingIndex,
                            requestCount, sortCriteria, out numberReturned, out totalMatches);
            }
        }
コード例 #2
0
        protected override void Search (Action<Object> consumer,
                                        string containerId,
                                        Action<QueryVisitor> query,
                                        int startingIndex,
                                        int requestCount,
                                        string sortCriteria,
                                        out int numberReturned,
                                        out int totalMatches)
        {
            if (query == null) {
                throw new ArgumentNullException ("query");
            }

            var visitor = new Wmp11QueryVisitor (this, containerId);
            query (visitor);
            if (visitor.Results != null) {
                totalMatches = visitor.Results.Count;
                numberReturned = VisitResults (consumer, visitor.Results, startingIndex, requestCount);
            } else {
                base.Search (consumer, containerId, query, startingIndex,
                    requestCount, sortCriteria, out numberReturned, out totalMatches);
            }
        }