protected virtual bool DoesThumbnailMatchSearch(ThumbnailItem thumbnailItem)
    {
        if (currentSearchString == null || currentSearchString == "")
        {
            return(true);
        }
        string lowerSearchString = currentSearchString.ToLower();
        string name = Util.EmptyIfNull(thumbnailItem.GetName()).ToLower();

        string description = Util.EmptyIfNull(thumbnailItem.GetDescription()).ToLower();

        return(name.Contains(lowerSearchString) || description.Contains(lowerSearchString));
    }
        private void VisibilityChangedEventHandler(object sender, DependencyPropertyChangedEventArgs args)
        {
            // TODO: When thumbnails are turned on it shows page 1-x in the thumbnail view and not
            // the page we are actually on -> needs to be fixed.
            AThumbnailItem item;
            bool           retrieved = thumbnailItemDict.Dict.TryGetValue(SelectedIndex, out item);
            ThumbnailItem  tItem     = item as ThumbnailItem;

            if (tItem != null)
            {
                tItem.ScrollThisElementIntoView();
            }
        }
 public void SelectThumbnail(ThumbnailItem thumbnail, System.Action <RectTransform> showContent)
 {
     if (thumbnailItems.Contains(thumbnail))
     {
         Debug.Log(name + " opening!");
         selectedThumbnail = thumbnail;
         detailContainer.Open();
         detailContainer.UpdateArrowPosition(selectedThumbnail.GetComponent <RectTransform>().anchoredPosition.x);
         showContent(detailContainer.GetContentContainer());
         UpdateThumbnailsForSelection();
     }
     else
     {
         CloseSelectedThumbnail();
     }
 }
        private void OnOpenCompletedEventHandler(PdfViewerException e)
        {
            if (e != null)
            {
                return;
            }

            thumbnailItemDict.Clear();
            int NoOfThumbnails = Math.Min(controller.PageCount, 5);

            for (int i = 0; i < NoOfThumbnails; i++)
            {
                ThumbnailItem item = new ThumbnailItem(i + 1, NoOfThumbnails, controller, SetSelection, ScrollElementIntoView);
                item.Update();
                thumbnailItemDict.Add(i + 1, item);
            }
        }
    void OnWorkshopListLoaded(WorkshopItemListEventArgs args)
    {
        if (args.IsError)
        {
            Debug.Log($"Sorry, encountered an error: {args.ErrorMessage}");
            return;
        }

        pageCount = args.ItemList.PagesItems;

        workingFeedback.SetActive(false);

        if (args.ItemList.Items.Count == 0)
        {
            noResultsFeedback.SetActive(true);
        }

        foreach (WorkshopItem item in args.ItemList.Items)
        {
            if (item.Name.IsNullOrEmpty())
            {
                continue;
            }
            ThumbnailItem thumbnailItem = Instantiate(cardPackThumbnailPrefab).GetComponent <ThumbnailItem>();
            // TEMP: Ignore workshop thumbnail texture for now since it's ugly
            // if (item.PreviewImageURL != null && item.PreviewImageURL.Length > 0)
            // {
            //   thumbnailItem.SetThumbnailUrl(item.PreviewImageURL);
            // }
            // else
            // {
            thumbnailItem.SetThumbnail(placeholderThumbnailTexture);
            // }

            thumbnailItem.SetName(item.Name);
            thumbnailItem.OnClick        = () => OpenWorkshopEntry(thumbnailItem, item);
            thumbnailItem.GetDescription = () => { return(item.Description); };
            AddThumbnail(thumbnailItem);
        }
    }
Exemple #6
0
 protected override bool DoesThumbnailMatchSearch(ThumbnailItem thumbnail)
 {
     return(thumbnail == newThumbnail || thumbnail == tutorialThumbnail || base.DoesThumbnailMatchSearch(thumbnail));
 }
 private void ScrollElementIntoView(ThumbnailItem item)
 {
     ThumbnailListBox.ScrollIntoView(item);
     this.Focus();
 }