示例#1
0
        public Results <Object> Browse(ResultsSettings settings)
        {
            var results = new BrowseResults(ContentDirectory, Id, settings);

            results.FetchResults();
            return(results);
        }
示例#2
0
        internal Results <T> Search <T> (string searchCriteria, ResultsSettings settings) where T : Object
        {
            if (searchCriteria == null)
            {
                throw new ArgumentNullException("searchCriteria");
            }

            var results = new SearchResults <T> (ContentDirectory, Id, searchCriteria, settings);

            results.FetchResults();
            return(results);
        }
        public Results <T> GetChildren <T> (Container container, ResultsSettings settings)
        {
            if (container == null)
            {
                throw new ArgumentNullException("container");
            }

            uint returned, total, update_id;
            var  xml = controller.Browse(container.Id, BrowseFlag.BrowseDirectChildren, settings.Filter,
                                         settings.Offset, settings.RequestCount, settings.SortCriteria, out returned, out total, out update_id);

            var results = new List <T> ((int)returned);

            foreach (var result in Deserialize <T> (xml))
            {
                results.Add(result);
            }

            return(new BrowseResults <T> (container, settings.SortCriteria, settings.Filter,
                                          settings.RequestCount, settings.Offset, total, results));
        }
        public Results <T> Search <T> (Container container, Action <QueryVisitor> query, ResultsSettings settings)
        {
            if (container == null)
            {
                throw new ArgumentNullException("container");
            }
            else if (query == null)
            {
                throw new ArgumentNullException("query");
            }

            var builder = new StringBuilder();

            query(new QueryStringifier(builder));
            var search_criteria = builder.ToString();

            uint returned, total, update_id;
            var  xml = controller.Search(container.Id, search_criteria, settings.Filter, settings.Offset,
                                         settings.RequestCount, settings.SortCriteria, out returned, out total, out update_id);

            var results = new List <T> ((int)returned);

            foreach (var result in Deserialize <T> (xml))
            {
                results.Add(result);
            }

            return(new SearchResults <T> (container, query, settings.SortCriteria,
                                          settings.Filter, settings.RequestCount, settings.Offset, total, results));
        }
示例#5
0
 public BrowseResults(ContentDirectory contentDirectory, string objectId, ResultsSettings settings)
     : this(contentDirectory, objectId, settings.SortCriteria,
            settings.Filter, settings.RequestCount, settings.Offset)
 {
 }
示例#6
0
 protected abstract Results <T> GetMoreResults(RemoteContentDirectory contentDirectory,
                                               ResultsSettings settings);
示例#7
0
        public Results <T> SearchForType <T> (ResultsSettings settings) where T : Object
        {
            var class_name = ClassManager.GetClassFromType <T> ();

            return(Search <T> (string.Format(@"upnp:class derivedfrom ""{0}""", class_name), settings));
        }
示例#8
0
 public Results <Object> Search(string searchCriteria, ResultsSettings settings)
 {
     return(Search <Object> (searchCriteria, settings));
 }