Beispiel #1
0
        public override void ViewDidLoad()
        {
            DictionaryWebView.FrameLoadDelegate = new DictionaryeWebFrameLoadDelegate(this);
            DictionaryWebView.UIDelegate        = new DictionaryWebUIDelegate();
            NavigatorManager = new NavigationDictionaryManager();
            NavigatorManager.Record(SearchTerm.Trim());

            SearchDictionary(SearchTerm);
        }
 bool CanSearch()
 {
     if (ItemsToSearch == null || !ItemsToSearch.Any() ||
         SearchTerm == HelpText || string.IsNullOrEmpty(SearchTerm) || SearchTerm.Trim().Length < SearchTermMinimumLength)
     {
         return(false);
     }
     else
     {
         return(true);
     }
 }
Beispiel #3
0
 private async Task ApplyFilter()
 {
     if (!string.IsNullOrEmpty(SearchTerm))
     {
         Employees = Employees.Where(v => v.FullName.ToLower().Contains(SearchTerm.Trim().ToLower())).ToList();
         Title     = $"Employees With {SearchTerm} Contained within the Name";
     }
     else
     {
         Employees = (await EmployeeDataService.GetAllEmployees()).ToList();
         Title     = "All Employees";
     }
 }
Beispiel #4
0
 private void ApplyFilter()
 {
     if (!string.IsNullOrEmpty(SearchTerm) && SearchTerm?.Length > 0)
     {
         todos = todos.Where(v => v.Title.ToLower().Contains(SearchTerm.Trim().ToLower())).ToList();
         title = $"Todos with {SearchTerm} Contained within the Title Found: {todos.Count}";
     }
     else
     {
         title = $"All Todos {todos.Count}";
     }
     message = $"AppliedFilter just ran! {DateTime.Now.TimeOfDay} Search Term: {SearchTerm}";
 }
Beispiel #5
0
 private async Task ApplyFilter()
 {
     if (!string.IsNullOrEmpty(SearchTerm))
     {
         Users = Users.Where(v => v.UserName.ToLower().Contains(SearchTerm.Trim().ToLower())).ToList();
         title = $"Users With {SearchTerm} Contained within the Username";
     }
     else
     {
         Users = (await UserDataService.GetAllUsers()).ToList();
         title = "All Users";
     }
 }
Beispiel #6
0
 private async Task ApplyFilter()
 {
     if (!string.IsNullOrEmpty(SearchTerm))
     {
         Roles = Roles.Where(v => v.Name.ToLower().Contains(SearchTerm.Trim().ToLower())).ToList();
         title = $"Roles With {SearchTerm} Contained within the Name";
     }
     else
     {
         Roles = (await RoleDataService.GetAllRoles()).ToList();
         title = "All Roles";
     }
 }
Beispiel #7
0
        private void PerformSearch()
        {
            if (string.IsNullOrEmpty(SearchTerm) || string.IsNullOrEmpty(SearchTerm.Trim()))
            {
                ClearSearch();
                return;
            }

            foreach (var vm in _viewModelsDictionary.Values)
            {
                vm.IsMarked = vm.MemberInfo.Name
                              .IndexOf(SearchTerm, StringComparison.InvariantCultureIgnoreCase) >= 0;
            }
        }
Beispiel #8
0
        private void PerformSearch()
        {
            if (string.IsNullOrEmpty(SearchTerm) || string.IsNullOrEmpty(SearchTerm.Trim()))
            {
                ClearSearch();
                return;
            }

            foreach (var type in Types)
            {
                type.IsMarked = type.Name
                                .IndexOf(SearchTerm, StringComparison.InvariantCultureIgnoreCase) >= 0;
            }
        }
        private void PerformSearch()
        {
            if (string.IsNullOrEmpty(SearchTerm) || string.IsNullOrEmpty(SearchTerm.Trim()))
            {
                ClearSearch();
                return;
            }

            foreach (var assemblyViewModel in _assemblyViewModels)
            {
                assemblyViewModel.IsFound = assemblyViewModel.Name
                                            .IndexOf(SearchTerm, StringComparison.InvariantCultureIgnoreCase) >= 0;
            }
        }
