예제 #1
0
    /// <summary>
    ///     Returns a display node with a list view to render members
    /// </summary>
    /// <param name="listName">The member type to list</param>
    /// <returns>The member list for display</returns>
    public MemberListDisplay GetListNodeDisplay(string listName)
    {
        IMemberType?foundType = _memberTypeService.Get(listName);
        var         name      = foundType != null ? foundType.Name : listName;

        var apps = new List <ContentApp>
        {
            ListViewContentAppFactory.CreateContentApp(_dataTypeService, _propertyEditors, listName, "member", Constants.DataTypes.DefaultMembersListView)
        };

        apps[0].Active = true;

        var display = new MemberListDisplay
        {
            ContentTypeAlias = listName,
            ContentTypeName  = name,
            Id          = listName,
            IsContainer = true,
            Name        = listName == Constants.Conventions.MemberTypes.AllMembersListId ? "All Members" : name,
            Path        = "-1," + listName,
            ParentId    = -1,
            ContentApps = apps
        };

        return(display);
    }
        /// <summary>
        /// Returns an item to be used to display the recycle bin for media
        /// </summary>
        /// <returns></returns>
        public MediaItemDisplay GetRecycleBin()
        {
            var apps = new List <ContentApp>();

            apps.Add(ListViewContentAppFactory.CreateContentApp(_dataTypeService, _propertyEditors, "recycleBin", "media", Constants.DataTypes.DefaultMediaListView));
            apps[0].Active = true;
            var display = new MediaItemDisplay
            {
                Id               = Constants.System.RecycleBinMedia,
                Alias            = "recycleBin",
                ParentId         = -1,
                Name             = _localizedTextService.Localize("general", "recycleBin"),
                ContentTypeAlias = "recycleBin",
                CreateDate       = DateTime.Now,
                IsContainer      = true,
                Path             = "-1," + Constants.System.RecycleBinMedia,
                ContentApps      = apps
            };

            return(display);
        }