internal static FavoritesSearchResult Search(string keyword, FavoriteCategory category)
        {
            if (category == null || category.Index < 0)
            {
                category = FavoriteCategory.All;
            }
            var result = new FavoritesSearchResult(keyword, category);

            return(result);
        }
Exemple #2
0
        public static bool TryParse(Uri uri, out FavoritesSearchResult result)
        {
            result = default;
            if (uri is null)
            {
                return(false);
            }
            var data = new UriHandlerData(uri);

            if (!FavoritesSearchHandler.Instance.CanHandle(data))
            {
                return(false);
            }
            result = (FavoritesSearchResult)FavoritesSearchHandler.Instance.Handle(data).Data;
            return(true);
        }