Facebook
Twitter
Pinterest
Tumblr
GitHub
RSS
  • DEV Home
  • Documentation
  • Reference
  • Download
Search Results for

    Show / Hide Table of Contents

    Features: Lists

    Basic List Display

    To show data in list form, you need to add a property of type GenericItemList and populate it by adding items.

    GenericItemList Property

        [DisplayName("Activities")]
        [Description("Shows the most recent activities in a list")]
        public GenericItemList ActivityList { get; set; }
    

    Populating the List

    public void CreateListItems(IActivityManager activityManager, ILibraryManager libraryManager)
    {
        this.ActivityList.Clear();
        this.LibraryItemsList.Clear();
    
        var query = activityManager.GetActivityLogEntries(null, 0, 6);
        foreach (var entry in query.Items)
        {
            this.ActivityList.Add(this.CreateListItem(entry));
        }
    }
    
    private GenericListItem CreateListItem(ActivityLogEntry entry)
    {
        return new GenericListItem
        {
            PrimaryText = entry.Name,
            SecondaryText = entry.Date.ToString(),
            Status = this.StatusFromSeverity(entry.Severity),
            Icon = IconNames.info,
            IconMode = ItemListIconMode.LargeRegular,
        };
    }
    
    private ItemStatus StatusFromSeverity(LogSeverity severity)
    {
        switch (severity)
        {
            case LogSeverity.Info:
            case LogSeverity.Debug:
                return ItemStatus.Succeeded;
            case LogSeverity.Warn:
                return ItemStatus.Warning;
            case LogSeverity.Error:
            case LogSeverity.Fatal:
                return ItemStatus.Failed;
            default:
                throw new ArgumentOutOfRangeException(nameof(severity), severity, null);
        }
    }
    

    Result

    Ui Feat Lists Basic

    Advanced List Features

    More documentation and features will be added over time.

    You may explore the reference documentation for GenericListItem to discover additional features.

    SDK
    On this Page
    Back to Top Copyright 2022 © EMBY LLC. Please see our terms of use and privacy policy.