GetMetadataId() 공개 메소드

public GetMetadataId ( int id, bool isFolder ) : int
id int
isFolder bool
리턴 int
예제 #1
0
        public IEnumerable <AdamItem> Items(Guid guid, string field, string subfolder)
        {
            ExplicitlyRecheckEditPermissions();
            PrepCore(guid, field);
            var folderManager = FolderManager.Instance;

            // get root and at the same time auto-create the core folder in case it's missing (important)
            EntityBase.Folder();

            // try to see if we can get into the subfolder - will throw error if missing
            var current = EntityBase.Folder(subfolder, false);

            var subfolders = folderManager.GetFolders(current);
            var files      = folderManager.GetFiles(current);

            var adamFolders =
                subfolders.Where(s => s.FolderID != current.FolderID)
                .Select(f => new AdamItem(f)
            {
                MetadataId = EntityBase.GetMetadataId(f.FolderID, true)
            });
            var adamFiles = files
                            .Select(f => new AdamItem(f)
            {
                MetadataId = EntityBase.GetMetadataId(f.FileId, false), Type = EntityBase.TypeName(f.Extension)
            });

            var all = adamFolders.Concat(adamFiles);

            return(all);
        }
예제 #2
0
        public IEnumerable <AdamItem> Items(Guid guid, string field, string subfolder, bool usePortalRoot = false)
        {
            Log.Add($"adam items a:{App?.AppId}, i:{guid}, field:{field}, subfold:{subfolder}, useRoot:{usePortalRoot}");
            ExplicitlyRecheckEditPermissions();
            PrepCore(guid, field, usePortalRoot);
            var folderManager = FolderManager.Instance;

            // get root and at the same time auto-create the core folder in case it's missing (important)
            EntityBase.Folder();

            // try to see if we can get into the subfolder - will throw error if missing
            var current = EntityBase.Folder(subfolder, false);

            var subfolders = folderManager.GetFolders(current);
            var files      = folderManager.GetFiles(current);

            var adamFolders =
                subfolders.Where(s => s.FolderID != current.FolderID)
                .Select(f => new AdamItem(f)
            {
                MetadataId = EntityBase.GetMetadataId(f.FolderID, true)
            })
                .ToList();
            var adamFiles = files
                            .Select(f => new AdamItem(f)
            {
                MetadataId = EntityBase.GetMetadataId(f.FileId, false), Type = EntityBase.TypeName(f.Extension)
            })
                            .ToList();

            var all = adamFolders.Concat(adamFiles).ToList();

            Log.Add($"items complete - will return fld⋮{adamFolders.Count}, files⋮{adamFiles.Count} tot⋮{all.Count}");
            return(all);
        }