Beispiel #10
0
        partial void WikiButtonClick(NSObject sender)
        {
            var      term      = SearchTerm.Trim();
            var      urlString = "https://www.google.com/search?q=" + term;
            NSString stringURL = new NSString(urlString);

            stringURL = stringURL.CreateStringByAddingPercentEscapes(NSStringEncoding.UTF8);

            NSUrl url = new NSUrl(stringURL.ToString());

            if (url != null)
            {
                NSWorkspace.SharedWorkspace.OpenUrl(url);
            }
        }
Beispiel #11
0
        public async Task Init()
        {
            if (Genres.Count == 0)
            {
                var genreEntities = await _genresService.Get <List <Model.Models.Genre> >(null);

                genreEntities.ForEach((genre) => Genres.Add(genre));
            }

            if (Authors.Count == 0)
            {
                var authorsEntities = await _authorsService.Get <List <Model.Models.Author> >(null);

                authorsEntities.ForEach((author) => Authors.Add(author));
            }

            var searchRequest = new BooksSearchRequest()
            {
                IsAuthorsLoadingEnabled = true,
                IsGenresLoadingEnabled  = true
            };

            if (SelectedGenre != null)
            {
                searchRequest.GenreId = SelectedGenre.Id;
            }

            if (SelectedAuthor != null)
            {
                searchRequest.AuthorId = SelectedAuthor.Id;
            }

            if (!string.IsNullOrEmpty(SearchTerm))
            {
                searchRequest.SearchTerm = SearchTerm.Trim();
            }

            var bookEntities = await _booksService.Get <List <Model.Models.Book> >(searchRequest);

            Books.Clear();
            bookEntities.ForEach((book) => Books.Add(book));
        }
 private async Task ApplyFilter()
 {
     if (!string.IsNullOrEmpty(SearchTerm))
     {
         CompanyDetails= CompanyDetails.Where(v => v.CompanyName.ToLower().Contains(SearchTerm.Trim().ToLower())).ToList();
         Title = $"Company Details with {SearchTerm} Contained within the Company Name";
     }
     else
     {
         CompanyDetails= (await CompanyDetailDataService.GetAllCompanyDetails()).ToList();
         Title = "All Employees";
     }
 }
Beispiel #13
0
        protected void SearchKeyup(ChangeEventArgs e)
        {
            SearchTerm = e.Value.ToString();

            DisableSearch = string.IsNullOrWhiteSpace(SearchTerm.Trim()) ? true : false;
        }
Beispiel #14
0
        async Task SearchMoviesAsync()
        {
            CurrentPageNumber = 1;

            if (IsBusy)
            {
                return;
            }

            if (string.IsNullOrWhiteSpace(SearchTerm) || SearchTerm.Trim().Length < 5)
            {
                await DisplayAlert(AppResources.TypeAtLeast5CharactersToSearch);

                return;
            }

            if (Connectivity.NetworkAccess != NetworkAccess.Internet)
            {
                await DisplayAlert(AppResources.ErrorNoConnection);

                return;
            }

            IsBusy = true;

            try
            {
                if (!Genres.Any())
                {
                    await GetGenresAsync();
                }

                var moviesData = await movieService.GetMoviesAsync(CurrentPageNumber, CultureInfo.CurrentCulture.Name, SearchTerm);

                Movies.Clear();

                if (moviesData == null || moviesData.Movies == null || !moviesData.Movies.Any())
                {
                    await DisplayAlert(AppResources.NoRecordsFound);

                    TotalPages = 0;
                }
                else
                {
                    TotalPages = moviesData.TotalPages;

                    for (int i = 0; i < moviesData.Movies.Length; i++)
                    {
                        moviesData.Movies[i].GenreNames = genreService.GetGenreNames(moviesData.Movies[i].GenreIds, Genres);
                        Movies.Add(moviesData.Movies[i]);
                    }
                }

                CurrentPageNumber++;
                GetMoreResults = TotalPages > 0 && CurrentPageNumber < TotalPages;
            }
            catch (Exception ex)
            {
                Console.WriteLine(ex.Message);
                await DisplayAlert(AppResources.ErrorSearchingMovies);
            }
            finally
            {
                IsBusy = false;
            }
        }